text
stringlengths
107
2.17M
Require Import abp_base. Require Import abp_defs. Goal forall (b : bit) (x y : proc), D + (fun d : D => seq (ia D r1 d) (enc H (mer (seq (Sn_d d b) y) x))) = enc H (Lmer (seq (Sn b) y) x). intros. elim ProcSn. elim (SUM5 D (fun d : D => seq (ia D r1 d) (Sn_d d b)) y). elimtype ((fun d : D => seq (ia D r1 d) (seq (Sn_d d b) y)) = (fun d : D => seq (seq (ia D r1 d) (Sn_d d b)) y)). 2: apply EXTE; intro; elim A5; apply refl_equal. elim (SUM6 D (fun d : D => seq (ia D r1 d) (seq (Sn_d d b) y)) x). elim SUM9. elimtype ((fun d : D => seq (ia D r1 d) (enc H (mer (seq (Sn_d d b) y) x))) = (fun d : D => enc H (Lmer (seq (ia D r1 d) (seq (Sn_d d b) y)) x))). apply refl_equal. apply EXTE; intro. elim CM3. elim D5. elim D1. apply refl_equal. exact Inr1H. Save LmerSn. Goal forall x : proc, Delta = enc H (Lmer (K i) x). intro. elim ChanK. elim (SUM6 Frame (fun x : Frame => seq (ia Frame r2 x) (seq (alt (seq (ia one int i) (ia Frame s3 x)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) x). elim SUM9. elimtype ((fun d : Frame => Delta) = (fun d : Frame => enc H (Lmer (seq (ia Frame r2 d) (seq (alt (seq (ia one int i) (ia Frame s3 d)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) x))). elim SUM1. apply refl_equal. apply EXTE. intro. elim CM3. elim D5. elim D2. elim A7. apply refl_equal. exact Inr2H. Save LmerK. Goal forall x : proc, Delta = enc H (Lmer (L i) x). intro. elim ChanL. elim (SUM6 frame (fun n : frame => seq (ia frame r5 n) (seq (alt (seq (ia one int i) (ia frame s6 n)) (seq (ia one int i) (ia frame s6 sce))) (L i))) x). elim SUM9. elimtype ((fun d : frame => Delta) = (fun d : frame => enc H (Lmer (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) x))). elim SUM1. apply refl_equal. apply EXTE. intro. elim CM3. elim D5. elim D2. elim A7. apply refl_equal. exact Inr5H. Save LmerL. Goal forall (b : bit) (x y : proc), Delta = enc H (Lmer (seq (Rn b) y) x). intros. elim ProcRn. elim (A4 (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y). elim (CM4 (seq (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y) (seq (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y) x). elim D4. cut (Delta = enc H (Lmer (seq (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y) x)). intro H0. elim H0. elim A6. elim (A4 (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce) (seq (ia frame s5 (tuple b)) (Rn b))). elim (A4 (seq (D + (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) (seq (ia Frame r3 lce) (seq (ia frame s5 (tuple b)) (Rn b))) y). elim (CM4 (seq (seq (D + (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) y) (seq (seq (ia Frame r3 lce) (seq (ia frame s5 (tuple b)) (Rn b))) y) x). elim A5. elim A5. elim A5. elim CM3. elim D4. elim D5. elim D2. elim A7. elim A6. elim SUM5. elim SUM6. elim SUM9. elimtype ((fun d : D => Delta) = (fun d : D => enc H (Lmer (seq (ia Frame r3 (Tuple b d)) (seq (ia frame s5 (tuple b)) (seq (Rn b) y))) x))). elim SUM1. apply refl_equal. apply EXTE. intro. elim CM3. elim D5. elim D2. elim A7. apply refl_equal. exact Inr3H. exact Inr3H. elim (SUM5 D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y). elim (SUM6 D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y) x). elim SUM9. elimtype ((fun d : D => Delta) = (fun d : D => enc H (Lmer (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y) x))). elim SUM1. apply refl_equal. apply EXTE; intro. elim A5. elim CM3. elim D5. elim D2. elim A7. apply refl_equal. exact Inr3H. Save LmerRn. Goal forall (b : bit) (x y : proc), Delta = enc H (Lmer (comm (L i) (seq (Rn b) y)) x). intros. cut (Delta = comm (L i) (seq (Rn b) y)). intro H0. elim H0. unfold Delta at 2 in |- *. elim CM2. elim D5. elim D3. elim A7. apply refl_equal. elim ChanL. elim SUM7. elimtype ((fun d : frame => Delta) = (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (Rn b) y))). elim SUM1. apply refl_equal. apply EXTE. intro. elim ProcRn. elim (A4 (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y). elim CM9. cut (Delta = comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y)). intro. elim H. elim A6. elim (A5 (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b)) y). elim A4. elim (A4 (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y)). elim CM9. cut (Delta = comm (seq (ia frame r5 d) (alt (seq (seq (ia one int i) (ia frame s6 d)) (L i)) (seq (seq (ia one int i) (ia frame s6 sce)) (L i)))) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y))). intro. elim H0. elim A6. elim (SUM5 D (fun d : D => ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y)). elim SC3. elim SUM7. elimtype ((fun d : D => Delta) = (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y)) (seq (ia frame r5 d) (alt (seq (seq (ia one int i) (ia frame s6 d)) (L i)) (seq (seq (ia one int i) (ia frame s6 sce)) (L i)))))). elim SUM1; apply refl_equal. apply EXTE; intro. elim CM7. elim CF2''. elim A7. apply refl_equal. exact EQFf. elim CM7. elim CF2''. elim A7. apply refl_equal. red in |- *. intro. apply EQFf. apply EQ_sym. assumption. elim (SUM5 D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y). elim SC3. elim SUM7. elimtype ((fun d : D => Delta) = (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y) (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))))). elim SUM1. apply refl_equal. apply EXTE; intro. elim A5. elim CM7. elim CF2''. elim A7. apply refl_equal. exact EQFf. Save CommLRn. Goal forall x : proc, Delta = enc H (Lmer (comm (K i) (L i)) x). cut (Delta = comm (K i) (L i)). intro H0. elim H0. unfold Delta at 2 in |- *. intro. elim CM2. elim A7. elim D3. apply refl_equal. elim ChanK. elim SUM7. elimtype ((fun d : Frame => Delta) = (fun d : Frame => comm (seq (ia Frame r2 d) (seq (alt (seq (ia one int i) (ia Frame s3 d)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (L i))). elim SUM1; apply refl_equal. apply EXTE; intro. elim ChanL. elim SC3. elim SUM7. elimtype ((fun d : frame => Delta) = (fun d0 : frame => comm (seq (ia frame r5 d0) (seq (alt (seq (ia one int i) (ia frame s6 d0)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame r2 d) (seq (alt (seq (ia one int i) (ia Frame s3 d)) (seq (ia one int i) (ia Frame s3 lce))) (K i))))). elim SUM1; apply refl_equal. apply EXTE; intro. elim CM7. elim CF2''. elim A7. apply refl_equal. red in |- *; intro. apply EQFf. apply EQ_sym. assumption. Save CommKL. Goal forall (b : bit) (x y : proc), Delta = enc H (Lmer (comm (K i) (seq (Rn b) y)) x). intros. cut (Delta = comm (K i) (seq (Rn b) y)). intro H0. elim H0. unfold Delta at 2 in |- *. elim CM2. elim A7. elim D3. apply refl_equal. elim ChanK. elim SUM7. elimtype ((fun d : Frame => Delta) = (fun d : Frame => comm (seq (ia Frame r2 d) (seq (alt (seq (ia one int i) (ia Frame s3 d)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (Rn b) y))). elim SUM1; apply refl_equal. apply EXTE; intro. elim ProcRn. elim A4. elim (A4 (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y). elim CM9. cut (Delta = comm (seq (ia Frame r2 d) (alt (seq (seq (ia one int i) (ia Frame s3 d)) (K i)) (seq (seq (ia one int i) (ia Frame s3 lce)) (K i)))) (seq (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y)). intro. elim H. elim A6. elim A5. elim A5. elim (A5 (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b)) y). elim (A4 (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y)). elim CM9. elim CM7. elim CF2. elim A7; elim A6. elim (SUM5 D (fun d : D => ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y)). elim SC3. elim SUM7. elimtype ((fun d : D => Delta) = (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y)) (seq (ia Frame r2 d) (alt (seq (ia one int i) (seq (ia Frame s3 d) (K i))) (seq (ia one int i) (seq (ia Frame s3 lce) (K i))))))). elim SUM1; apply refl_equal. apply EXTE; intro. elim CM7. elim CF2. elim A7; apply refl_equal. apply refl_equal. apply refl_equal. elim SC3. elim (SUM5 D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y). elim SUM7. elimtype ((fun d : D => Delta) = (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y) (seq (ia Frame r2 d) (alt (seq (seq (ia one int i) (ia Frame s3 d)) (K i)) (seq (seq (ia one int i) (ia Frame s3 lce)) (K i)))))). elim SUM1; apply refl_equal. apply EXTE; intro. elim A5. elim CM7. elim CF2. elim A7. apply refl_equal. apply refl_equal. Save CommKRn. Goal forall (b : bit) (x y : proc), Delta = enc H (Lmer (comm (seq (Sn b) y) (K i)) x). intros. cut (Delta = comm (seq (Sn b) y) (K i)). intro H0. elim H0. unfold Delta at 2 in |- *. elim CM2. elim A7. elim D3. apply refl_equal. elim ProcSn. elim (SUM5 D (fun d : D => seq (ia D r1 d) (Sn_d d b)) y). elim SUM7. elimtype ((fun d : D => Delta) = (fun d : D => comm (seq (seq (ia D r1 d) (Sn_d d b)) y) (K i))). elim SUM1; apply refl_equal. apply EXTE; intro. elim A5. elim ChanK. elim SC3. elim SUM7. elimtype ((fun d : Frame => Delta) = (fun d0 : Frame => comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia D r1 d) (seq (Sn_d d b) y)))). elim SUM1; apply refl_equal. apply EXTE; intro. elim CM7. elim CF2''. elim A7. apply refl_equal. exact EQFD. Save CommSnK. Goal forall (b : bit) (x y : proc), Delta = enc H (Lmer (comm (seq (Sn b) y) (L i)) x). intros. cut (Delta = comm (seq (Sn b) y) (L i)). intro H0. elim H0. unfold Delta at 2 in |- *. elim CM2. elim A7. elim D3. apply refl_equal. elim ProcSn. elim (SUM5 D (fun d : D => seq (ia D r1 d) (Sn_d d b)) y). elim SUM7. elimtype ((fun d : D => Delta) = (fun d : D => comm (seq (seq (ia D r1 d) (Sn_d d b)) y) (L i))). elim SUM1; apply refl_equal. apply EXTE; intro. elim A5. elim ChanL. elim SC3. elim SUM7. elimtype ((fun d : frame => Delta) = (fun d0 : frame => comm (seq (ia frame r5 d0) (seq (alt (seq (ia one int i) (ia frame s6 d0)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia D r1 d) (seq (Sn_d d b) y)))). elim SUM1; apply refl_equal. apply EXTE; intro. elim CM7. elim CF2''. elim A7. apply refl_equal. exact EQfD. Save CommSnL. Goal forall (b b' : bit) (x y y' : proc), Delta = enc H (Lmer (comm (seq (Sn b) y) (seq (Rn b') y')) x). intros. cut (Delta = comm (seq (Sn b) y) (seq (Rn b') y')). intro H0. elim H0. unfold Delta at 2 in |- *. elim CM2. elim A7. elim D3. apply refl_equal. elim ProcSn. elim (SUM5 D (fun d : D => seq (ia D r1 d) (Sn_d d b)) y). elim SUM7. elimtype ((fun d : D => Delta) = (fun d : D => comm (seq (seq (ia D r1 d) (Sn_d d b)) y) (seq (Rn b') y'))). elim SUM1; apply refl_equal. apply EXTE; intro. elim A5. elim ProcRn. elim (A4 (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b' d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b')) (Rn b'))) (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b') d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b')))))) y'). elim CM9. cut (Delta = comm (seq (ia D r1 d) (seq (Sn_d d b) y)) (seq (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b') d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b')))))) y')). intro. elim H. elim A6. elim (A5 (alt (D + (fun d : D => ia Frame r3 (Tuple b' d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b')) (Rn b')) y'). elim (A4 (D + (fun d : D => ia Frame r3 (Tuple b' d))) (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')). elim CM9. elim CM7. elim CF2''. elim A7; elim A6. elim SC3. elim (SUM5 D (fun d : D => ia Frame r3 (Tuple b' d)) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')). elim SUM7. elimtype ((fun d : D => Delta) = (fun d0 : D => comm (seq (ia Frame r3 (Tuple b' d0)) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')) (seq (ia D r1 d) (seq (Sn_d d b) y)))). elim SUM1; apply refl_equal. apply EXTE; intro. elim CM7. elim CF2''. elim A7; apply refl_equal. exact EQFD. red in |- *. intro. apply EQFD. apply EQ_sym. assumption. elim (SUM5 D (fun d : D => seq (ia Frame r3 (Tuple (toggle b') d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))) y'). elim SC3. elim SUM7. elimtype ((fun d : D => Delta) = (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b') d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b'))))) y') (seq (ia D r1 d) (seq (Sn_d d b) y)))). elim SUM1; apply refl_equal. apply EXTE; intro. elim A5. elim CM7. elim CF2''. elim A7. apply refl_equal. exact EQFD. Save CommSnRn. Goal forall (b : bit) (d : D) (x y : proc), Delta = enc H (Lmer (seq (Sn_d d b) y) x). intros. elim ProcSn_d. elim A5. elim CM3. elim D5. elim D2. elim A7. apply refl_equal. exact Ins2H. Save LmerSnd. Goal forall (b : bit) (d : D) (x y : proc), Delta = enc H (Lmer (seq (Tn_d d b) y) x). intros. elim ProcTn_d. elim A4. elim A4. elim A4. elim CM4. elim CM4. elim A5. elim A5. elim CM3. elim CM3. elim CM3. elim D4. elim D4. elim D5. elim D5. elim D5. elim D2. elim D2. elim D2. elim A7. elim A7. elim A6. elim A6. apply refl_equal. exact Inr6H. exact Inr6H. exact Inr6H. Save LmerTnd. Goal forall (f : frame) (x y : proc), Delta = enc H (Lmer (seq (ia frame s5 f) y) x). intros. elim CM3. elim D5. elim D2. elim A7. apply refl_equal. exact Ins5H. Save Lmers5. Goal forall (d : D) (x y : proc), seq (ia D s4 d) (enc H (mer y x)) = enc H (Lmer (seq (ia D s4 d) y) x). intros. elim CM3. elim D5. elim D1. apply refl_equal. exact Ins4H. Save Lmers4. Goal forall x y y' : proc, alt (seq (ia one int i) (enc H (mer y x))) (seq (ia one int i) (enc H (mer y' x))) = enc H (Lmer (alt (seq (ia one int i) y) (seq (ia one int i) y')) x). intros. elim CM4. elim CM3. elim CM3. elim D4. elim D5. elim D5. elim D1. apply refl_equal. exact InintH. Save Lmeri. Goal forall (f : Frame) (x y : proc), Delta = enc H (Lmer (seq (ia Frame s3 f) y) x). intros. elim CM3. elim D5. elim D2. elim A7. apply refl_equal. exact Ins3H. Save Lmers3. Goal forall (f : frame) (x y : proc), Delta = enc H (Lmer (seq (ia frame s6 f) y) x). intros. elim CM3. elim D5. elim D2. elim A7. apply refl_equal. exact Ins6H. Save Lmers6. Goal forall (c : bool) (p : proc), cond p c p = p. intros. elim c. elim COND1. apply refl_equal. elim COND2. apply refl_equal. Save Bak4_2_1. Goal forall (c : bool) (x y z : proc), (true = c -> x = y) -> cond x c z = cond y c z. intro. intro. intro. intro. elim c. intro. elim COND1. elim COND1. elim H. apply refl_equal. apply refl_equal. intro. elim COND2. elim COND2. apply refl_equal. Save Def4_3_1_2. Goal forall (c : bool) (x y z : proc), (false = c -> x = y) -> cond z c x = cond z c y. intro. intro. intro. intro. elim c. intro. elim COND1. elim COND1. apply refl_equal. intro. elim COND2. elim COND2. elim H. apply refl_equal. apply refl_equal. Save Def4_3_1_2'. Goal forall (x : Frame -> proc) (d : Frame), x d = Frame + (fun e : Frame => cond (x d) (eqF e d) Delta). intros. pattern (x d) at 1 in |- *. elimtype (Frame + (fun e : Frame => x d) = x d). cut (forall e : Frame, x d = alt (cond (x d) (eqF e d) Delta) (x d)). intros. elim (SUM3 Frame d (fun e : Frame => cond (x d) (eqF e d) Delta)). elim eqF7. elim COND1. pattern (x d) at 3 in |- *. elimtype (Frame + (fun e : Frame => x d) = x d). cut (forall x y : Frame -> proc, Frame + (fun d : Frame => alt (x d) (y d)) = alt (Frame + x) (Frame + y)). intro SUM4r. elim SUM4r. cut ((fun e : Frame => alt (cond (x d) (eqF e d) Delta) (x d)) = (fun e : Frame => x d)). intros. elim H0. apply refl_equal. apply EXTE. intro; apply sym_equal; trivial. intros. apply sym_equal. apply SUM4. elim SUM1; auto. intro. elim (eqF e d). elim COND1. elim A3; auto. elim COND2. elim A1; elim A6; auto. elim SUM1; auto. Save Sum_EliminationF. Goal forall (x : frame -> proc) (d : frame), x d = frame + (fun e : frame => cond (x d) (eqf e d) Delta). intros. pattern (x d) at 1 in |- *. elimtype (frame + (fun e : frame => x d) = x d). cut (forall e : frame, x d = alt (cond (x d) (eqf e d) Delta) (x d)). intros. elim (SUM3 frame d (fun e : frame => cond (x d) (eqf e d) Delta)). elim eqf7. elim COND1. pattern (x d) at 3 in |- *. elimtype (frame + (fun e : frame => x d) = x d). cut (forall x y : frame -> proc, frame + (fun d : frame => alt (x d) (y d)) = alt (frame + x) (frame + y)). intro SUM4r. elim SUM4r. cut ((fun e : frame => alt (cond (x d) (eqf e d) Delta) (x d)) = (fun e : frame => x d)). intros. elim H0. apply refl_equal. apply EXTE. intro; apply sym_equal; trivial. intros. apply sym_equal. apply SUM4. elim SUM1; auto. intro. elim (eqf e d). elim COND1. elim A3; auto. elim COND2. elim A1; elim A6; auto. elim SUM1; auto. Save Sum_Eliminationf. Goal forall (x : D -> proc) (d : D), x d = D + (fun e : D => cond (x d) (eqD e d) Delta). intros. pattern (x d) at 1 in |- *. elimtype (D + (fun e : D => x d) = x d). cut (forall e : D, x d = alt (cond (x d) (eqD e d) Delta) (x d)). intros. elim (SUM3 D d (fun e : D => cond (x d) (eqD e d) Delta)). elim eqD7. elim COND1. pattern (x d) at 3 in |- *. elimtype (D + (fun e : D => x d) = x d). cut (forall x y : D -> proc, D + (fun d : D => alt (x d) (y d)) = alt (D + x) (D + y)). intro SUM4r. elim SUM4r. cut ((fun e : D => alt (cond (x d) (eqD e d) Delta) (x d)) = (fun e : D => x d)). intros. elim H0. apply refl_equal. apply EXTE. intro; apply sym_equal; trivial. intros. apply sym_equal. apply SUM4. elim SUM1; auto. intro. elim (eqD e d). elim COND1. elim A3; auto. elim COND2. elim A1; elim A6; auto. elim SUM1; auto. Save Sum_EliminationD. Goal forall (d : D) (n : bit) (y : proc), seq (ia Frame c2 (Tuple n d)) (mer y (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple n d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) = comm (seq (ia Frame s2 (Tuple n d)) y) (K i). intros. pattern (K i) at 2 in |- *. elim ChanK. elim SC3. elim SUM7. elimtype ((fun d0 : Frame => cond (seq (ia Frame c2 (Tuple n d)) (mer y (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple n d))) (seq (ia one int i) (ia Frame s3 lce))) (K i)))) (eqF d0 (Tuple n d)) Delta) = (fun d0 : Frame => comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple n d)) y))). 2: apply EXTE; intro. 2: elim CM7. 2: elim (Bak4_2_1 (eqF d0 (Tuple n d)) (seq (comm (ia Frame r2 d0) (ia Frame s2 (Tuple n d))) (mer (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i)) y))). 2: elim (Def4_3_1_2' (eqF d0 (Tuple n d)) Delta (seq (comm (ia Frame r2 d0) (ia Frame s2 (Tuple n d))) (mer (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i)) y)) (seq (comm (ia Frame r2 d0) (ia Frame s2 (Tuple n d))) (mer (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i)) y))). 2: elim (Def4_3_1_2 (eqF d0 (Tuple n d)) (seq (ia Frame c2 (Tuple n d)) (mer y (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple n d))) (seq (ia one int i) (ia Frame s3 lce))) (K i)))) (seq (comm (ia Frame r2 d0) (ia Frame s2 (Tuple n d))) (mer (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i)) y)) Delta). 2: apply refl_equal. 2: intros. 2: elim (eqF_intro d0 (Tuple n d)). 3: assumption. 2: elim CF1. 2: unfold gamma in |- *. 2: elim SC6. 2: apply refl_equal. 2: intro. 2: elim CF2'. 2: elim A7. 2: apply refl_equal. 2: apply eqF_intro'. 2: assumption. elim (Sum_EliminationF (fun d' : Frame => seq (ia Frame c2 d') (mer y (seq (alt (seq (ia one int i) (ia Frame s3 d')) (seq (ia one int i) (ia Frame s3 lce))) (K i)))) (Tuple n d)). apply refl_equal. Save comms2K. Goal forall (d : D) (n : bit) (y x : proc), seq (ia Frame c2 (Tuple n d)) (enc H (mer (mer y (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple n d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) x)) = enc H (Lmer (comm (seq (ia Frame s2 (Tuple n d)) y) (K i)) x). intros. elim comms2K. elim CM3. elim D5. elim D1. apply refl_equal. exact Inc2H. Save Comms2K. Goal forall (d : D) (n n' : bit) (y y' : proc), Delta = comm (seq (ia Frame s2 (Tuple n d)) y) (seq (Rn n') y'). intros. elim ProcRn. elim (A4 (seq (alt (D + (fun d : D => ia Frame r3 (Tuple n' d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple n')) (Rn n'))) (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle n') d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle n')))))) y'). elim CM9. elim (A4 (D + (fun d : D => ia Frame r3 (Tuple n' d))) (ia Frame r3 lce) (seq (ia frame s5 (tuple n')) (Rn n'))). elim (A4 (seq (D + (fun d : D => ia Frame r3 (Tuple n' d))) (seq (ia frame s5 (tuple n')) (Rn n'))) (seq (ia Frame r3 lce) (seq (ia frame s5 (tuple n')) (Rn n'))) y'). elim (CM9 (seq (ia Frame s2 (Tuple n d)) y) (seq (seq (D + (fun d : D => ia Frame r3 (Tuple n' d))) (seq (ia frame s5 (tuple n')) (Rn n'))) y') (seq (seq (ia Frame r3 lce) (seq (ia frame s5 (tuple n')) (Rn n'))) y')). elimtype (Delta = comm (seq (ia Frame s2 (Tuple n d)) y) (seq (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle n') d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle n')))))) y')). elimtype (Delta = comm (seq (ia Frame s2 (Tuple n d)) y) (seq (seq (ia Frame r3 lce) (seq (ia frame s5 (tuple n')) (Rn n'))) y')). repeat elim A6. elim (A5 (D + (fun d : D => ia Frame r3 (Tuple n' d))) (seq (ia frame s5 (tuple n')) (Rn n')) y'). elim SC3. elim (SUM5 D (fun d : D => ia Frame r3 (Tuple n' d)) (seq (seq (ia frame s5 (tuple n')) (Rn n')) y')). elim SUM7. elimtype ((fun d0 : D => Delta) = (fun d0 : D => comm (seq (ia Frame r3 (Tuple n' d0)) (seq (seq (ia frame s5 (tuple n')) (Rn n')) y')) (seq (ia Frame s2 (Tuple n d)) y))). elim SUM1; apply refl_equal. apply EXTE; intro. elim CM7. elim CF2. elim A7. apply refl_equal. apply refl_equal. elim A5. elim CM7. elim CF2. elim A7. apply refl_equal. apply refl_equal. elim SC3. elim (SUM5 D (fun d : D => seq (ia Frame r3 (Tuple (toggle n') d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle n'))))) y'). elim SUM7. elimtype ((fun d0 : D => Delta) = (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle n') d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle n'))))) y') (seq (ia Frame s2 (Tuple n d)) y))). elim SUM1; apply refl_equal. apply EXTE; intro. elim A5. elim CM7. elim CF2. elim A7. apply refl_equal. apply refl_equal. Save comms2Rn. Goal forall (n n' : bit) (d : D) (x y y' : proc), Delta = enc H (Lmer (comm (seq (ia Frame s2 (Tuple n d)) y) (seq (Rn n') y')) x). intros. elim comms2Rn. unfold Delta in |- *. elim CM2. elim A7. elim D3. apply refl_equal. Save Comms2Rn. Goal forall (d : D) (n : bit) (y : proc), Delta = comm (seq (ia Frame s2 (Tuple n d)) y) (L i). intros. elim ChanL. elim SC3. elim SUM7. elimtype ((fun d0 : frame => Delta) = (fun d0 : frame => comm (seq (ia frame r5 d0) (seq (alt (seq (ia one int i) (ia frame s6 d0)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s2 (Tuple n d)) y))). elim SUM1. apply refl_equal. apply EXTE; intro. elim CM7. elim CF2''. elim A7. apply refl_equal. red in |- *. intro. apply EQFf. apply EQ_sym. assumption. Save comms2L. Goal forall (d : D) (n : bit) (x y : proc), Delta = enc H (Lmer (comm (seq (ia Frame s2 (Tuple n d)) y) (L i)) x). intros. elim comms2L. unfold Delta in |- *. elim CM2. elim A7. elim D3. apply refl_equal. Save Comms2L. Goal forall x y y' : proc, Delta = enc H (Lmer (comm (alt (seq (ia one int i) y) (seq (ia one int i) y')) (L i)) x). intros. elim SC3. elim CM9. elim ChanL. elimtype (Delta = comm (frame + (fun n : frame => seq (ia frame r5 n) (seq (alt (seq (ia one int i) (ia frame s6 n)) (seq (ia one int i) (ia frame s6 sce))) (L i)))) (seq (ia one int i) y')). elimtype (Delta = comm (frame + (fun n : frame => seq (ia frame r5 n) (seq (alt (seq (ia one int i) (ia frame s6 n)) (seq (ia one int i) (ia frame s6 sce))) (L i)))) (seq (ia one int i) y)). elim A6. unfold Delta in |- *. elim CM2. elim D5. elim D3. elim A7. apply refl_equal. elim SUM7. elimtype ((fun d : frame => Delta) = (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia one int i) y))). elim SUM1; apply refl_equal. apply EXTE; intro. elim CM7. elim CF2''. elim A7. apply refl_equal. exact EQfi. elim SUM7. elimtype ((fun d : frame => Delta) = (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia one int i) y'))). elim SUM1; apply refl_equal. apply EXTE; intro. elim CM7. elim CF2''. elim A7. apply refl_equal. exact EQfi. Save CommiL. Goal forall x y y' : proc, Delta = enc H (Lmer (comm (alt (seq (ia one int i) y) (seq (ia one int i) y')) (K i)) x). intros. elim SC3. elim ChanK. elim (SUM7 Frame (fun x : Frame => seq (ia Frame r2 x) (seq (alt (seq (ia one int i) (ia Frame s3 x)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (alt (seq (ia one int i) y) (seq (ia one int i) y'))). elimtype ((fun d : Frame => Delta) = (fun d : Frame => comm (seq (ia Frame r2 d) (seq (alt (seq (ia one int i) (ia Frame s3 d)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (alt (seq (ia one int i) y) (seq (ia one int i) y')))). elim SUM1. unfold Delta at 2 in |- *. elim CM2. elim D5. elim D3. elim A7. apply refl_equal. apply EXTE. intro. elim A4. elim CM9. elim CM7. elim CM7. elim CF2''. elim A7. elim A7. elim A6. apply refl_equal. exact EQFi. Save CommiK. Goal forall (x y y' : proc) (b : bit), Delta = enc H (Lmer (comm (seq (ia one int i) y) (seq (Rn b) y')) x). intros. elim SC3. elim ProcRn. elimtype (Delta = comm (seq (alt (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))))) y') (seq (ia one int i) y)). unfold Delta in |- *. elim CM2. elim A7. elim D3. apply refl_equal. elim (A4 (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y'). elim CM8. elimtype (Delta = comm (seq (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y') (seq (ia one int i) y)). elim A6. elim (A5 (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b)) y'). elim (A4 (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')). elim CM8. elimtype (Delta = comm (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia one int i) y)). elim A6. elim (SUM5 D (fun d : D => ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')). elim SUM7. elimtype ((fun d : D => Delta) = (fun d : D => comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia one int i) y))). elim SUM1; apply refl_equal. apply EXTE; intro. elim CM7. elim CF2''. elim A7. apply refl_equal. exact EQFi. elim CM7. elim CF2''. elim A7. apply refl_equal. exact EQFi. elim (SUM5 D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y'). elim SUM7. elimtype ((fun d : D => Delta) = (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia one int i) y))). elim SUM1; apply refl_equal. apply EXTE; intro. elim A5. elim CM7. elim CF2''. elim A7. apply refl_equal. exact EQFi. Save commiRn. Goal forall (x y y' y'' : proc) (b : bit), Delta = enc H (Lmer (comm (alt (seq (ia one int i) y) (seq (ia one int i) y')) (seq (Rn b) y'')) x). intros. elim CM8. elim CM4. elim D4. elim commiRn. elim commiRn. elim A6. apply refl_equal. Save CommiRn. Goal forall (x y : proc) (b : bit) (d : D), Delta = enc H (Lmer (comm (seq (Tn_d d b) y) (L i)) x). intros. elim ProcTn_d. elim ChanL. elim A4. elim (SC3 (alt (seq (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (Sn_d d b)) y) (seq (ia frame r6 (tuple b)) y)) (frame + (fun n : frame => seq (ia frame r5 n) (seq (alt (seq (ia one int i) (ia frame s6 n)) (seq (ia one int i) (ia frame s6 sce))) (L i))))). elim (SUM7 frame (fun n : frame => seq (ia frame r5 n) (seq (alt (seq (ia one int i) (ia frame s6 n)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (alt (seq (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (Sn_d d b)) y) (seq (ia frame r6 (tuple b)) y))). elim (SUM6 frame (fun d0 : frame => comm (seq (ia frame r5 d0) (seq (alt (seq (ia one int i) (ia frame s6 d0)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (alt (seq (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (Sn_d d b)) y) (seq (ia frame r6 (tuple b)) y))) x). elim SUM9. elimtype ((fun d : frame => Delta) = (fun d0 : frame => enc H (Lmer (comm (seq (ia frame r5 d0) (seq (alt (seq (ia one int i) (ia frame s6 d0)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (alt (seq (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (Sn_d d b)) y) (seq (ia frame r6 (tuple b)) y))) x))). elim SUM1; apply refl_equal. apply EXTE; intro. elim CM9. elim A5. elim A4. elim A4. elim CM9. elim CM7. elim CM7. elim CM7. elim CF2. elim CF2. elim CF2. elim A7. elim A7. elim A6. elim A6. unfold Delta in |- *. elim CM2. elim D5. elim D3. elim A7. apply refl_equal. apply refl_equal. apply refl_equal. apply refl_equal. Save CommTn_dL. Goal forall (x y y' : proc) (b : bit) (d : D), Delta = enc H (Lmer (comm (seq (Tn_d d b) y) (seq (ia one int i) y')) x). intros. elim ProcTn_d. elim A4. elim CM8. elim A5. elim A4. elim CM8. elim CM7. elim CM7. elim CM7. elim CF2''. elim CF2''. elim CF2''. elim A7. elim A7. elim A6. elim A6. unfold Delta in |- *. elim CM2. elim D5. elim D3. elim A7. apply refl_equal. exact EQfi. exact EQfi. exact EQfi. Save commTn_di1. Goal forall (x y y' y'' : proc) (b : bit) (d : D), Delta = enc H (Lmer (comm (seq (Tn_d d b) y) (alt (seq (ia one int i) y') (seq (ia one int i) y''))) x). intros. elim CM9. elim CM4. elim D4. elim commTn_di1. elim commTn_di1. elim A6. apply refl_equal. Save CommTn_di. Goal forall (x y : proc) (b : bit) (d : D), Delta = enc H (Lmer (comm (seq (Sn_d d b) y) (L i)) x). intros. elim ProcSn_d. elim A5. elim SC3. elim ChanL. elim (SUM7 frame (fun n : frame => seq (ia frame r5 n) (seq (alt (seq (ia one int i) (ia frame s6 n)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))). elimtype ((fun d : frame => Delta) = (fun d0 : frame => comm (seq (ia frame r5 d0) (seq (alt (seq (ia one int i) (ia frame s6 d0)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)))). elim SUM1. unfold Delta at 2 in |- *. elim CM2. elim D5. elim D3. elim A7. apply refl_equal. apply EXTE. intro. elim CM7. elim CF2''. elim A7. apply refl_equal. red in |- *. intro. apply EQFf. apply EQ_sym. assumption. Save CommSn_dL. Goal forall (x y : proc) (b : bit) (d : D), seq (ia Frame c2 (Tuple b d)) (enc H (mer (seq (Tn_d d b) y) (mer (alt (seq (ia one int i) (seq (ia Frame s3 (Tuple b d)) (K i))) (seq (ia one int i) (seq (ia Frame s3 lce) (K i)))) x))) = enc H (Lmer (comm (seq (Sn_d d b) y) (K i)) x). intros. elim ProcSn_d. elim A5. pattern (K i) at 3 in |- *. elim ChanK. elim (SC3 (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)) (Frame + (fun x : Frame => seq (ia Frame r2 x) (seq (alt (seq (ia one int i) (ia Frame s3 x)) (seq (ia one int i) (ia Frame s3 lce))) (K i))))). elim (SUM7 Frame (fun x : Frame => seq (ia Frame r2 x) (seq (alt (seq (ia one int i) (ia Frame s3 x)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))). elimtype (Frame + (fun d0 : Frame => cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) = Frame + (fun d0 : Frame => comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)))). elim (Sum_EliminationF (fun d0 : Frame => comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (Tuple b d)). elim CM7; elim CF1. elim CM3; elim D5. elim A4. elim A5. elim A5. elim (SC6 (seq (Tn_d d b) y) (alt (seq (ia one int i) (seq (ia Frame s3 (Tuple b d)) (K i))) (seq (ia one int i) (seq (ia Frame s3 lce) (K i))))). elim SC7. unfold gamma in |- *; trivial. elim D1. trivial. exact Inc2H. elimtype ((fun d0 : Frame => cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta) = (fun d0 : Frame => comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y)))). trivial. apply EXTE; intros. cut (true = eqF d0 (Tuple b d) \/ false = eqF d0 (Tuple b d)). cut (true = eqF d0 (Tuple b d) -> cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta = comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))). cut (false = eqF d0 (Tuple b d) -> cond (comm (seq (ia Frame r2 (Tuple b d)) (seq (alt (seq (ia one int i) (ia Frame s3 (Tuple b d))) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))) (eqF d0 (Tuple b d)) Delta = comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia Frame s2 (Tuple b d)) (seq (Tn_d d b) y))). intros. exact (or_ind H0 H H1). intro. elim H. elim COND2. elim CM7. elim CF2'. elim A7. trivial. exact (eqF_intro' d0 (Tuple b d) H). intro. elim (eqF_intro d0 (Tuple b d) H). elim eqF7; elim COND1. trivial. apply Lemma4. Save CommSn_dK. Goal forall (x y y' : proc) (b b' : bit) (d : D), Delta = enc H (Lmer (comm (seq (Sn_d d b) y) (seq (Rn b') y')) x). intros. elim SC3. elim ProcRn. elim (A4 (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b' d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b')) (Rn b'))) (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b') d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b')))))) y'). elim (CM8 (seq (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b' d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b')) (Rn b'))) y') (seq (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b') d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b')))))) y') (seq (Sn_d d b) y)). elimtype (Delta = comm (seq (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b' d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b')) (Rn b'))) y') (seq (Sn_d d b) y)). elim (A6' (comm (seq (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b') d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b')))))) y') (seq (Sn_d d b) y))). elim (SUM5 D (fun d : D => seq (ia Frame r3 (Tuple (toggle b') d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))) y'). elim (SUM7 D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b') d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b'))))) y') (seq (Sn_d d b) y)). elimtype ((fun d : D => Delta) = (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b') d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b'))))) y') (seq (Sn_d d b) y))). elim SUM1. unfold Delta at 2 in |- *. elim CM2. elim D5. elim D3. elim A7. apply refl_equal. apply EXTE. intro. elim A5. elim ProcSn_d. elim A5. elim A5. elim CM7. elim CF2. elim A7. apply refl_equal. apply refl_equal. elim (A4 (D + (fun d : D => ia Frame r3 (Tuple b' d))) (ia Frame r3 lce) (seq (ia frame s5 (tuple b')) (Rn b'))). elim (A4 (seq (D + (fun d : D => ia Frame r3 (Tuple b' d))) (seq (ia frame s5 (tuple b')) (Rn b'))) (seq (ia Frame r3 lce) (seq (ia frame s5 (tuple b')) (Rn b'))) y'). elim CM8. elimtype (Delta = comm (seq (seq (D + (fun d : D => ia Frame r3 (Tuple b' d))) (seq (ia frame s5 (tuple b')) (Rn b'))) y') (seq (Sn_d d b) y)). elim A6'. elim A5. elim ProcSn_d. elim A5. elim A5. elim CM7. elim CF2. elim A7. apply refl_equal. apply refl_equal. elim (A5 (D + (fun d : D => ia Frame r3 (Tuple b' d))) (seq (ia frame s5 (tuple b')) (Rn b')) y'). elim (SUM5 D (fun d : D => ia Frame r3 (Tuple b' d)) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')). elim SUM7. elimtype ((fun d : D => Delta) = (fun d0 : D => comm (seq (ia Frame r3 (Tuple b' d0)) (seq (seq (ia frame s5 (tuple b')) (Rn b')) y')) (seq (Sn_d d b) y))). elim SUM1. apply refl_equal. apply EXTE. intro. elim ProcSn_d. elim A5. elim A5. elim CM7. elim CF2. elim A7. apply refl_equal. apply refl_equal. Save CommSn_dRn. Goal forall (x y y' : proc) (b : bit) (d : D), Delta = enc H (Lmer (comm (seq (ia D s4 d) y) (seq (Tn_d d b) y')) x). intros. elim SC3. elim ProcTn_d. elim A4. elim A4. elim A4. elim CM8. elim CM8. elim A5. elim A5. elim CM7. elim CM7. elim CM7. elim CF2''. elim CF2''. elim CF2''. elim A7. elim A7. elim A6. elim A6. unfold Delta at 2 in |- *. elim CM2. elim D5. elim D3. elim A7. apply refl_equal. exact EQfD. exact EQfD. exact EQfD. Save CommTn_ds4. Goal forall (x y y' : proc) (b : bit) (d : D) (f : frame), Delta = enc H (Lmer (comm (seq (ia frame s5 f) y) (seq (Tn_d d b) y')) x). intros. elim ProcTn_d. elim A4. elim A4. elim A4. elim CM9. elim CM9. elim A5. elim A5. elim CM7. elim CM7. elim CM7. elim CF2. elim CF2. elim CF2. elim A7. elim A7. elim A6. elim A6. unfold Delta at 2 in |- *. elim CM2. elim D5. elim D3. elim A7. apply refl_equal. apply refl_equal. apply refl_equal. apply refl_equal. Save CommTn_ds5. Goal forall (x y : proc) (b : bit) (d : D), Delta = enc H (Lmer (comm (K i) (seq (Tn_d d b) y)) x). intros. elim ChanK. elim (SUM7 Frame (fun x : Frame => seq (ia Frame r2 x) (seq (alt (seq (ia one int i) (ia Frame s3 x)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (Tn_d d b) y)). elimtype ((fun f : Frame => Delta) = (fun d0 : Frame => comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (Tn_d d b) y))). elim SUM1. unfold Delta in |- *. unfold Delta in |- *. elim CM2. elim D5. elim D3. elim A7. apply refl_equal. elim ProcTn_d. elim A4. elim A4. elim A4. apply EXTE. intro. elim CM9. elim CM9. elim A5. elim A5. elim CM7. elim CM7. elim CM7. elim CF2''. elim CF2''. elim CF2''. elim A7. elim A7. elim A6. elim A6. apply refl_equal. exact EQFf. exact EQFf. exact EQFf. Save CommTn_dK. Goal forall (x y : proc) (d : D), Delta = enc H (Lmer (comm (seq (ia D s4 d) y) (L i)) x). intros. elim SC3. elim ChanL. elim (SUM7 frame (fun n : frame => seq (ia frame r5 n) (seq (alt (seq (ia one int i) (ia frame s6 n)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia D s4 d) y)). elimtype ((fun d : frame => Delta) = (fun d0 : frame => comm (seq (ia frame r5 d0) (seq (alt (seq (ia one int i) (ia frame s6 d0)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia D s4 d) y))). elim SUM1. unfold Delta in |- *. unfold Delta in |- *. elim CM2. elim D5. elim D3. elim A7. apply refl_equal. apply EXTE. intro. elim CM7. elim CF2''. elim A7. apply refl_equal. exact EQfD. Save CommLs4. Goal forall (x y : proc) (f : frame), seq (ia frame c5 f) (enc H (mer y (mer (alt (seq (ia one int i) (seq (ia frame s6 f) (L i))) (seq (ia one int i) (seq (ia frame s6 sce) (L i)))) x))) = enc H (Lmer (comm (seq (ia frame s5 f) y) (L i)) x). intros. pattern (L i) at 3 in |- *. elim ChanL. elim (SC3 (seq (ia frame s5 f) y) (frame + (fun n : frame => seq (ia frame r5 n) (seq (alt (seq (ia one int i) (ia frame s6 n)) (seq (ia one int i) (ia frame s6 sce))) (L i))))). elim (SUM7 frame (fun n : frame => seq (ia frame r5 n) (seq (alt (seq (ia one int i) (ia frame s6 n)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia frame s5 f) y)). elimtype ((fun d : frame => cond (comm (seq (ia frame r5 f) (seq (alt (seq (ia one int i) (ia frame s6 f)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia frame s5 f) y)) (eqf d f) Delta) = (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia frame s5 f) y))). elim (Sum_Eliminationf (fun e : frame => comm (seq (ia frame r5 e) (seq (alt (seq (ia one int i) (ia frame s6 e)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia frame s5 e) y)) f). elim CM7. elim CF1. unfold gamma in |- *. elim CM3. elim A4. elim (SC6 y (alt (seq (seq (ia one int i) (ia frame s6 f)) (L i)) (seq (seq (ia one int i) (ia frame s6 sce)) (L i)))). elim SC7. elim D5. elim D1. elim A5; elim A5. trivial. exact Inc5H. apply EXTE; intro. cut (true = eqf d f \/ false = eqf d f). cut (true = eqf d f -> cond (comm (seq (ia frame r5 f) (seq (alt (seq (ia one int i) (ia frame s6 f)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia frame s5 f) y)) (eqf d f) Delta = comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia frame s5 f) y)). cut (false = eqf d f -> cond (comm (seq (ia frame r5 f) (seq (alt (seq (ia one int i) (ia frame s6 f)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia frame s5 f) y)) (eqf d f) Delta = comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia frame s5 f) y)). intros. exact (or_ind H0 H H1). intro. elim H; elim COND2. elim CM7; elim CF2'. elim A7; trivial. exact (eqf_intro' d f H). 2: apply Lemma4. intros. elim H. elim COND1. elim (eqf_intro d f H). trivial. Save CommLs5. Goal forall (x y : proc) (f : frame), Delta = enc H (Lmer (comm (seq (ia frame s6 f) y) (K i)) x). intros. elim SC3. elim ChanK. elim (SUM7 Frame (fun x : Frame => seq (ia Frame r2 x) (seq (alt (seq (ia one int i) (ia Frame s3 x)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia frame s6 f) y)). elimtype ((fun d : Frame => Delta) = (fun d : Frame => comm (seq (ia Frame r2 d) (seq (alt (seq (ia one int i) (ia Frame s3 d)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia frame s6 f) y))). elim SUM1. unfold Delta in |- *. unfold Delta in |- *. elim CM2. elim D5. elim D3. elim A7. apply refl_equal. apply EXTE. intro. elim CM7. elim CF2''. elim A7. apply refl_equal. exact EQFf. Save CommKs6. Goal forall (x y y' : proc) (b : bit) (f : frame), Delta = enc H (Lmer (comm (seq (ia frame s6 f) y) (seq (Rn b) y')) x). intros. elim SC3. elim ProcRn. elim (A4 (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y'). elim (CM8 (seq (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y') (seq (ia frame s6 f) y)). elimtype (Delta = comm (seq (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y') (seq (ia frame s6 f) y)). elim (A6 (comm (seq (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (ia frame s6 f) y))). elim (A4 (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce) (seq (ia frame s5 (tuple b)) (Rn b))). elim (A4 (seq (D + (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) (seq (ia Frame r3 lce) (seq (ia frame s5 (tuple b)) (Rn b))) y'). elim (CM8 (seq (seq (D + (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (seq (ia Frame r3 lce) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (ia frame s6 f) y)). elimtype (Delta = comm (seq (seq (D + (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (ia frame s6 f) y)). elim A6'. elim A5. elim CM7. elim CF2''. elim A7. unfold Delta at 2 in |- *. elim CM2. elim D5. elim D3. elim A7. apply refl_equal. exact EQFf. elim (A5 (D + (fun d : D => ia Frame r3 (Tuple b d))) (seq (ia frame s5 (tuple b)) (Rn b)) y'). elim (SUM5 D (fun d : D => ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')). elim SUM7. elimtype ((fun d : D => Delta) = (fun d : D => comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia frame s6 f) y))). elim SUM1. apply refl_equal. apply EXTE. intro. elim CM7. elim CF2''. elim A7. apply refl_equal. exact EQFf. elim (SUM5 D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y'). elim SUM7. elimtype ((fun d : D => Delta) = (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia frame s6 f) y))). elim SUM1. apply refl_equal. apply EXTE. intro. elim A5. elim CM7. elim CF2''. elim A7. apply refl_equal. exact EQFf. Save CommRns6. Goal forall (x y y' : proc) (b : bit) (d : D), seq (ia frame c6 sce) (enc H (mer y (mer (seq (Sn_d d b) y') x))) = enc H (Lmer (comm (seq (ia frame s6 sce) y) (seq (Tn_d d b) y')) x). intros. elim ProcTn_d. elim A4. elim A4. elim A4. elim CM9. elim CM9. elim A5. elim A5. elim CM7. elim CM7. elim CM7. elim CF1. elim CF2'. elim CF2'. elim A7. elim A7. elim A6. elim A6'. elim CM3. elim D5. elim D1. elim SC7. apply refl_equal. exact Inc6H. apply eqf_intro'. apply eqf2. apply eqf_intro'. apply eqf2. Save CommTn_ds6_sce. Goal forall (x y y' : proc) (b : bit) (d : D), seq (ia frame c6 (tuple (toggle b))) (enc H (mer y (mer (seq (Sn_d d b) y') x))) = enc H (Lmer (comm (seq (ia frame s6 (tuple (toggle b))) y) (seq (Tn_d d b) y')) x). intros. elim ProcTn_d. elim A4. elim A4. elim A4. elim CM9. elim CM9. elim A5. elim A5. elim CM7. elim CM7. elim CM7. elim CF1. elim CF2'. elim CF2'. elim A7. elim A7. elim A6. elim A6. elim CM3. elim D5. elim D1. elim SC7. apply refl_equal. exact Inc6H. apply eqf_intro'. elim eqf4. apply bit3. apply eqf_intro'. apply eqf3. Save CommTn_ds6_b. Goal forall (x y y' : proc) (b : bit) (d : D), seq (ia frame c6 (tuple b)) (enc H (mer y (mer y' x))) = enc H (Lmer (comm (seq (ia frame s6 (tuple b)) y) (seq (Tn_d d b) y')) x). intros. elim ProcTn_d. elim A4. elim A4. elim A4. elim CM9. elim CM9. elim A5. elim A5. elim CM7. elim CM7. elim CM7. elim CF1. elim CF2'. elim CF2'. elim A7. elim A6'. elim A6'. elim CM3. elim D5. elim D1. elim SC7. apply refl_equal. exact Inc6H. apply eqf_intro'. apply eqf3. apply eqf_intro'. elim eqf4. apply bit2. Save CommTn_ds6_b'. Goal forall (x y : proc) (d : D), Delta = enc H (Lmer (comm (K i) (seq (ia D s4 d) y)) x). intros. elim ChanK. elim (SUM7 Frame (fun x : Frame => seq (ia Frame r2 x) (seq (alt (seq (ia one int i) (ia Frame s3 x)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia D s4 d) y)). elimtype ((fun d : Frame => Delta) = (fun d0 : Frame => comm (seq (ia Frame r2 d0) (seq (alt (seq (ia one int i) (ia Frame s3 d0)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia D s4 d) y))). elim SUM1. unfold Delta in |- *. elim CM2. elim D5. elim D3. elim A7. apply refl_equal. apply EXTE. intro. elim CM7. elim CF2''. elim A7. apply refl_equal. exact EQFD. Save CommKs4. Goal forall (x y : proc) (f : frame), Delta = enc H (Lmer (comm (K i) (seq (ia frame s5 f) y)) x). intros. elim ChanK. elim (SUM7 Frame (fun x : Frame => seq (ia Frame r2 x) (seq (alt (seq (ia one int i) (ia Frame s3 x)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia frame s5 f) y)). elimtype ((fun f : Frame => Delta) = (fun d : Frame => comm (seq (ia Frame r2 d) (seq (alt (seq (ia one int i) (ia Frame s3 d)) (seq (ia one int i) (ia Frame s3 lce))) (K i))) (seq (ia frame s5 f) y))). elim SUM1. unfold Delta in |- *. elim CM2. elim D5. elim D3. elim A7. apply refl_equal. apply EXTE. intro. elim CM7. elim CF2''. elim A7. apply refl_equal. exact EQFf. Save CommKs5. Theorem CommTn_dRn : forall (x y y' : proc) (b b' : bit) (d : D), Delta = enc H (Lmer (comm (seq (Tn_d d b) y) (seq (Rn b') y')) x). Theorem Comms3Tn_d : forall (x y y' : proc) (b : bit) (d : D) (f : Frame), Delta = enc H (Lmer (comm (seq (ia Frame s3 f) y) (seq (Tn_d d b) y')) x). Proof. (* Goal: forall (x y y' : proc) (b : bit) (d : D) (f : Frame), @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s3 f) y) (seq (Tn_d d b) y')) x)) *) intros. (* Goal: @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s3 f) y) (seq (Tn_d d b) y')) x)) *) elim ProcTn_d. (* Goal: @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s3 f) y) (seq (alt (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (Sn_d d b)) (ia frame r6 (tuple b))) y')) x)) *) elim A4. (* Goal: @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s3 f) y) (alt (seq (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (Sn_d d b)) y') (seq (ia frame r6 (tuple b)) y'))) x)) *) elim CM9. (* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (Sn_d d b)) y')) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *) elim A5. (* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (seq (alt (ia frame r6 (tuple (toggle b))) (ia frame r6 sce)) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *) elim A4. (* Goal: @eq proc Delta (enc H (Lmer (alt (comm (seq (ia Frame s3 f) y) (alt (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y')) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *) elim CM9. (* Goal: @eq proc Delta (enc H (Lmer (alt (alt (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple (toggle b))) (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *) elim CM7. (* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq (comm (ia Frame s3 f) (ia frame r6 (tuple (toggle b)))) (mer y (seq (Sn_d d b) y'))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 sce) (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *) elim CM7. (* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq (comm (ia Frame s3 f) (ia frame r6 (tuple (toggle b)))) (mer y (seq (Sn_d d b) y'))) (seq (comm (ia Frame s3 f) (ia frame r6 sce)) (mer y (seq (Sn_d d b) y')))) (comm (seq (ia Frame s3 f) y) (seq (ia frame r6 (tuple b)) y'))) x)) *) elim CM7. (* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq (comm (ia Frame s3 f) (ia frame r6 (tuple (toggle b)))) (mer y (seq (Sn_d d b) y'))) (seq (comm (ia Frame s3 f) (ia frame r6 sce)) (mer y (seq (Sn_d d b) y')))) (seq (comm (ia Frame s3 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *) elim CF2''. (* Goal: not (EQ Frame frame) *) (* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq (comm (ia Frame s3 f) (ia frame r6 sce)) (mer y (seq (Sn_d d b) y')))) (seq (comm (ia Frame s3 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *) elim CF2''. (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq (comm (ia Frame s3 f) (ia frame r6 (tuple b))) (mer y y'))) x)) *) elim CF2''. (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: @eq proc Delta (enc H (Lmer (alt (alt (seq Delta (mer y (seq (Sn_d d b) y'))) (seq Delta (mer y (seq (Sn_d d b) y')))) (seq Delta (mer y y'))) x)) *) elim A7. (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: @eq proc Delta (enc H (Lmer (alt (alt Delta Delta) (seq Delta (mer y y'))) x)) *) elim A7. (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: @eq proc Delta (enc H (Lmer (alt (alt Delta Delta) Delta) x)) *) elim A6. (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: @eq proc Delta (enc H (Lmer (alt Delta Delta) x)) *) elim A6. (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: @eq proc Delta (enc H (Lmer Delta x)) *) unfold Delta in |- *. (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: @eq proc (ia one delta i) (enc H (Lmer (ia one delta i) x)) *) elim CM2. (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: @eq proc (ia one delta i) (enc H (seq (ia one delta i) x)) *) elim A7. (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: @eq proc (ia one delta i) (enc H Delta) *) elim D3. (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: @eq proc (ia one delta i) Delta *) apply refl_equal. (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) exact EQFf. (* Goal: not (EQ Frame frame) *) (* Goal: not (EQ Frame frame) *) exact EQFf. (* Goal: not (EQ Frame frame) *) exact EQFf. Qed. Theorem Comms3L : forall (x y : proc) (f : Frame), Delta = enc H (Lmer (comm (seq (ia Frame s3 f) y) (L i)) x). Proof. (* Goal: forall (x y : proc) (f : Frame), @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s3 f) y) (L i)) x)) *) intros. (* Goal: @eq proc Delta (enc H (Lmer (comm (seq (ia Frame s3 f) y) (L i)) x)) *) elim SC3. (* Goal: @eq proc Delta (enc H (Lmer (comm (L i) (seq (ia Frame s3 f) y)) x)) *) elim ChanL. (* Goal: @eq proc Delta (enc H (Lmer (comm (sum frame (fun n : frame => seq (ia frame r5 n) (seq (alt (seq (ia one int i) (ia frame s6 n)) (seq (ia one int i) (ia frame s6 sce))) (L i)))) (seq (ia Frame s3 f) y)) x)) *) elim (SUM7 frame (fun n : frame => seq (ia frame r5 n) (seq (alt (seq (ia one int i) (ia frame s6 n)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)). (* Goal: @eq proc Delta (enc H (Lmer (sum frame (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y))) x)) *) elimtype ((fun d : frame => Delta) = (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y))). (* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *) (* Goal: @eq proc Delta (enc H (Lmer (sum frame (fun _ : frame => Delta)) x)) *) elim SUM1. (* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *) (* Goal: @eq proc Delta (enc H (Lmer Delta x)) *) unfold Delta in |- *. (* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *) (* Goal: @eq proc (ia one delta i) (enc H (Lmer (ia one delta i) x)) *) elim CM2. (* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *) (* Goal: @eq proc (ia one delta i) (enc H (seq (ia one delta i) x)) *) elim D5. (* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *) (* Goal: @eq proc (ia one delta i) (seq (enc H (ia one delta i)) (enc H x)) *) elim D3. (* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *) (* Goal: @eq proc (ia one delta i) (seq Delta (enc H x)) *) elim A7. (* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *) (* Goal: @eq proc (ia one delta i) Delta *) apply refl_equal. (* Goal: @eq (forall _ : frame, proc) (fun _ : frame => Delta) (fun d : frame => comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *) apply EXTE. (* Goal: forall d : frame, @eq proc Delta (comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *) intro. (* Goal: @eq proc Delta (comm (seq (ia frame r5 d) (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i))) (seq (ia Frame s3 f) y)) *) elim CM7. (* Goal: @eq proc Delta (seq (comm (ia frame r5 d) (ia Frame s3 f)) (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *) elim CF2''. (* Goal: not (EQ frame Frame) *) (* Goal: @eq proc Delta (seq Delta (mer (seq (alt (seq (ia one int i) (ia frame s6 d)) (seq (ia one int i) (ia frame s6 sce))) (L i)) y)) *) elim A7. (* Goal: not (EQ frame Frame) *) (* Goal: @eq proc Delta Delta *) apply refl_equal. (* Goal: not (EQ frame Frame) *) red in |- *. (* Goal: forall _ : EQ frame Frame, False *) intro. (* Goal: False *) apply EQFf. (* Goal: EQ Frame frame *) apply EQ_sym. (* Goal: EQ frame Frame *) assumption. Qed. Theorem Comms3Rn_lce : forall (x y y' : proc) (b : bit), seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x)) = enc H (Lmer (comm (seq (ia Frame s3 lce) y) (seq (Rn b) y')) x). Proof. (* Goal: forall (x y y' : proc) (b : bit), @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (comm (seq (ia Frame s3 lce) y) (seq (Rn b) y')) x)) *) intros. (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (comm (seq (ia Frame s3 lce) y) (seq (Rn b) y')) x)) *) pattern (Rn b) at 2 in |- *. (* Goal: (fun p : proc => @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (comm (seq (ia Frame s3 lce) y) (seq p y')) x))) (Rn b) *) elim ProcRn. (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (comm (seq (ia Frame s3 lce) y) (seq (alt (seq (alt (sum D (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))))) y')) x)) *) elim (A4 (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y'). (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (comm (seq (ia Frame s3 lce) y) (alt (seq (seq (alt (sum D (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y'))) x)) *) elim (CM9 (seq (ia Frame s3 lce) y) (seq (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')). (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (alt (comm (seq (ia Frame s3 lce) y) (seq (seq (alt (sum D (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y')) (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y'))) x)) *) elim (CM4 (comm (seq (ia Frame s3 lce) y) (seq (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y')) (comm (seq (ia Frame s3 lce) y) (seq (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x). (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (alt (Lmer (comm (seq (ia Frame s3 lce) y) (seq (seq (alt (sum D (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y')) x) (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x))) *) elimtype (Delta = Lmer (comm (seq (ia Frame s3 lce) y) (seq (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x). (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (alt (Lmer (comm (seq (ia Frame s3 lce) y) (seq (seq (alt (sum D (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y')) x) Delta)) *) elim (A6 (Lmer (comm (seq (ia Frame s3 lce) y) (seq (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y')) x)). (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (comm (seq (ia Frame s3 lce) y) (seq (seq (alt (sum D (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y')) x)) *) elim (A5 (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b)) y'). (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (comm (seq (ia Frame s3 lce) y) (seq (alt (sum D (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) x)) *) elim (A4 (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')). (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (comm (seq (ia Frame s3 lce) y) (alt (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')))) x)) *) elim (CM9 (seq (ia Frame s3 lce) y) (seq (D + (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))). (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (alt (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) (comm (seq (ia Frame s3 lce) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')))) x)) *) elimtype (Delta = comm (seq (ia Frame s3 lce) y) (seq (D + (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))). (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (alt Delta (comm (seq (ia Frame s3 lce) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')))) x)) *) elim A6'. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (comm (seq (ia Frame s3 lce) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) x)) *) elim CM7. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (seq (comm (ia Frame s3 lce) (ia Frame r3 lce)) (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) x)) *) elim CF1. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (Lmer (seq (ia Frame (gamma s3 r3) lce) (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) x)) *) elim CM3. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (enc H (seq (ia Frame (gamma s3 r3) lce) (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) *) elim D5. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (seq (enc H (ia Frame (gamma s3 r3) lce)) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) *) elim D1. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: not (In_ehlist (gamma s3 r3) H) *) (* Goal: @eq proc (seq (ia Frame c3 lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) (seq (ia Frame (gamma s3 r3) lce) (enc H (mer (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) x))) *) apply refl_equal. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: not (In_ehlist (gamma s3 r3) H) *) exact Inc3H. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) elim SC3. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 lce) y)) *) elim (SUM5 D (fun d : D => ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')). (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) (seq (ia Frame s3 lce) y)) *) elim SUM7. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc Delta (sum D (fun d : D => comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 lce) y))) *) elimtype ((fun d : D => Delta) = (fun d : D => comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 lce) y))). (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 lce) y)) *) (* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *) elim SUM1. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 lce) y)) *) (* Goal: @eq proc Delta Delta *) apply refl_equal. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 lce) y)) *) apply EXTE. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: forall d : D, @eq proc Delta (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 lce) y)) *) intro. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 lce) y)) *) elim A5. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple b d)) (seq (ia frame s5 (tuple b)) (seq (Rn b) y'))) (seq (ia Frame s3 lce) y)) *) elim CM7. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple b d)) (ia Frame s3 lce)) (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y)) *) elim CF2'. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: not (@eq Frame (Tuple b d) lce) *) (* Goal: @eq proc Delta (seq Delta (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y)) *) elim A7. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: not (@eq Frame (Tuple b d) lce) *) (* Goal: @eq proc Delta Delta *) apply refl_equal. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: not (@eq Frame (Tuple b d) lce) *) apply eqF_intro'. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) (* Goal: @eq bool false (eqF (Tuple b d) lce) *) apply eqF3. (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) x) *) elim (SUM5 D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y'). (* Goal: @eq proc Delta (Lmer (comm (seq (ia Frame s3 lce) y) (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y'))) x) *) elim (SC3 (seq (ia Frame s3 lce) y) (D + (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y'))). (* Goal: @eq proc Delta (Lmer (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 lce) y)) x) *) elim (SUM7 D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)). (* Goal: @eq proc Delta (Lmer (sum D (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y))) x) *) elimtype ((fun d : D => Delta) = (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y))). (* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *) (* Goal: @eq proc Delta (Lmer (sum D (fun _ : D => Delta)) x) *) unfold Delta in |- *. (* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *) (* Goal: @eq proc (ia one delta i) (Lmer (sum D (fun _ : D => ia one delta i)) x) *) elim SUM6. (* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *) (* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => Lmer (ia one delta i) x)) *) elim CM2. (* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *) (* Goal: @eq proc (ia one delta i) (sum D (fun _ : D => seq (ia one delta i) x)) *) elim SUM1. (* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *) (* Goal: @eq proc (ia one delta i) (seq (ia one delta i) x) *) elim A7. (* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *) (* Goal: @eq proc (ia one delta i) Delta *) apply refl_equal. (* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *) apply EXTE. (* Goal: forall d : D, @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *) intro. (* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 lce) y)) *) elim A5. (* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 lce) y)) *) elim CM7. (* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d)) (ia Frame s3 lce)) (mer (seq (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))) y') y)) *) elim CF2'. (* Goal: not (@eq Frame (Tuple (toggle b) d) lce) *) (* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))) y') y)) *) elim A7. (* Goal: not (@eq Frame (Tuple (toggle b) d) lce) *) (* Goal: @eq proc Delta Delta *) apply refl_equal. (* Goal: not (@eq Frame (Tuple (toggle b) d) lce) *) apply eqF_intro'. (* Goal: @eq bool false (eqF (Tuple (toggle b) d) lce) *) apply eqF3. Qed. Theorem Comms3Rn_b' : forall (x y y' : proc) (b : bit) (d : D), seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x)) = enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (Rn b) y')) x). Proof. (* Goal: forall (x y y' : proc) (b : bit) (d : D), @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (Rn b) y')) x)) *) intros. (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (Rn b) y')) x)) *) pattern (Rn b) at 2 in |- *. (* Goal: (fun p : proc => @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq p y')) x))) (Rn b) *) elim ProcRn. (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (alt (seq (alt (sum D (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))))) y')) x)) *) elim (A4 (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y'). (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (alt (seq (seq (alt (sum D (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y'))) x)) *) elim (CM9 (seq (ia Frame s3 (Tuple b d)) y) (seq (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y') (seq (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')). (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (alt (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (seq (alt (sum D (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y')) (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y'))) x)) *) elimtype (Delta = comm (seq (ia Frame s3 (Tuple b d)) y) (seq (D + (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (alt (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (seq (alt (sum D (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y')) Delta) x)) *) elim (A6 (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (seq (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y'))). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (seq (alt (sum D (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b))) y')) x)) *) elim (A5 (alt (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (ia frame s5 (tuple b)) (Rn b)) y'). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (alt (sum D (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) x)) *) elim (A4 (D + (fun d : D => ia Frame r3 (Tuple b d))) (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (alt (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')))) x)) *) elim (CM9 (seq (ia Frame s3 (Tuple b d)) y) (seq (D + (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (alt (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')))) x)) *) elimtype (Delta = comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (alt (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) Delta) x)) *) elim (A6 (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (D + (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')))). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => ia Frame r3 (Tuple b d))) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) x)) *) elim (SUM5 D (fun d : D => ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame s3 (Tuple b d)) y) (sum D (fun d : D => seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')))) x)) *) elim (SC3 (seq (ia Frame s3 (Tuple b d)) y) (D + (fun d : D => seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')))). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (sum D (fun d : D => seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) (seq (ia Frame s3 (Tuple b d)) y)) x)) *) elim (SUM7 D (fun d : D => seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (sum D (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y))) x)) *) elimtype ((fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) = (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y))). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (sum D (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta)) x)) *) elim (Sum_EliminationD (fun d : D => comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) d). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) x)) *) elim CM7. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (comm (ia Frame r3 (Tuple b d)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *) elim CF1. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (Lmer (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) x)) *) elim CM3. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (enc H (seq (ia Frame (gamma r3 s3) (Tuple b d)) (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *) elim D5. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (seq (enc H (ia Frame (gamma r3 s3) (Tuple b d))) (enc H (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *) elim D1. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: not (In_ehlist (gamma r3 s3) H) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (seq (ia Frame (gamma r3 s3) (Tuple b d)) (enc H (mer (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y) x))) *) elim A5. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: not (In_ehlist (gamma r3 s3) H) *) (* Goal: @eq proc (seq (ia Frame c3 (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) (seq (ia Frame (gamma r3 s3) (Tuple b d)) (enc H (mer (mer (seq (ia frame s5 (tuple b)) (seq (Rn b) y')) y) x))) *) apply refl_equal. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: not (In_ehlist (gamma r3 s3) H) *) exact Inc3H. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq (forall _ : D, proc) (fun d0 : D => cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (fun d0 : D => comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) apply EXTE; intro. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq proc (cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) pattern (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) at 1 in |- *. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: (fun p : proc => @eq proc (cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) p) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) elim (Bak4_2_1 (eqD d0 d) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y))). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq proc (cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (cond (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y))) *) elim (Def4_3_1_2 (eqD d0 d) (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y))). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq proc (cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y))) *) elim (Def4_3_1_2' (eqD d0 d) Delta (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y))). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: forall _ : @eq bool false (eqD d0 d), @eq proc Delta (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq proc (cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) (cond (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (eqD d0 d) Delta) *) apply refl_equal. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: forall _ : @eq bool false (eqD d0 d), @eq proc Delta (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) intro. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) elim CM7. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple b d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) *) elim CF2'. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: not (@eq Frame (Tuple b d0) (Tuple b d)) *) (* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia frame s5 (tuple b)) (Rn b)) y') y)) *) elim A7. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: not (@eq Frame (Tuple b d0) (Tuple b d)) *) (* Goal: @eq proc Delta Delta *) apply refl_equal. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: not (@eq Frame (Tuple b d0) (Tuple b d)) *) red in |- *. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: forall _ : @eq Frame (Tuple b d0) (Tuple b d), False *) intro. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: False *) absurd (true = false). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool true false *) (* Goal: not (@eq bool true false) *) red in |- *; intro. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool true false *) (* Goal: False *) cut (forall P : bool -> Prop, P true -> P false). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool true false *) (* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *) (* Goal: forall _ : forall (P : forall _ : bool, Prop) (_ : P true), P false, False *) intro L. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool true false *) (* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *) (* Goal: False *) apply (L (fun b : bool => match b return Prop with | true => True | false => False end)). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool true false *) (* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *) (* Goal: True *) exact I. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool true false *) (* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *) intros. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool true false *) (* Goal: P false *) elim H1. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool true false *) (* Goal: P true *) assumption. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool true false *) elimtype (eqD d0 d = false). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool (eqD d0 d) false *) (* Goal: @eq bool true (eqD d0 d) *) elimtype (eqF (Tuple b d0) (Tuple b d) = eqD d0 d). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool (eqD d0 d) false *) (* Goal: @eq bool (eqF (Tuple b d0) (Tuple b d)) (eqD d0 d) *) (* Goal: @eq bool true (eqF (Tuple b d0) (Tuple b d)) *) elim H0. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool (eqD d0 d) false *) (* Goal: @eq bool (eqF (Tuple b d0) (Tuple b d)) (eqD d0 d) *) (* Goal: @eq bool true (eqF (Tuple b d0) (Tuple b d0)) *) elim eqF4. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool (eqD d0 d) false *) (* Goal: @eq bool (eqF (Tuple b d0) (Tuple b d)) (eqD d0 d) *) (* Goal: @eq bool true (andb (eqb b b) (eqD d0 d0)) *) elim eqD7. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool (eqD d0 d) false *) (* Goal: @eq bool (eqF (Tuple b d0) (Tuple b d)) (eqD d0 d) *) (* Goal: @eq bool true (andb (eqb b b) true) *) elim bit1. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool (eqD d0 d) false *) (* Goal: @eq bool (eqF (Tuple b d0) (Tuple b d)) (eqD d0 d) *) (* Goal: @eq bool true (andb true true) *) elim andb1. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool (eqD d0 d) false *) (* Goal: @eq bool (eqF (Tuple b d0) (Tuple b d)) (eqD d0 d) *) (* Goal: @eq bool true true *) apply refl_equal. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool (eqD d0 d) false *) (* Goal: @eq bool (eqF (Tuple b d0) (Tuple b d)) (eqD d0 d) *) elim eqF4. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool (eqD d0 d) false *) (* Goal: @eq bool (andb (eqb b b) (eqD d0 d)) (eqD d0 d) *) elim bit1. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool (eqD d0 d) false *) (* Goal: @eq bool (andb true (eqD d0 d)) (eqD d0 d) *) elim andb1. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool (eqD d0 d) false *) (* Goal: @eq bool (eqD d0 d) (eqD d0 d) *) apply refl_equal. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool (eqD d0 d) false *) elim H. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq bool false false *) apply refl_equal. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: forall _ : @eq bool true (eqD d0 d), @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) intro. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq proc (comm (seq (ia Frame r3 (Tuple b d)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) elim (eqD_intro d0 d). (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq bool true (eqD d0 d) *) (* Goal: @eq proc (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d0)) y)) (comm (seq (ia Frame r3 (Tuple b d0)) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y')) (seq (ia Frame s3 (Tuple b d0)) y)) *) apply refl_equal. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) (* Goal: @eq bool true (eqD d0 d) *) assumption. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (ia Frame r3 lce) (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) elim CM7. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq proc Delta (seq (comm (ia Frame s3 (Tuple b d)) (ia Frame r3 lce)) (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) elim CF2'. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: not (@eq Frame (Tuple b d) lce) *) (* Goal: @eq proc Delta (seq Delta (mer y (seq (seq (ia frame s5 (tuple b)) (Rn b)) y'))) *) elim A7. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: not (@eq Frame (Tuple b d) lce) *) (* Goal: @eq proc Delta Delta *) apply refl_equal. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: not (@eq Frame (Tuple b d) lce) *) apply eqF_intro'. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq bool false (eqF (Tuple b d) lce) *) elim eqF3. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) (* Goal: @eq bool false false *) apply refl_equal. (* Goal: @eq proc Delta (comm (seq (ia Frame s3 (Tuple b d)) y) (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y')) *) elim SC3. (* Goal: @eq proc Delta (comm (seq (sum D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b)))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *) elim (SUM5 D (fun d : D => seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y'). (* Goal: @eq proc Delta (comm (sum D (fun d : D => seq (seq (ia Frame r3 (Tuple (toggle b) d)) (seq (ia D s4 d) (ia frame s5 (tuple (toggle b))))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) elim SUM7. (* Goal: @eq proc Delta (sum D (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y))) *) elimtype ((fun d : D => Delta) = (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y))). (* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq proc Delta (sum D (fun _ : D => Delta)) *) elim SUM1. (* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *) (* Goal: @eq proc Delta Delta *) apply refl_equal. (* Goal: @eq (forall _ : D, proc) (fun _ : D => Delta) (fun d0 : D => comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *) apply EXTE. (* Goal: forall d0 : D, @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *) intro. (* Goal: @eq proc Delta (comm (seq (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b))))) y') (seq (ia Frame s3 (Tuple b d)) y)) *) elim A5. (* Goal: @eq proc Delta (comm (seq (ia Frame r3 (Tuple (toggle b) d0)) (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y')) (seq (ia Frame s3 (Tuple b d)) y)) *) elim CM7. (* Goal: @eq proc Delta (seq (comm (ia Frame r3 (Tuple (toggle b) d0)) (ia Frame s3 (Tuple b d))) (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *) elim CF2'. (* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *) (* Goal: @eq proc Delta (seq Delta (mer (seq (seq (ia D s4 d0) (ia frame s5 (tuple (toggle b)))) y') y)) *) elim A7. (* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *) (* Goal: @eq proc Delta Delta *) apply refl_equal. (* Goal: not (@eq Frame (Tuple (toggle b) d0) (Tuple b d)) *) red in |- *; intro. (* Goal: False *) absurd (true = false). (* Goal: @eq bool true false *) (* Goal: not (@eq bool true false) *) red in |- *. (* Goal: @eq bool true false *) (* Goal: forall _ : @eq bool true false, False *) intro. (* Goal: @eq bool true false *) (* Goal: False *) cut (forall P : bool -> Prop, P true -> P false). (* Goal: @eq bool true false *) (* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *) (* Goal: forall _ : forall (P : forall _ : bool, Prop) (_ : P true), P false, False *) intro L. (* Goal: @eq bool true false *) (* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *) (* Goal: False *) apply (L (fun b : bool => match b return Prop with | true => True | false => False end)). (* Goal: @eq bool true false *) (* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *) (* Goal: True *) exact I. (* Goal: @eq bool true false *) (* Goal: forall (P : forall _ : bool, Prop) (_ : P true), P false *) intros. (* Goal: @eq bool true false *) (* Goal: P false *) elim H0. (* Goal: @eq bool true false *) (* Goal: P true *) assumption. (* Goal: @eq bool true false *) elimtype (eqF (Tuple b d) (Tuple b d) = true). (* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *) (* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) false *) pattern (Tuple b d) at 2 in |- *. (* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *) (* Goal: (fun f : Frame => @eq bool (eqF (Tuple b d) f) false) (Tuple b d) *) elim H. (* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *) (* Goal: @eq bool (eqF (Tuple b d) (Tuple (toggle b) d0)) false *) elim eqF4. (* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *) (* Goal: @eq bool (andb (eqb b (toggle b)) (eqD d d0)) false *) elim bit2. (* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *) (* Goal: @eq bool (andb false (eqD d d0)) false *) elim andb2. (* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *) (* Goal: @eq bool false false *) apply refl_equal. (* Goal: @eq bool (eqF (Tuple b d) (Tuple b d)) true *) elim eqF4. (* Goal: @eq bool (andb (eqb b b) (eqD d d)) true *) elim bit1. (* Goal: @eq bool (andb true (eqD d d)) true *) elim andb1. (* Goal: @eq bool (eqD d d) true *) elim eqD7. (* Goal: @eq bool true true *) apply refl_equal. Qed. Theorem Comms3Rn_b : forall (x y y' : proc) (b : bit) (d : D), seq (ia Frame c3 (Tuple (toggle b) d)) (enc H (mer y (mer (seq (ia D s4 d) (seq (ia frame s5 (tuple (toggle b))) y')) x))) = enc H (Lmer (comm (seq (ia Frame s3 (Tuple (toggle b) d)) y) (seq (Rn b) y')) x).
Set Implicit Arguments. Unset Strict Implicit. Require Export Module_util. Require Export Sub_module. Require Export Group_kernel. Section Def. Variable R : RING. Variable Mod Mod2 : MODULE R. Variable f : Hom Mod Mod2. Definition Ker : submodule Mod. Proof. (* Goal: @submodule R Mod *) apply (Build_submodule (R:=R) (M:=Mod) (submodule_subgroup:=Ker f)). (* 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 Mod)))))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@Ker (abelian_group_group (@module_carrier R Mod)) (abelian_group_group (@module_carrier R Mod2)) (@module_monoid_hom R Mod Mod2 f)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod a x) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@Ker (abelian_group_group (@module_carrier R Mod)) (abelian_group_group (@module_carrier R Mod2)) (@module_monoid_hom R Mod Mod2 f))))) *) 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 R Mod)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod2)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) (@module_mult R Mod a x)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod2))))) *) intros a x H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) (@module_mult R Mod a x)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod2))))) *) apply Trans with (module_mult a (f x)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@module_mult R Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod2))))) *) apply Trans with (module_mult a (monoid_unit (module_carrier Mod2))); auto with algebra. Qed. Definition coKer : submodule Mod2. Proof. (* Goal: @submodule R Mod2 *) apply (Build_submodule (R:=R) (M:=Mod2) (submodule_subgroup:=coKer f)). (* 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 Mod2)))))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod2)) (@coKer (abelian_group_group (@module_carrier R Mod)) (abelian_group_group (@module_carrier R Mod2)) (@module_monoid_hom R Mod Mod2 f)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@module_mult R Mod2 a x) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod2)) (@coKer (abelian_group_group (@module_carrier R Mod)) (abelian_group_group (@module_carrier R Mod2)) (@module_monoid_hom R Mod Mod2 f))))) *) 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 R Mod2)))))) (_ : @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x0)))), @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@module_mult R Mod2 a x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x0))) *) intros a x H'; try assumption. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@module_mult R Mod2 a x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 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 (abelian_group_group (@module_carrier R Mod)))))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@module_mult R Mod2 a x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x0))) *) exists (module_mult a x0); split; [ try assumption | idtac ]. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@module_mult R Mod2 a x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) (@module_mult R Mod a x0)) *) apply Trans with (module_mult a (f x0)); auto with algebra. Qed. Lemma Ker_prop : forall x : Mod, in_part x Ker -> Equal (f x) (monoid_unit Mod2). Proof. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod Ker))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod2))))) *) auto with algebra. Qed. Lemma Ker_prop_rev : forall x : Mod, Equal (f x) (monoid_unit Mod2) -> in_part x Ker. Proof. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod2)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod)) (@submodule_subgroup R Mod Ker)))) *) auto with algebra. Qed. Lemma coKer_prop : forall x : Mod, in_part (f x) coKer. Proof. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@subgroup_submonoid (abelian_group_group (@module_carrier R Mod2)) (@submodule_subgroup R Mod2 coKer)))) *) simpl in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))), @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R Mod))) (group_monoid (abelian_group_group (@module_carrier R Mod2))) (@module_monoid_hom R Mod Mod2 f))) x0))) *) intros x; exists x; split; [ idtac | try assumption ]; auto with algebra. Qed. End Def. Hint Resolve Ker_prop coKer_prop: algebra.
From mathcomp Require Import ssreflect ssrbool eqtype seq ssrfun. From LemmaOverloading Require Import heaps rels hprop stmod stsep stlogR. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Definition llist (T : Type) := ptr. Section LList. Variable T : Type. Notation llist := (llist T). Fixpoint lseg (p q : ptr) (xs : seq T) {struct xs} := if xs is x::xt then [Pred h | exists r, exists h', h = p :-> x :+ (p .+ 1 :-> r :+ h') /\ h' \In lseg r q xt] else [Pred h | p = q /\ h = empty]. Lemma lseg_add_last xs x p r h : h \In lseg p r (rcons xs x) <-> exists q, exists h', h = h' :+ (q :-> x :+ q .+ 1 :-> r) /\ h' \In lseg p q xs. Proof. (* Goal: iff (@InMem heap h (@Mem heap (SimplPredPredType heap) (lseg p r (@rcons T xs x)))) (@ex ptr (fun q : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 h' (union2 (@pts T q x) (@pts ptr (ptr_offset q (S O)) r)))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (lseg p q xs)))))) *) move: xs x p r h. (* Goal: forall (xs : list T) (x : T) (p r : ptr) (h : heap), iff (@InMem heap h (@Mem heap (SimplPredPredType heap) (lseg p r (@rcons T xs x)))) (@ex ptr (fun q : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 h' (union2 (@pts T q x) (@pts ptr (ptr_offset q (S O)) r)))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (lseg p q xs)))))) *) elim=>[|x xs IH] y p r h /=; first by split; case=>x [_][->][<-] ->; hhauto. (* Goal: iff (@InMem heap h (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r0 : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r0) h'))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (lseg r0 r (@rcons T xs y)))))))))) (@ex ptr (fun q : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 h' (union2 (@pts T q y) (@pts ptr (ptr_offset q (S O)) r)))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r : ptr => @ex heap (fun h'0 : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r) h'0))) (@InMem heap h'0 (@Mem heap (SimplPredPredType heap) (lseg r q xs)))))))))))) *) split. (* Goal: forall _ : @ex ptr (fun q : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 h' (union2 (@pts T q y) (@pts ptr (ptr_offset q (S O)) r)))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r : ptr => @ex heap (fun h'0 : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r) h'0))) (@InMem heap h'0 (@Mem heap (SimplPredPredType heap) (lseg r q xs))))))))))), @InMem heap h (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r0 : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r0) h'))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (lseg r0 r (@rcons T xs y))))))))) *) (* Goal: forall _ : @InMem heap h (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r0 : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r0) h'))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (lseg r0 r (@rcons T xs y))))))))), @ex ptr (fun q : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 h' (union2 (@pts T q y) (@pts ptr (ptr_offset q (S O)) r)))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r : ptr => @ex heap (fun h'0 : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r) h'0))) (@InMem heap h'0 (@Mem heap (SimplPredPredType heap) (lseg r q xs))))))))))) *) - (* Goal: forall _ : @ex ptr (fun q : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 h' (union2 (@pts T q y) (@pts ptr (ptr_offset q (S O)) r)))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r : ptr => @ex heap (fun h'0 : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r) h'0))) (@InMem heap h'0 (@Mem heap (SimplPredPredType heap) (lseg r q xs))))))))))), @InMem heap h (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r0 : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r0) h'))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (lseg r0 r (@rcons T xs y))))))))) *) (* Goal: forall _ : @InMem heap h (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r0 : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r0) h'))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (lseg r0 r (@rcons T xs y))))))))), @ex ptr (fun q : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 h' (union2 (@pts T q y) (@pts ptr (ptr_offset q (S O)) r)))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r : ptr => @ex heap (fun h'0 : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r) h'0))) (@InMem heap h'0 (@Mem heap (SimplPredPredType heap) (lseg r q xs))))))))))) *) case=>z [h1][->]; case/IH=>w [h2][->] H1. (* Goal: forall _ : @ex ptr (fun q : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 h' (union2 (@pts T q y) (@pts ptr (ptr_offset q (S O)) r)))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r : ptr => @ex heap (fun h'0 : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r) h'0))) (@InMem heap h'0 (@Mem heap (SimplPredPredType heap) (lseg r q xs))))))))))), @InMem heap h (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r0 : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r0) h'))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (lseg r0 r (@rcons T xs y))))))))) *) (* Goal: @ex ptr (fun q : ptr => @ex heap (fun h' : heap => and (@eq heap (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) z) (union2 h2 (union2 (@pts T w y) (@pts ptr (ptr_offset w (S O)) r))))) (union2 h' (union2 (@pts T q y) (@pts ptr (ptr_offset q (S O)) r)))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r : ptr => @ex heap (fun h'0 : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r) h'0))) (@InMem heap h'0 (@Mem heap (SimplPredPredType heap) (lseg r q xs))))))))))) *) by exists w; exists (p :-> x :+ (p .+ 1 :-> z :+ h2)); hhauto. (* Goal: forall _ : @ex ptr (fun q : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 h' (union2 (@pts T q y) (@pts ptr (ptr_offset q (S O)) r)))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r : ptr => @ex heap (fun h'0 : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r) h'0))) (@InMem heap h'0 (@Mem heap (SimplPredPredType heap) (lseg r q xs))))))))))), @InMem heap h (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r0 : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r0) h'))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (lseg r0 r (@rcons T xs y))))))))) *) case=>q [h1][->][z][h2][->] H1. (* Goal: @InMem heap (union2 (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) z) h2)) (union2 (@pts T q y) (@pts ptr (ptr_offset q (S O)) r))) (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r0 : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r0) h'))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (lseg r0 r (@rcons T xs y))))))))) *) exists z; exists (h2 :+ q :-> y :+ q .+ 1 :-> r). (* Goal: and (@eq heap (union2 (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) z) h2)) (union2 (@pts T q y) (@pts ptr (ptr_offset q (S O)) r))) (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) z) (union2 (union2 h2 (@pts T q y)) (@pts ptr (ptr_offset q (S O)) r))))) (@InMem heap (union2 (union2 h2 (@pts T q y)) (@pts ptr (ptr_offset q (S O)) r)) (@Mem heap (SimplPredPredType heap) (lseg z r (@rcons T xs y)))) *) by rewrite -!unA; split=>//; apply/IH; eauto. Qed. Lemma lseg_null xs q h : def h -> h \In lseg null q xs -> [/\ q = null, xs = [::] & h = empty]. Proof. (* Goal: forall (_ : is_true (def h)) (_ : @InMem heap h (@Mem heap (SimplPredPredType heap) (lseg null q xs))), and3 (@eq ptr q null) (@eq (list T) xs (@nil T)) (@eq heap h empty) *) case:xs=>[|x xs] D /= H; first by case: H=><- ->. (* Goal: and3 (@eq ptr q null) (@eq (list T) (@cons T x xs) (@nil T)) (@eq heap h empty) *) by case: H D=>r [h'][->] _; rewrite defPtUn eq_refl. Qed. Lemma lseg_neq xs p q h : p != q -> h \In lseg p q xs -> exists x, exists r, exists h', [/\ xs = x :: behead xs, p :-> x :+ (p .+ 1 :-> r :+ h') = h & h' \In lseg r q (behead xs)]. Proof. (* Goal: forall (_ : is_true (negb (@eq_op ptr_eqType p q))) (_ : @InMem heap h (@Mem heap (SimplPredPredType heap) (lseg p q xs))), @ex T (fun x : T => @ex ptr (fun r : ptr => @ex heap (fun h' : heap => and3 (@eq (list T) xs (@cons T x (@behead T xs))) (@eq heap (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r) h')) h) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (lseg r q (@behead T xs))))))) *) case:xs=>[|x xs] /= H []; last by move=>y [h'][->] H1; hhauto. (* Goal: forall (_ : @eq ptr p q) (_ : @eq heap h empty), @ex T (fun x : T => @ex ptr (fun r : ptr => @ex heap (fun h' : heap => and3 (@eq (list T) (@nil T) (@cons T x (@nil T))) (@eq heap (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r) h')) h) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => and (@eq ptr r q) (@eq heap h empty)))))))) *) by move=>E; rewrite E eq_refl in H. Qed. Lemma lseg_empty xs p q : empty \In lseg p q xs -> p = q /\ xs = [::]. Proof. (* Goal: forall _ : @InMem heap empty (@Mem heap (SimplPredPredType heap) (lseg p q xs)), and (@eq ptr p q) (@eq (list T) xs (@nil T)) *) case:xs=>[|x xs] /=; [by case | case=>r [h][]]. (* Goal: forall (_ : @eq heap empty (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r) h))) (_ : @InMem heap h (@Mem heap (SimplPredPredType heap) (lseg r q xs))), and (@eq ptr p q) (@eq (list T) (@cons T x xs) (@nil T)) *) by move/esym; case/un0E; move/empbE; rewrite empPt. Qed. Lemma lseg_case xs p q h : h \In lseg p q xs -> [/\ p = q, xs = [::] & h = empty] \/ exists x, exists r, exists h', [/\ xs = x :: behead xs, h = p :-> x :+ (p .+ 1 :-> r :+ h') & Proof. (* Goal: forall _ : @InMem heap h (@Mem heap (SimplPredPredType heap) (lseg p q xs)), or (and3 (@eq ptr p q) (@eq (list T) xs (@nil T)) (@eq heap h empty)) (@ex T (fun x : T => @ex ptr (fun r : ptr => @ex heap (fun h' : heap => and3 (@eq (list T) xs (@cons T x (@behead T xs))) (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r) h'))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (lseg r q (@behead T xs)))))))) *) case:xs=>[|x xs] /=; first by case=>->->; left. (* Goal: forall _ : @InMem heap h (@Mem heap (SimplPredPredType heap) (@SimplPred heap (fun h : heap => @ex ptr (fun r : ptr => @ex heap (fun h' : heap => and (@eq heap h (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r) h'))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (lseg r q xs)))))))), or (and3 (@eq ptr p q) (@eq (list T) (@cons T x xs) (@nil T)) (@eq heap h empty)) (@ex T (fun x0 : T => @ex ptr (fun r : ptr => @ex heap (fun h' : heap => and3 (@eq (list T) (@cons T x xs) (@cons T x0 xs)) (@eq heap h (union2 (@pts T p x0) (union2 (@pts ptr (ptr_offset p (S O)) r) h'))) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (lseg r q xs))))))) *) by case=>r [h'][->] H; right; hhauto. Qed. Definition lseq p := lseg p null. Lemma lseq_null xs h : def h -> h \In lseq null xs -> xs = [::] /\ h = empty. Proof. (* Goal: forall (_ : is_true (def h)) (_ : @InMem heap h (@Mem heap (SimplPredPredType heap) (lseq null xs))), and (@eq (list T) xs (@nil T)) (@eq heap h empty) *) by move=>D; case/(lseg_null D)=>_ ->. Qed. Lemma lseq_pos xs p h : p != null -> h \In lseq p xs -> exists x, exists r, exists h', [/\ xs = x :: behead xs, p :-> x :+ (p .+ 1 :-> r :+ h') = h & h' \In lseq r (behead xs)]. Proof. (* Goal: forall (_ : is_true (negb (@eq_op ptr_eqType p null))) (_ : @InMem heap h (@Mem heap (SimplPredPredType heap) (lseq p xs))), @ex T (fun x : T => @ex ptr (fun r : ptr => @ex heap (fun h' : heap => and3 (@eq (list T) xs (@cons T x (@behead T xs))) (@eq heap (union2 (@pts T p x) (union2 (@pts ptr (ptr_offset p (S O)) r) h')) h) (@InMem heap h' (@Mem heap (SimplPredPredType heap) (lseq r (@behead T xs))))))) *) by apply: lseg_neq. Qed. Program Definition insert p x : STsep (fun i => exists xs, i \In lseq p xs, fun y i m => forall xs, i \In lseq p xs -> exists q, m \In lseq q (x::xs) /\ y = Val q) := Do (q <-- allocb p 2; q ::= x;; ret q). Program Definition remove p : STsep (fun i => exists xs, i \In lseq p xs, fun y i m => forall xs, i \In lseq p xs -> exists q, m \In lseq q (behead xs) /\ y = Val q) := Do (If p == null then ret p else pnext <-- !(p .+ 1); Definition shape_rev p s := [Pred h | h \In lseq p.1 s.1 # lseq p.2 s.2]. Definition revT : Type := forall p, STsep (fun i => exists ps, i \In shape_rev p ps, fun y i m => forall ps, i \In shape_rev p ps -> exists r, m \In lseq r (rev ps.1 ++ ps.2) /\ y = Val r). Program Definition reverse p : STsep (fun i => exists xs, i \In lseq p xs, fun y i m => forall xs, i \In lseq p xs -> exists q, m \In lseq q (rev xs) /\ y = Val q) := Do (Fix (fun (reverse : revT) p => (Do (If p.1 == null then ret p.2 End LList.
Require Export GeoCoq.Elements.OriginalProofs.lemma_betweennotequal. Section Euclid. Context `{Ax1:euclidean_neutral}. Lemma lemma_raystrict : forall A B C, Out A B C -> neq A C. Proof. (* Goal: forall (A B C : @Point Ax1) (_ : @Out Ax1 A B C), @neq Ax1 A C *) intros. (* Goal: @neq Ax1 A 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: @neq Ax1 A C *) assert (neq A C) by (forward_using lemma_betweennotequal). (* Goal: @neq Ax1 A C *) close. Qed. End Euclid.
Require Export GeoCoq.Tarski_dev.Ch13_6_Desargues_Hessenberg. Section T14_sum. Context `{T2D:Tarski_2D}. Context `{TE:@Tarski_euclidean Tn TnEQD}. Lemma Pj_exists : forall A B C, exists D, Pj A B C D. Proof. (* Goal: forall A B C : @Tpoint Tn, @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Pj Tn A B C D) *) intros. (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Pj Tn A B C D) *) unfold Pj in *. (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => or (@Par Tn A B C D) (@eq (@Tpoint Tn) C D)) *) elim (eq_dec_points A B);intro. (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => or (@Par Tn A B C D) (@eq (@Tpoint Tn) C D)) *) (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => or (@Par Tn A B C D) (@eq (@Tpoint Tn) C D)) *) subst. (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => or (@Par Tn A B C D) (@eq (@Tpoint Tn) C D)) *) (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => or (@Par Tn B B C D) (@eq (@Tpoint Tn) C D)) *) exists C. (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => or (@Par Tn A B C D) (@eq (@Tpoint Tn) C D)) *) (* Goal: or (@Par Tn B B C C) (@eq (@Tpoint Tn) C C) *) tauto. (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => or (@Par Tn A B C D) (@eq (@Tpoint Tn) C D)) *) assert (T:=parallel_existence A B C H). (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => or (@Par Tn A B C D) (@eq (@Tpoint Tn) C D)) *) decompose [and ex] T;clear T. (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => or (@Par Tn A B C D) (@eq (@Tpoint Tn) C D)) *) exists x0. (* Goal: or (@Par Tn A B C x0) (@eq (@Tpoint Tn) C x0) *) induction (eq_dec_points C x0). (* Goal: or (@Par Tn A B C x0) (@eq (@Tpoint Tn) C x0) *) (* Goal: or (@Par Tn A B C x0) (@eq (@Tpoint Tn) C x0) *) tauto. (* Goal: or (@Par Tn A B C x0) (@eq (@Tpoint Tn) C x0) *) eauto using par_col2_par with col. Qed. Lemma sum_to_sump : forall O E E' A B C, Sum O E E' A B C -> Sump O E E' A B C. Proof. (* Goal: forall (O E E' A B C : @Tpoint Tn) (_ : @Sum Tn O E E' A B C), @Sump Tn O E E' A B C *) intros. (* Goal: @Sump Tn O E E' A B C *) unfold Sum in H. (* Goal: @Sump Tn O E E' A B C *) unfold Ar2 in H. (* Goal: @Sump Tn O E E' A B C *) spliter. (* Goal: @Sump Tn O E E' A B C *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn A A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn B C' A' P' O E') (@Proj Tn C' C O E E E')))))) *) ex_and H0 A'. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn A A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn B C' A' P' O E') (@Proj Tn C' C O E E E')))))) *) ex_and H4 C'. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn A A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn B C' A' P' O E') (@Proj Tn C' C O E E E')))))) *) exists A'. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn A A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn B C' A' P' O E') (@Proj Tn C' C O E E E'))))) *) exists C'. (* Goal: @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn A A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn B C' A' P' O E') (@Proj Tn C' C O E E E')))) *) assert(O <> E /\ O <> E'). (* Goal: @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn A A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn B C' A' P' O E') (@Proj Tn C' C O E E E')))) *) (* Goal: and (not (@eq (@Tpoint Tn) O E)) (not (@eq (@Tpoint Tn) O E')) *) repeat split; intro; subst O; apply H; Col. (* Goal: @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn A A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn B C' A' P' O E') (@Proj Tn C' C O E E E')))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn A A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn B C' A' P' O E') (@Proj Tn C' C O E E E')))) *) assert(HH:=parallel_existence1 O E A' H8). (* Goal: @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn A A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn B C' A' P' O E') (@Proj Tn C' C O E E E')))) *) ex_and HH P'. (* Goal: @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn A A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn B C' A' P' O E') (@Proj Tn C' C O E E E')))) *) exists P'. (* Goal: and (@Proj Tn A A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn B C' A' P' O E') (@Proj Tn C' C O E E E'))) *) assert( E <> E'). (* Goal: and (@Proj Tn A A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn B C' A' P' O E') (@Proj Tn C' C O E E E'))) *) (* Goal: not (@eq (@Tpoint Tn) E E') *) intro. (* Goal: and (@Proj Tn A A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn B C' A' P' O E') (@Proj Tn C' C O E E E'))) *) (* Goal: False *) subst E'. (* Goal: and (@Proj Tn A A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn B C' A' P' O E') (@Proj Tn C' C O E E E'))) *) (* Goal: False *) apply H. (* Goal: and (@Proj Tn A A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn B C' A' P' O E') (@Proj Tn C' C O E E E'))) *) (* Goal: @Col Tn O E E *) Col. (* Goal: and (@Proj Tn A A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn B C' A' P' O E') (@Proj Tn C' C O E E E'))) *) repeat split; Col. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: not (@Par Tn O E' E E') *) intro. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: False *) induction H12. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: False *) (* Goal: False *) apply H12. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E') (@Col Tn X E E')) *) exists E'. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: False *) (* Goal: and (@Col Tn E' O E') (@Col Tn E' E E') *) split; Col. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: False *) spliter. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: False *) contradiction. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) unfold Pj in H0. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) induction H0. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) left. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: @Par Tn A A' E E' *) apply par_symmetry. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: @Par Tn E E' A A' *) assumption. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) right. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) (* Goal: @eq (@Tpoint Tn) A A' *) auto. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) apply par_distincts in H10. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) spliter. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) auto. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: not (@Par Tn A' P' O E') *) intro. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: False *) assert(Par O E O E'). (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: False *) (* Goal: @Par Tn O E O E' *) apply (par_trans _ _ A' P'); auto. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: False *) induction H13. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: False *) (* Goal: False *) apply H13. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O E')) *) exists O. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: False *) (* Goal: and (@Col Tn O O E) (@Col Tn O O E') *) split; Col. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: False *) spliter. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: False *) apply H. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn O E E' *) Col. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) unfold Pj in H5. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) induction H5. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn A' P' C' *) assert(Par A' C' A' P'). (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn A' C' A' P' *) apply (par_trans _ _ O E). (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) (* Goal: @Par Tn A' C' O E *) apply par_symmetry. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) (* Goal: @Par Tn O E A' C' *) auto. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) auto. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn A' P' C' *) induction H12. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn A' P' C' *) apply False_ind. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: False *) apply H12. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A' C') (@Col Tn X A' P')) *) exists A'. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: and (@Col Tn A' A' C') (@Col Tn A' A' P') *) split; Col. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn A' P' C' *) spliter. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn A' P' C' *) Col. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' C' *) subst C'. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P' A' *) Col. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) unfold Pj in H6. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) induction H6. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) left. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Par Tn B C' O E' *) apply par_symmetry. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) (* Goal: @Par Tn O E' B C' *) auto. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: or (@Par Tn B C' O E') (@eq (@Tpoint Tn) B C') *) right. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) (* Goal: @eq (@Tpoint Tn) B C' *) auto. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@Par Tn O E E E') *) intro. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: False *) induction H12. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: False *) (* Goal: False *) apply H12. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X E E')) *) exists E. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: False *) (* Goal: and (@Col Tn E O E) (@Col Tn E E E') *) split; Col. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: False *) spliter. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: False *) contradiction. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) unfold Pj in H7. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) induction H7. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) left. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: @Par Tn C' C E E' *) apply par_symmetry. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: @Par Tn E E' C' C *) apply par_left_comm. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) (* Goal: @Par Tn E' E C' C *) auto. (* Goal: or (@Par Tn C' C E E') (@eq (@Tpoint Tn) C' C) *) tauto. Qed. Lemma sump_to_sum : forall O E E' A B C, Sump O E E' A B C -> Sum O E E' A B C. Proof. (* Goal: forall (O E E' A B C : @Tpoint Tn) (_ : @Sump Tn O E E' A B C), @Sum Tn O E E' A B C *) intros. (* Goal: @Sum Tn O E E' A B C *) unfold Sump in H. (* Goal: @Sum Tn O E E' A B C *) spliter. (* Goal: @Sum Tn O E E' A B C *) ex_and H1 A'. (* Goal: @Sum Tn O E E' A B C *) ex_and H2 C'. (* Goal: @Sum Tn O E E' A B C *) ex_and H1 P'. (* Goal: @Sum Tn O E E' A B C *) unfold Sum. (* Goal: and (@Ar2 Tn O E E' A B C) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C))))))) *) split. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: @Ar2 Tn O E E' A B C *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: @Col Tn O E C *) (* Goal: not (@Col Tn O E E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: @Col Tn O E C *) (* Goal: False *) unfold Proj in H1. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: @Col Tn O E C *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: @Col Tn O E C *) (* Goal: False *) apply H7. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: @Col Tn O E C *) (* Goal: @Par Tn O E' E E' *) right. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: @Col Tn O E 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 A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: @Col Tn O E C *) unfold Proj in H4. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: @Col Tn O E C *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: @Col Tn O E C *) Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) exists A'. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C))))) *) exists C'. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) unfold Pj. (* Goal: and (or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A')) (and (@Col Tn O E' A') (and (or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C')) (and (or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C')) (or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C))))) *) repeat split. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O E' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) unfold Proj in H1. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O E' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) spliter. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O E' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) induction H8. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O E' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) left. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O E' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) (* Goal: @Par Tn E E' A A' *) apply par_symmetry. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O E' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) (* Goal: @Par Tn A A' E E' *) auto. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O E' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) tauto. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O E' A' *) unfold Proj in H1. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O E' A' *) tauto. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) induction(eq_dec_points A' C'). (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) tauto. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) left. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Par Tn O E A' C' *) unfold Proj in H3. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Par Tn O E A' C' *) spliter. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Par Tn O E A' C' *) apply (par_col_par _ _ _ P'); Col. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) unfold Proj in H3. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) spliter. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) induction H8. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) left. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Par Tn O E' B C' *) apply par_symmetry. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Par Tn B C' O E' *) auto. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) tauto. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) unfold Proj in H4. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) spliter. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) induction H8. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) left. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: @Par Tn E' E C' C *) apply par_symmetry. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: @Par Tn C' C E' E *) apply par_right_comm. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: @Par Tn C' C E E' *) auto. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) tauto. Qed. Lemma project_col_project : forall A B C P P' X Y, A <> C -> Col A B C -> Proj P P' A B X Y -> Proj P P' A C X Y. Lemma project_trivial : forall P A B X Y, A <> B -> X <> Y -> Col A B P -> ~ Par A B X Y -> Proj P P A B X Y. Proof. (* Goal: forall (P A B X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) X Y)) (_ : @Col Tn A B P) (_ : not (@Par Tn A B X Y)), @Proj Tn P P A B X Y *) intros. (* Goal: @Proj Tn P P A B X Y *) unfold Proj. (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) X Y)) (and (not (@Par Tn A B X Y)) (and (@Col Tn A B P) (or (@Par Tn P P X Y) (@eq (@Tpoint Tn) P P))))) *) repeat split; Col. Qed. Lemma pj_col_project : forall P P' A B X Y, A <> B -> X <> Y -> Col P' A B -> ~ Par A B X Y -> Pj X Y P P' -> Proj P P' A B X Y. Proof. (* Goal: forall (P P' A B X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) X Y)) (_ : @Col Tn P' A B) (_ : not (@Par Tn A B X Y)) (_ : @Pj Tn X Y P P'), @Proj Tn P P' A B X Y *) intros. (* Goal: @Proj Tn P P' A B X Y *) unfold Pj in H3. (* Goal: @Proj Tn P P' A B X Y *) induction H3. (* Goal: @Proj Tn P P' A B X Y *) (* Goal: @Proj Tn P P' A B X Y *) unfold Proj. (* Goal: @Proj Tn P P' A B X Y *) (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) X Y)) (and (not (@Par Tn A B X Y)) (and (@Col Tn A B P') (or (@Par Tn P P' X Y) (@eq (@Tpoint Tn) P P'))))) *) repeat split; Col. (* Goal: @Proj Tn P P' A B X Y *) (* Goal: or (@Par Tn P P' X Y) (@eq (@Tpoint Tn) P P') *) left. (* Goal: @Proj Tn P P' A B X Y *) (* Goal: @Par Tn P P' X Y *) apply par_symmetry. (* Goal: @Proj Tn P P' A B X Y *) (* Goal: @Par Tn X Y P P' *) assumption. (* Goal: @Proj Tn P P' A B X Y *) subst P'. (* Goal: @Proj Tn P P A B X Y *) apply project_trivial; Col. Qed. Section Grid. Variable O E E' : Tpoint. Variable grid_ok : ~ Col O E E'. Lemma sum_exists : forall A B, Col O E A -> Col O E B -> exists C, Sum 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 => @Sum Tn O E E' A B C) *) intros. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) assert(NC:= grid_ok). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) assert(O <> E). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: not (@eq (@Tpoint Tn) O E) *) intro. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) subst E. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) apply NC. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @Col Tn O O E' *) Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) assert(O <> E'). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: not (@eq (@Tpoint Tn) O E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) subst E'. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) apply NC. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @Col Tn O E O *) Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) induction(eq_dec_points O A). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) subst A. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' O B C) *) exists B. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @Sum Tn O E E' O B B *) unfold Sum. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: and (@Ar2 Tn O E E' O B B) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B))))))) *) split. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) (* Goal: @Ar2 Tn O E E' O B B *) unfold Ar2. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) (* Goal: and (not (@Col Tn O E E')) (and (@Col Tn O E O) (and (@Col Tn O E B) (@Col Tn O E B))) *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O O) (and (@Col Tn O E' O) (and (@Pj Tn O E O C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B))))) *) exists B. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: and (@Pj Tn E E' O O) (and (@Col Tn O E' O) (and (@Pj Tn O E O B) (and (@Pj Tn O E' B B) (@Pj Tn E' E B B)))) *) unfold Pj. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: and (or (@Par Tn E E' O O) (@eq (@Tpoint Tn) O O)) (and (@Col Tn O E' O) (and (or (@Par Tn O E O B) (@eq (@Tpoint Tn) O B)) (and (or (@Par Tn O E' B B) (@eq (@Tpoint Tn) B B)) (or (@Par Tn E' E B B) (@eq (@Tpoint Tn) B B))))) *) repeat split. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E B B) (@eq (@Tpoint Tn) B B) *) (* Goal: or (@Par Tn O E' B B) (@eq (@Tpoint Tn) B B) *) (* Goal: or (@Par Tn O E O B) (@eq (@Tpoint Tn) O B) *) (* Goal: @Col Tn O E' O *) (* Goal: or (@Par Tn E E' O O) (@eq (@Tpoint Tn) O O) *) right. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E B B) (@eq (@Tpoint Tn) B B) *) (* Goal: or (@Par Tn O E' B B) (@eq (@Tpoint Tn) B B) *) (* Goal: or (@Par Tn O E O B) (@eq (@Tpoint Tn) O B) *) (* Goal: @Col Tn O E' O *) (* Goal: @eq (@Tpoint Tn) O O *) auto. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E B B) (@eq (@Tpoint Tn) B B) *) (* Goal: or (@Par Tn O E' B B) (@eq (@Tpoint Tn) B B) *) (* Goal: or (@Par Tn O E O B) (@eq (@Tpoint Tn) O B) *) (* Goal: @Col Tn O E' O *) Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E B B) (@eq (@Tpoint Tn) B B) *) (* Goal: or (@Par Tn O E' B B) (@eq (@Tpoint Tn) B B) *) (* Goal: or (@Par Tn O E O B) (@eq (@Tpoint Tn) O B) *) induction(eq_dec_points O B). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E B B) (@eq (@Tpoint Tn) B B) *) (* Goal: or (@Par Tn O E' B B) (@eq (@Tpoint Tn) B B) *) (* Goal: or (@Par Tn O E O B) (@eq (@Tpoint Tn) O B) *) (* Goal: or (@Par Tn O E O B) (@eq (@Tpoint Tn) O B) *) right; auto. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E B B) (@eq (@Tpoint Tn) B B) *) (* Goal: or (@Par Tn O E' B B) (@eq (@Tpoint Tn) B B) *) (* Goal: or (@Par Tn O E O B) (@eq (@Tpoint Tn) O B) *) left. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E B B) (@eq (@Tpoint Tn) B B) *) (* Goal: or (@Par Tn O E' B B) (@eq (@Tpoint Tn) B B) *) (* Goal: @Par Tn O E O B *) right. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E B B) (@eq (@Tpoint Tn) B B) *) (* Goal: or (@Par Tn O E' B B) (@eq (@Tpoint Tn) B B) *) (* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (not (@eq (@Tpoint Tn) O B)) (and (@Col Tn O O B) (@Col Tn E O B))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E B B) (@eq (@Tpoint Tn) B B) *) (* Goal: or (@Par Tn O E' B B) (@eq (@Tpoint Tn) B B) *) right; auto. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E B B) (@eq (@Tpoint Tn) B B) *) right; auto. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) assert(exists! A' , Proj A A' O E' E E'). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun A' : @Tpoint Tn => @Proj Tn A A' O E' E E')) *) apply(project_existence A O E' E E'); intro; try (subst E' ; apply NC; Col). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) induction H4. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) (* Goal: False *) apply H4. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum 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 => @Sum 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 => @Sum Tn O E E' A B C) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) apply NC. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @Col Tn O E E' *) Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) ex_and H4 A'. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) assert(HH:=parallel_existence1 O E A' H1). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) ex_and HH P. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) unfold unique in H5. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) assert(A <> A'). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: not (@eq (@Tpoint Tn) A A') *) intro. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) subst A'. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) apply project_col in H5. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) apply NC. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @Col Tn O E E' *) apply (col_transitivity_1 _ A); Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) induction(eq_dec_points B O). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) subst B. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A O C) *) exists A. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @Sum Tn O E E' A O A *) unfold Sum. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: and (@Ar2 Tn O E E' A O A) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A))))))) *) split. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) (* Goal: @Ar2 Tn O E E' A O A *) unfold Ar2. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) (* Goal: and (not (@Col Tn O E E')) (and (@Col Tn O E A) (and (@Col Tn O E O) (@Col Tn O E A))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) exists A'. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A))))) *) exists A'. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' A') (and (@Pj Tn O E' O A') (@Pj Tn E' E A' A)))) *) unfold Pj. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: and (or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A')) (and (@Col Tn O E' A') (and (or (@Par Tn O E A' A') (@eq (@Tpoint Tn) A' A')) (and (or (@Par Tn O E' O A') (@eq (@Tpoint Tn) O A')) (or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A))))) *) unfold Proj in H5. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: and (or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A')) (and (@Col Tn O E' A') (and (or (@Par Tn O E A' A') (@eq (@Tpoint Tn) A' A')) (and (or (@Par Tn O E' O A') (@eq (@Tpoint Tn) O A')) (or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: and (or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A')) (and (@Col Tn O E' A') (and (or (@Par Tn O E A' A') (@eq (@Tpoint Tn) A' A')) (and (or (@Par Tn O E' O A') (@eq (@Tpoint Tn) O A')) (or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A))))) *) repeat split. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: or (@Par Tn O E' O A') (@eq (@Tpoint Tn) O A') *) (* Goal: or (@Par Tn O E A' A') (@eq (@Tpoint Tn) A' A') *) (* Goal: @Col Tn O E' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: or (@Par Tn O E' O A') (@eq (@Tpoint Tn) O A') *) (* Goal: or (@Par Tn O E A' A') (@eq (@Tpoint Tn) A' A') *) (* Goal: @Col Tn O E' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) induction H11. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: or (@Par Tn O E' O A') (@eq (@Tpoint Tn) O A') *) (* Goal: or (@Par Tn O E A' A') (@eq (@Tpoint Tn) A' A') *) (* Goal: @Col Tn O E' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) left. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: or (@Par Tn O E' O A') (@eq (@Tpoint Tn) O A') *) (* Goal: or (@Par Tn O E A' A') (@eq (@Tpoint Tn) A' A') *) (* Goal: @Col Tn O E' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) (* Goal: @Par Tn E E' A A' *) apply par_symmetry. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: or (@Par Tn O E' O A') (@eq (@Tpoint Tn) O A') *) (* Goal: or (@Par Tn O E A' A') (@eq (@Tpoint Tn) A' A') *) (* Goal: @Col Tn O E' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) (* Goal: @Par Tn A A' E E' *) auto. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: or (@Par Tn O E' O A') (@eq (@Tpoint Tn) O A') *) (* Goal: or (@Par Tn O E A' A') (@eq (@Tpoint Tn) A' A') *) (* Goal: @Col Tn O E' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: or (@Par Tn O E' O A') (@eq (@Tpoint Tn) O A') *) (* Goal: or (@Par Tn O E A' A') (@eq (@Tpoint Tn) A' A') *) (* Goal: @Col Tn O E' A' *) Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: or (@Par Tn O E' O A') (@eq (@Tpoint Tn) O A') *) (* Goal: or (@Par Tn O E A' A') (@eq (@Tpoint Tn) A' A') *) right. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: or (@Par Tn O E' O A') (@eq (@Tpoint Tn) O A') *) (* Goal: @eq (@Tpoint Tn) A' A' *) auto. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: or (@Par Tn O E' O A') (@eq (@Tpoint Tn) O A') *) left. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: @Par Tn O E' O A' *) right. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: and (not (@eq (@Tpoint Tn) O E')) (and (not (@eq (@Tpoint Tn) O A')) (and (@Col Tn O O A') (@Col Tn E' O A'))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: not (@eq (@Tpoint Tn) O A') *) intro. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: False *) subst A'. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: False *) induction H11. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: False *) (* Goal: False *) induction H11. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H11. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* 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 C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn E A O) (@Col Tn E E E') *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: False *) (* Goal: False *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: False *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) induction H11. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) left. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: @Par Tn E' E A' A *) apply par_symmetry. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: @Par Tn A' A E' E *) apply par_comm. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: @Par Tn A A' E E' *) auto. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) assert(exists! C', Proj B C' A' P O E'). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun C' : @Tpoint Tn => @Proj Tn B C' A' P O E')) *) apply(project_existence B A' P O E'); auto. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: not (@Par Tn O E' A' P) *) (* Goal: not (@eq (@Tpoint Tn) A' P) *) apply par_distincts in H4. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: not (@Par Tn O E' A' P) *) (* Goal: not (@eq (@Tpoint Tn) A' P) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: not (@Par Tn O E' A' P) *) (* Goal: not (@eq (@Tpoint Tn) A' P) *) auto. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: not (@Par Tn O E' A' P) *) intro. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) assert(Par O E O E'). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) (* Goal: @Par Tn O E O E' *) apply (par_trans _ _ A' P). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) (* Goal: @Par Tn A' P O E' *) (* Goal: @Par Tn O E A' P *) auto. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) (* Goal: @Par Tn A' P O E' *) apply par_symmetry. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) (* Goal: @Par Tn O E' A' P *) auto. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) induction H10. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) (* Goal: False *) apply H10. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum 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 O E')) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) (* Goal: and (@Col Tn O O E) (@Col Tn O O E') *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) apply NC. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @Col Tn O E E' *) Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) ex_and H9 C'. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) unfold unique in H10. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) assert(exists! C : Tpoint, Proj C' C O E A A'). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun C : @Tpoint Tn => @Proj Tn C' C O E A A')) *) apply(project_existence C' O E A A'); auto. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: not (@Par Tn A A' O E) *) intro. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) induction H11. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) (* Goal: False *) apply H11. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A A') (@Col Tn X O E)) *) exists A. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) (* Goal: and (@Col Tn A A A') (@Col Tn A O E) *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) assert(HH:=project_par_dir A A' O E' E E' H11 H5). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) assert(Col E A A'). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) (* Goal: @Col Tn E A A' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) induction HH. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) (* Goal: False *) apply H16. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A A') (@Col Tn X E E')) *) exists E. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) (* Goal: and (@Col Tn E A A') (@Col Tn E E E') *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) apply NC. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @Col Tn O E E' *) apply col_permutation_2. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @Col Tn E E' O *) apply(col_transitivity_1 _ A'); Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: not (@eq (@Tpoint Tn) E A') *) intro. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) subst A'. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) clean_trivial_hyps. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) unfold Proj in H5. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: False *) apply NC. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) (* Goal: @Col Tn O E E' *) Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) ex_and H11 C. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) unfold unique in H12. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) unfold Proj in *. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E E' A B C) *) exists C. (* Goal: @Sum Tn O E E' A B C *) unfold Sum. (* Goal: and (@Ar2 Tn O E E' A B C) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C))))))) *) split. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: @Ar2 Tn O E E' A B C *) unfold Ar2. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' 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 A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) exists A'. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C))))) *) exists C'. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) unfold Pj. (* Goal: and (or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A')) (and (@Col Tn O E' A') (and (or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C')) (and (or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C')) (or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C))))) *) repeat split. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O E' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) left. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O E' A' *) (* Goal: @Par Tn E E' A A' *) induction H24. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O E' A' *) (* Goal: @Par Tn E E' A A' *) (* Goal: @Par Tn E E' A A' *) apply par_symmetry. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O E' A' *) (* Goal: @Par Tn E E' A A' *) (* Goal: @Par Tn A A' E E' *) auto. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O E' A' *) (* Goal: @Par Tn E E' A A' *) contradiction. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O E' A' *) Col. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E A' C') (@eq (@Tpoint Tn) A' C') *) left. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Par Tn O E A' C' *) eapply (par_col_par _ _ _ P). (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) intro. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) subst C'. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) induction H16. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: False *) induction H16. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H16. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A' C) (@Col Tn X A A')) *) exists A'. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn A' A' C) (@Col Tn A' A A') *) split; Col. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: False *) induction H20. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: False *) (* Goal: False *) induction H20. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H20. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B A') (@Col Tn X O E')) *) exists A'. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn A' B A') (@Col Tn A' O E') *) split; Col. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply NC. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: False *) (* Goal: @Col Tn O E E' *) apply (col_transitivity_1 _ B); Col. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: False *) subst A'. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: False *) apply H14. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: @Par Tn O E A B *) right. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) (* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (not (@eq (@Tpoint Tn) A B)) (and (@Col Tn O A B) (@Col Tn E A B))) *) repeat split; try finish; ColR. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) subst A'. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: False *) apply H14. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: @Par Tn O E A C *) right. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) (* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (not (@eq (@Tpoint Tn) A C)) (and (@Col Tn O A C) (@Col Tn E A C))) *) repeat split; try finish; ColR. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) (* Goal: @Par Tn O E A' P *) assumption. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Col Tn A' P C' *) ColR. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) induction H20. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) left. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Par Tn O E' B C' *) apply par_symmetry. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) (* Goal: @Par Tn B C' O E' *) auto. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn O E' B C') (@eq (@Tpoint Tn) B C') *) right; auto. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) induction H24. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) induction H16. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) left. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: @Par Tn E' E C' C *) apply (par_trans _ _ A A'). (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: @Par Tn A A' C' C *) (* Goal: @Par Tn E' E A A' *) apply par_symmetry. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: @Par Tn A A' C' C *) (* Goal: @Par Tn A A' E' E *) apply par_right_comm. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: @Par Tn A A' C' C *) (* Goal: @Par Tn A A' E E' *) auto. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: @Par Tn A A' C' C *) apply par_symmetry. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: @Par Tn C' C A A' *) auto. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) subst C'. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: or (@Par Tn E' E C C) (@eq (@Tpoint Tn) C C) *) right. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) (* Goal: @eq (@Tpoint Tn) C C *) auto. (* Goal: or (@Par Tn E' E C' C) (@eq (@Tpoint Tn) C' C) *) contradiction. Qed. Lemma sum_uniqueness : forall A B C1 C2, Sum O E E' A B C1 -> Sum O E E' A B C2 -> C1 = C2. Proof. (* Goal: forall (A B C1 C2 : @Tpoint Tn) (_ : @Sum Tn O E E' A B C1) (_ : @Sum Tn O E E' A B C2), @eq (@Tpoint Tn) C1 C2 *) intros. (* Goal: @eq (@Tpoint Tn) C1 C2 *) apply sum_to_sump in H. (* Goal: @eq (@Tpoint Tn) C1 C2 *) apply sum_to_sump in H0. (* Goal: @eq (@Tpoint Tn) C1 C2 *) unfold Sump in H. (* Goal: @eq (@Tpoint Tn) C1 C2 *) unfold Sump in H0. (* Goal: @eq (@Tpoint Tn) C1 C2 *) spliter. (* Goal: @eq (@Tpoint Tn) C1 C2 *) clean_duplicated_hyps. (* Goal: @eq (@Tpoint Tn) C1 C2 *) ex_and H4 A'. (* Goal: @eq (@Tpoint Tn) C1 C2 *) ex_and H0 C'. (* Goal: @eq (@Tpoint Tn) C1 C2 *) ex_and H1 P'. (* Goal: @eq (@Tpoint Tn) C1 C2 *) ex_and H2 A''. (* Goal: @eq (@Tpoint Tn) C1 C2 *) ex_and H6 C''. (* Goal: @eq (@Tpoint Tn) C1 C2 *) ex_and H2 P''. (* Goal: @eq (@Tpoint Tn) C1 C2 *) assert(A'=A''). (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: @eq (@Tpoint Tn) A' A'' *) apply(project_uniqueness A A' A'' O E' E E');auto. (* Goal: @eq (@Tpoint Tn) C1 C2 *) subst A''. (* Goal: @eq (@Tpoint Tn) C1 C2 *) assert(Col A' P' P''). (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: @Col Tn A' P' P'' *) assert(Par A' P' A' P''). (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: @Col Tn A' P' P'' *) (* Goal: @Par Tn A' P' A' P'' *) apply (par_trans _ _ O E). (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: @Col Tn A' P' P'' *) (* Goal: @Par Tn O E A' P'' *) (* Goal: @Par Tn A' P' O E *) apply par_symmetry. (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: @Col Tn A' P' P'' *) (* Goal: @Par Tn O E A' P'' *) (* Goal: @Par Tn O E A' P' *) auto. (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: @Col Tn A' P' P'' *) (* Goal: @Par Tn O E A' P'' *) auto. (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: @Col Tn A' P' P'' *) induction H9. (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: @Col Tn A' P' P'' *) (* Goal: @Col Tn A' P' P'' *) apply False_ind. (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: @Col Tn A' P' P'' *) (* Goal: False *) apply H9. (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: @Col Tn A' P' P'' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A' P') (@Col Tn X A' P'')) *) exists A'. (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: @Col Tn A' P' P'' *) (* Goal: and (@Col Tn A' A' P') (@Col Tn A' A' P'') *) split; Col. (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: @Col Tn A' P' P'' *) spliter. (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: @Col Tn A' P' P'' *) Col. (* Goal: @eq (@Tpoint Tn) C1 C2 *) assert(Proj B C'' A' P' O E'). (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: @Proj Tn B C'' A' P' O E' *) eapply (project_col_project _ P''); Col. (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) unfold Proj in H4. (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) tauto. (* Goal: @eq (@Tpoint Tn) C1 C2 *) assert(C' = C''). (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: @eq (@Tpoint Tn) C' C'' *) apply(project_uniqueness B C' C'' A' P' O E');auto. (* Goal: @eq (@Tpoint Tn) C1 C2 *) subst C''. (* Goal: @eq (@Tpoint Tn) C1 C2 *) apply(project_uniqueness C' C1 C2 O E E E');auto. Qed. Lemma opp_exists : forall A, Col O E A -> exists MA, Opp O E E' A MA. Proof. (* Goal: forall (A : @Tpoint Tn) (_ : @Col Tn O E A), @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' A MA) *) intros. (* Goal: @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' A MA) *) assert(NC:= grid_ok). (* Goal: @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' A MA) *) induction(eq_dec_points A O). (* Goal: @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' A MA) *) (* Goal: @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' A MA) *) subst A. (* Goal: @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' A MA) *) (* Goal: @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' O MA) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' A MA) *) (* Goal: @Opp Tn O E E' O O *) unfold Opp. (* Goal: @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' A MA) *) (* Goal: @Sum Tn O E E' O O O *) unfold Sum. (* Goal: @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' A MA) *) (* Goal: and (@Ar2 Tn O E E' O O O) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' O))))))) *) split. (* Goal: @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' A MA) *) (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' O)))))) *) (* Goal: @Ar2 Tn O E E' O O O *) unfold Ar2. (* Goal: @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' A MA) *) (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' O)))))) *) (* Goal: and (not (@Col Tn O E E')) (and (@Col Tn O E O) (and (@Col Tn O E O) (@Col Tn O E O))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' A MA) *) (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' O)))))) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' A MA) *) (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O O) (and (@Col Tn O E' O) (and (@Pj Tn O E O C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' O))))) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' A MA) *) (* Goal: and (@Pj Tn E E' O O) (and (@Col Tn O E' O) (and (@Pj Tn O E O O) (and (@Pj Tn O E' O O) (@Pj Tn E' E O O)))) *) repeat split; Col; try right; auto. (* Goal: @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' A MA) *) prolong A O MA A O. (* Goal: @ex (@Tpoint Tn) (fun MA : @Tpoint Tn => @Opp Tn O E E' A MA) *) exists MA. (* Goal: @Opp Tn O E E' A MA *) unfold Opp. (* Goal: @Sum Tn O E E' MA A O *) apply sump_to_sum. (* Goal: @Sump Tn O E E' MA A O *) unfold Sump. (* Goal: and (@Col Tn O E MA) (and (@Col Tn O E A) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))))) *) repeat split. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) (* Goal: @Col Tn O E A *) (* Goal: @Col Tn O E MA *) apply bet_col in H1. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) (* Goal: @Col Tn O E A *) (* Goal: @Col Tn O E MA *) apply (col_transitivity_1 _ A);Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) (* Goal: @Col Tn O E A *) Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) assert(E <> E' /\ O <> E'). (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) (* Goal: and (not (@eq (@Tpoint Tn) E E')) (not (@eq (@Tpoint Tn) O E')) *) split; intro; subst E'; apply NC; Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) assert(exists! P' : Tpoint, Proj MA P' O E' E E'). (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn MA P' O E' E E')) *) apply(project_existence MA O E' E E'); auto. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) (* Goal: not (@Par Tn E E' O E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) (* Goal: False *) induction H5. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) (* Goal: False *) (* Goal: False *) apply H5. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) (* 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 A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) (* Goal: False *) (* Goal: and (@Col Tn E' E E') (@Col Tn E' O E') *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) (* Goal: False *) apply NC. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) (* Goal: @Col Tn O E E' *) Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) ex_and H5 A'. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) unfold unique in H6. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) exists A'. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) assert(O <> E). (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: not (@eq (@Tpoint Tn) O E) *) intro. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: False *) subst E. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: False *) apply NC. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: @Col Tn O O E' *) Col. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) assert(HH:= parallel_existence1 O E A' H7). (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) ex_and HH P'. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) assert(exists! C' : Tpoint, Proj A C' A' P' O E'). (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun C' : @Tpoint Tn => @Proj Tn A C' A' P' O E')) *) apply(project_existence A A' P' O E'); auto. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: not (@Par Tn O E' A' P') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) apply par_distincts in H8. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: not (@Par Tn O E' A' P') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: not (@Par Tn O E' A' P') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) auto. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: not (@Par Tn O E' A' P') *) intro. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: False *) assert(Par O E O E'). (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: False *) (* Goal: @Par Tn O E O E' *) apply (par_trans _ _ A' P'). (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: False *) (* Goal: @Par Tn A' P' O E' *) (* Goal: @Par Tn O E A' P' *) auto. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: False *) (* Goal: @Par Tn A' P' O E' *) apply par_symmetry; auto. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: False *) induction H10. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: False *) (* Goal: False *) apply H10. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E 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: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: False *) (* Goal: and (@Col Tn O O E) (@Col Tn O O E') *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: False *) apply NC. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) (* Goal: @Col Tn O E E' *) Col. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) ex_and H9 C'. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) unfold unique in H10. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))))) *) exists C'. (* Goal: @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')))) *) exists P'. (* Goal: and (@Proj Tn MA A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E'))) *) split; auto. (* Goal: and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E')) *) split; auto. (* Goal: and (@Proj Tn A C' A' P' O E') (@Proj Tn C' O O E E E') *) split; auto. (* Goal: @Proj Tn C' O O E E E' *) unfold Proj in H5. (* Goal: @Proj Tn C' O O E E E' *) spliter. (* Goal: @Proj Tn C' O O E E E' *) unfold Proj. (* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (not (@eq (@Tpoint Tn) E E')) (and (not (@Par Tn O E E E')) (and (@Col Tn O E O) (or (@Par Tn C' O E E') (@eq (@Tpoint Tn) C' O))))) *) repeat split; Col. (* Goal: or (@Par Tn C' O E E') (@eq (@Tpoint Tn) C' O) *) (* Goal: not (@Par Tn O E E E') *) intro. (* Goal: or (@Par Tn C' O E E') (@eq (@Tpoint Tn) C' O) *) (* Goal: False *) induction H15. (* Goal: or (@Par Tn C' O E E') (@eq (@Tpoint Tn) C' O) *) (* Goal: False *) (* Goal: False *) apply H15. (* Goal: or (@Par Tn C' O E E') (@eq (@Tpoint Tn) C' O) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X E E')) *) exists E. (* Goal: or (@Par Tn C' O E E') (@eq (@Tpoint Tn) C' O) *) (* Goal: False *) (* Goal: and (@Col Tn E O E) (@Col Tn E E E') *) split; Col. (* Goal: or (@Par Tn C' O E E') (@eq (@Tpoint Tn) C' O) *) (* Goal: False *) apply NC. (* Goal: or (@Par Tn C' O E E') (@eq (@Tpoint Tn) C' O) *) (* Goal: @Col Tn O E E' *) tauto. (* Goal: or (@Par Tn C' O E E') (@eq (@Tpoint Tn) C' O) *) left. (* Goal: @Par Tn C' O E E' *) unfold Proj in H9. (* Goal: @Par Tn C' O E E' *) spliter. (* Goal: @Par Tn C' O E E' *) assert(Par O E' O A'). (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn O E' O A' *) right. (* Goal: @Par Tn C' O E E' *) (* Goal: and (not (@eq (@Tpoint Tn) O E')) (and (not (@eq (@Tpoint Tn) O A')) (and (@Col Tn O O A') (@Col Tn E' O A'))) *) repeat split; Col. (* Goal: @Par Tn C' O E E' *) (* Goal: not (@eq (@Tpoint Tn) O A') *) intro. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) subst A'. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) clean_trivial_hyps. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) induction H14. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) (* Goal: False *) induction H13. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H13. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X MA O) (@Col Tn X E E')) *) exists E. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn E MA O) (@Col Tn E E E') *) split; Col. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) (* Goal: False *) (* Goal: @Col Tn E MA O *) apply col_permutation_1. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) (* Goal: False *) (* Goal: @Col Tn O E MA *) apply bet_col in H1. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) (* Goal: False *) (* Goal: @Col Tn O E MA *) apply(col_transitivity_1 _ A); Col. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) (* Goal: False *) apply NC. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) (* Goal: @Col Tn O E E' *) tauto. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) subst MA. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) apply cong_symmetry in H2. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) apply cong_identity in H2. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) contradiction. (* Goal: @Par Tn C' O E E' *) assert(Plg A C' A' O). (* Goal: @Par Tn C' O E E' *) (* Goal: @Plg Tn A C' A' O *) apply pars_par_plg. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Par_strict Tn A C' A' O *) induction H18. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Par_strict Tn A C' A' O *) (* Goal: @Par_strict Tn A C' A' O *) assert(Par A C' A' O). (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Par_strict Tn A C' A' O *) (* Goal: @Par_strict Tn A C' A' O *) (* Goal: @Par Tn A C' A' O *) apply (par_trans _ _ O E'). (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Par_strict Tn A C' A' O *) (* Goal: @Par_strict Tn A C' A' O *) (* Goal: @Par Tn O E' A' O *) (* Goal: @Par Tn A C' O E' *) Par. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Par_strict Tn A C' A' O *) (* Goal: @Par_strict Tn A C' A' O *) (* Goal: @Par Tn O E' A' O *) Par. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Par_strict Tn A C' A' O *) (* Goal: @Par_strict Tn A C' A' O *) induction H20. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Par_strict Tn A C' A' O *) (* Goal: @Par_strict Tn A C' A' O *) (* Goal: @Par_strict Tn A C' A' O *) auto. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Par_strict Tn A C' A' O *) (* Goal: @Par_strict Tn A C' A' O *) spliter. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Par_strict Tn A C' A' O *) (* Goal: @Par_strict Tn A C' A' O *) apply False_ind. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Par_strict Tn A C' A' O *) (* Goal: False *) apply NC. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Par_strict Tn A C' A' O *) (* Goal: @Col Tn O E E' *) apply (col_transitivity_1 _ A'); Col. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Par_strict Tn A C' A' O *) (* Goal: @Col Tn O A' E *) apply (col_transitivity_1 _ A); Col. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Par_strict Tn A C' A' O *) subst C'. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Par_strict Tn A A A' O *) apply False_ind. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: False *) induction H8. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: False *) (* Goal: False *) apply H8. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' P')) *) exists A. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: False *) (* Goal: and (@Col Tn A O E) (@Col Tn A A' P') *) split; Col. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: False *) spliter. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: False *) apply NC. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Col Tn O E E' *) apply (col_transitivity_1 _ A'); Col. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Col Tn O A' E *) (* Goal: not (@eq (@Tpoint Tn) O A') *) intro. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Col Tn O A' E *) (* Goal: False *) subst A'. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Col Tn O A' E *) (* Goal: False *) apply par_distincts in H19. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Col Tn O A' E *) (* Goal: False *) tauto. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Col Tn O A' E *) apply col_permutation_2. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) (* Goal: @Col Tn A' E O *) apply (col_transitivity_1 _ P'); Col. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A O C' A' *) apply par_comm. (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn O A A' C' *) apply (par_col_par _ _ _ P'). (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) intro. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: False *) subst C'. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: False *) induction H18. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: False *) (* Goal: False *) induction H18. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H18. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A A') (@Col Tn X O E')) *) exists A'. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn A' A A') (@Col Tn A' O E') *) split; Col. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: False *) (* Goal: False *) apply NC. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: False *) (* Goal: @Col Tn O E E' *) apply (col_transitivity_1 _ A); Col. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: False *) subst A'. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: False *) induction H19. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: False *) (* Goal: False *) apply H18. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E') (@Col Tn X O A)) *) exists O. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: False *) (* Goal: and (@Col Tn O O E') (@Col Tn O O A) *) split; Col. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: False *) spliter. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: False *) apply NC. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) (* Goal: @Col Tn O E E' *) apply (col_transitivity_1 _ A); Col. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O A A' P' *) apply par_symmetry. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn A' P' O A *) apply (par_col_par _ _ _ E); Col. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn A' P' O E *) apply par_symmetry. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) Par. (* Goal: @Par Tn C' O E E' *) (* Goal: @Col Tn A' P' C' *) Col. (* Goal: @Par Tn C' O E E' *) assert(Parallelogram A O MA O). (* Goal: @Par Tn C' O E E' *) (* Goal: @Parallelogram Tn A O MA O *) right. (* Goal: @Par Tn C' O E E' *) (* Goal: @Parallelogram_flat Tn A O MA O *) unfold Parallelogram_flat. (* Goal: @Par Tn C' O E E' *) (* Goal: and (@Col Tn A O MA) (and (@Col Tn A O O) (and (@Cong Tn A O MA O) (and (@Cong Tn A O MA O) (or (not (@eq (@Tpoint Tn) A MA)) (not (@eq (@Tpoint Tn) O O)))))) *) repeat split; Col; Cong. (* Goal: @Par Tn C' O E E' *) (* Goal: or (not (@eq (@Tpoint Tn) A MA)) (not (@eq (@Tpoint Tn) O O)) *) left. (* Goal: @Par Tn C' O E E' *) (* Goal: not (@eq (@Tpoint Tn) A MA) *) intro. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) subst MA. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) apply between_identity in H1. (* Goal: @Par Tn C' O E E' *) (* Goal: False *) contradiction. (* Goal: @Par Tn C' O E E' *) apply plg_to_parallelogram in H20. (* Goal: @Par Tn C' O E E' *) apply plg_permut in H20. (* Goal: @Par Tn C' O E E' *) apply plg_comm2 in H21. (* Goal: @Par Tn C' O E E' *) assert(Parallelogram C' A' MA O). (* Goal: @Par Tn C' O E E' *) (* Goal: @Parallelogram Tn C' A' MA O *) assert(HH:= plg_pseudo_trans C' A' O A O MA H20 H21). (* Goal: @Par Tn C' O E E' *) (* Goal: @Parallelogram Tn C' A' MA O *) induction HH. (* Goal: @Par Tn C' O E E' *) (* Goal: @Parallelogram Tn C' A' MA O *) (* Goal: @Parallelogram Tn C' A' MA O *) auto. (* Goal: @Par Tn C' O E E' *) (* Goal: @Parallelogram Tn C' A' MA O *) spliter. (* Goal: @Par Tn C' O E E' *) (* Goal: @Parallelogram Tn C' A' MA O *) subst MA. (* Goal: @Par Tn C' O E E' *) (* Goal: @Parallelogram Tn C' A' O O *) apply cong_symmetry in H2. (* Goal: @Par Tn C' O E E' *) (* Goal: @Parallelogram Tn C' A' O O *) apply cong_identity in H2. (* Goal: @Par Tn C' O E E' *) (* Goal: @Parallelogram Tn C' A' O O *) contradiction. (* Goal: @Par Tn C' O E E' *) apply plg_par in H22. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: @Par Tn C' O E E' *) spliter. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: @Par Tn C' O E E' *) induction H14. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn C' O E E' *) apply (par_trans _ _ A' MA). (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A' MA E E' *) (* Goal: @Par Tn C' O A' MA *) auto. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn A' MA E E' *) Par. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: @Par Tn C' O E E' *) subst MA. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: @Par Tn C' O E E' *) apply par_distincts in H23. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: @Par Tn C' O E E' *) tauto. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) intro. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: False *) subst C'. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: False *) unfold Parallelogram in H20. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: False *) induction H20. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: False *) (* Goal: False *) unfold Parallelogram_strict in H20. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: False *) (* Goal: False *) apply par_distincts in H23. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: False *) (* Goal: False *) tauto. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: False *) unfold Parallelogram_flat in H20. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: False *) spliter. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: False *) apply cong_symmetry in H24. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: False *) apply cong_identity in H24. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: False *) subst A. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) (* Goal: False *) tauto. (* Goal: not (@eq (@Tpoint Tn) A' MA) *) intro. (* Goal: False *) subst MA. (* Goal: False *) unfold Parallelogram in H21. (* Goal: False *) induction H21. (* Goal: False *) (* Goal: False *) unfold Parallelogram_strict in H21. (* Goal: False *) (* Goal: False *) spliter. (* Goal: False *) (* Goal: False *) unfold TS in H21; unfold Parallelogram. (* Goal: False *) (* Goal: False *) spliter; Col. (* Goal: False *) unfold Parallelogram_flat in H21. (* Goal: False *) spliter. (* Goal: False *) apply NC. (* Goal: @Col Tn O E E' *) apply (col_transitivity_1 _ A); Col. (* Goal: @Col Tn O A E' *) apply (col_transitivity_1 _ A'); Col. (* Goal: not (@eq (@Tpoint Tn) O A') *) intro. (* Goal: False *) subst A'. (* Goal: False *) apply cong_identity in H24. (* Goal: False *) subst A. (* Goal: False *) tauto. Qed. Lemma opp0 : Opp O E E' O O. Proof. (* Goal: @Opp Tn O E E' O O *) assert(NC:=grid_ok). (* Goal: @Opp Tn O E E' O O *) assert(O <> E' /\ E <> E'). (* Goal: @Opp Tn O E E' O O *) (* Goal: and (not (@eq (@Tpoint Tn) O E')) (not (@eq (@Tpoint Tn) E E')) *) split; intro ; subst E'; apply NC; Col. (* Goal: @Opp Tn O E E' O O *) spliter. (* Goal: @Opp Tn O E E' O O *) assert(O <> E). (* Goal: @Opp Tn O E E' O O *) (* Goal: not (@eq (@Tpoint Tn) O E) *) intro. (* Goal: @Opp Tn O E E' O O *) (* Goal: False *) subst E. (* Goal: @Opp Tn O E E' O O *) (* Goal: False *) apply NC; Col. (* Goal: @Opp Tn O E E' O O *) unfold Opp. (* Goal: @Sum Tn O E E' O O O *) apply sump_to_sum. (* Goal: @Sump Tn O E E' O O O *) unfold Sump. (* Goal: and (@Col Tn O E O) (and (@Col Tn O E O) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn O A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn O C' A' P' O E') (@Proj Tn C' O O E E E')))))))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn O A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn O C' A' P' O E') (@Proj Tn C' O O E E E')))))) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn O O O E' E E') (and (@Par Tn O E O P') (and (@Proj Tn O C' O P' O E') (@Proj Tn C' O O E E E'))))) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn O O O E' E E') (and (@Par Tn O E O P') (and (@Proj Tn O O O P' O E') (@Proj Tn O O O E E E')))) *) exists E. (* Goal: and (@Proj Tn O O O E' E E') (and (@Par Tn O E O E) (and (@Proj Tn O O O E O E') (@Proj Tn O O O E E E'))) *) split. (* Goal: and (@Par Tn O E O E) (and (@Proj Tn O O O E O E') (@Proj Tn O O O E E E')) *) (* Goal: @Proj Tn O O O E' E E' *) apply project_trivial; Col. (* Goal: and (@Par Tn O E O E) (and (@Proj Tn O O O E O E') (@Proj Tn O O O E E E')) *) (* Goal: not (@Par Tn O E' E E') *) intro. (* Goal: and (@Par Tn O E O E) (and (@Proj Tn O O O E O E') (@Proj Tn O O O E E E')) *) (* Goal: False *) induction H2. (* Goal: and (@Par Tn O E O E) (and (@Proj Tn O O O E O E') (@Proj Tn O O O E E E')) *) (* Goal: False *) (* Goal: False *) apply H2. (* Goal: and (@Par Tn O E O E) (and (@Proj Tn O O O E O E') (@Proj Tn O O O E E 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: and (@Par Tn O E O E) (and (@Proj Tn O O O E O E') (@Proj Tn O O O E E E')) *) (* Goal: False *) (* Goal: and (@Col Tn E' O E') (@Col Tn E' E E') *) split; Col. (* Goal: and (@Par Tn O E O E) (and (@Proj Tn O O O E O E') (@Proj Tn O O O E E E')) *) (* Goal: False *) spliter. (* Goal: and (@Par Tn O E O E) (and (@Proj Tn O O O E O E') (@Proj Tn O O O E E E')) *) (* Goal: False *) contradiction. (* Goal: and (@Par Tn O E O E) (and (@Proj Tn O O O E O E') (@Proj Tn O O O E E E')) *) split. (* Goal: and (@Proj Tn O O O E O E') (@Proj Tn O O O E E E') *) (* Goal: @Par Tn O E O E *) apply par_reflexivity; auto. (* Goal: and (@Proj Tn O O O E O E') (@Proj Tn O O O E E E') *) split. (* Goal: @Proj Tn O O O E E E' *) (* Goal: @Proj Tn O O O E O E' *) apply project_trivial; Col. (* Goal: @Proj Tn O O O E E E' *) (* Goal: not (@Par Tn O E O E') *) intro. (* Goal: @Proj Tn O O O E E E' *) (* Goal: False *) induction H2. (* Goal: @Proj Tn O O O E E E' *) (* Goal: False *) (* Goal: False *) apply H2. (* Goal: @Proj Tn O O O E E 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: @Proj Tn O O O E E E' *) (* Goal: False *) (* Goal: and (@Col Tn O O E) (@Col Tn O O E') *) split; Col. (* Goal: @Proj Tn O O O E E E' *) (* Goal: False *) spliter. (* Goal: @Proj Tn O O O E E E' *) (* Goal: False *) apply NC. (* Goal: @Proj Tn O O O E E E' *) (* Goal: @Col Tn O E E' *) Col. (* Goal: @Proj Tn O O O E E E' *) apply project_trivial; Col. (* Goal: not (@Par Tn O E E E') *) intro. (* Goal: False *) induction H2. (* Goal: False *) (* Goal: False *) apply H2. (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X E E')) *) exists E. (* Goal: False *) (* Goal: and (@Col Tn E O E) (@Col Tn E E E') *) split; Col. (* Goal: False *) spliter. (* Goal: False *) contradiction. Qed. Lemma pj_trivial : forall A B C, Pj A B C C. Proof. (* Goal: forall A B C : @Tpoint Tn, @Pj Tn A B C C *) intros. (* Goal: @Pj Tn A B C C *) unfold Pj. (* Goal: or (@Par Tn A B C C) (@eq (@Tpoint Tn) C C) *) right. (* Goal: @eq (@Tpoint Tn) C C *) auto. Qed. Lemma sum_O_O : Sum O E E' O O O. Proof. (* Goal: @Sum Tn O E E' O O O *) unfold Sum. (* Goal: and (@Ar2 Tn O E E' O O O) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' O))))))) *) assert(O <> E' /\ E <> E'). (* Goal: and (@Ar2 Tn O E E' O O O) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' O))))))) *) (* Goal: and (not (@eq (@Tpoint Tn) O E')) (not (@eq (@Tpoint Tn) E E')) *) split; intro ; subst E'; apply grid_ok; Col. (* Goal: and (@Ar2 Tn O E E' O O O) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' O))))))) *) split. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' O)))))) *) (* Goal: @Ar2 Tn O E E' O O O *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' O)))))) *) (* Goal: @Ar2 Tn O E E' O O O *) unfold Ar2. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' O)))))) *) (* Goal: and (not (@Col Tn O E E')) (and (@Col Tn O E O) (and (@Col Tn O E O) (@Col Tn O E O))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' O)))))) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O O) (and (@Col Tn O E' O) (and (@Pj Tn O E O C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' O))))) *) exists O. (* Goal: and (@Pj Tn E E' O O) (and (@Col Tn O E' O) (and (@Pj Tn O E O O) (and (@Pj Tn O E' O O) (@Pj Tn E' E O O)))) *) repeat split;try (apply pj_trivial). (* Goal: @Col Tn O E' O *) Col. Qed. Lemma sum_A_O : forall A, Col O E A -> Sum O E E' A O A. Proof. (* Goal: forall (A : @Tpoint Tn) (_ : @Col Tn O E A), @Sum Tn O E E' A O A *) intros. (* Goal: @Sum Tn O E E' A O A *) unfold Sum. (* Goal: and (@Ar2 Tn O E E' A O A) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A))))))) *) split. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) (* Goal: @Ar2 Tn O E E' A O A *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) assert(O <> E' /\ E <> E'). (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) (* Goal: and (not (@eq (@Tpoint Tn) O E')) (not (@eq (@Tpoint Tn) E E')) *) split; intro; subst E'; apply grid_ok; Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) induction (eq_dec_points A O). (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A O) (and (@Col Tn O E' O) (and (@Pj Tn O E O C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A))))) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) (* Goal: and (@Pj Tn E E' A O) (and (@Col Tn O E' O) (and (@Pj Tn O E O O) (and (@Pj Tn O E' O O) (@Pj Tn E' E O A)))) *) repeat split; Col; unfold Pj ; try auto. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) assert(~ Par E E' O E'). (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) (* Goal: not (@Par Tn E E' O E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) (* Goal: False *) induction H3. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) (* Goal: False *) (* Goal: False *) apply H3. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) (* 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 A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) (* Goal: False *) (* Goal: and (@Col Tn E' E E') (@Col Tn E' O E') *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) (* Goal: False *) apply grid_ok. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) (* Goal: @Col Tn O E E' *) Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) assert(HH:= project_existence A O E' E E' H1 H0 H3). (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) ex_and HH A'. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) unfold unique in H4. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A)))))) *) exists A'. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' O C') (@Pj Tn E' E C' A))))) *) exists A'. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' A') (and (@Pj Tn O E' O A') (@Pj Tn E' E A' A)))) *) unfold Proj in H4. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' A') (and (@Pj Tn O E' O A') (@Pj Tn E' E A' A)))) *) spliter. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' A') (and (@Pj Tn O E' O A') (@Pj Tn E' E A' A)))) *) repeat split; Col. (* Goal: @Pj Tn E' E A' A *) (* Goal: @Pj Tn O E' O A' *) (* Goal: @Pj Tn O E A' A' *) (* Goal: @Pj Tn E E' A A' *) unfold Pj. (* Goal: @Pj Tn E' E A' A *) (* Goal: @Pj Tn O E' O A' *) (* Goal: @Pj Tn O E A' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) induction H9. (* Goal: @Pj Tn E' E A' A *) (* Goal: @Pj Tn O E' O A' *) (* Goal: @Pj Tn O E A' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) left. (* Goal: @Pj Tn E' E A' A *) (* Goal: @Pj Tn O E' O A' *) (* Goal: @Pj Tn O E A' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) (* Goal: @Par Tn E E' A A' *) apply par_symmetry. (* Goal: @Pj Tn E' E A' A *) (* Goal: @Pj Tn O E' O A' *) (* Goal: @Pj Tn O E A' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) (* Goal: @Par Tn A A' E E' *) Par. (* Goal: @Pj Tn E' E A' A *) (* Goal: @Pj Tn O E' O A' *) (* Goal: @Pj Tn O E A' A' *) (* Goal: or (@Par Tn E E' A A') (@eq (@Tpoint Tn) A A') *) tauto. (* Goal: @Pj Tn E' E A' A *) (* Goal: @Pj Tn O E' O A' *) (* Goal: @Pj Tn O E A' A' *) unfold Pj. (* Goal: @Pj Tn E' E A' A *) (* Goal: @Pj Tn O E' O A' *) (* Goal: or (@Par Tn O E A' A') (@eq (@Tpoint Tn) A' A') *) tauto. (* Goal: @Pj Tn E' E A' A *) (* Goal: @Pj Tn O E' O A' *) unfold Pj. (* Goal: @Pj Tn E' E A' A *) (* Goal: or (@Par Tn O E' O A') (@eq (@Tpoint Tn) O A') *) left. (* Goal: @Pj Tn E' E A' A *) (* Goal: @Par Tn O E' O A' *) right. (* Goal: @Pj Tn E' E A' A *) (* Goal: and (not (@eq (@Tpoint Tn) O E')) (and (not (@eq (@Tpoint Tn) O A')) (and (@Col Tn O O A') (@Col Tn E' O A'))) *) repeat split; Col. (* Goal: @Pj Tn E' E A' A *) (* Goal: not (@eq (@Tpoint Tn) O A') *) intro. (* Goal: @Pj Tn E' E A' A *) (* Goal: False *) subst A'. (* Goal: @Pj Tn E' E A' A *) (* Goal: False *) induction H9. (* Goal: @Pj Tn E' E A' A *) (* Goal: False *) (* Goal: False *) induction H9. (* Goal: @Pj Tn E' E A' A *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H9. (* Goal: @Pj Tn E' E A' A *) (* 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: @Pj Tn E' E A' A *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn E A O) (@Col Tn E E E') *) split; Col. (* Goal: @Pj Tn E' E A' A *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Pj Tn E' E A' A *) (* Goal: False *) (* Goal: False *) contradiction. (* Goal: @Pj Tn E' E A' A *) (* Goal: False *) contradiction. (* Goal: @Pj Tn E' E A' A *) unfold Pj. (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) induction H9. (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) left. (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: @Par Tn E' E A' A *) apply par_symmetry. (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) (* Goal: @Par Tn A' A E' E *) Par. (* Goal: or (@Par Tn E' E A' A) (@eq (@Tpoint Tn) A' A) *) right. (* Goal: @eq (@Tpoint Tn) A' A *) auto. Qed. Lemma sum_O_B : forall B, Col O E B -> Sum O E E' O B B. Proof. (* Goal: forall (B : @Tpoint Tn) (_ : @Col Tn O E B), @Sum Tn O E E' O B B *) intros. (* Goal: @Sum Tn O E E' O B B *) induction(eq_dec_points B O). (* Goal: @Sum Tn O E E' O B B *) (* Goal: @Sum Tn O E E' O B B *) subst B. (* Goal: @Sum Tn O E E' O B B *) (* Goal: @Sum Tn O E E' O O O *) apply sum_O_O. (* Goal: @Sum Tn O E E' O B B *) unfold Sum. (* Goal: and (@Ar2 Tn O E E' O B B) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B))))))) *) split. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) (* Goal: @Ar2 Tn O E E' O B B *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) assert(O <> E' /\ E <> E'). (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) (* Goal: and (not (@eq (@Tpoint Tn) O E')) (not (@eq (@Tpoint Tn) E E')) *) split; intro; subst E'; apply grid_ok; Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) assert(~ Par E E' O E'). (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) (* Goal: not (@Par Tn E E' O E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) (* Goal: False *) induction H3. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) (* Goal: False *) (* Goal: False *) apply H3. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) (* 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 A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) (* Goal: False *) (* Goal: and (@Col Tn E' E E') (@Col Tn E' O E') *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) (* Goal: False *) apply grid_ok. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) (* Goal: @Col Tn O E E' *) Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B)))))) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' O O) (and (@Col Tn O E' O) (and (@Pj Tn O E O C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' B))))) *) exists B. (* Goal: and (@Pj Tn E E' O O) (and (@Col Tn O E' O) (and (@Pj Tn O E O B) (and (@Pj Tn O E' B B) (@Pj Tn E' E B B)))) *) repeat split; try(apply pj_trivial). (* Goal: @Pj Tn O E O B *) (* Goal: @Col Tn O E' O *) Col. (* Goal: @Pj Tn O E O B *) left. (* Goal: @Par Tn O E O B *) right. (* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (not (@eq (@Tpoint Tn) O B)) (and (@Col Tn O O B) (@Col Tn E O B))) *) repeat split; Col. (* Goal: not (@eq (@Tpoint Tn) O E) *) intro. (* Goal: False *) subst E. (* Goal: False *) apply grid_ok. (* Goal: @Col Tn O O E' *) Col. Qed. Lemma opp0_uniqueness : forall M, Opp O E E' O M -> M = O. Proof. (* Goal: forall (M : @Tpoint Tn) (_ : @Opp Tn O E E' O M), @eq (@Tpoint Tn) M O *) intros. (* Goal: @eq (@Tpoint Tn) M O *) assert(NC:= grid_ok). (* Goal: @eq (@Tpoint Tn) M O *) unfold Opp in H. (* Goal: @eq (@Tpoint Tn) M O *) apply sum_to_sump in H. (* Goal: @eq (@Tpoint Tn) M O *) unfold Sump in H. (* Goal: @eq (@Tpoint Tn) M O *) spliter. (* Goal: @eq (@Tpoint Tn) M O *) ex_and H1 A'. (* Goal: @eq (@Tpoint Tn) M O *) ex_and H2 C'. (* Goal: @eq (@Tpoint Tn) M O *) ex_and H1 P'. (* Goal: @eq (@Tpoint Tn) M O *) unfold Proj in *. (* Goal: @eq (@Tpoint Tn) M O *) spliter. (* Goal: @eq (@Tpoint Tn) M O *) induction H8. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) induction H12. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) assert(Par O E' E E'). (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @Par Tn O E' E E' *) apply (par_trans _ _ C' O). (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn O E' C' O *) apply par_symmetry. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @Par Tn C' O E E' *) (* Goal: @Par Tn C' O O E' *) Par. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @Par Tn C' O E E' *) Par. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: False *) induction H17. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: False *) (* Goal: False *) apply H17. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E') (@Col Tn X E E')) *) exists E'. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: False *) (* Goal: and (@Col Tn E' O E') (@Col Tn E' E E') *) split; Col. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: False *) spliter. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: False *) contradiction. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) subst C'. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) apply par_distincts in H8. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) tauto. (* Goal: @eq (@Tpoint Tn) M O *) subst C'. (* Goal: @eq (@Tpoint Tn) M O *) assert( A' = O). (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) A' O *) apply (l6_21 O E E' O); Col. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @Col Tn O E A' *) induction H2. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @Col Tn O E A' *) (* Goal: @Col Tn O E A' *) apply False_ind. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @Col Tn O E A' *) (* Goal: False *) apply H2. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @Col Tn O E A' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' P')) *) exists O. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @Col Tn O E A' *) (* Goal: and (@Col Tn O O E) (@Col Tn O A' P') *) split; Col. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @Col Tn O E A' *) spliter. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @Col Tn O E A' *) apply col_permutation_1. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @Col Tn A' O E *) apply(col_transitivity_1 _ P'); Col. (* Goal: @eq (@Tpoint Tn) M O *) subst A'. (* Goal: @eq (@Tpoint Tn) M O *) induction H16. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) induction H8. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: False *) apply H8. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X M O) (@Col Tn X E E')) *) exists E. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: and (@Col Tn E M O) (@Col Tn E E E') *) split; Col. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) spliter. (* Goal: @eq (@Tpoint Tn) M O *) (* Goal: @eq (@Tpoint Tn) M O *) contradiction. (* Goal: @eq (@Tpoint Tn) M O *) assumption. Qed. Lemma proj_pars : forall A A' C' , A <> O -> Col O E A -> Par O E A' C' -> Proj A A' O E' E E' -> Par_strict O E A' C'. Proof. (* Goal: forall (A A' C' : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A O)) (_ : @Col Tn O E A) (_ : @Par Tn O E A' C') (_ : @Proj Tn A A' O E' E E'), @Par_strict Tn O E A' C' *) intros. (* Goal: @Par_strict Tn O E A' C' *) unfold Par_strict. (* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (not (@eq (@Tpoint Tn) A' C')) (and (@Coplanar Tn O E A' C') (not (@ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C')))))) *) assert(HH:=grid_ok). (* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (not (@eq (@Tpoint Tn) A' C')) (and (@Coplanar Tn O E A' C') (not (@ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C')))))) *) repeat split; try apply all_coplanar. (* Goal: not (@ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C'))) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) intro. (* Goal: not (@ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C'))) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: False *) subst E. (* Goal: not (@ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C'))) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: False *) apply HH. (* Goal: not (@ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C'))) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O O E' *) Col. (* Goal: not (@ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C'))) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) apply par_distincts in H1. (* Goal: not (@ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C'))) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) tauto. (* Goal: not (@ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C'))) *) intro. (* Goal: False *) ex_and H3 X. (* Goal: False *) unfold Proj in H2. (* Goal: False *) spliter. (* Goal: False *) induction H1. (* Goal: False *) (* Goal: False *) apply H1. (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C')) *) exists X. (* Goal: False *) (* Goal: and (@Col Tn X O E) (@Col Tn X A' C') *) split; Col. (* Goal: False *) spliter. (* Goal: False *) assert(Col A' O E). (* Goal: False *) (* Goal: @Col Tn A' O E *) apply (col_transitivity_1 _ C'); Col. (* Goal: False *) induction(eq_dec_points A' O). (* Goal: False *) (* Goal: False *) subst A'. (* Goal: False *) (* Goal: False *) clean_trivial_hyps. (* Goal: False *) (* Goal: False *) induction H8. (* Goal: False *) (* Goal: False *) (* Goal: False *) induction H7. (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H7. (* Goal: False *) (* 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: False *) (* Goal: and (@Col Tn E A O) (@Col Tn E E E') *) split; Col. (* Goal: False *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: False *) (* Goal: False *) (* Goal: False *) contradiction. (* Goal: False *) (* Goal: False *) contradiction. (* Goal: False *) apply grid_ok. (* Goal: @Col Tn O E E' *) apply(col_transitivity_1 _ A'); Col. Qed. Lemma proj_col : forall A A' C' , A = O -> Col O E A -> Par O E A' C' -> Proj A A' O E' E E' -> A' = O. Proof. (* Goal: forall (A A' C' : @Tpoint Tn) (_ : @eq (@Tpoint Tn) A O) (_ : @Col Tn O E A) (_ : @Par Tn O E A' C') (_ : @Proj Tn A A' O E' E E'), @eq (@Tpoint Tn) A' O *) intros. (* Goal: @eq (@Tpoint Tn) A' O *) assert(HH:=grid_ok). (* Goal: @eq (@Tpoint Tn) A' O *) unfold Proj in H2. (* Goal: @eq (@Tpoint Tn) A' O *) spliter. (* Goal: @eq (@Tpoint Tn) A' O *) subst A. (* Goal: @eq (@Tpoint Tn) A' O *) induction H6. (* Goal: @eq (@Tpoint Tn) A' O *) (* Goal: @eq (@Tpoint Tn) A' O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) A' O *) (* Goal: False *) apply H4. (* Goal: @eq (@Tpoint Tn) A' O *) (* Goal: @Par Tn O E' E E' *) apply par_symmetry. (* Goal: @eq (@Tpoint Tn) A' O *) (* Goal: @Par Tn E E' O E' *) eapply (par_col_par _ _ _ A'); Col. (* Goal: @eq (@Tpoint Tn) A' O *) (* Goal: @Par Tn E E' O A' *) apply par_symmetry. (* Goal: @eq (@Tpoint Tn) A' O *) (* Goal: @Par Tn O A' E E' *) Par. (* Goal: @eq (@Tpoint Tn) A' O *) auto. Qed. Lemma grid_not_par : ~Par O E E E' /\ ~Par O E O E' /\ ~Par O E' E E' /\ O <> E /\ O <> E' /\ E <> E'. Proof. (* Goal: and (not (@Par Tn O E E E')) (and (not (@Par Tn O E O E')) (and (not (@Par Tn O E' E E')) (and (not (@eq (@Tpoint Tn) O E)) (and (not (@eq (@Tpoint Tn) O E')) (not (@eq (@Tpoint Tn) E E')))))) *) repeat split. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E E') *) (* Goal: not (@Par Tn O E O E') *) (* Goal: not (@Par Tn O E E E') *) intro. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E E') *) (* Goal: not (@Par Tn O E O E') *) (* Goal: False *) unfold Par in H. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E E') *) (* Goal: not (@Par Tn O E O E') *) (* Goal: False *) induction H. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E E') *) (* Goal: not (@Par Tn O E O E') *) (* Goal: False *) (* Goal: False *) apply H. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E E') *) (* Goal: not (@Par Tn O E O 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: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E E') *) (* Goal: not (@Par Tn O E O E') *) (* Goal: False *) (* Goal: and (@Col Tn E O E) (@Col Tn E E E') *) split; Col. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E E') *) (* Goal: not (@Par Tn O E O E') *) (* Goal: False *) spliter. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E E') *) (* Goal: not (@Par Tn O E O E') *) (* Goal: False *) contradiction. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E E') *) (* Goal: not (@Par Tn O E O E') *) intro. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E E') *) (* Goal: False *) induction H. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E E') *) (* Goal: False *) (* Goal: False *) apply H. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E 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: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E E') *) (* Goal: False *) (* Goal: and (@Col Tn O O E) (@Col Tn O O E') *) split; Col. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E E') *) (* Goal: False *) spliter. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E E') *) (* Goal: False *) apply grid_ok. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E E') *) (* Goal: @Col Tn O E E' *) Col. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@Par Tn O E' E E') *) intro. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: False *) induction H. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: False *) (* Goal: False *) apply H. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O 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: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: False *) (* Goal: and (@Col Tn E' O E') (@Col Tn E' E E') *) split; Col. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: False *) spliter. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: False *) contradiction. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) intro. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: False *) subst E. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: False *) apply grid_ok. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: @Col Tn O O E' *) Col. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) intro. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: False *) subst E'. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: False *) apply grid_ok. (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: @Col Tn O E O *) Col. (* Goal: not (@eq (@Tpoint Tn) E E') *) intro. (* Goal: False *) subst E'. (* Goal: False *) apply grid_ok. (* Goal: @Col Tn O E E *) Col. Qed. Lemma proj_id : forall A A', Proj A A' O E' E E' -> Col O E A -> Col O E A' -> A = O. Proof. (* Goal: forall (A A' : @Tpoint Tn) (_ : @Proj Tn A A' O E' E E') (_ : @Col Tn O E A) (_ : @Col Tn O E A'), @eq (@Tpoint Tn) A O *) intros. (* Goal: @eq (@Tpoint Tn) A O *) assert(HH:=grid_not_par). (* Goal: @eq (@Tpoint Tn) A O *) spliter. (* Goal: @eq (@Tpoint Tn) A O *) unfold Proj in H. (* Goal: @eq (@Tpoint Tn) A O *) spliter. (* Goal: @eq (@Tpoint Tn) A O *) induction H11. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) apply(l6_21 O E E' O); Col. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @Col Tn E' O A *) assert(Col O A' A). (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @Col Tn E' O A *) (* Goal: @Col Tn O A' A *) apply(col_transitivity_1 _ E); Col. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @Col Tn E' O A *) apply col_permutation_2. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @Col Tn O A E' *) apply (col_transitivity_1 _ A'); Col. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: not (@eq (@Tpoint Tn) O A') *) intro. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) subst A'. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) induction H11. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) (* Goal: False *) apply H11. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A O) (@Col Tn X E E')) *) exists E. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) (* Goal: and (@Col Tn E A O) (@Col Tn E E E') *) split; Col. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) spliter. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) contradiction. (* Goal: @eq (@Tpoint Tn) A O *) subst. (* Goal: @eq (@Tpoint Tn) A' O *) apply(l6_21 O E E' O); Col. Qed. Lemma sum_O_B_eq : forall B C, Sum O E E' O B C -> B = C. Proof. (* Goal: forall (B C : @Tpoint Tn) (_ : @Sum Tn O E E' O B C), @eq (@Tpoint Tn) B C *) intros. (* Goal: @eq (@Tpoint Tn) B C *) assert (HS:=H). (* Goal: @eq (@Tpoint Tn) B C *) unfold Sum in H. (* Goal: @eq (@Tpoint Tn) B C *) spliter. (* Goal: @eq (@Tpoint Tn) B C *) unfold Ar2 in H. (* Goal: @eq (@Tpoint Tn) B C *) spliter. (* Goal: @eq (@Tpoint Tn) B C *) assert(HH:=sum_O_B B H2). (* Goal: @eq (@Tpoint Tn) B C *) apply (sum_uniqueness O B); auto. Qed. Lemma sum_A_O_eq : forall A C, Sum O E E' A O C -> A = C. Proof. (* Goal: forall (A C : @Tpoint Tn) (_ : @Sum Tn O E E' A O C), @eq (@Tpoint Tn) A C *) intros. (* Goal: @eq (@Tpoint Tn) A C *) assert (HS:=H). (* Goal: @eq (@Tpoint Tn) A C *) unfold Sum in H. (* Goal: @eq (@Tpoint Tn) A C *) spliter. (* Goal: @eq (@Tpoint Tn) A C *) unfold Ar2 in H. (* Goal: @eq (@Tpoint Tn) A C *) spliter. (* Goal: @eq (@Tpoint Tn) A C *) assert(HH:=sum_A_O A H1). (* Goal: @eq (@Tpoint Tn) A C *) apply (sum_uniqueness A O); auto. Qed. Lemma sum_par_strict : forall A B C A' C', Ar2 O E E' A B C -> A <> O -> Pj E E' A A' -> Col O E' A' -> Pj O E A' C' -> Pj O E' B C' -> Pj E' E C' C -> A' <> O /\ (Par_strict O E A' C' \/ B = O). Proof. (* Goal: forall (A B C A' C' : @Tpoint Tn) (_ : @Ar2 Tn O E E' A B C) (_ : not (@eq (@Tpoint Tn) A O)) (_ : @Pj Tn E E' A A') (_ : @Col Tn O E' A') (_ : @Pj Tn O E A' C') (_ : @Pj Tn O E' B C') (_ : @Pj Tn E' E C' C), and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) intros. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) assert(Sum O E E' A B C). (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: @Sum Tn O E E' A B C *) unfold Sum. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: and (@Ar2 Tn O E E' A B C) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C))))))) *) split. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: @Ar2 Tn O E E' A B C *) auto. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) exists A'. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C))))) *) exists C'. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) repeat split; auto. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) unfold Ar2 in H. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) unfold Pj in *. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) spliter. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) assert(A' <> O). (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) intro. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) subst A'. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) induction H3. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) induction H3. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H3. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O C')) *) exists O. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn O O E) (@Col Tn O O C') *) split; Col. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) induction H1. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) induction H1. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H1. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* 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: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn E E E') (@Col Tn E A O) *) split; Col. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply grid_ok. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) (* Goal: @Col Tn O E E' *) apply(col_transitivity_1 _ A); Col. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) contradiction. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) subst C'. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) induction H1. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) induction H1. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H1. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* 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: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn E E E') (@Col Tn E A O) *) split; Col. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) apply grid_ok. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: @Col Tn O E E' *) apply(col_transitivity_1 _ A); Col. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) contradiction. (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) split. (* Goal: or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O) *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) auto. (* Goal: or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O) *) induction(eq_dec_points B O). (* Goal: or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O) *) (* Goal: or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O) *) tauto. (* Goal: or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O) *) left. (* Goal: @Par_strict Tn O E A' C' *) induction H3. (* Goal: @Par_strict Tn O E A' C' *) (* Goal: @Par_strict Tn O E A' C' *) induction H3. (* Goal: @Par_strict Tn O E A' C' *) (* Goal: @Par_strict Tn O E A' C' *) (* Goal: @Par_strict Tn O E A' C' *) assumption. (* Goal: @Par_strict Tn O E A' C' *) (* Goal: @Par_strict Tn O E A' C' *) spliter. (* Goal: @Par_strict Tn O E A' C' *) (* Goal: @Par_strict Tn O E A' C' *) apply False_ind. (* Goal: @Par_strict Tn O E A' C' *) (* Goal: False *) apply grid_ok. (* Goal: @Par_strict Tn O E A' C' *) (* Goal: @Col Tn O E E' *) assert(Col A' O E ). (* Goal: @Par_strict Tn O E A' C' *) (* Goal: @Col Tn O E E' *) (* Goal: @Col Tn A' O E *) apply(col_transitivity_1 _ C'); Col. (* Goal: @Par_strict Tn O E A' C' *) (* Goal: @Col Tn O E E' *) apply(col_transitivity_1 _ A'); Col. (* Goal: @Par_strict Tn O E A' C' *) subst C'. (* Goal: @Par_strict Tn O E A' A' *) apply False_ind. (* Goal: False *) induction H4. (* Goal: False *) (* Goal: False *) induction H3. (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H3. (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E') (@Col Tn X B A')) *) exists A'. (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn A' O E') (@Col Tn A' B A') *) split; Col. (* Goal: False *) (* Goal: False *) spliter. (* Goal: False *) (* Goal: False *) assert(Col O B E'). (* Goal: False *) (* Goal: False *) (* Goal: @Col Tn O B E' *) apply (col_transitivity_1 _ A'); Col. (* Goal: False *) (* Goal: False *) apply grid_ok. (* Goal: False *) (* Goal: @Col Tn O E E' *) apply (col_transitivity_1 _ B); Col. (* Goal: False *) subst A'. (* Goal: False *) assert(HH:= grid_not_par). (* Goal: False *) spliter. (* Goal: False *) induction H5. (* Goal: False *) (* Goal: False *) apply H3. (* Goal: False *) (* Goal: @Par Tn O E E E' *) apply par_symmetry. (* Goal: False *) (* Goal: @Par Tn E E' O E *) apply (par_col_par _ _ _ B); Col. (* Goal: False *) (* Goal: @Par Tn E E' O B *) apply par_right_comm. (* Goal: False *) (* Goal: @Par Tn E E' B O *) apply (par_col_par _ _ _ C); Par. (* Goal: False *) (* Goal: @Col Tn B C O *) apply col_permutation_1. (* Goal: False *) (* Goal: @Col Tn O B C *) apply(col_transitivity_1 _ E); Col. (* Goal: False *) subst C. (* Goal: False *) apply grid_ok. (* Goal: @Col Tn O E E' *) apply(col_transitivity_1 _ B); Col. Qed. Lemma sum_A_B_A : forall A B, Sum O E E' A B A -> B = O. Proof. (* Goal: forall (A B : @Tpoint Tn) (_ : @Sum Tn O E E' A B A), @eq (@Tpoint Tn) B O *) intros. (* Goal: @eq (@Tpoint Tn) B O *) unfold Sum in H. (* Goal: @eq (@Tpoint Tn) B O *) spliter. (* Goal: @eq (@Tpoint Tn) B O *) ex_and H0 A'. (* Goal: @eq (@Tpoint Tn) B O *) ex_and H1 C'. (* Goal: @eq (@Tpoint Tn) B O *) assert(HH:= grid_not_par). (* Goal: @eq (@Tpoint Tn) B O *) spliter. (* Goal: @eq (@Tpoint Tn) B O *) induction(eq_dec_points A O). (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) subst A. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) unfold Pj in *. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) unfold Ar2 in H. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) spliter. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) induction H0. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) induction H0. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: False *) apply H0. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E') (@Col Tn X O A')) *) exists E'. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: and (@Col Tn E' E E') (@Col Tn E' O A') *) split; Col. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) spliter. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: False *) apply grid_ok. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) subst A'. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) induction H2. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) induction H4. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: False *) apply H5. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @Par Tn O E E E' *) apply (par_trans _ _ O C') ; Par. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) subst C'. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) apply par_distincts in H0. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) tauto. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) subst C'. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) induction H3. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) induction H0. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: False *) apply H0. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E') (@Col Tn X B O)) *) exists O. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: and (@Col Tn O O E') (@Col Tn O B O) *) split; Col. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) spliter. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) induction(eq_dec_points B O). (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) auto. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: False *) apply grid_ok. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) assumption. (* Goal: @eq (@Tpoint Tn) B O *) assert(A' <> O /\ (Par_strict O E A' C' \/ B = O)). (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) apply(sum_par_strict A B A A' C');auto. (* Goal: @eq (@Tpoint Tn) B O *) spliter. (* Goal: @eq (@Tpoint Tn) B O *) induction(eq_dec_points B O). (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) auto. (* Goal: @eq (@Tpoint Tn) B O *) induction H13. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) unfold Pj in *. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) unfold Ar2 in H. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) spliter. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) induction H0. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) induction H4. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) assert(Par A A' A C'). (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @Par Tn A A' A C' *) apply (par_trans _ _ E E'); Par. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: False *) induction H18. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: False *) (* Goal: False *) apply H18. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A A') (@Col Tn X A C')) *) exists A. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: False *) (* Goal: and (@Col Tn A A A') (@Col Tn A A C') *) split; Col. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: False *) spliter. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: False *) apply H13. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C')) *) exists A. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: and (@Col Tn A O E) (@Col Tn A A' C') *) split; Col. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) subst C'. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: False *) apply H13. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' A)) *) exists A. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: and (@Col Tn A O E) (@Col Tn A A' A) *) split; Col. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) subst A'. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @eq (@Tpoint Tn) B O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: False *) apply grid_ok. (* Goal: @eq (@Tpoint Tn) B O *) (* Goal: @Col Tn O E E' *) apply(col_transitivity_1 _ A);Col. (* Goal: @eq (@Tpoint Tn) B O *) contradiction. Qed. Lemma sum_A_B_B : forall A B, Sum O E E' A B B -> A = O. Proof. (* Goal: forall (A B : @Tpoint Tn) (_ : @Sum Tn O E E' A B B), @eq (@Tpoint Tn) A O *) intros. (* Goal: @eq (@Tpoint Tn) A O *) unfold Sum in H. (* Goal: @eq (@Tpoint Tn) A O *) spliter. (* Goal: @eq (@Tpoint Tn) A O *) ex_and H0 A'. (* Goal: @eq (@Tpoint Tn) A O *) ex_and H1 C'. (* Goal: @eq (@Tpoint Tn) A O *) assert(HH:= grid_not_par). (* Goal: @eq (@Tpoint Tn) A O *) spliter. (* Goal: @eq (@Tpoint Tn) A O *) unfold Pj in *. (* Goal: @eq (@Tpoint Tn) A O *) unfold Ar2 in H. (* Goal: @eq (@Tpoint Tn) A O *) spliter. (* Goal: @eq (@Tpoint Tn) A O *) induction H3. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) induction H4. (* 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 H7. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @Par Tn O E' E E' *) apply(par_trans _ _ B C'); Par. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) subst C'. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) apply par_distincts in H3. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) tauto. (* Goal: @eq (@Tpoint Tn) A O *) subst C'. (* Goal: @eq (@Tpoint Tn) A O *) induction(eq_dec_points A O). (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) auto. (* Goal: @eq (@Tpoint Tn) A O *) assert(A' <> O /\ (Par_strict O E A' B \/ B = O)). (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' B) (@eq (@Tpoint Tn) B O)) *) apply(sum_par_strict A B B A' B);auto. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @Pj Tn O E' B B *) (* Goal: @Ar2 Tn O E E' A B B *) repeat split; auto. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @Pj Tn O E' B B *) unfold Pj. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: or (@Par Tn O E' B B) (@eq (@Tpoint Tn) B B) *) auto. (* Goal: @eq (@Tpoint Tn) A O *) spliter. (* Goal: @eq (@Tpoint Tn) A O *) induction H15. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) apply H15. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' B)) *) exists B. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: and (@Col Tn B O E) (@Col Tn B A' B) *) split; Col. (* Goal: @eq (@Tpoint Tn) A O *) subst B. (* Goal: @eq (@Tpoint Tn) A O *) induction H2. (* 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 H2. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' O)) *) exists O. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: and (@Col Tn O O E) (@Col Tn O A' O) *) split; 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 H. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @eq (@Tpoint Tn) A O *) subst A'. (* Goal: @eq (@Tpoint Tn) A O *) tauto. Qed. Lemma sum_uniquenessB : forall A X Y C, Sum O E E' A X C -> Sum O E E' A Y C -> X = Y. Proof. (* Goal: forall (A X Y C : @Tpoint Tn) (_ : @Sum Tn O E E' A X C) (_ : @Sum Tn O E E' A Y C), @eq (@Tpoint Tn) X Y *) intros. (* Goal: @eq (@Tpoint Tn) X Y *) induction (eq_dec_points A O). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst A. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) assert(X = C). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X C *) apply(sum_O_B_eq X C H). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) assert(Y = C). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) Y C *) apply(sum_O_B_eq Y C H0). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst X. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) C Y *) subst Y. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) C C *) auto. (* Goal: @eq (@Tpoint Tn) X Y *) assert(HSx:= H). (* Goal: @eq (@Tpoint Tn) X Y *) assert(HSy:= H0). (* Goal: @eq (@Tpoint Tn) X Y *) unfold Sum in H. (* Goal: @eq (@Tpoint Tn) X Y *) unfold Sum in H0. (* Goal: @eq (@Tpoint Tn) X Y *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) assert(Hx:=H). (* Goal: @eq (@Tpoint Tn) X Y *) assert(Hy:=H0). (* Goal: @eq (@Tpoint Tn) X Y *) unfold Ar2 in H. (* Goal: @eq (@Tpoint Tn) X Y *) unfold Ar2 in H0. (* Goal: @eq (@Tpoint Tn) X Y *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) ex_and H2 A''. (* Goal: @eq (@Tpoint Tn) X Y *) ex_and H10 C''. (* Goal: @eq (@Tpoint Tn) X Y *) ex_and H3 A'. (* Goal: @eq (@Tpoint Tn) X Y *) ex_and H14 C'. (* Goal: @eq (@Tpoint Tn) X Y *) clean_duplicated_hyps. (* Goal: @eq (@Tpoint Tn) X Y *) assert(A' <> O /\ (Par_strict O E A' C' \/ X = O)). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) X O)) *) apply(sum_par_strict A X C A' C'); auto. (* Goal: @eq (@Tpoint Tn) X Y *) assert(A'' <> O /\ (Par_strict O E A'' C'' \/ Y = O)). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (not (@eq (@Tpoint Tn) A'' O)) (or (@Par_strict Tn O E A'' C'') (@eq (@Tpoint Tn) Y O)) *) apply(sum_par_strict A Y C A'' C''); auto. (* Goal: @eq (@Tpoint Tn) X Y *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) unfold Pj in *. (* Goal: @eq (@Tpoint Tn) X Y *) induction(eq_dec_points X O). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst X. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) O Y *) assert(HH:=sum_A_O A H7). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) O Y *) assert(C = A). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) O Y *) (* Goal: @eq (@Tpoint Tn) C A *) apply (sum_uniqueness A O); auto. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) O Y *) subst C. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) O Y *) assert(Y=O). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) O Y *) (* Goal: @eq (@Tpoint Tn) Y O *) apply (sum_A_B_A A ); auto. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) O Y *) subst Y. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) O O *) auto. (* Goal: @eq (@Tpoint Tn) X Y *) induction H2. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H3. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) assert(Par A A' A A''). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @Par Tn A A' A A'' *) apply (par_trans _ _ E E'); Par. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H19. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H19. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A A') (@Col Tn X A A'')) *) exists A. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn A A A') (@Col Tn A A A'') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) assert(A' = A''). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) A' A'' *) apply (l6_21 O E' A A'); Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: not (@Col Tn O E' A) *) intro. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply grid_ok. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @Col Tn O E E' *) apply(col_transitivity_1 _ A); Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst A''. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H4. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H6. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) assert(Par A' C' A' C''). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @Par Tn A' C' A' C'' *) apply(par_trans _ _ O E); left; Par. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H23. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H23. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A' C') (@Col Tn X A' C'')) *) exists A'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn A' A' C') (@Col Tn A' A' C'') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H13. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H17. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) assert(Par C C' C C''). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @Par Tn C C' C C'' *) apply(par_trans _ _ E' E); Par. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H27. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H27. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X C C') (@Col Tn X C C'')) *) exists C. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn C C C') (@Col Tn C C C'') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) assert(C' = C''). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) C' C'' *) apply (l6_21 A' C' C C'); Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: not (@Col Tn A' C' C) *) intro. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H6. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C')) *) exists C. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn C O E) (@Col Tn C A' C') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst C''. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) clean_trivial_hyps. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H12. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H16. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) assert(Par Y C' X C'). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @Par Tn Y C' X C' *) apply (par_trans _ _ O E'); Par. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H21. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H21. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 Y C') (@Col Tn X0 X C')) *) exists C'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn C' Y C') (@Col Tn C' X C') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply(l6_21 O E C' X); Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: not (@Col Tn O E C') *) intro. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H4. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C')) *) exists C'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn C' O E) (@Col Tn C' A' C') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst X. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) C' Y *) clean_duplicated_hyps. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) C' Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H6. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C')) *) exists C'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn C' O E) (@Col Tn C' A' C') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst Y. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X C' *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H6. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C')) *) exists C'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn C' O E) (@Col Tn C' A' C') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst C'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) clean_duplicated_hyps. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) clean_trivial_hyps. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H6. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C)) *) exists C. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn C O E) (@Col Tn C A' C) *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst C''. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H4. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C)) *) exists C. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn C O E) (@Col Tn C A' C) *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst X. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) O Y *) tauto. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst Y. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X O *) assert(A = C). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X O *) (* Goal: @eq (@Tpoint Tn) A C *) apply(sum_A_O_eq A C HSy). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X O *) subst C. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X O *) clean_duplicated_hyps. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X O *) clean_trivial_hyps. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X O *) apply(sum_A_B_A A); auto. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst A'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) clean_duplicated_hyps. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H15. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H6. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H3. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A C')) *) exists A. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn A O E) (@Col Tn A A C') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst X. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) O Y *) tauto. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst C'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H6. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A A)) *) exists A. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn A O E) (@Col Tn A A A) *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) contradiction. (* Goal: @eq (@Tpoint Tn) X Y *) subst A''. (* Goal: @eq (@Tpoint Tn) X Y *) induction H4. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H2. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A C'')) *) exists A. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn A O E) (@Col Tn A A C'') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) subst Y. (* Goal: @eq (@Tpoint Tn) X O *) assert(A = C). (* Goal: @eq (@Tpoint Tn) X O *) (* Goal: @eq (@Tpoint Tn) A C *) apply (sum_A_O_eq A C HSy). (* Goal: @eq (@Tpoint Tn) X O *) subst C. (* Goal: @eq (@Tpoint Tn) X O *) apply (sum_A_B_A A _ HSx). Qed. Lemma sum_uniquenessA : forall B X Y C, Sum O E E' X B C -> Sum O E E' Y B C -> X = Y. Proof. (* Goal: forall (B X Y C : @Tpoint Tn) (_ : @Sum Tn O E E' X B C) (_ : @Sum Tn O E E' Y B C), @eq (@Tpoint Tn) X Y *) intros. (* Goal: @eq (@Tpoint Tn) X Y *) induction (eq_dec_points B O). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst B. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) assert(X = C). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X C *) apply(sum_A_O_eq X C H). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst X. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) C Y *) assert(Y = C). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) C Y *) (* Goal: @eq (@Tpoint Tn) Y C *) apply(sum_A_O_eq Y C H0). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) C Y *) subst Y. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) C C *) auto. (* Goal: @eq (@Tpoint Tn) X Y *) assert(HSx:= H). (* Goal: @eq (@Tpoint Tn) X Y *) assert(HSy:= H0). (* Goal: @eq (@Tpoint Tn) X Y *) unfold Sum in H. (* Goal: @eq (@Tpoint Tn) X Y *) unfold Sum in H0. (* Goal: @eq (@Tpoint Tn) X Y *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) assert(Hx:=H). (* Goal: @eq (@Tpoint Tn) X Y *) assert(Hy:=H0). (* Goal: @eq (@Tpoint Tn) X Y *) unfold Ar2 in H. (* Goal: @eq (@Tpoint Tn) X Y *) unfold Ar2 in H0. (* Goal: @eq (@Tpoint Tn) X Y *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) ex_and H2 A''. (* Goal: @eq (@Tpoint Tn) X Y *) ex_and H10 C''. (* Goal: @eq (@Tpoint Tn) X Y *) ex_and H3 A'. (* Goal: @eq (@Tpoint Tn) X Y *) ex_and H14 C'. (* Goal: @eq (@Tpoint Tn) X Y *) clean_duplicated_hyps. (* Goal: @eq (@Tpoint Tn) X Y *) unfold Pj in *. (* Goal: @eq (@Tpoint Tn) X Y *) induction(eq_dec_points X O). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst X. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) O Y *) assert(HH:=sum_O_B B H8). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) O Y *) assert(B = C). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) O Y *) (* Goal: @eq (@Tpoint Tn) B C *) apply (sum_uniqueness O B); auto. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) O Y *) subst C. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) O Y *) apply sym_equal. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) Y O *) apply (sum_A_B_B Y B); auto. (* Goal: @eq (@Tpoint Tn) X Y *) induction(eq_dec_points Y O). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst Y. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X O *) assert(HH:=sum_O_B B H8). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X O *) assert(B = C). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X O *) (* Goal: @eq (@Tpoint Tn) B C *) apply (sum_uniqueness O B); auto. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X O *) subst C. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X O *) apply (sum_A_B_B X B); auto. (* Goal: @eq (@Tpoint Tn) X Y *) assert(A' <> O /\ (Par_strict O E A' C' \/ B = O)). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) apply(sum_par_strict X B C A' C'); auto. (* Goal: @eq (@Tpoint Tn) X Y *) assert(A'' <> O /\ (Par_strict O E A'' C'' \/ B = O)). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (not (@eq (@Tpoint Tn) A'' O)) (or (@Par_strict Tn O E A'' C'') (@eq (@Tpoint Tn) B O)) *) apply(sum_par_strict Y B C A'' C''); auto. (* Goal: @eq (@Tpoint Tn) X Y *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) induction H12. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H16. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) assert(Par B C' B C''). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @Par Tn B C' B C'' *) apply (par_trans _ _ O E'); Par. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H20. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H20. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C') (@Col Tn X B C'')) *) exists B. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn B B C') (@Col Tn B B C'') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) clean_trivial_hyps. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H13. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H17. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) assert(Par C C' C C''). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @Par Tn C C' C C'' *) apply (par_trans _ _ E E'); Par. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H22. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H22. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X C C') (@Col Tn X C C'')) *) exists C. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn C C C') (@Col Tn C C C'') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) assert(C' = C''). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) C' C'' *) apply(l6_21 C C' B C'); Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: not (@Col Tn C C' B) *) intro. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) induction H19. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: False *) apply H19. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C')) *) exists C'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: and (@Col Tn C' O E) (@Col Tn C' A' C') *) split. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: @Col Tn C' O E *) assert(Col O B C). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: @Col Tn C' O E *) (* Goal: @Col Tn O B C *) apply (col_transitivity_1 _ E); Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: @Col Tn C' O E *) (* Goal: not (@eq (@Tpoint Tn) O E) *) intro. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: @Col Tn C' O E *) (* Goal: False *) apply grid_ok. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: @Col Tn C' O E *) (* Goal: @Col Tn O E E' *) subst E. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: @Col Tn C' O E *) (* Goal: @Col Tn O O E' *) Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: @Col Tn C' O E *) assert(Col E B C). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: @Col Tn C' O E *) (* Goal: @Col Tn E B C *) apply (col_transitivity_1 _ O); Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: @Col Tn C' O E *) (* Goal: not (@eq (@Tpoint Tn) E O) *) intro. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: @Col Tn C' O E *) (* Goal: False *) apply grid_ok. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: @Col Tn C' O E *) (* Goal: @Col Tn O E E' *) subst E. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: @Col Tn C' O E *) (* Goal: @Col Tn O O E' *) Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: @Col Tn C' O E *) apply(col3 B C); Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) intro. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: False *) subst C. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: False *) clean_trivial_hyps. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: False *) apply(sum_A_B_B) in HSx. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) (* Goal: False *) contradiction. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn C' A' C' *) Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) contradiction. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst C''. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) clean_trivial_hyps. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H19. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H18. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) assert(Par A' C' A'' C'). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @Par Tn A' C' A'' C' *) apply (par_trans _ _ O E);left; Par. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H23. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H23. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A' C') (@Col Tn X A'' C')) *) exists C'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn C' A' C') (@Col Tn C' A'' C') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) assert(A'= A''). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) A' A'' *) apply (l6_21 O E' C' A'); Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: not (@Col Tn O E' C') *) intro. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) induction H16. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: False *) apply H16. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E') (@Col Tn X B C')) *) exists C'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: and (@Col Tn C' O E') (@Col Tn C' B C') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H1. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) B O *) apply (l6_21 O E C' O); Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: not (@eq (@Tpoint Tn) C' O) *) (* Goal: not (@Col Tn O E C') *) intro. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: not (@eq (@Tpoint Tn) C' O) *) (* Goal: False *) apply grid_ok. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: not (@eq (@Tpoint Tn) C' O) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: not (@eq (@Tpoint Tn) C' O) *) intro. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) subst C'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) clean_trivial_hyps. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H18. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A'' O)) *) exists O. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn O O E) (@Col Tn O A'' O) *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst A''. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) clean_trivial_hyps. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) clean_duplicated_hyps. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H2. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H3. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) assert(Par Y A' X A'). (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @Par Tn Y A' X A' *) apply(par_trans _ _ E E'); Par. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) induction H6. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H6. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 Y A') (@Col Tn X0 X A')) *) exists A'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn A' Y A') (@Col Tn A' X A') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply (l6_21 O E A' X); Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: not (@Col Tn O E A') *) intro. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H19. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C')) *) exists A'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn A' O E) (@Col Tn A' A' C') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst X. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) A' Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H19. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C')) *) exists A'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn A' O E) (@Col Tn A' A' C') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst Y. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X A' *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply H19. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C')) *) exists A'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: and (@Col Tn A' O E) (@Col Tn A' A' C') *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) contradiction. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) contradiction. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst C'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) induction H16. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: False *) apply H16. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E') (@Col Tn X B C)) *) exists O. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: and (@Col Tn O O E') (@Col Tn O B C) *) split. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn O B C *) (* Goal: @Col Tn O O E' *) Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn O B C *) apply(col3 O E); Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) O E) *) intro. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: False *) subst E. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: False *) apply grid_ok; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply grid_ok. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @Col Tn O E E' *) apply(colx B C); Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) subst C''. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) induction H12. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: False *) apply H12. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E') (@Col Tn X B C)) *) exists O. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: and (@Col Tn O O E') (@Col Tn O B C) *) split. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn O B C *) (* Goal: @Col Tn O O E' *) Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @Col Tn O B C *) apply(col3 O E); Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) O E) *) intro. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: False *) subst E. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: False *) apply grid_ok; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) spliter. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) apply grid_ok. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @Col Tn O E E' *) apply(colx B C); Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) subst C'. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) induction H19. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: False *) apply H16. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' B)) *) exists B. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) (* Goal: and (@Col Tn B O E) (@Col Tn B A' B) *) split; Col. (* Goal: @eq (@Tpoint Tn) X Y *) (* Goal: False *) contradiction. (* Goal: @eq (@Tpoint Tn) X Y *) subst C''. (* Goal: @eq (@Tpoint Tn) X Y *) apply False_ind. (* Goal: False *) induction H18. (* Goal: False *) (* Goal: False *) apply H12. (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A'' B)) *) exists B. (* Goal: False *) (* Goal: and (@Col Tn B O E) (@Col Tn B A'' B) *) split; Col. (* Goal: False *) contradiction. Qed. Lemma sum_B_null : forall A B, Sum O E E' A B A -> B = O. Proof. (* Goal: forall (A B : @Tpoint Tn) (_ : @Sum Tn O E E' A B A), @eq (@Tpoint Tn) B O *) intros. (* Goal: @eq (@Tpoint Tn) B O *) assert(HS:=H). (* Goal: @eq (@Tpoint Tn) B O *) unfold Sum in H. (* Goal: @eq (@Tpoint Tn) B O *) spliter. (* Goal: @eq (@Tpoint Tn) B O *) unfold Ar2 in H. (* Goal: @eq (@Tpoint Tn) B O *) spliter. (* Goal: @eq (@Tpoint Tn) B O *) assert(HP:= sum_A_O A H1). (* Goal: @eq (@Tpoint Tn) B O *) apply(sum_uniquenessB A B O A); auto. Qed. Lemma sum_A_null : forall A B, Sum O E E' A B B -> A = O. Proof. (* Goal: forall (A B : @Tpoint Tn) (_ : @Sum Tn O E E' A B B), @eq (@Tpoint Tn) A O *) intros. (* Goal: @eq (@Tpoint Tn) A O *) assert(HS:=H). (* Goal: @eq (@Tpoint Tn) A O *) unfold Sum in H. (* Goal: @eq (@Tpoint Tn) A O *) spliter. (* Goal: @eq (@Tpoint Tn) A O *) unfold Ar2 in H. (* Goal: @eq (@Tpoint Tn) A O *) spliter. (* Goal: @eq (@Tpoint Tn) A O *) assert(HP:= sum_O_B B H2). (* Goal: @eq (@Tpoint Tn) A O *) apply(sum_uniquenessA B A O B); auto. Qed. Lemma sum_plg : forall A B C, Sum O E E' A B C -> (A <> O ) \/ ( B <> O) -> exists A', exists C', Plg O B C' A' /\ Plg C' A' A C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : @Sum Tn O E E' A B C) (_ : or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O))), @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Plg Tn O B C' A') (@Plg Tn C' A' A C))) *) intros. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Plg Tn O B C' A') (@Plg Tn C' A' A C))) *) assert(HS:=H). (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Plg Tn O B C' A') (@Plg Tn C' A' A C))) *) unfold Sum in H. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Plg Tn O B C' A') (@Plg Tn C' A' A C))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Plg Tn O B C' A') (@Plg Tn C' A' A C))) *) ex_and H1 A'. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Plg Tn O B C' A') (@Plg Tn C' A' A C))) *) ex_and H2 C'. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Plg Tn O B C' A') (@Plg Tn C' A' A C))) *) exists A'. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Plg Tn O B C' A') (@Plg Tn C' A' A C)) *) exists C'. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) unfold Pj in *. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) unfold Ar2 in H. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) assert(HH:= grid_not_par). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) spliter. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) induction(eq_dec_points O B). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) subst B. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A C) *) assert(HH:=sum_A_O A H12). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A C) *) assert(HP:=sum_uniqueness A O C A HS HH). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A C) *) subst C. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) induction H4. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) induction H4. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) apply False_ind. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: False *) apply H4. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E') (@Col Tn X O C')) *) exists O. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Col Tn O O E') (@Col Tn O O C') *) split; Col. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) spliter. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) induction H3. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) induction H3. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) apply False_ind. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: False *) apply H3. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C')) *) exists O. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Col Tn O O E) (@Col Tn O A' C') *) split. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: @Col Tn O A' C' *) (* Goal: @Col Tn O O E *) Col. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: @Col Tn O A' C' *) apply (col_transitivity_1 _ E'); Col. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) spliter. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) apply False_ind. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: False *) apply grid_ok. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: @Col Tn O E E' *) assert(Col C' O E). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: @Col Tn O E E' *) (* Goal: @Col Tn C' O E *) ColR. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) subst C'. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: and (@Plg Tn O O A' A') (@Plg Tn A' A' A A) *) split; apply parallelogram_to_plg; apply plg_trivial1. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: not (@eq (@Tpoint Tn) A' A) *) (* Goal: not (@eq (@Tpoint Tn) O A') *) auto. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: not (@eq (@Tpoint Tn) A' A) *) intro. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: False *) subst A'. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: False *) apply H. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A A) *) subst C'. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O O O A') (@Plg Tn O A' A A) *) apply False_ind. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: False *) induction H5. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: False *) (* Goal: False *) apply H6. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: False *) (* Goal: @Par Tn O E E E' *) apply par_symmetry. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: False *) (* Goal: @Par Tn E E' O E *) apply (par_col_par _ _ _ A); Col; Par. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: False *) subst A. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: False *) induction H0; tauto. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) induction(eq_dec_points A O). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) subst A. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O C) *) assert(HH:=sum_O_B B H13 ). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O C) *) assert(HP:=sum_uniqueness O B C B HS HH). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O C) *) subst C. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) clean_trivial_hyps. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) induction H1. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) induction H1. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) apply False_ind. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) (* Goal: False *) apply H1. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E') (@Col Tn X O A')) *) exists E'. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) (* Goal: and (@Col Tn E' E E') (@Col Tn E' O A') *) split; Col. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) spliter. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) apply False_ind. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) (* Goal: False *) apply H. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) (* Goal: @Col Tn O E E' *) apply (col_transitivity_1 _ A'); Col. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' O B) *) subst A'. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' O) (@Plg Tn C' O O B) *) clean_trivial_hyps. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' O) (@Plg Tn C' O O B) *) induction H5. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' O) (@Plg Tn C' O O B) *) (* Goal: and (@Plg Tn O B C' O) (@Plg Tn C' O O B) *) induction H4. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' O) (@Plg Tn C' O O B) *) (* Goal: and (@Plg Tn O B C' O) (@Plg Tn C' O O B) *) (* Goal: and (@Plg Tn O B C' O) (@Plg Tn C' O O B) *) apply False_ind. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' O) (@Plg Tn C' O O B) *) (* Goal: and (@Plg Tn O B C' O) (@Plg Tn C' O O B) *) (* Goal: False *) apply H8. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' O) (@Plg Tn C' O O B) *) (* Goal: and (@Plg Tn O B C' O) (@Plg Tn C' O O B) *) (* Goal: @Par Tn O E' E E' *) apply (par_trans _ _ B C'); Par. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' O) (@Plg Tn C' O O B) *) (* Goal: and (@Plg Tn O B C' O) (@Plg Tn C' O O B) *) subst C'. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' O) (@Plg Tn C' O O B) *) (* Goal: and (@Plg Tn O B B O) (@Plg Tn B O O B) *) split; apply parallelogram_to_plg; apply plg_trivial; auto. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' O) (@Plg Tn C' O O B) *) subst C'. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B B O) (@Plg Tn B O O B) *) split; apply parallelogram_to_plg; apply plg_trivial; auto. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) assert(A' <> O). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) intro. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: False *) subst A'. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: False *) induction H1. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: False *) (* Goal: False *) apply H6. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: False *) (* Goal: @Par Tn O E E E' *) apply par_symmetry. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: False *) (* Goal: @Par Tn E E' O E *) apply (par_col_par _ _ _ A); Col;Par. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: False *) contradiction. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) assert(A' <> O /\ (Par_strict O E A' C' \/ B = O)). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (not (@eq (@Tpoint Tn) A' O)) (or (@Par_strict Tn O E A' C') (@eq (@Tpoint Tn) B O)) *) apply(sum_par_strict A B C A' C');auto. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Ar2 Tn O E E' A B C *) repeat split; auto. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) spliter. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) induction H19. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) assert(Par O B C' A'). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Par Tn O B C' A' *) apply par_symmetry. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Par Tn C' A' O B *) apply (par_col_par _ _ _ E); finish. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) assert(Par_strict O B C' A'). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Par_strict Tn O B C' A' *) induction H20. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Par_strict Tn O B C' A' *) (* Goal: @Par_strict Tn O B C' A' *) auto. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Par_strict Tn O B C' A' *) spliter. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Par_strict Tn O B C' A' *) apply False_ind. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: False *) apply H19. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C')) *) exists O. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Col Tn O O E) (@Col Tn O A' C') *) split; Col. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) induction H4. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) assert(Par O A' B C'). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Par Tn O A' B C' *) apply par_symmetry. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Par Tn B C' O A' *) apply (par_col_par _ _ _ E'); Par; Col. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) assert(HX:= pars_par_plg O B C' A' H21 H22). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) assert(Par C' A' A C). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Par Tn C' A' A C *) apply(par_col_par _ _ _ O). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Col Tn A O C *) (* Goal: @Par Tn C' A' A O *) (* Goal: not (@eq (@Tpoint Tn) A C) *) intro. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Col Tn A O C *) (* Goal: @Par Tn C' A' A O *) (* Goal: False *) subst C. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Col Tn A O C *) (* Goal: @Par Tn C' A' A O *) (* Goal: False *) apply H15. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Col Tn A O C *) (* Goal: @Par Tn C' A' A O *) (* Goal: @eq (@Tpoint Tn) O B *) apply sym_equal. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Col Tn A O C *) (* Goal: @Par Tn C' A' A O *) (* Goal: @eq (@Tpoint Tn) B O *) apply(sum_A_B_A A); auto. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Col Tn A O C *) (* Goal: @Par Tn C' A' A O *) apply par_right_comm. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Col Tn A O C *) (* Goal: @Par Tn C' A' O A *) apply(par_col_par _ _ _ B). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Col Tn A O C *) (* Goal: @Col Tn O B A *) (* Goal: @Par Tn C' A' O B *) (* Goal: not (@eq (@Tpoint Tn) O A) *) auto. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Col Tn A O C *) (* Goal: @Col Tn O B A *) (* Goal: @Par Tn C' A' O B *) Par. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Col Tn A O C *) (* Goal: @Col Tn O B A *) ColR. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Col Tn A O C *) ColR. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) assert(Par_strict C' A' A C). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Par_strict Tn C' A' A C *) induction H23. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Par_strict Tn C' A' A C *) (* Goal: @Par_strict Tn C' A' A C *) auto. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Par_strict Tn C' A' A C *) spliter. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Par_strict Tn C' A' A C *) apply False_ind. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: False *) apply H19. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' C')) *) exists C'. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Col Tn C' O E) (@Col Tn C' A' C') *) split. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Col Tn C' A' C' *) (* Goal: @Col Tn C' O E *) ColR. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Col Tn C' A' C' *) Col. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) induction H1. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) induction H5. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) assert(Par C' C A' A). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Par Tn C' C A' A *) apply (par_trans _ _ E E'); Par. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) assert(HY:= pars_par_plg C' A' A C H24 H25). (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) split; auto. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) subst C'. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C A') (@Plg Tn C A' A C) *) assert_diffs;contradiction. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) split; Col. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Plg Tn C' A' A C *) subst A'. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Plg Tn C' A A C *) assert_diffs. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: @Plg Tn C' A A C *) contradiction. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) subst C'. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B B A') (@Plg Tn B A' A C) *) assert_diffs. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) (* Goal: and (@Plg Tn O B B A') (@Plg Tn B A' A C) *) contradiction. (* Goal: and (@Plg Tn O B C' A') (@Plg Tn C' A' A C) *) subst B. (* Goal: and (@Plg Tn O O C' A') (@Plg Tn C' A' A C) *) tauto. Qed. Lemma sum_cong : forall A B C, Sum O E E' A B C -> (A <> O \/ B <> O) -> Parallelogram_flat O A C B. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : @Sum Tn O E E' A B C) (_ : or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O))), @Parallelogram_flat Tn O A C B *) intros. (* Goal: @Parallelogram_flat Tn O A C B *) induction(eq_dec_points A O). (* Goal: @Parallelogram_flat Tn O A C B *) (* Goal: @Parallelogram_flat Tn O A C B *) subst A. (* Goal: @Parallelogram_flat Tn O A C B *) (* Goal: @Parallelogram_flat Tn O O C B *) assert(HP:= (sum_O_B_eq B C H)). (* Goal: @Parallelogram_flat Tn O A C B *) (* Goal: @Parallelogram_flat Tn O O C B *) subst C. (* Goal: @Parallelogram_flat Tn O A C B *) (* Goal: @Parallelogram_flat Tn O O B B *) induction H0. (* Goal: @Parallelogram_flat Tn O A C B *) (* Goal: @Parallelogram_flat Tn O O B B *) (* Goal: @Parallelogram_flat Tn O O B B *) tauto. (* Goal: @Parallelogram_flat Tn O A C B *) (* Goal: @Parallelogram_flat Tn O O B B *) assert(Parallelogram O O B B). (* Goal: @Parallelogram_flat Tn O A C B *) (* Goal: @Parallelogram_flat Tn O O B B *) (* Goal: @Parallelogram Tn O O B B *) apply plg_trivial1; auto. (* Goal: @Parallelogram_flat Tn O A C B *) (* Goal: @Parallelogram_flat Tn O O B B *) induction H1. (* Goal: @Parallelogram_flat Tn O A C B *) (* Goal: @Parallelogram_flat Tn O O B B *) (* Goal: @Parallelogram_flat Tn O O B B *) apply False_ind. (* Goal: @Parallelogram_flat Tn O A C B *) (* Goal: @Parallelogram_flat Tn O O B B *) (* Goal: False *) unfold Parallelogram_strict in H1. (* Goal: @Parallelogram_flat Tn O A C B *) (* Goal: @Parallelogram_flat Tn O O B B *) (* Goal: False *) spliter. (* Goal: @Parallelogram_flat Tn O A C B *) (* Goal: @Parallelogram_flat Tn O O B B *) (* Goal: False *) apply par_distincts in H2. (* Goal: @Parallelogram_flat Tn O A C B *) (* Goal: @Parallelogram_flat Tn O O B B *) (* Goal: False *) tauto. (* Goal: @Parallelogram_flat Tn O A C B *) (* Goal: @Parallelogram_flat Tn O O B B *) assumption. (* Goal: @Parallelogram_flat Tn O A C B *) assert(exists A' C' : Tpoint, Plg O B C' A' /\ Plg C' A' A C). (* Goal: @Parallelogram_flat Tn O A C B *) (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Plg Tn O B C' A') (@Plg Tn C' A' A C))) *) apply(sum_plg A B C); auto. (* Goal: @Parallelogram_flat Tn O A C B *) ex_and H2 A'. (* Goal: @Parallelogram_flat Tn O A C B *) ex_and H3 C'. (* Goal: @Parallelogram_flat Tn O A C B *) apply plg_to_parallelogram in H2. (* Goal: @Parallelogram_flat Tn O A C B *) apply plg_to_parallelogram in H3. (* Goal: @Parallelogram_flat Tn O A C B *) apply plgf_permut. (* Goal: @Parallelogram_flat Tn B O A C *) assert(HH:=plg_pseudo_trans O B C' A' A C H2 H3). (* Goal: @Parallelogram_flat Tn B O A C *) induction HH. (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Parallelogram_flat Tn B O A C *) induction H4. (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Parallelogram_flat Tn B O A C *) apply False_ind. (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: False *) apply H4. (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Col Tn A O C *) unfold Sum in H. (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Col Tn A O C *) spliter. (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Col Tn A O C *) unfold Ar2 in H. (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Col Tn A O C *) spliter. (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Col Tn A O C *) assert_diffs. (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Col Tn A O C *) ColR. (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Parallelogram_flat Tn B O A C *) apply plgf_comm2. (* Goal: @Parallelogram_flat Tn B O A C *) (* Goal: @Parallelogram_flat Tn O B C A *) auto. (* Goal: @Parallelogram_flat Tn B O A C *) spliter. (* Goal: @Parallelogram_flat Tn B O A C *) subst A. (* Goal: @Parallelogram_flat Tn B O C C *) apply False_ind. (* Goal: False *) subst C. (* Goal: False *) tauto. Qed. Lemma sum_cong2 : forall A B C, Sum O E E' A B C -> (A <> O \/ B <> O) -> (Cong O A B C /\ Cong O B A C). Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : @Sum Tn O E E' A B C) (_ : or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O))), and (@Cong Tn O A B C) (@Cong Tn O B A C) *) intros. (* Goal: and (@Cong Tn O A B C) (@Cong Tn O B A C) *) apply sum_cong in H. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) (* Goal: and (@Cong Tn O A B C) (@Cong Tn O B A C) *) unfold Parallelogram_flat in *. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) (* Goal: and (@Cong Tn O A B C) (@Cong Tn O B A C) *) spliter;split;Cong. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) assumption. Qed. Lemma sum_comm : forall A B C, Sum O E E' A B C -> Sum O E E' B A C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : @Sum Tn O E E' A B C), @Sum Tn O E E' B A C *) intros. (* Goal: @Sum Tn O E E' B A C *) induction (eq_dec_points B O). (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' B A C *) subst B. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' O A C *) assert(Col O E A). (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' O A C *) (* Goal: @Col Tn O E A *) unfold Sum in H. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' O A C *) (* Goal: @Col Tn O E A *) spliter. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' O A C *) (* Goal: @Col Tn O E A *) unfold Ar2 in H. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' O A C *) (* Goal: @Col Tn O E A *) tauto. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' O A C *) assert(C = A). (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' O A C *) (* Goal: @eq (@Tpoint Tn) C A *) apply (sum_uniqueness A O). (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' O A C *) (* Goal: @Sum Tn O E E' A O A *) (* Goal: @Sum Tn O E E' A O C *) auto. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' O A C *) (* Goal: @Sum Tn O E E' A O A *) apply sum_A_O. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' O A C *) (* Goal: @Col Tn O E A *) auto. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' O A C *) subst C. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' O A A *) apply sum_O_B. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Col Tn O E A *) auto. (* Goal: @Sum Tn O E E' B A C *) induction(eq_dec_points A O). (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' B A C *) subst A. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' B O C *) assert(Col O E B). (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' B O C *) (* Goal: @Col Tn O E B *) unfold Sum in H. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' B O C *) (* Goal: @Col Tn O E B *) spliter. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' B O C *) (* Goal: @Col Tn O E B *) unfold Ar2 in H. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' B O C *) (* Goal: @Col Tn O E B *) tauto. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' B O C *) assert(B = C). (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' B O C *) (* Goal: @eq (@Tpoint Tn) B C *) apply (sum_uniqueness O B). (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' B O C *) (* Goal: @Sum Tn O E E' O B C *) (* Goal: @Sum Tn O E E' O B B *) apply sum_O_B. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' B O C *) (* Goal: @Sum Tn O E E' O B C *) (* Goal: @Col Tn O E B *) Col. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' B O C *) (* Goal: @Sum Tn O E E' O B C *) auto. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' B O C *) subst C. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Sum Tn O E E' B O B *) apply sum_A_O. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Col Tn O E B *) Col. (* Goal: @Sum Tn O E E' B A C *) assert(A <> O \/ B <> O). (* Goal: @Sum Tn O E E' B A C *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) left. (* Goal: @Sum Tn O E E' B A C *) (* Goal: not (@eq (@Tpoint Tn) A O) *) auto. (* Goal: @Sum Tn O E E' B A C *) assert(HH:=grid_not_par). (* Goal: @Sum Tn O E E' B A C *) spliter. (* Goal: @Sum Tn O E E' B A C *) assert(HH := sum_plg A B C H H2). (* Goal: @Sum Tn O E E' B A C *) ex_and HH A'. (* Goal: @Sum Tn O E E' B A C *) ex_and H9 C'. (* Goal: @Sum Tn O E E' B A C *) assert(exists ! P' : Tpoint, Proj B P' O E' E E'). (* Goal: @Sum Tn O E E' B A 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'); auto. (* Goal: @Sum Tn O E E' B A C *) (* Goal: not (@Par Tn E E' O E') *) intro. (* Goal: @Sum Tn O E E' B A C *) (* Goal: False *) apply H5. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Par Tn O E' E E' *) Par. (* Goal: @Sum Tn O E E' B A C *) unfold unique in H11. (* Goal: @Sum Tn O E E' B A C *) ex_and H11 B'. (* Goal: @Sum Tn O E E' B A C *) clear H12. (* Goal: @Sum Tn O E E' B A C *) assert(HH:= parallel_existence1 O E B' H6). (* Goal: @Sum Tn O E E' B A C *) ex_and HH P'. (* Goal: @Sum Tn O E E' B A C *) assert(exists! P : Tpoint, Proj A P B' P' O E'). (* Goal: @Sum Tn O E E' B A C *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P : @Tpoint Tn => @Proj Tn A P B' P' O E')) *) apply(project_existence A B' P' O E'); auto. (* Goal: @Sum Tn O E E' B A C *) (* Goal: not (@Par Tn O E' B' P') *) (* Goal: not (@eq (@Tpoint Tn) B' P') *) apply par_distincts in H12. (* Goal: @Sum Tn O E E' B A C *) (* Goal: not (@Par Tn O E' B' P') *) (* Goal: not (@eq (@Tpoint Tn) B' P') *) spliter. (* Goal: @Sum Tn O E E' B A C *) (* Goal: not (@Par Tn O E' B' P') *) (* Goal: not (@eq (@Tpoint Tn) B' P') *) auto. (* Goal: @Sum Tn O E E' B A C *) (* Goal: not (@Par Tn O E' B' P') *) intro. (* Goal: @Sum Tn O E E' B A C *) (* Goal: False *) apply H4. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Par Tn O E O E' *) apply(par_trans _ _ B' P'); Par. (* Goal: @Sum Tn O E E' B A C *) unfold unique in H13. (* Goal: @Sum Tn O E E' B A C *) ex_and H13 D'. (* Goal: @Sum Tn O E E' B A C *) clear H14. (* Goal: @Sum Tn O E E' B A C *) assert( Ar2 O E E' A B C). (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Ar2 Tn O E E' A B C *) unfold Sum in H. (* Goal: @Sum Tn O E E' B A C *) (* Goal: @Ar2 Tn O E E' A B C *) tauto. (* Goal: @Sum Tn O E E' B A C *) assert(HH:= sum_to_sump O E E' A B C H). (* Goal: @Sum Tn O E E' B A C *) unfold Sump in H13. (* Goal: @Sum Tn O E E' B A C *) apply sump_to_sum. (* Goal: @Sump Tn O E E' B A C *) unfold Sump. (* Goal: and (@Col Tn O E B) (and (@Col Tn O E A) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn B A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' C O E E E')))))))) *) unfold Ar2 in H14. (* Goal: and (@Col Tn O E B) (and (@Col Tn O E A) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn B A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' C O E E E')))))))) *) spliter. (* Goal: and (@Col Tn O E B) (and (@Col Tn O E A) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn B A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' C O E E E')))))))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn B A' O E' E E') (and (@Par Tn O E A' P') (and (@Proj Tn A C' A' P' O E') (@Proj Tn C' C O E E E')))))) *) exists B'. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn B B' O E' E E') (and (@Par Tn O E B' P') (and (@Proj Tn A C' B' P' O E') (@Proj Tn C' C O E E E'))))) *) exists D'. (* Goal: @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => and (@Proj Tn B B' O E' E E') (and (@Par Tn O E B' P') (and (@Proj Tn A D' B' P' O E') (@Proj Tn D' C O E E E')))) *) exists P'. (* Goal: and (@Proj Tn B B' O E' E E') (and (@Par Tn O E B' P') (and (@Proj Tn A D' B' P' O E') (@Proj Tn D' C O E E E'))) *) split; auto. (* Goal: and (@Par Tn O E B' P') (and (@Proj Tn A D' B' P' O E') (@Proj Tn D' C O E E E')) *) split; auto. (* Goal: and (@Proj Tn A D' B' P' O E') (@Proj Tn D' C O E E E') *) split; auto. (* Goal: @Proj Tn D' C O E E E' *) assert(Par_strict O E B' P'). (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par_strict Tn O E B' P' *) induction H12. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par_strict Tn O E B' P' *) (* Goal: @Par_strict Tn O E B' P' *) auto. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par_strict Tn O E B' P' *) spliter. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par_strict Tn O E B' P' *) apply False_ind. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) assert(HA:=H11). (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) unfold Proj in H11. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) spliter. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) assert(Col B' O E). (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) (* Goal: @Col Tn B' O E *) apply (col_transitivity_1 _ P'); Col. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) assert(B' <> O). (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) (* Goal: False *) subst B'. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) (* Goal: False *) apply project_id in HA. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) (* Goal: @Col Tn O E' B *) (* Goal: False *) contradiction. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) (* Goal: @Col Tn O E' B *) induction H24. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) (* Goal: @Col Tn O E' B *) (* Goal: @Col Tn O E' B *) induction H24. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) (* Goal: @Col Tn O E' B *) (* Goal: @Col Tn O E' B *) (* Goal: @Col Tn O E' B *) apply False_ind. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) (* Goal: @Col Tn O E' B *) (* Goal: @Col Tn O E' B *) (* Goal: False *) apply H24. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) (* Goal: @Col Tn O E' 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: @Proj Tn D' C O E E E' *) (* Goal: False *) (* Goal: @Col Tn O E' B *) (* Goal: @Col Tn O E' B *) (* Goal: and (@Col Tn E B O) (@Col Tn E E E') *) split; Col. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) (* Goal: @Col Tn O E' B *) (* Goal: @Col Tn O E' B *) spliter. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) (* Goal: @Col Tn O E' B *) (* Goal: @Col Tn O E' B *) contradiction. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) (* Goal: @Col Tn O E' B *) contradiction. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) apply grid_ok. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn O E E' *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Proj Tn D' C O E E E' *) assert(Par O A B' D'). (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par Tn O A B' D' *) apply (par_col_par _ _ _ P'). (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) intro. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) (* Goal: False *) subst D'. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) (* Goal: False *) unfold Proj in *. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) (* Goal: False *) spliter. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) (* Goal: False *) induction H22. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) (* Goal: False *) (* Goal: False *) induction H22. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H22. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B') (@Col Tn X O E')) *) exists B'. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn B' A B') (@Col Tn B' O E') *) split; Col. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) (* Goal: False *) (* Goal: False *) apply grid_ok. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) (* Goal: False *) (* Goal: @Col Tn O E E' *) apply (col_transitivity_1 _ A); Col. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) (* Goal: False *) subst B'. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) (* Goal: False *) apply H18. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A P')) *) exists A. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) (* Goal: and (@Col Tn A O E) (@Col Tn A A P') *) split; Col. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn O A B' P' *) apply par_symmetry. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) (* Goal: @Par Tn B' P' O A *) apply (par_col_par _ _ _ E); Col; Par. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) unfold Proj in H13. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) spliter. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' D' *) Col. (* Goal: @Proj Tn D' C O E E E' *) assert(Par_strict O A B' D'). (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par_strict Tn O A B' D' *) induction H19. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par_strict Tn O A B' D' *) (* Goal: @Par_strict Tn O A B' D' *) auto. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par_strict Tn O A B' D' *) spliter. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par_strict Tn O A B' D' *) apply False_ind. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) apply H18. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X B' P')) *) unfold Proj in H13. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X B' P')) *) spliter. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X B' P')) *) exists O. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: and (@Col Tn O O E) (@Col Tn O B' P') *) split. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn O B' P' *) (* Goal: @Col Tn O O E *) Col. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn O B' P' *) apply col_permutation_2. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Col Tn B' P' O *) apply (col_transitivity_1 _ D'); Col. (* Goal: @Proj Tn D' C O E E E' *) assert(Par O B' A D'). (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par Tn O B' A D' *) unfold Proj in H13. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par Tn O B' A D' *) spliter. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par Tn O B' A D' *) induction H24. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par Tn O B' A D' *) (* Goal: @Par Tn O B' A D' *) apply par_symmetry. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par Tn O B' A D' *) (* Goal: @Par Tn A D' O B' *) apply(par_col_par _ _ _ E'); Par. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par Tn O B' A D' *) (* Goal: @Col Tn O E' B' *) (* Goal: not (@eq (@Tpoint Tn) O B') *) intro. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par Tn O B' A D' *) (* Goal: @Col Tn O E' B' *) (* Goal: False *) subst B'. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par Tn O B' A D' *) (* Goal: @Col Tn O E' B' *) (* Goal: False *) apply H20. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par Tn O B' A D' *) (* Goal: @Col Tn O E' B' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O A) (@Col Tn X O D')) *) exists O. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par Tn O B' A D' *) (* Goal: @Col Tn O E' B' *) (* Goal: and (@Col Tn O O A) (@Col Tn O O D') *) split;Col. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par Tn O B' A D' *) (* Goal: @Col Tn O E' B' *) unfold Proj in H11. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par Tn O B' A D' *) (* Goal: @Col Tn O E' B' *) spliter. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par Tn O B' A D' *) (* Goal: @Col Tn O E' B' *) auto. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par Tn O B' A D' *) subst D'. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Par Tn O B' A A *) apply False_ind. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) apply H20. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O A) (@Col Tn X B' A)) *) exists A. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: and (@Col Tn A O A) (@Col Tn A B' A) *) split; Col. (* Goal: @Proj Tn D' C O E E E' *) assert(Plg O A D' B'). (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Plg Tn O A D' B' *) apply(pars_par_plg O A D' B' ); Par. (* Goal: @Proj Tn D' C O E E E' *) assert(HT:=sum_cong A B C H H2). (* Goal: @Proj Tn D' C O E E E' *) assert(Parallelogram D' B' B C \/ D' = B' /\ O = A /\ C = B /\ D' = C). (* Goal: @Proj Tn D' C O E E E' *) (* Goal: or (@Parallelogram Tn D' B' B C) (and (@eq (@Tpoint Tn) D' B') (and (@eq (@Tpoint Tn) O A) (and (@eq (@Tpoint Tn) C B) (@eq (@Tpoint Tn) D' C)))) *) apply(plg_pseudo_trans D' B' O A C B). (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Parallelogram Tn O A C B *) (* Goal: @Parallelogram Tn D' B' O A *) apply plg_to_parallelogram in H22. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Parallelogram Tn O A C B *) (* Goal: @Parallelogram Tn D' B' O A *) apply plg_permut in H22. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Parallelogram Tn O A C B *) (* Goal: @Parallelogram Tn D' B' O A *) apply plg_permut in H22. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Parallelogram Tn O A C B *) (* Goal: @Parallelogram Tn D' B' O A *) auto. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Parallelogram Tn O A C B *) right. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Parallelogram_flat Tn O A C B *) auto. (* Goal: @Proj Tn D' C O E E E' *) induction H23. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: @Proj Tn D' C O E E E' *) repeat split; auto. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: or (@Par Tn D' C E E') (@eq (@Tpoint Tn) D' C) *) apply plg_permut in H23. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: or (@Par Tn D' C E E') (@eq (@Tpoint Tn) D' C) *) apply plg_par in H23. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) (* Goal: or (@Par Tn D' C E E') (@eq (@Tpoint Tn) D' C) *) unfold Proj in *. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) (* Goal: or (@Par Tn D' C E E') (@eq (@Tpoint Tn) D' C) *) spliter. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) (* Goal: or (@Par Tn D' C E E') (@eq (@Tpoint Tn) D' C) *) induction H32. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) (* Goal: or (@Par Tn D' C E E') (@eq (@Tpoint Tn) D' C) *) (* Goal: or (@Par Tn D' C E E') (@eq (@Tpoint Tn) D' C) *) left. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) (* Goal: or (@Par Tn D' C E E') (@eq (@Tpoint Tn) D' C) *) (* Goal: @Par Tn D' C E E' *) apply (par_trans _ _ B B'); Par. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) (* Goal: or (@Par Tn D' C E E') (@eq (@Tpoint Tn) D' C) *) subst B'. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) (* Goal: or (@Par Tn D' C E E') (@eq (@Tpoint Tn) D' C) *) apply par_distincts in H23. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) (* Goal: or (@Par Tn D' C E E') (@eq (@Tpoint Tn) D' C) *) tauto. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) intro. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) (* Goal: False *) subst B'. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) (* Goal: False *) apply H20. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O A) (@Col Tn X B D')) *) exists B. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) (* Goal: and (@Col Tn B O A) (@Col Tn B B D') *) split. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) (* Goal: @Col Tn B B D' *) (* Goal: @Col Tn B O A *) ColR. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) (* Goal: @Col Tn B B D' *) Col. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) intro. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) subst C. (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) assert(HN:= sum_A_null A B H). (* Goal: @Proj Tn D' C O E E E' *) (* Goal: False *) contradiction. (* Goal: @Proj Tn D' C O E E E' *) spliter. (* Goal: @Proj Tn D' C O E E E' *) subst A. (* Goal: @Proj Tn D' C O E E E' *) tauto. Qed. Lemma cong_sum : forall A B C, O <> C \/ B <> A -> Ar2 O E E' A B C -> Cong O A B C -> Cong O B A C -> Sum O E E' A B C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : or (not (@eq (@Tpoint Tn) O C)) (not (@eq (@Tpoint Tn) B A))) (_ : @Ar2 Tn O E E' A B C) (_ : @Cong Tn O A B C) (_ : @Cong Tn O B A C), @Sum Tn O E E' A B C *) intros A B C. (* Goal: forall (_ : or (not (@eq (@Tpoint Tn) O C)) (not (@eq (@Tpoint Tn) B A))) (_ : @Ar2 Tn O E E' A B C) (_ : @Cong Tn O A B C) (_ : @Cong Tn O B A C), @Sum Tn O E E' A B C *) intro Hor. (* Goal: forall (_ : @Ar2 Tn O E E' A B C) (_ : @Cong Tn O A B C) (_ : @Cong Tn O B A C), @Sum Tn O E E' A B C *) intros. (* Goal: @Sum Tn O E E' A B C *) induction (eq_dec_points A O). (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A B C *) subst A. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' O B C *) unfold Ar2 in H. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' O B C *) spliter. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' O B C *) apply cong_symmetry in H0. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' O B C *) apply cong_identity in H0. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' O B C *) subst C. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' O B B *) apply sum_O_B; Col. (* Goal: @Sum Tn O E E' A B C *) induction (eq_dec_points B O). (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A B C *) subst B. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A O C *) unfold Ar2 in H. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A O C *) spliter. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A O C *) apply cong_symmetry in H1. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A O C *) apply cong_identity in H1. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A O C *) subst C. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A O A *) apply sum_A_O; Col. (* Goal: @Sum Tn O E E' A B C *) unfold Sum. (* Goal: and (@Ar2 Tn O E E' A B C) (@ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C))))))) *) split; auto. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) unfold Ar2 in H. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) assert(HH:=grid_not_par). (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) assert(exists ! P' : Tpoint, Proj A P' O E' E E'). (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' 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'); auto. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: not (@Par Tn E E' O E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: False *) apply H6. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: @Par Tn O E' E E' *) Par. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) ex_and H13 A'. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) unfold unique in H14. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) clear H14. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) unfold Proj in H13. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) clean_duplicated_hyps. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) assert(HH:=parallel_existence1 O E A' H7). (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) ex_and HH P'. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) assert(exists ! C' : Tpoint, Proj B C' A' P' O E'). (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun C' : @Tpoint Tn => @Proj Tn B C' A' P' O E')) *) apply(project_existence B A' P' O E'); auto. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: not (@Par Tn O E' A' P') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) apply par_distincts in H. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: not (@Par Tn O E' A' P') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: not (@Par Tn O E' A' P') *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) auto. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: not (@Par Tn O E' A' P') *) intro. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: False *) apply H5. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) (* Goal: @Par Tn O E O E' *) apply(par_trans _ _ A' P'); Par. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) ex_and H13 C'. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) unfold unique in H14. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) clear H14. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) unfold Proj in H13. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))))) *) exists A'. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C))))) *) exists C'. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) assert(A' <> O). (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) intro. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) subst A'. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) induction H17. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) (* Goal: False *) induction H17. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H17. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* 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: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn E A O) (@Col Tn E E E') *) split; Col. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) (* Goal: False *) contradiction. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) contradiction. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) assert(Par_strict O E A' P'). (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: @Par_strict Tn O E A' P' *) unfold Par_strict. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (not (@eq (@Tpoint Tn) A' P')) (and (@Coplanar Tn O E A' P') (not (@ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' P')))))) *) repeat split; auto; try apply all_coplanar. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: not (@ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' P'))) *) intro. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) ex_and H21 X. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) induction H. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) (* Goal: False *) apply H. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' P')) *) exists X. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) (* Goal: and (@Col Tn X O E) (@Col Tn X A' P') *) split; Col. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) spliter. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) apply grid_ok. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) assert(A <> A'). (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: not (@eq (@Tpoint Tn) A A') *) intro. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) subst A'. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: False *) apply H21. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A P')) *) exists A. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) (* Goal: and (@Col Tn A O E) (@Col Tn A A P') *) split; Col. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' E C' C)))) *) repeat split; Col. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Pj Tn O E A' C' *) (* Goal: @Pj Tn E E' A A' *) induction H17. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Pj Tn O E A' C' *) (* Goal: @Pj Tn E E' A A' *) (* Goal: @Pj Tn E E' A A' *) left; Par. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Pj Tn O E A' C' *) (* Goal: @Pj Tn E E' A A' *) right; auto. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Pj Tn O E A' C' *) left. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Par Tn O E A' C' *) apply (par_col_par _ _ _ P'). (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) intro. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) (* Goal: False *) subst C'. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) (* Goal: False *) induction H19. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) (* Goal: False *) (* Goal: False *) induction H19. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H19. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B A') (@Col Tn X O E')) *) exists A'. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn A' B A') (@Col Tn A' O E') *) split; Col. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) (* Goal: False *) (* Goal: False *) apply grid_ok. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) (* Goal: False *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) (* Goal: False *) subst A'. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) (* Goal: False *) apply H21. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X B P')) *) exists B. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) (* Goal: and (@Col Tn B O E) (@Col Tn B B P') *) split; Col. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par Tn O E A' P' *) Par. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Col Tn A' P' C' *) Col. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) induction H19. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Pj Tn O E' B C' *) left. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) (* Goal: @Par Tn O E' B C' *) Par. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn O E' B C' *) right. (* Goal: @Pj Tn E' E C' C *) (* Goal: @eq (@Tpoint Tn) B C' *) auto. (* Goal: @Pj Tn E' E C' C *) assert(A' <> C'). (* Goal: @Pj Tn E' E C' C *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) intro. (* Goal: @Pj Tn E' E C' C *) (* Goal: False *) subst C'. (* Goal: @Pj Tn E' E C' C *) (* Goal: False *) induction H19. (* Goal: @Pj Tn E' E C' C *) (* Goal: False *) (* Goal: False *) induction H19. (* Goal: @Pj Tn E' E C' C *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H19. (* Goal: @Pj Tn E' E C' C *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B A') (@Col Tn X O E')) *) exists A'. (* Goal: @Pj Tn E' E C' C *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn A' B A') (@Col Tn A' O E') *) split; Col. (* Goal: @Pj Tn E' E C' C *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Pj Tn E' E C' C *) (* Goal: False *) (* Goal: False *) apply grid_ok. (* Goal: @Pj Tn E' E C' C *) (* Goal: False *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E' E C' C *) (* Goal: False *) subst A'. (* Goal: @Pj Tn E' E C' C *) (* Goal: False *) apply H21. (* Goal: @Pj Tn E' E C' C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X B P')) *) exists B. (* Goal: @Pj Tn E' E C' C *) (* Goal: and (@Col Tn B O E) (@Col Tn B B P') *) split; Col. (* Goal: @Pj Tn E' E C' C *) assert(Plg O B C' A'). (* Goal: @Pj Tn E' E C' C *) (* Goal: @Plg Tn O B C' A' *) apply(pars_par_plg O B C' A'). (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B C' *) (* Goal: @Par_strict Tn O B C' A' *) apply par_strict_right_comm. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B C' *) (* Goal: @Par_strict Tn O B A' C' *) apply(par_strict_col_par_strict _ _ _ P'). (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par_strict Tn O B A' P' *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) auto. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par_strict Tn O B A' P' *) apply par_strict_symmetry. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Par_strict Tn A' P' O B *) apply(par_strict_col_par_strict _ _ _ E). (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn O E B *) (* Goal: @Par_strict Tn A' P' O E *) (* Goal: not (@eq (@Tpoint Tn) O B) *) auto. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn O E B *) (* Goal: @Par_strict Tn A' P' O E *) Par. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B C' *) (* Goal: @Col Tn A' P' C' *) (* Goal: @Col Tn O E B *) Col. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B C' *) (* Goal: @Col Tn A' P' C' *) Col. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B C' *) induction H19. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B C' *) (* Goal: @Par Tn O A' B C' *) apply par_symmetry. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B C' *) (* Goal: @Par Tn B C' O A' *) apply(par_col_par _ _ _ E'). (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B C' *) (* Goal: @Col Tn O E' A' *) (* Goal: @Par Tn B C' O E' *) (* Goal: not (@eq (@Tpoint Tn) O A') *) auto. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B C' *) (* Goal: @Col Tn O E' A' *) (* Goal: @Par Tn B C' O E' *) Par. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B C' *) (* Goal: @Col Tn O E' A' *) Col. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B C' *) subst C'. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn O A' B B *) apply False_ind. (* Goal: @Pj Tn E' E C' C *) (* Goal: False *) apply H21. (* Goal: @Pj Tn E' E C' C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' P')) *) exists B. (* Goal: @Pj Tn E' E C' C *) (* Goal: and (@Col Tn B O E) (@Col Tn B A' P') *) split; Col. (* Goal: @Pj Tn E' E C' C *) assert(Plg O B C A). (* Goal: @Pj Tn E' E C' C *) (* Goal: @Plg Tn O B C A *) apply(parallelogram_to_plg). (* Goal: @Pj Tn E' E C' C *) (* Goal: @Parallelogram Tn O B C A *) right. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Parallelogram_flat Tn O B C A *) unfold Parallelogram_flat. (* Goal: @Pj Tn E' E C' C *) (* Goal: and (@Col Tn O B C) (and (@Col Tn O B A) (and (@Cong Tn O B C A) (and (@Cong Tn O A C B) (or (not (@eq (@Tpoint Tn) O C)) (not (@eq (@Tpoint Tn) B A)))))) *) repeat split; try ColR. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Cong Tn O A C B *) (* Goal: @Cong Tn O B C A *) Cong. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Cong Tn O A C B *) Cong. (* Goal: @Pj Tn E' E C' C *) auto. (* Goal: @Pj Tn E' E C' C *) apply plg_to_parallelogram in H24. (* Goal: @Pj Tn E' E C' C *) apply plg_to_parallelogram in H25. (* Goal: @Pj Tn E' E C' C *) assert(Parallelogram A C C' A'). (* Goal: @Pj Tn E' E C' C *) (* Goal: @Parallelogram Tn A C C' A' *) assert(Parallelogram C A A' C' \/ C = A /\ O = B /\ C' = A' /\ C = C'). (* Goal: @Pj Tn E' E C' C *) (* Goal: @Parallelogram Tn A C C' A' *) (* Goal: or (@Parallelogram Tn C A A' C') (and (@eq (@Tpoint Tn) C A) (and (@eq (@Tpoint Tn) O B) (and (@eq (@Tpoint Tn) C' A') (@eq (@Tpoint Tn) C C')))) *) apply(plg_pseudo_trans C A O B C' A'). (* Goal: @Pj Tn E' E C' C *) (* Goal: @Parallelogram Tn A C C' A' *) (* Goal: @Parallelogram Tn O B C' A' *) (* Goal: @Parallelogram Tn C A O B *) apply plg_permut. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Parallelogram Tn A C C' A' *) (* Goal: @Parallelogram Tn O B C' A' *) (* Goal: @Parallelogram Tn B C A O *) apply plg_permut. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Parallelogram Tn A C C' A' *) (* Goal: @Parallelogram Tn O B C' A' *) (* Goal: @Parallelogram Tn O B C A *) assumption. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Parallelogram Tn A C C' A' *) (* Goal: @Parallelogram Tn O B C' A' *) assumption. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Parallelogram Tn A C C' A' *) induction H26. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Parallelogram Tn A C C' A' *) (* Goal: @Parallelogram Tn A C C' A' *) apply plg_comm2. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Parallelogram Tn A C C' A' *) (* Goal: @Parallelogram Tn C A A' C' *) assumption. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Parallelogram Tn A C C' A' *) spliter. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Parallelogram Tn A C C' A' *) subst C'. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Parallelogram Tn A C A' A' *) subst A'. (* Goal: @Pj Tn E' E C' C *) (* Goal: @Parallelogram Tn A C C C *) tauto. (* Goal: @Pj Tn E' E C' C *) apply plg_par in H26. (* Goal: not (@eq (@Tpoint Tn) C C') *) (* Goal: not (@eq (@Tpoint Tn) A C) *) (* Goal: @Pj Tn E' E C' C *) spliter. (* Goal: not (@eq (@Tpoint Tn) C C') *) (* Goal: not (@eq (@Tpoint Tn) A C) *) (* Goal: @Pj Tn E' E C' C *) induction H17. (* Goal: not (@eq (@Tpoint Tn) C C') *) (* Goal: not (@eq (@Tpoint Tn) A C) *) (* Goal: @Pj Tn E' E C' C *) (* Goal: @Pj Tn E' E C' C *) left. (* Goal: not (@eq (@Tpoint Tn) C C') *) (* Goal: not (@eq (@Tpoint Tn) A C) *) (* Goal: @Pj Tn E' E C' C *) (* Goal: @Par Tn E' E C' C *) apply(par_trans _ _ A A'); Par. (* Goal: not (@eq (@Tpoint Tn) C C') *) (* Goal: not (@eq (@Tpoint Tn) A C) *) (* Goal: @Pj Tn E' E C' C *) contradiction. (* Goal: not (@eq (@Tpoint Tn) C C') *) (* Goal: not (@eq (@Tpoint Tn) A C) *) intro. (* Goal: not (@eq (@Tpoint Tn) C C') *) (* Goal: False *) subst C. (* Goal: not (@eq (@Tpoint Tn) C C') *) (* Goal: False *) apply cong_identity in H1. (* Goal: not (@eq (@Tpoint Tn) C C') *) (* Goal: False *) subst B. (* Goal: not (@eq (@Tpoint Tn) C C') *) (* Goal: False *) tauto. (* Goal: not (@eq (@Tpoint Tn) C C') *) intro. (* Goal: False *) subst C'. (* Goal: False *) apply plg_permut in H26. (* Goal: False *) induction H19. (* Goal: False *) (* Goal: False *) induction H19. (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H19. (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C) (@Col Tn X O E')) *) exists O. (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn O B C) (@Col Tn O O E') *) split; Col. (* Goal: False *) (* Goal: False *) (* Goal: @Col Tn O B C *) ColR. (* Goal: False *) (* Goal: False *) spliter. (* Goal: False *) (* Goal: False *) apply grid_ok. (* Goal: False *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: False *) subst C. (* Goal: False *) apply H21. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A' P')) *) exists B. (* Goal: and (@Col Tn B O E) (@Col Tn B A' P') *) split; Col. Qed. Lemma sum_iff_cong : forall A B C, Ar2 O E E' A B C -> (O <> C \/ B <> A) -> ((Cong O A B C /\ Cong O B A C) <-> Sum O E E' A B C). Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : @Ar2 Tn O E E' A B C) (_ : or (not (@eq (@Tpoint Tn) O C)) (not (@eq (@Tpoint Tn) B A))), iff (and (@Cong Tn O A B C) (@Cong Tn O B A C)) (@Sum Tn O E E' A B C) *) intros. (* Goal: iff (and (@Cong Tn O A B C) (@Cong Tn O B A C)) (@Sum Tn O E E' A B C) *) split. (* Goal: forall _ : @Sum Tn O E E' A B C, and (@Cong Tn O A B C) (@Cong Tn O B A C) *) (* Goal: forall _ : and (@Cong Tn O A B C) (@Cong Tn O B A C), @Sum Tn O E E' A B C *) intros. (* Goal: forall _ : @Sum Tn O E E' A B C, and (@Cong Tn O A B C) (@Cong Tn O B A C) *) (* Goal: @Sum Tn O E E' A B C *) apply cong_sum;intuition idtac. (* Goal: forall _ : @Sum Tn O E E' A B C, and (@Cong Tn O A B C) (@Cong Tn O B A C) *) intros. (* Goal: and (@Cong Tn O A B C) (@Cong Tn O B A C) *) apply sum_cong2. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) (* Goal: @Sum Tn O E E' A B C *) assumption. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) destruct H. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) elim (eq_dec_points A O); intro. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) subst. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) (* Goal: or (not (@eq (@Tpoint Tn) O O)) (not (@eq (@Tpoint Tn) B O)) *) right. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) (* Goal: not (@eq (@Tpoint Tn) B O) *) intro. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) subst. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) assert (T:= sum_O_O). (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) destruct H0. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: False *) apply H0. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) (* Goal: @eq (@Tpoint Tn) O C *) eauto using sum_uniqueness. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) (* Goal: False *) intuition. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) intuition. Qed. Lemma opp_comm : forall X Y, Opp O E E' X Y -> Opp O E E' Y X. Proof. (* Goal: forall (X Y : @Tpoint Tn) (_ : @Opp Tn O E E' X Y), @Opp Tn O E E' Y X *) intros. (* Goal: @Opp Tn O E E' Y X *) unfold Opp in *. (* Goal: @Sum Tn O E E' X Y O *) apply sum_comm. (* Goal: @Sum Tn O E E' Y X O *) auto. Qed. Lemma opp_uniqueness : forall A MA1 MA2, Opp O E E' A MA1 -> Opp O E E' A MA2 -> MA1 = MA2. Proof. (* Goal: forall (A MA1 MA2 : @Tpoint Tn) (_ : @Opp Tn O E E' A MA1) (_ : @Opp Tn O E E' A MA2), @eq (@Tpoint Tn) MA1 MA2 *) intros. (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) unfold Opp in *. (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) apply sum_comm in H. (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) apply sum_comm in H0. (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) induction(eq_dec_points A O). (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) subst A. (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) assert(HH:=sum_uniquenessB O MA1 MA2 O H H0). (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) assumption. (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) apply sum_plg in H. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) apply sum_plg in H0. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) ex_and H A'. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) ex_and H2 C'. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) ex_and H0 A''. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) ex_and H3 C''. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) apply plg_to_parallelogram in H. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) apply plg_to_parallelogram in H0. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) apply plg_to_parallelogram in H2. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) apply plg_to_parallelogram in H3. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) assert(Parallelogram C' A' A'' C'' \/ C' = A' /\ A = O /\ C'' = A'' /\ C' = C''). (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: or (@Parallelogram Tn C' A' A'' C'') (and (@eq (@Tpoint Tn) C' A') (and (@eq (@Tpoint Tn) A O) (and (@eq (@Tpoint Tn) C'' A'') (@eq (@Tpoint Tn) C' C'')))) *) apply(plg_pseudo_trans C' A' A O C'' A''); auto. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @Parallelogram Tn A O C'' A'' *) apply plg_permut. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @Parallelogram Tn A'' A O C'' *) apply plg_permut. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @Parallelogram Tn C'' A'' A O *) auto. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) induction H4. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) assert(Parallelogram O MA1 C'' A'' \/ O = MA1 /\ C' = A' /\ A'' = C'' /\ O = A''). (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: or (@Parallelogram Tn O MA1 C'' A'') (and (@eq (@Tpoint Tn) O MA1) (and (@eq (@Tpoint Tn) C' A') (and (@eq (@Tpoint Tn) A'' C'') (@eq (@Tpoint Tn) O A'')))) *) apply(plg_pseudo_trans O MA1 C' A' A'' C''); auto. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) induction H5. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) assert(Parallelogram O MA1 MA2 O \/ O = MA1 /\ C'' = A'' /\ O = MA2 /\ O = O). (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: or (@Parallelogram Tn O MA1 MA2 O) (and (@eq (@Tpoint Tn) O MA1) (and (@eq (@Tpoint Tn) C'' A'') (and (@eq (@Tpoint Tn) O MA2) (@eq (@Tpoint Tn) O O)))) *) apply(plg_pseudo_trans O MA1 C'' A'' O MA2); auto. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @Parallelogram Tn C'' A'' O MA2 *) apply plg_permut. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @Parallelogram Tn MA2 C'' A'' O *) apply plg_permut. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @Parallelogram Tn O MA2 C'' A'' *) assumption. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) induction H6. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) unfold Parallelogram in H6. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) induction H6. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) unfold Parallelogram_strict in H6. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) spliter. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) unfold TS in H6. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) spliter. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) apply False_ind. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: False *) apply H9. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @Col Tn O O MA2 *) Col. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) unfold Parallelogram_flat in H6. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) spliter. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) apply cong_symmetry in H9. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) apply cong_identity in H9. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) auto. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) spliter. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) subst MA1. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) subst MA2. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) O O *) auto. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) spliter. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) subst MA1. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) subst C''. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) subst A''. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) subst C'. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) unfold Parallelogram in H0. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) induction H0. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) unfold Parallelogram_strict in H0. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) spliter. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) apply par_distincts in H5. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) tauto. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) unfold Parallelogram_flat in H0. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) spliter. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) apply cong_identity in H6. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) (* Goal: @eq (@Tpoint Tn) O MA2 *) auto. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) spliter. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) (* Goal: @eq (@Tpoint Tn) MA1 MA2 *) contradiction. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA2 O)) *) left; auto. (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) MA1 O)) *) left; auto. Qed. End Grid. Lemma pj_uniqueness : forall O E E' A A' A'', ~Col O E E' -> Col O E A -> Col O E' A' -> Col O E' A'' -> Pj E E' A A' -> Pj E E' A A'' -> A' = A''. Proof. (* Goal: forall (O E E' A A' A'' : @Tpoint Tn) (_ : not (@Col Tn O E E')) (_ : @Col Tn O E A) (_ : @Col Tn O E' A') (_ : @Col Tn O E' A'') (_ : @Pj Tn E E' A A') (_ : @Pj Tn E E' A A''), @eq (@Tpoint Tn) A' A'' *) intros. (* Goal: @eq (@Tpoint Tn) A' A'' *) unfold Pj in *. (* 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' A'' *) assert(HH:= grid_not_par O E E' H). (* 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'' *) induction H3. (* 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: False *) apply H7. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @Par Tn O E' E E' *) apply par_symmetry. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @Par Tn E E' O E' *) apply (par_col_par _ _ _ A'); Col. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) A' A'' *) subst A'. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) O A'' *) induction H4. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) O A'' *) (* Goal: @eq (@Tpoint Tn) O A'' *) apply False_ind. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) O A'' *) (* Goal: False *) apply H7. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) O A'' *) (* Goal: @Par Tn O E' E E' *) apply par_symmetry. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) O A'' *) (* Goal: @Par Tn E E' O E' *) apply (par_col_par _ _ _ A''); Col. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) O A'' *) auto. (* Goal: @eq (@Tpoint Tn) A' A'' *) induction H3; induction H4. (* 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 A A' 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'' *) (* Goal: @Par Tn A A' A A'' *) apply (par_trans _ _ E E'); 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 H6. (* 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 H6. (* 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 A A') (@Col Tn X A A'')) *) exists 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: and (@Col Tn A A A') (@Col Tn A A 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' A A'); Col. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: not (@Col Tn O E' A) *) intro. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: False *) apply H. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) A' A'' *) auto. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* 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' A'' *) (* Goal: @eq (@Tpoint Tn) A' A *) apply False_ind. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: False *) apply H. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @eq (@Tpoint Tn) A' A'' *) auto. (* 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 A'' *) apply False_ind. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: False *) apply H. (* Goal: @eq (@Tpoint Tn) A' A'' *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @eq (@Tpoint Tn) A' A'' *) congruence. Qed. Lemma pj_right_comm : forall A B C D, Pj A B C D -> Pj A B D C. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @Pj Tn A B C D), @Pj Tn A B D C *) intros. (* Goal: @Pj Tn A B D C *) unfold Pj in *. (* Goal: or (@Par Tn A B D C) (@eq (@Tpoint Tn) D C) *) induction H. (* Goal: or (@Par Tn A B D C) (@eq (@Tpoint Tn) D C) *) (* Goal: or (@Par Tn A B D C) (@eq (@Tpoint Tn) D C) *) left. (* Goal: or (@Par Tn A B D C) (@eq (@Tpoint Tn) D C) *) (* Goal: @Par Tn A B D C *) Par. (* Goal: or (@Par Tn A B D C) (@eq (@Tpoint Tn) D C) *) right. (* Goal: @eq (@Tpoint Tn) D C *) auto. Qed. Lemma pj_left_comm : forall A B C D, Pj A B C D -> Pj B A C D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @Pj Tn A B C D), @Pj Tn B A C D *) intros. (* Goal: @Pj Tn B A C D *) unfold Pj in *. (* Goal: or (@Par Tn B A C D) (@eq (@Tpoint Tn) C D) *) induction H. (* Goal: or (@Par Tn B A C D) (@eq (@Tpoint Tn) C D) *) (* Goal: or (@Par Tn B A C D) (@eq (@Tpoint Tn) C D) *) left. (* Goal: or (@Par Tn B A C D) (@eq (@Tpoint Tn) C D) *) (* Goal: @Par Tn B A C D *) Par. (* Goal: or (@Par Tn B A C D) (@eq (@Tpoint Tn) C D) *) right. (* Goal: @eq (@Tpoint Tn) C D *) auto. Qed. Lemma pj_comm : forall A B C D, Pj A B C D -> Pj B A D C. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @Pj Tn A B C D), @Pj Tn B A D C *) intros. (* Goal: @Pj Tn B A D C *) apply pj_left_comm. (* Goal: @Pj Tn A B D C *) apply pj_right_comm. (* Goal: @Pj Tn A B C D *) auto. Qed. Lemma proj_preserves_sum : forall O E E' A B C A' B' C', Sum 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' -> Sum O E' E A' B' C'. Proof. (* Goal: forall (O E E' A B C A' B' C' : @Tpoint Tn) (_ : @Sum 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'), @Sum Tn O E' E A' B' C' *) intros. (* Goal: @Sum Tn O E' E A' B' C' *) assert(HH:= H). (* Goal: @Sum Tn O E' E A' B' C' *) unfold Sum in HH. (* Goal: @Sum Tn O E' E A' B' C' *) spliter. (* Goal: @Sum Tn O E' E A' B' C' *) ex_and H5 A0. (* Goal: @Sum Tn O E' E A' B' C' *) ex_and H6 C0. (* Goal: @Sum Tn O E' E A' B' C' *) unfold Ar2 in H4. (* Goal: @Sum Tn O E' E A' B' C' *) spliter. (* Goal: @Sum Tn O E' E A' B' C' *) assert(HH:= grid_not_par O E E' H4). (* Goal: @Sum Tn O E' E A' B' C' *) unfold Ar1 in H0. (* Goal: @Sum Tn O E' E A' B' C' *) spliter. (* Goal: @Sum Tn O E' E A' B' C' *) induction(eq_dec_points A O). (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) subst A. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) unfold Pj in H1. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) induction H1. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) apply False_ind. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) apply H15. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Par Tn O E' E E' *) apply par_symmetry. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Par Tn E E' O E' *) apply (par_col_par _ _ _ A');Col. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) subst A'. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E O B' C' *) assert(B = C). (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E O B' C' *) (* Goal: @eq (@Tpoint Tn) B C *) apply (sum_O_B_eq O E E'); auto. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E O B' C' *) subst C. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E O B' C' *) assert(B' = C'). (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E O B' C' *) (* Goal: @eq (@Tpoint Tn) B' C' *) apply (pj_uniqueness O E E' B); Col. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E O B' C' *) subst C'. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E O B' B' *) apply sum_O_B; Col. (* Goal: @Sum Tn O E' E A' B' C' *) induction(eq_dec_points B O). (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) subst B. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) unfold Pj in H2. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) induction H2. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) apply False_ind. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) apply H15. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Par Tn O E' E E' *) apply par_symmetry. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Par Tn E E' O E' *) apply (par_col_par _ _ _ B'); Col. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' B' C' *) subst B'. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' O C' *) assert(A = C). (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' O C' *) (* Goal: @eq (@Tpoint Tn) A C *) apply (sum_A_O_eq O E E'); auto. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' O C' *) subst C. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' O C' *) assert(A' = C'). (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' O C' *) (* Goal: @eq (@Tpoint Tn) A' C' *) apply (pj_uniqueness O E E' A); Col. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' O C' *) subst C'. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: @Sum Tn O E' E A' O A' *) apply sum_A_O; Col. (* Goal: @Sum Tn O E' E A' B' C' *) assert(A' <> O). (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) intro. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) subst A'. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) unfold Pj in H1. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) induction H1. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) apply H13. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: @Par Tn O E E E' *) apply par_symmetry. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: @Par Tn E E' O E *) apply (par_col_par _ _ _ A);finish. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) contradiction. (* Goal: @Sum Tn O E' E A' B' C' *) assert(B' <> O). (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) subst B'. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) unfold Pj in H2. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) induction H2. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) apply H13. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: @Par Tn O E E E' *) apply par_symmetry. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: @Par Tn E E' O E *) apply (par_col_par _ _ _ B); Par. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: @Col Tn O B E *) Col. (* Goal: @Sum Tn O E' E A' B' C' *) (* Goal: False *) contradiction. (* Goal: @Sum Tn O E' E A' B' C' *) unfold Sum. (* Goal: and (@Ar2 Tn O E' E A' B' C') (@ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => and (@Pj Tn E' E A' A'0) (and (@Col Tn O E A'0) (and (@Pj Tn O E' A'0 C'0) (and (@Pj Tn O E B' C'0) (@Pj Tn E E' C'0 C'))))))) *) spliter. (* Goal: and (@Ar2 Tn O E' E A' B' C') (@ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => and (@Pj Tn E' E A' A'0) (and (@Col Tn O E A'0) (and (@Pj Tn O E' A'0 C'0) (and (@Pj Tn O E B' C'0) (@Pj Tn E E' C'0 C'))))))) *) split. (* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => and (@Pj Tn E' E A' A'0) (and (@Col Tn O E A'0) (and (@Pj Tn O E' A'0 C'0) (and (@Pj Tn O E B' C'0) (@Pj Tn E E' C'0 C')))))) *) (* Goal: @Ar2 Tn O E' E A' B' C' *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => and (@Pj Tn E' E A' A'0) (and (@Col Tn O E A'0) (and (@Pj Tn O E' A'0 C'0) (and (@Pj Tn O E B' C'0) (@Pj Tn E E' C'0 C')))))) *) assert(HH:=plg_existence A O B' H22). (* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => and (@Pj Tn E' E A' A'0) (and (@Col Tn O E A'0) (and (@Pj Tn O E' A'0 C'0) (and (@Pj Tn O E B' C'0) (@Pj Tn E E' C'0 C')))))) *) ex_and HH D. (* Goal: @ex (@Tpoint Tn) (fun A'0 : @Tpoint Tn => @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => and (@Pj Tn E' E A' A'0) (and (@Col Tn O E A'0) (and (@Pj Tn O E' A'0 C'0) (and (@Pj Tn O E B' C'0) (@Pj Tn E E' C'0 C')))))) *) exists A. (* Goal: @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => and (@Pj Tn E' E A' A) (and (@Col Tn O E A) (and (@Pj Tn O E' A C'0) (and (@Pj Tn O E B' C'0) (@Pj Tn E E' C'0 C'))))) *) exists D. (* Goal: and (@Pj Tn E' E A' A) (and (@Col Tn O E A) (and (@Pj Tn O E' A D) (and (@Pj Tn O E B' D) (@Pj Tn E E' D C')))) *) assert(HP:= H26). (* Goal: and (@Pj Tn E' E A' A) (and (@Col Tn O E A) (and (@Pj Tn O E' A D) (and (@Pj Tn O E B' D) (@Pj Tn E E' D C')))) *) apply plg_par in H26. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: and (@Pj Tn E' E A' A) (and (@Col Tn O E A) (and (@Pj Tn O E' A D) (and (@Pj Tn O E B' D) (@Pj Tn E E' D C')))) *) spliter. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: and (@Pj Tn E' E A' A) (and (@Col Tn O E A) (and (@Pj Tn O E' A D) (and (@Pj Tn O E B' D) (@Pj Tn E E' D C')))) *) repeat split; Col. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn O E B' D *) (* Goal: @Pj Tn O E' A D *) (* Goal: @Pj Tn E' E A' A *) apply pj_comm; auto. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn O E B' D *) (* Goal: @Pj Tn O E' A D *) left. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn O E B' D *) (* Goal: @Par Tn O E' A D *) apply par_symmetry. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn O E B' D *) (* Goal: @Par Tn A D O E' *) apply(par_col_par _ _ _ B'); finish. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn O E B' D *) left. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Par Tn O E B' D *) apply par_symmetry. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Par Tn B' D O E *) apply(par_col_par _ _ _ A); finish. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) assert(Parallelogram_flat O A C B). (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Parallelogram_flat Tn O A C B *) apply(sum_cong O E E' H4 A B C H). (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) left; auto. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) assert(Parallelogram B' D C B \/ B' = D /\ A = O /\ B = C /\ B' = B). (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: or (@Parallelogram Tn B' D C B) (and (@eq (@Tpoint Tn) B' D) (and (@eq (@Tpoint Tn) A O) (and (@eq (@Tpoint Tn) B C) (@eq (@Tpoint Tn) B' B)))) *) apply(plg_pseudo_trans B' D A O B C). (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Parallelogram Tn A O B C *) (* Goal: @Parallelogram Tn B' D A O *) apply plg_permut. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Parallelogram Tn A O B C *) (* Goal: @Parallelogram Tn O B' D A *) apply plg_permut. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Parallelogram Tn A O B C *) (* Goal: @Parallelogram Tn A O B' D *) auto. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Parallelogram Tn A O B C *) apply plg_comm2. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Parallelogram Tn O A C B *) right. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Parallelogram_flat Tn O A C B *) auto. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) induction H29. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) apply plg_par in H29. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) spliter. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) induction H2. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) induction H3. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) assert(Par B B' C C'). (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Par Tn B B' C C' *) apply (par_trans _ _ E E'); Par. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) assert(Par C D C C'). (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Par Tn C D C C' *) apply(par_trans _ _ B B'); Par. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) induction H32. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) apply False_ind. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: False *) apply H32. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X C D) (@Col Tn X C C')) *) exists C. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: and (@Col Tn C C D) (@Col Tn C C C') *) split; Col. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) spliter. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) left. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Par Tn E E' D C' *) apply par_right_comm. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Par Tn E E' C' D *) apply (par_col_par _ _ _ C); Col; Par. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) C' D) *) intro. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: False *) subst D. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: False *) induction H29. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: False *) (* Goal: False *) apply H29. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B' C') (@Col Tn X C B)) *) exists O. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: False *) (* Goal: and (@Col Tn O B' C') (@Col Tn O C B) *) split; ColR. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: False *) spliter. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: False *) apply H25. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @eq (@Tpoint Tn) B' O *) apply(l6_21 O E E' O);sfinish. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C' *) subst C'. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Pj Tn E E' D C *) left. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Par Tn E E' D C *) apply (par_trans _ _ B B'); Par. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) subst B'. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) apply par_distincts in H30. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) (* Goal: @Pj Tn E E' D C' *) tauto. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) B' D) *) intro. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: False *) subst D. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: False *) apply par_distincts in H26. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: False *) tauto. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) intro. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: False *) subst D. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: False *) induction H27. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: False *) (* Goal: False *) apply H27. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A C) (@Col Tn X O B')) *) exists O. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: False *) (* Goal: and (@Col Tn O A C) (@Col Tn O O B') *) split; ColR. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: False *) spliter. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: False *) apply H4. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Col Tn O E E' *) apply (col_transitivity_1 _ A). (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Col Tn O A E' *) (* Goal: @Col Tn O A E *) (* Goal: not (@eq (@Tpoint Tn) O A) *) auto. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Col Tn O A E' *) (* Goal: @Col Tn O A E *) Col. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) (* Goal: @Col Tn O A E' *) apply (col_transitivity_1 _ B'); Col. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) spliter. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) (* Goal: @Pj Tn E E' D C' *) contradiction. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: not (@eq (@Tpoint Tn) A O) *) intro. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: False *) subst. (* Goal: not (@eq (@Tpoint Tn) O B') *) (* Goal: False *) intuition. (* Goal: not (@eq (@Tpoint Tn) O B') *) intuition. Qed. Lemma sum_assoc_1 : forall O E E' A B C AB BC ABC, Sum O E E' A B AB -> Sum O E E' B C BC -> Sum O E E' A BC ABC -> Sum O E E' AB C ABC. Proof. (* Goal: forall (O E E' A B C AB BC ABC : @Tpoint Tn) (_ : @Sum Tn O E E' A B AB) (_ : @Sum Tn O E E' B C BC) (_ : @Sum Tn O E E' A BC ABC), @Sum Tn O E E' AB C ABC *) intros. (* Goal: @Sum Tn O E E' AB C ABC *) assert(HS1:=H). (* Goal: @Sum Tn O E E' AB C ABC *) assert(HS2:=H0). (* Goal: @Sum Tn O E E' AB C ABC *) assert(HS3:=H1). (* Goal: @Sum Tn O E E' AB C ABC *) unfold Sum in H. (* Goal: @Sum Tn O E E' AB C ABC *) unfold Sum in H0. (* Goal: @Sum Tn O E E' AB C ABC *) unfold Sum in H1. (* Goal: @Sum Tn O E E' AB C ABC *) spliter. (* Goal: @Sum Tn O E E' AB C ABC *) assert(HA1:= H). (* Goal: @Sum Tn O E E' AB C ABC *) assert(HA2:= H0). (* Goal: @Sum Tn O E E' AB C ABC *) assert(HA3 := H1). (* Goal: @Sum Tn O E E' AB C ABC *) unfold Ar2 in H. (* Goal: @Sum Tn O E E' AB C ABC *) unfold Ar2 in H0. (* Goal: @Sum Tn O E E' AB C ABC *) unfold Ar2 in H1. (* Goal: @Sum Tn O E E' AB C ABC *) clear H2. (* Goal: @Sum Tn O E E' AB C ABC *) clear H3. (* Goal: @Sum Tn O E E' AB C ABC *) clear H4. (* Goal: @Sum Tn O E E' AB C ABC *) spliter. (* Goal: @Sum Tn O E E' AB C ABC *) clean_duplicated_hyps. (* Goal: @Sum Tn O E E' AB C ABC *) induction (eq_dec_points A O). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) subst A. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) assert(HH:= sum_O_B_eq O E E' H B AB HS1). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) subst AB. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' B C ABC *) assert(HH:= sum_O_B_eq O E E' H BC ABC HS3). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' B C ABC *) subst BC. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' B C ABC *) auto. (* Goal: @Sum Tn O E E' AB C ABC *) induction (eq_dec_points B O). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) subst B. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) assert(HH:= sum_A_O_eq O E E' H A AB HS1). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) subst AB. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' A C ABC *) assert(HH:= sum_O_B_eq O E E' H C BC HS2). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' A C ABC *) subst BC. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' A C ABC *) auto. (* Goal: @Sum Tn O E E' AB C ABC *) induction (eq_dec_points C O). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) subst C. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB O ABC *) assert(HH:= sum_A_O_eq O E E' H B BC HS2). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB O ABC *) subst BC. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB O ABC *) assert(HH:=sum_uniqueness O E E' A B AB ABC HS1 HS3). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB O ABC *) subst AB. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' ABC O ABC *) apply sum_A_O; Col. (* Goal: @Sum Tn O E E' AB C ABC *) assert(HH:= grid_not_par O E E' H). (* Goal: @Sum Tn O E E' AB C ABC *) spliter. (* Goal: @Sum Tn O E E' AB C ABC *) apply sum_comm in HS1; auto. (* Goal: @Sum Tn O E E' AB C ABC *) apply sum_comm in HS3; auto. (* Goal: @Sum Tn O E E' AB C ABC *) assert(S1:=HS1). (* Goal: @Sum Tn O E E' AB C ABC *) assert(S2:=HS2). (* Goal: @Sum Tn O E E' AB C ABC *) assert(S3:=HS3). (* Goal: @Sum Tn O E E' AB C ABC *) unfold Sum in HS1. (* Goal: @Sum Tn O E E' AB C ABC *) unfold Sum in HS2. (* Goal: @Sum Tn O E E' AB C ABC *) unfold Sum in HS3. (* Goal: @Sum Tn O E E' AB C ABC *) spliter. (* Goal: @Sum Tn O E E' AB C ABC *) ex_and H20 B1'. (* Goal: @Sum Tn O E E' AB C ABC *) ex_and H21 A1. (* Goal: @Sum Tn O E E' AB C ABC *) ex_and H18 B1''. (* Goal: @Sum Tn O E E' AB C ABC *) ex_and H25 C1. (* Goal: @Sum Tn O E E' AB C ABC *) ex_and H16 BC3'. (* Goal: @Sum Tn O E E' AB C ABC *) ex_and H29 A3. (* Goal: @Sum Tn O E E' AB C ABC *) assert(B1'=B1''). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @eq (@Tpoint Tn) B1' B1'' *) apply (pj_uniqueness O E E' B B1' B1''); Col. (* Goal: @Sum Tn O E E' AB C ABC *) subst B1''. (* Goal: @Sum Tn O E E' AB C ABC *) clean_duplicated_hyps. (* Goal: @Sum Tn O E E' AB C ABC *) assert(HH:=sum_par_strict O E E' H B A AB B1' A1 H19 H1 H20 H21 H22 H23 H24). (* Goal: @Sum Tn O E E' AB C ABC *) spliter. (* Goal: @Sum Tn O E E' AB C ABC *) assert(Par_strict O E B1' A1). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Par_strict Tn O E B1' A1 *) induction H25. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Par_strict Tn O E B1' A1 *) (* Goal: @Par_strict Tn O E B1' A1 *) auto. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Par_strict Tn O E B1' A1 *) contradiction. (* Goal: @Sum Tn O E E' AB C ABC *) clear H25. (* Goal: @Sum Tn O E E' AB C ABC *) clear H22. (* Goal: @Sum Tn O E E' AB C ABC *) assert(HH:=grid_not_par O E E' H). (* Goal: @Sum Tn O E E' AB C ABC *) spliter. (* Goal: @Sum Tn O E E' AB C ABC *) assert(exists ! P' : Tpoint, Proj AB P' O E' E E'). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn AB P' O E' E E')) *) apply(project_existence AB O E' E E' H37 H36). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: not (@Par Tn E E' O E') *) intro. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) apply H34. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Par Tn O E' E E' *) Par. (* Goal: @Sum Tn O E E' AB C ABC *) ex_and H38 AB2'. (* Goal: @Sum Tn O E E' AB C ABC *) unfold unique in H39. (* Goal: @Sum Tn O E E' AB C ABC *) spliter. (* Goal: @Sum Tn O E E' AB C ABC *) clear H39. (* Goal: @Sum Tn O E E' AB C ABC *) unfold Proj in H38. (* Goal: @Sum Tn O E E' AB C ABC *) spliter. (* Goal: @Sum Tn O E E' AB C ABC *) clean_duplicated_hyps. (* Goal: @Sum Tn O E E' AB C ABC *) assert(A <> AB). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: not (@eq (@Tpoint Tn) A AB) *) intro. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) subst AB. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) apply sum_A_B_B in S1. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: not (@Col Tn O E E') *) (* Goal: False *) contradiction. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: not (@Col Tn O E E') *) auto. (* Goal: @Sum Tn O E E' AB C ABC *) assert(ABC <> AB). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: not (@eq (@Tpoint Tn) ABC AB) *) intro. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) subst ABC. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) assert(HP := sum_uniquenessA O E E' H A BC B AB S3 S1). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) subst BC. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) apply sum_A_B_A in S2; auto. (* Goal: @Sum Tn O E E' AB C ABC *) assert(HH:=plg_existence C O AB2' H2). (* Goal: @Sum Tn O E E' AB C ABC *) ex_and HH C2. (* Goal: @Sum Tn O E E' AB C ABC *) induction H42. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) assert(AB <> AB2'). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: not (@eq (@Tpoint Tn) AB AB2') *) intro. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) subst AB2'. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) apply par_distincts in H35. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) tauto. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) assert(Pl:=H34). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) assert(O <> AB2'). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: not (@eq (@Tpoint Tn) O AB2') *) intro. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) subst AB2'. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) assert(HH:=plg_trivial C O H2). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) assert(HP:= plg_uniqueness C O O C C2 HH Pl). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) subst C2. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) induction H35. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) (* Goal: False *) apply H35. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X AB O) (@Col Tn X E E')) *) exists E. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) (* Goal: and (@Col Tn E AB O) (@Col Tn E E E') *) split; Col. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) spliter. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: False *) contradiction. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) apply plg_par in H34; auto. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) spliter. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) repeat split; Col. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' AB A') (and (@Col Tn O E' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E' C C') (@Pj Tn E' E C' ABC)))))) *) exists AB2'. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E' AB AB2') (and (@Col Tn O E' AB2') (and (@Pj Tn O E AB2' C') (and (@Pj Tn O E' C C') (@Pj Tn E' E C' ABC))))) *) exists C2. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: and (@Pj Tn E E' AB AB2') (and (@Col Tn O E' AB2') (and (@Pj Tn O E AB2' C2) (and (@Pj Tn O E' C C2) (@Pj Tn E' E C2 ABC)))) *) repeat split. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Pj Tn O E' C C2 *) (* Goal: @Pj Tn O E AB2' C2 *) (* Goal: @Col Tn O E' AB2' *) (* Goal: @Pj Tn E E' AB AB2' *) left; Par. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Pj Tn O E' C C2 *) (* Goal: @Pj Tn O E AB2' C2 *) (* Goal: @Col Tn O E' AB2' *) Col. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Pj Tn O E' C C2 *) (* Goal: @Pj Tn O E AB2' C2 *) left. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Pj Tn O E' C C2 *) (* Goal: @Par Tn O E AB2' C2 *) apply (par_trans _ _ O C);Par. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Pj Tn O E' C C2 *) (* Goal: @Par Tn O E O C *) right. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Pj Tn O E' C C2 *) (* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (not (@eq (@Tpoint Tn) O C)) (and (@Col Tn O O C) (@Col Tn E O C))) *) repeat split; Col. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Pj Tn O E' C C2 *) left. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Par Tn O E' C C2 *) apply (par_trans _ _ O AB2'); Par. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Par Tn O E' O AB2' *) right. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: and (not (@eq (@Tpoint Tn) O E')) (and (not (@eq (@Tpoint Tn) O AB2')) (and (@Col Tn O O AB2') (@Col Tn E' O AB2'))) *) repeat split; Col. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) assert(Parallelogram O BC ABC A). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn O BC ABC A *) right. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram_flat Tn O BC ABC A *) apply(sum_cong O E E' H BC A ABC S3);auto. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) assert(Parallelogram O B AB A). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn O B AB A *) right. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram_flat Tn O B AB A *) apply(sum_cong O E E' H B A AB S1); auto. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) assert(Parallelogram O B BC C ). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn O B BC C *) right. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram_flat Tn O B BC C *) apply(sum_cong O E E' H B C BC); auto. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) assert( Parallelogram B AB ABC BC \/ B = AB /\ A = O /\ BC = ABC /\ B = BC). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: or (@Parallelogram Tn B AB ABC BC) (and (@eq (@Tpoint Tn) B AB) (and (@eq (@Tpoint Tn) A O) (and (@eq (@Tpoint Tn) BC ABC) (@eq (@Tpoint Tn) B BC)))) *) apply(plg_pseudo_trans B AB A O BC ABC). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn A O BC ABC *) (* Goal: @Parallelogram Tn B AB A O *) apply plg_permut. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn A O BC ABC *) (* Goal: @Parallelogram Tn O B AB A *) assumption. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn A O BC ABC *) apply plg_permut. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn ABC A O BC *) apply plg_permut. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn BC ABC A O *) apply plg_permut. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn O BC ABC A *) assumption. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) assert(Parallelogram B AB ABC BC). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn B AB ABC BC *) induction H43. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn B AB ABC BC *) (* Goal: @Parallelogram Tn B AB ABC BC *) assumption. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn B AB ABC BC *) spliter. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn B AB ABC BC *) contradiction. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) clear H43. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) assert(Parallelogram O C ABC AB \/ O = C /\ BC = B /\ AB = ABC /\ O = AB). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: or (@Parallelogram Tn O C ABC AB) (and (@eq (@Tpoint Tn) O C) (and (@eq (@Tpoint Tn) BC B) (and (@eq (@Tpoint Tn) AB ABC) (@eq (@Tpoint Tn) O AB)))) *) apply(plg_pseudo_trans O C BC B AB ABC). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn BC B AB ABC *) (* Goal: @Parallelogram Tn O C BC B *) apply plg_permut. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn BC B AB ABC *) (* Goal: @Parallelogram Tn B O C BC *) apply plg_comm2. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn BC B AB ABC *) (* Goal: @Parallelogram Tn O B BC C *) assumption. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn BC B AB ABC *) apply plg_permut. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn ABC BC B AB *) apply plg_permut. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn AB ABC BC B *) apply plg_permut. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn B AB ABC BC *) assumption. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) assert(Parallelogram O C ABC AB). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn O C ABC AB *) induction H43. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn O C ABC AB *) (* Goal: @Parallelogram Tn O C ABC AB *) assumption. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn O C ABC AB *) spliter. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn O C ABC AB *) subst C. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn O O ABC AB *) tauto. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) clear H43. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) assert(Parallelogram ABC AB AB2' C2 \/ ABC = AB /\ O = C /\ C2 = AB2' /\ ABC = C2). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: or (@Parallelogram Tn ABC AB AB2' C2) (and (@eq (@Tpoint Tn) ABC AB) (and (@eq (@Tpoint Tn) O C) (and (@eq (@Tpoint Tn) C2 AB2') (@eq (@Tpoint Tn) ABC C2)))) *) apply(plg_pseudo_trans ABC AB O C C2 AB2'). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn O C C2 AB2' *) (* Goal: @Parallelogram Tn ABC AB O C *) apply plg_permut. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn O C C2 AB2' *) (* Goal: @Parallelogram Tn C ABC AB O *) apply plg_permut. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn O C C2 AB2' *) (* Goal: @Parallelogram Tn O C ABC AB *) assumption. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn O C C2 AB2' *) apply plg_comm2. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn C O AB2' C2 *) assumption. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) assert(Parallelogram ABC AB AB2' C2). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn ABC AB AB2' C2 *) induction H43. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn ABC AB AB2' C2 *) (* Goal: @Parallelogram Tn ABC AB AB2' C2 *) assumption. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn ABC AB AB2' C2 *) spliter. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn ABC AB AB2' C2 *) subst C. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) (* Goal: @Parallelogram Tn ABC AB AB2' C2 *) tauto. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) clear H43. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) apply plg_par in H46; auto. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) spliter. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Pj Tn E' E C2 ABC *) left. (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @Par Tn E' E C2 ABC *) apply(par_trans _ _ AB AB2'); Par. (* Goal: @Sum Tn O E E' AB C ABC *) subst AB2'. (* Goal: @Sum Tn O E E' AB C ABC *) assert(AB = O). (* Goal: @Sum Tn O E E' AB C ABC *) (* Goal: @eq (@Tpoint Tn) AB O *) apply(l6_21 O E E' O); Col. (* Goal: @Sum Tn O E E' AB C ABC *) subst AB. (* Goal: @Sum Tn O E E' O C ABC *) assert(HH:= plg_trivial C O H2). (* Goal: @Sum Tn O E E' O C ABC *) assert(Hp:= plg_uniqueness C O O C C2 HH H34). (* Goal: @Sum Tn O E E' O C ABC *) subst C2. (* Goal: @Sum Tn O E E' O C ABC *) assert(Parallelogram_flat O B BC C). (* Goal: @Sum Tn O E E' O C ABC *) (* Goal: @Parallelogram_flat Tn O B BC C *) apply(sum_cong O E E' H B C BC);auto. (* Goal: @Sum Tn O E E' O C ABC *) assert(Parallelogram_flat O BC ABC A). (* Goal: @Sum Tn O E E' O C ABC *) (* Goal: @Parallelogram_flat Tn O BC ABC A *) apply(sum_cong O E E' H BC A ABC);auto. (* Goal: @Sum Tn O E E' O C ABC *) assert(Parallelogram_flat O B O A). (* Goal: @Sum Tn O E E' O C ABC *) (* Goal: @Parallelogram_flat Tn O B O A *) apply(sum_cong O E E' H B A O); auto. (* Goal: @Sum Tn O E E' O C ABC *) assert(Parallelogram BC C A O \/ BC = C /\ O = B /\ O = A /\ BC = O). (* Goal: @Sum Tn O E E' O C ABC *) (* Goal: or (@Parallelogram Tn BC C A O) (and (@eq (@Tpoint Tn) BC C) (and (@eq (@Tpoint Tn) O B) (and (@eq (@Tpoint Tn) O A) (@eq (@Tpoint Tn) BC O)))) *) apply(plg_pseudo_trans BC C O B O A). (* Goal: @Sum Tn O E E' O C ABC *) (* Goal: @Parallelogram Tn O B O A *) (* Goal: @Parallelogram Tn BC C O B *) apply plg_permut. (* Goal: @Sum Tn O E E' O C ABC *) (* Goal: @Parallelogram Tn O B O A *) (* Goal: @Parallelogram Tn B BC C O *) apply plg_permut. (* Goal: @Sum Tn O E E' O C ABC *) (* Goal: @Parallelogram Tn O B O A *) (* Goal: @Parallelogram Tn O B BC C *) right; assumption. (* Goal: @Sum Tn O E E' O C ABC *) (* Goal: @Parallelogram Tn O B O A *) right; assumption. (* Goal: @Sum Tn O E E' O C ABC *) assert(Parallelogram BC C A O). (* Goal: @Sum Tn O E E' O C ABC *) (* Goal: @Parallelogram Tn BC C A O *) induction H38. (* Goal: @Sum Tn O E E' O C ABC *) (* Goal: @Parallelogram Tn BC C A O *) (* Goal: @Parallelogram Tn BC C A O *) assumption. (* Goal: @Sum Tn O E E' O C ABC *) (* Goal: @Parallelogram Tn BC C A O *) spliter. (* Goal: @Sum Tn O E E' O C ABC *) (* Goal: @Parallelogram Tn BC C A O *) subst A. (* Goal: @Sum Tn O E E' O C ABC *) (* Goal: @Parallelogram Tn BC C O O *) tauto. (* Goal: @Sum Tn O E E' O C ABC *) clear H38. (* Goal: @Sum Tn O E E' O C ABC *) assert(Parallelogram O BC ABC A). (* Goal: @Sum Tn O E E' O C ABC *) (* Goal: @Parallelogram Tn O BC ABC A *) right; assumption. (* Goal: @Sum Tn O E E' O C ABC *) apply plg_permut in H38. (* Goal: @Sum Tn O E E' O C ABC *) apply plg_permut in H38. (* Goal: @Sum Tn O E E' O C ABC *) apply plg_permut in H38. (* Goal: @Sum Tn O E E' O C ABC *) apply plg_permut in H39. (* Goal: @Sum Tn O E E' O C ABC *) apply plg_permut in H39. (* Goal: @Sum Tn O E E' O C ABC *) assert(HP:=plg_uniqueness A O BC C ABC H39 H38). (* Goal: @Sum Tn O E E' O C ABC *) subst ABC. (* Goal: @Sum Tn O E E' O C C *) apply sum_O_B; Col. Qed. Lemma sum_assoc_2 : forall O E E' A B C AB BC ABC, Sum O E E' A B AB -> Sum O E E' B C BC -> Sum O E E' AB C ABC -> Sum O E E' A BC ABC. Proof. (* Goal: forall (O E E' A B C AB BC ABC : @Tpoint Tn) (_ : @Sum Tn O E E' A B AB) (_ : @Sum Tn O E E' B C BC) (_ : @Sum Tn O E E' AB C ABC), @Sum Tn O E E' A BC ABC *) intros. (* Goal: @Sum Tn O E E' A BC ABC *) assert(HS1:=H). (* Goal: @Sum Tn O E E' A BC ABC *) assert(HS2:=H0). (* Goal: @Sum Tn O E E' A BC ABC *) assert(HS3:=H1). (* Goal: @Sum Tn O E E' A BC ABC *) unfold Sum in H. (* Goal: @Sum Tn O E E' A BC ABC *) unfold Sum in H0. (* Goal: @Sum Tn O E E' A BC ABC *) unfold Sum in H1. (* Goal: @Sum Tn O E E' A BC ABC *) spliter. (* Goal: @Sum Tn O E E' A BC ABC *) unfold Ar2 in H. (* Goal: @Sum Tn O E E' A BC ABC *) spliter. (* Goal: @Sum Tn O E E' A BC ABC *) clean_duplicated_hyps. (* Goal: @Sum Tn O E E' A BC ABC *) apply sum_comm; auto. (* Goal: @Sum Tn O E E' BC A ABC *) apply(sum_assoc_1 O E E' C B A BC AB ABC ). (* Goal: @Sum Tn O E E' C AB ABC *) (* Goal: @Sum Tn O E E' B A AB *) (* Goal: @Sum Tn O E E' C B BC *) apply sum_comm; auto. (* Goal: @Sum Tn O E E' C AB ABC *) (* Goal: @Sum Tn O E E' B A AB *) apply sum_comm; auto. (* Goal: @Sum Tn O E E' C AB ABC *) apply sum_comm; auto. Qed. Lemma sum_assoc : forall O E E' A B C AB BC ABC, Sum O E E' A B AB -> Sum O E E' B C BC -> (Sum O E E' A BC ABC <-> Sum O E E' AB C ABC). Proof. (* Goal: forall (O E E' A B C AB BC ABC : @Tpoint Tn) (_ : @Sum Tn O E E' A B AB) (_ : @Sum Tn O E E' B C BC), iff (@Sum Tn O E E' A BC ABC) (@Sum Tn O E E' AB C ABC) *) intros. (* Goal: iff (@Sum Tn O E E' A BC ABC) (@Sum Tn O E E' AB C ABC) *) split; intro. (* Goal: @Sum Tn O E E' A BC ABC *) (* Goal: @Sum Tn O E E' AB C ABC *) apply(sum_assoc_1 O E E' A B C AB BC ABC); auto. (* Goal: @Sum Tn O E E' A BC ABC *) apply(sum_assoc_2 O E E' A B C AB BC ABC); auto. Qed. Lemma sum_y_axis_change : forall O E E' E'' A B C, Sum O E E' A B C -> ~ Col O E E'' -> Sum O E E'' A B C. Proof. (* Goal: forall (O E E' E'' A B C : @Tpoint Tn) (_ : @Sum Tn O E E' A B C) (_ : not (@Col Tn O E E'')), @Sum Tn O E E'' A B C *) intros. (* Goal: @Sum Tn O E E'' A B C *) assert(HS:= H). (* Goal: @Sum Tn O E E'' A B C *) assert(Ar2 O E E' A B C). (* Goal: @Sum Tn O E E'' A B C *) (* Goal: @Ar2 Tn O E E' A B C *) unfold Sum in H. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: @Ar2 Tn O E E' A B C *) tauto. (* Goal: @Sum Tn O E E'' A B C *) assert(HA:=H1). (* Goal: @Sum Tn O E E'' A B C *) unfold Ar2 in H1. (* Goal: @Sum Tn O E E'' A B C *) spliter. (* Goal: @Sum Tn O E E'' A B C *) assert(HH:=grid_not_par O E E' H1). (* Goal: @Sum Tn O E E'' A B C *) spliter. (* Goal: @Sum Tn O E E'' A B C *) induction(eq_dec_points A O). (* Goal: @Sum Tn O E E'' A B C *) (* Goal: @Sum Tn O E E'' A B C *) subst A. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: @Sum Tn O E E'' O B C *) apply sum_O_B_eq in H; Col. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: @Sum Tn O E E'' O B C *) subst C. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: @Sum Tn O E E'' O B B *) apply sum_O_B; Col. (* Goal: @Sum Tn O E E'' A B C *) induction(eq_dec_points B O). (* Goal: @Sum Tn O E E'' A B C *) (* Goal: @Sum Tn O E E'' A B C *) subst B. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: @Sum Tn O E E'' A O C *) apply sum_A_O_eq in H; Col. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: @Sum Tn O E E'' A O C *) subst C. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: @Sum Tn O E E'' A O A *) apply sum_A_O; Col. (* Goal: @Sum Tn O E E'' A B C *) apply sum_plg in H; auto. (* Goal: @Sum Tn O E E'' A B C *) ex_and H A'. (* Goal: @Sum Tn O E E'' A B C *) ex_and H13 C'. (* Goal: @Sum Tn O E E'' A B C *) assert(exists ! P' : Tpoint, Proj A P' O E'' E E''). (* Goal: @Sum Tn O E E'' A 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''); intro; try (subst E''; apply H0; Col). (* Goal: @Sum Tn O E E'' A B C *) (* Goal: False *) induction H14. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: False *) (* Goal: False *) apply H14. (* Goal: @Sum 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: @Sum Tn O E E'' A B C *) (* Goal: False *) (* Goal: and (@Col Tn E'' E E'') (@Col Tn E'' O E'') *) split; Col. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: False *) spliter. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: False *) apply H0. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: @Col Tn O E E'' *) Col. (* Goal: @Sum Tn O E E'' A B C *) ex_and H14 A''. (* Goal: @Sum Tn O E E'' A B C *) unfold unique in H15. (* Goal: @Sum Tn O E E'' A B C *) spliter. (* Goal: @Sum Tn O E E'' A B C *) clear H15. (* Goal: @Sum Tn O E E'' A B C *) unfold Proj in H14. (* Goal: @Sum Tn O E E'' A B C *) spliter. (* Goal: @Sum Tn O E E'' A B C *) assert(Par A A'' E E''). (* Goal: @Sum Tn O E E'' A B C *) (* Goal: @Par Tn A A'' E E'' *) induction H18; auto. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: @Par Tn A A'' E E'' *) subst A''. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: @Par Tn A A E E'' *) apply False_ind. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: False *) apply H0. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: @Col Tn O E E'' *) ColR. (* Goal: @Sum Tn O E E'' A B C *) clear H18. (* Goal: @Sum Tn O E E'' A B C *) assert(HH:= plg_existence B O A'' H12). (* Goal: @Sum Tn O E E'' A B C *) ex_and HH C''. (* Goal: @Sum Tn O E E'' A B C *) apply plg_to_parallelogram in H. (* Goal: @Sum Tn O E E'' A B C *) apply plg_to_parallelogram in H13. (* Goal: @Sum Tn O E E'' A B C *) assert(A'' <> O). (* Goal: @Sum Tn O E E'' A B C *) (* Goal: not (@eq (@Tpoint Tn) A'' O) *) intro. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: False *) subst A''. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: False *) induction H19. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: False *) (* Goal: False *) apply H19. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A O) (@Col Tn X E E'')) *) exists E. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: False *) (* Goal: and (@Col Tn E A O) (@Col Tn E E E'') *) split; Col. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: False *) spliter. (* Goal: @Sum Tn O E E'' A B C *) (* Goal: False *) contradiction. (* Goal: @Sum Tn O E E'' A B C *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E'' A A') (and (@Col Tn O E'' A') (and (@Pj Tn O E A' C') (and (@Pj Tn O E'' B C') (@Pj Tn E'' E C' C)))))) *) exists A''. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn E E'' A A'') (and (@Col Tn O E'' A'') (and (@Pj Tn O E A'' C') (and (@Pj Tn O E'' B C') (@Pj Tn E'' E C' C))))) *) exists C''. (* Goal: and (@Pj Tn E E'' A A'') (and (@Col Tn O E'' A'') (and (@Pj Tn O E A'' C'') (and (@Pj Tn O E'' B C'') (@Pj Tn E'' E C'' C)))) *) repeat split. (* Goal: @Pj Tn E'' E C'' C *) (* Goal: @Pj Tn O E'' B C'' *) (* Goal: @Pj Tn O E A'' C'' *) (* Goal: @Col Tn O E'' A'' *) (* Goal: @Pj Tn E E'' A A'' *) left. (* Goal: @Pj Tn E'' E C'' C *) (* Goal: @Pj Tn O E'' B C'' *) (* Goal: @Pj Tn O E A'' C'' *) (* Goal: @Col Tn O E'' A'' *) (* Goal: @Par Tn E E'' A A'' *) Par. (* Goal: @Pj Tn E'' E C'' C *) (* Goal: @Pj Tn O E'' B C'' *) (* Goal: @Pj Tn O E A'' C'' *) (* Goal: @Col Tn O E'' A'' *) Col. (* Goal: @Pj Tn E'' E C'' C *) (* Goal: @Pj Tn O E'' B C'' *) (* Goal: @Pj Tn O E A'' C'' *) apply plg_par in H18; auto. (* Goal: @Pj Tn E'' E C'' C *) (* Goal: @Pj Tn O E'' B C'' *) (* Goal: @Pj Tn O E A'' C'' *) spliter. (* Goal: @Pj Tn E'' E C'' C *) (* Goal: @Pj Tn O E'' B C'' *) (* Goal: @Pj Tn O E A'' C'' *) left. (* Goal: @Pj Tn E'' E C'' C *) (* Goal: @Pj Tn O E'' B C'' *) (* Goal: @Par Tn O E A'' C'' *) apply par_symmetry. (* Goal: @Pj Tn E'' E C'' C *) (* Goal: @Pj Tn O E'' B C'' *) (* Goal: @Par Tn A'' C'' O E *) apply (par_col_par _ _ _ B); Par; Col. (* Goal: @Pj Tn E'' E C'' C *) (* Goal: @Pj Tn O E'' B C'' *) apply plg_par in H18; auto. (* Goal: @Pj Tn E'' E C'' C *) (* Goal: @Pj Tn O E'' B C'' *) spliter. (* Goal: @Pj Tn E'' E C'' C *) (* Goal: @Pj Tn O E'' B C'' *) left. (* Goal: @Pj Tn E'' E C'' C *) (* Goal: @Par Tn O E'' B C'' *) apply par_symmetry. (* Goal: @Pj Tn E'' E C'' C *) (* Goal: @Par Tn B C'' O E'' *) apply (par_col_par _ _ _ A''); Par; Col. (* Goal: @Pj Tn E'' E C'' C *) left. (* Goal: @Par Tn E'' E C'' C *) assert(Parallelogram_flat O A C B). (* Goal: @Par Tn E'' E C'' C *) (* Goal: @Parallelogram_flat Tn O A C B *) apply(sum_cong O E E' H1 A B C HS). (* Goal: @Par Tn E'' E C'' C *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) left; auto. (* Goal: @Par Tn E'' E C'' C *) assert(Parallelogram O A C B). (* Goal: @Par Tn E'' E C'' C *) (* Goal: @Parallelogram Tn O A C B *) right; auto. (* Goal: @Par Tn E'' E C'' C *) assert(Parallelogram C'' A'' A C \/ C'' = A'' /\ O = B /\ C = A /\ C'' = C). (* Goal: @Par Tn E'' E C'' C *) (* Goal: or (@Parallelogram Tn C'' A'' A C) (and (@eq (@Tpoint Tn) C'' A'') (and (@eq (@Tpoint Tn) O B) (and (@eq (@Tpoint Tn) C A) (@eq (@Tpoint Tn) C'' C)))) *) apply(plg_pseudo_trans C'' A'' O B C A). (* Goal: @Par Tn E'' E C'' C *) (* Goal: @Parallelogram Tn O B C A *) (* Goal: @Parallelogram Tn C'' A'' O B *) apply plg_comm2. (* Goal: @Par Tn E'' E C'' C *) (* Goal: @Parallelogram Tn O B C A *) (* Goal: @Parallelogram Tn A'' C'' B O *) apply plg_permut. (* Goal: @Par Tn E'' E C'' C *) (* Goal: @Parallelogram Tn O B C A *) (* Goal: @Parallelogram Tn O A'' C'' B *) apply plg_permut. (* Goal: @Par Tn E'' E C'' C *) (* Goal: @Parallelogram Tn O B C A *) (* Goal: @Parallelogram Tn B O A'' C'' *) assumption. (* Goal: @Par Tn E'' E C'' C *) (* Goal: @Parallelogram Tn O B C A *) apply plg_permut in H22. (* Goal: @Par Tn E'' E C'' C *) (* Goal: @Parallelogram Tn O B C A *) apply plg_comm2. (* Goal: @Par Tn E'' E C'' C *) (* Goal: @Parallelogram Tn B O A C *) apply plg_permut. (* Goal: @Par Tn E'' E C'' C *) (* Goal: @Parallelogram Tn C B O A *) apply plg_permut. (* Goal: @Par Tn E'' E C'' C *) (* Goal: @Parallelogram Tn A C B O *) assumption. (* Goal: @Par Tn E'' E C'' C *) assert(Parallelogram C'' A'' A C). (* Goal: @Par Tn E'' E C'' C *) (* Goal: @Parallelogram Tn C'' A'' A C *) induction H23. (* Goal: @Par Tn E'' E C'' C *) (* Goal: @Parallelogram Tn C'' A'' A C *) (* Goal: @Parallelogram Tn C'' A'' A C *) assumption. (* Goal: @Par Tn E'' E C'' C *) (* Goal: @Parallelogram Tn C'' A'' A C *) spliter. (* Goal: @Par Tn E'' E C'' C *) (* Goal: @Parallelogram Tn C'' A'' A C *) subst B. (* Goal: @Par Tn E'' E C'' C *) (* Goal: @Parallelogram Tn C'' A'' A C *) tauto. (* Goal: @Par Tn E'' E C'' C *) clear H23. (* Goal: @Par Tn E'' E C'' C *) assert(A <> C). (* Goal: @Par Tn E'' E C'' C *) (* Goal: not (@eq (@Tpoint Tn) A C) *) intro. (* Goal: @Par Tn E'' E C'' C *) (* Goal: False *) subst C. (* Goal: @Par Tn E'' E C'' C *) (* Goal: False *) assert(Parallelogram O A A O). (* Goal: @Par Tn E'' E C'' C *) (* Goal: False *) (* Goal: @Parallelogram Tn O A A O *) apply(plg_trivial O A); auto. (* Goal: @Par Tn E'' E C'' C *) (* Goal: False *) assert(HH:=plg_uniqueness O A A O B H23 H22). (* Goal: @Par Tn E'' E C'' C *) (* Goal: False *) subst B. (* Goal: @Par Tn E'' E C'' C *) (* Goal: False *) tauto. (* Goal: @Par Tn E'' E C'' C *) assert(A <> A''). (* Goal: @Par Tn E'' E C'' C *) (* Goal: not (@eq (@Tpoint Tn) A A'') *) intro. (* Goal: @Par Tn E'' E C'' C *) (* Goal: False *) subst A''. (* Goal: @Par Tn E'' E C'' C *) (* Goal: False *) apply par_distincts in H19. (* Goal: @Par Tn E'' E C'' C *) (* Goal: False *) tauto. (* Goal: @Par Tn E'' E C'' C *) assert(A'' <> C''). (* Goal: @Par Tn E'' E C'' C *) (* Goal: not (@eq (@Tpoint Tn) A'' C'') *) intro. (* Goal: @Par Tn E'' E C'' C *) (* Goal: False *) subst C''. (* Goal: @Par Tn E'' E C'' C *) (* Goal: False *) assert(Parallelogram A'' A'' A A). (* Goal: @Par Tn E'' E C'' C *) (* Goal: False *) (* Goal: @Parallelogram Tn A'' A'' A A *) apply(plg_trivial1); auto. (* Goal: @Par Tn E'' E C'' C *) (* Goal: False *) assert(HH:= plg_uniqueness A'' A'' A A C H26 H24). (* Goal: @Par Tn E'' E C'' C *) (* Goal: False *) contradiction. (* Goal: @Par Tn E'' E C'' C *) apply plg_par in H24; auto. (* Goal: @Par Tn E'' E C'' C *) spliter. (* Goal: @Par Tn E'' E C'' C *) apply(par_trans _ _ A'' A); Par. Qed. Lemma sum_x_axis_unit_change : forall O E E' U A B C, Sum O E E' A B C -> Col O E U -> U <> O -> Sum O U E' A B C. Proof. (* Goal: forall (O E E' U A B C : @Tpoint Tn) (_ : @Sum Tn O E E' A B C) (_ : @Col Tn O E U) (_ : not (@eq (@Tpoint Tn) U O)), @Sum Tn O U E' A B C *) intros. (* Goal: @Sum Tn O U E' A B C *) induction (eq_dec_points U E). (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Sum Tn O U E' A B C *) subst U. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Sum Tn O E E' A B C *) assumption. (* Goal: @Sum Tn O U E' A B C *) assert(HS:= H). (* Goal: @Sum Tn O U E' A B C *) assert(Ar2 O E E' A B C). (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Ar2 Tn O E E' A B C *) unfold Sum in H. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Ar2 Tn O E E' A B C *) tauto. (* Goal: @Sum Tn O U E' A B C *) assert(HA:=H3). (* Goal: @Sum Tn O U E' A B C *) unfold Ar2 in H3. (* Goal: @Sum Tn O U E' A B C *) spliter. (* Goal: @Sum Tn O U E' A B C *) assert(HH:=grid_not_par O E E' H3). (* Goal: @Sum Tn O U E' A B C *) spliter. (* Goal: @Sum Tn O U E' A B C *) assert(~Col O U E'). (* Goal: @Sum Tn O U E' A B C *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @Sum Tn O U E' A B C *) (* Goal: False *) apply H3. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Sum Tn O U E' A B C *) assert(HH:=grid_not_par O U E' H13). (* Goal: @Sum Tn O U E' A B C *) spliter. (* Goal: @Sum Tn O U E' A B C *) induction(eq_dec_points A O). (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Sum Tn O U E' A B C *) subst A. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Sum Tn O U E' O B C *) apply sum_O_B_eq in H; Col. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Sum Tn O U E' O B C *) subst C. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Sum Tn O U E' O B B *) apply sum_O_B; Col. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Col Tn O U B *) ColR. (* Goal: @Sum Tn O U E' A B C *) induction(eq_dec_points B O). (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Sum Tn O U E' A B C *) subst B. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Sum Tn O U E' A O C *) apply sum_A_O_eq in H; Col. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Sum Tn O U E' A O C *) subst C. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Sum Tn O U E' A O A *) apply sum_A_O; Col. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Col Tn O U A *) ColR. (* Goal: @Sum Tn O U E' A B C *) apply sum_plg in H; auto. (* Goal: @Sum Tn O U E' A B C *) ex_and H A'. (* Goal: @Sum Tn O U E' A B C *) ex_and H22 C'. (* Goal: @Sum Tn O U E' A B C *) apply plg_to_parallelogram in H. (* Goal: @Sum Tn O U E' A B C *) apply plg_to_parallelogram in H22. (* Goal: @Sum Tn O U E' A B C *) assert(Ar2 O U E' A B C). (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Ar2 Tn O U E' A B C *) repeat split ; auto; ColR. (* Goal: @Sum Tn O U E' A B C *) assert(HB:= H23). (* Goal: @Sum Tn O U E' A B C *) unfold Ar2 in H23. (* Goal: @Sum Tn O U E' A B C *) spliter. (* Goal: @Sum Tn O U E' A B C *) clean_duplicated_hyps. (* Goal: @Sum Tn O U E' A B C *) assert(exists ! P' : Tpoint, Proj A P' O E' U E'). (* Goal: @Sum Tn O U E' A B C *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn A P' O E' U E')) *) apply(project_existence A O E' U E' H19 H11 ). (* Goal: @Sum Tn O U E' A B C *) (* Goal: not (@Par Tn U E' O E') *) intro. (* Goal: @Sum Tn O U E' A B C *) (* Goal: False *) apply H16. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Par Tn O E' U E' *) Par. (* Goal: @Sum Tn O U E' A B C *) ex_and H18 A''. (* Goal: @Sum Tn O U E' A B C *) unfold unique in H23. (* Goal: @Sum Tn O U E' A B C *) spliter. (* Goal: @Sum Tn O U E' A B C *) clear H23. (* Goal: @Sum Tn O U E' A B C *) unfold Proj in H18. (* Goal: @Sum Tn O U E' A B C *) spliter. (* Goal: @Sum Tn O U E' A B C *) clean_duplicated_hyps. (* Goal: @Sum Tn O U E' A B C *) assert(Par A A'' U E'). (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Par Tn A A'' U E' *) induction H29. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Par Tn A A'' U E' *) (* Goal: @Par Tn A A'' U E' *) assumption. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Par Tn A A'' U E' *) subst A''. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Par Tn A A U E' *) apply False_ind. (* Goal: @Sum Tn O U E' A B C *) (* Goal: False *) apply H3. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Sum Tn O U E' A B C *) clear H29. (* Goal: @Sum Tn O U E' A B C *) assert(HH:= plg_existence B O A'' H21). (* Goal: @Sum Tn O U E' A B C *) ex_and HH C''. (* Goal: @Sum Tn O U E' A B C *) assert(O <> A''). (* Goal: @Sum Tn O U E' A B C *) (* Goal: not (@eq (@Tpoint Tn) O A'') *) intro. (* Goal: @Sum Tn O U E' A B C *) (* Goal: False *) subst A''. (* Goal: @Sum Tn O U E' A B C *) (* Goal: False *) assert(HH:=plg_trivial B O H21). (* Goal: @Sum Tn O U E' A B C *) (* Goal: False *) assert(B = C''). (* Goal: @Sum Tn O U E' A B C *) (* Goal: False *) (* Goal: @eq (@Tpoint Tn) B C'' *) apply (plg_uniqueness B O O B C''); auto. (* Goal: @Sum Tn O U E' A B C *) (* Goal: False *) subst C''. (* Goal: @Sum Tn O U E' A B C *) (* Goal: False *) induction H18. (* Goal: @Sum Tn O U E' A B C *) (* Goal: False *) (* Goal: False *) apply H18. (* Goal: @Sum Tn O U E' A B C *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A O) (@Col Tn X U E')) *) exists U. (* Goal: @Sum Tn O U E' A B C *) (* Goal: False *) (* Goal: and (@Col Tn U A O) (@Col Tn U U E') *) split; Col. (* Goal: @Sum Tn O U E' A B C *) (* Goal: False *) spliter. (* Goal: @Sum Tn O U E' A B C *) (* Goal: False *) apply H3. (* Goal: @Sum Tn O U E' A B C *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Sum Tn O U E' A B C *) assert(HP1:=H23). (* Goal: @Sum Tn O U E' A B C *) apply plg_par in H23; auto. (* Goal: @Sum Tn O U E' A B C *) spliter. (* Goal: @Sum Tn O U E' A B C *) repeat split; auto. (* Goal: @ex (@Tpoint Tn) (fun A' : @Tpoint Tn => @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn U E' A A') (and (@Col Tn O E' A') (and (@Pj Tn O U A' C') (and (@Pj Tn O E' B C') (@Pj Tn E' U C' C)))))) *) exists A''. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Pj Tn U E' A A'') (and (@Col Tn O E' A'') (and (@Pj Tn O U A'' C') (and (@Pj Tn O E' B C') (@Pj Tn E' U C' C))))) *) exists C''. (* Goal: and (@Pj Tn U E' A A'') (and (@Col Tn O E' A'') (and (@Pj Tn O U A'' C'') (and (@Pj Tn O E' B C'') (@Pj Tn E' U C'' C)))) *) repeat split. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Pj Tn O E' B C'' *) (* Goal: @Pj Tn O U A'' C'' *) (* Goal: @Col Tn O E' A'' *) (* Goal: @Pj Tn U E' A A'' *) left. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Pj Tn O E' B C'' *) (* Goal: @Pj Tn O U A'' C'' *) (* Goal: @Col Tn O E' A'' *) (* Goal: @Par Tn U E' A A'' *) Par. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Pj Tn O E' B C'' *) (* Goal: @Pj Tn O U A'' C'' *) (* Goal: @Col Tn O E' A'' *) Col. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Pj Tn O E' B C'' *) (* Goal: @Pj Tn O U A'' C'' *) left. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Pj Tn O E' B C'' *) (* Goal: @Par Tn O U A'' C'' *) assert(Par O U B O). (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Pj Tn O E' B C'' *) (* Goal: @Par Tn O U A'' C'' *) (* Goal: @Par Tn O U B O *) right. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Pj Tn O E' B C'' *) (* Goal: @Par Tn O U A'' C'' *) (* Goal: and (not (@eq (@Tpoint Tn) O U)) (and (not (@eq (@Tpoint Tn) B O)) (and (@Col Tn O B O) (@Col Tn U B O))) *) repeat split; Col. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Pj Tn O E' B C'' *) (* Goal: @Par Tn O U A'' C'' *) apply (par_trans _ _ B O); Par. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Pj Tn O E' B C'' *) left. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Par Tn O E' B C'' *) assert(Par O E' O A''). (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Par Tn O E' B C'' *) (* Goal: @Par Tn O E' O A'' *) right. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Par Tn O E' B C'' *) (* Goal: and (not (@eq (@Tpoint Tn) O E')) (and (not (@eq (@Tpoint Tn) O A'')) (and (@Col Tn O O A'') (@Col Tn E' O A''))) *) repeat split; Col. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Par Tn O E' B C'' *) apply(par_trans _ _ O A''); Par. (* Goal: @Pj Tn E' U C'' C *) assert(Parallelogram_flat O A C B). (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Parallelogram_flat Tn O A C B *) apply(sum_cong O E E' H3 A B C HS); auto. (* Goal: @Pj Tn E' U C'' C *) assert(Parallelogram O A C B). (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Parallelogram Tn O A C B *) right. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Parallelogram_flat Tn O A C B *) assumption. (* Goal: @Pj Tn E' U C'' C *) assert(Parallelogram A C C'' A'' \/ A = C /\ B = O /\ A'' = C'' /\ A = A''). (* Goal: @Pj Tn E' U C'' C *) (* Goal: or (@Parallelogram Tn A C C'' A'') (and (@eq (@Tpoint Tn) A C) (and (@eq (@Tpoint Tn) B O) (and (@eq (@Tpoint Tn) A'' C'') (@eq (@Tpoint Tn) A A'')))) *) apply(plg_pseudo_trans A C B O A'' C''). (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Parallelogram Tn B O A'' C'' *) (* Goal: @Parallelogram Tn A C B O *) apply plg_permut. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Parallelogram Tn B O A'' C'' *) (* Goal: @Parallelogram Tn O A C B *) assumption. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Parallelogram Tn B O A'' C'' *) assumption. (* Goal: @Pj Tn E' U C'' C *) assert(Parallelogram A C C'' A''). (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Parallelogram Tn A C C'' A'' *) induction H32. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Parallelogram Tn A C C'' A'' *) (* Goal: @Parallelogram Tn A C C'' A'' *) assumption. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Parallelogram Tn A C C'' A'' *) spliter. (* Goal: @Pj Tn E' U C'' C *) (* Goal: @Parallelogram Tn A C C'' A'' *) contradiction. (* Goal: @Pj Tn E' U C'' C *) clear H32. (* Goal: @Pj Tn E' U C'' C *) apply plg_par in H33. (* Goal: not (@eq (@Tpoint Tn) C C'') *) (* Goal: not (@eq (@Tpoint Tn) A C) *) (* Goal: @Pj Tn E' U C'' C *) left. (* Goal: not (@eq (@Tpoint Tn) C C'') *) (* Goal: not (@eq (@Tpoint Tn) A C) *) (* Goal: @Par Tn E' U C'' C *) spliter. (* Goal: not (@eq (@Tpoint Tn) C C'') *) (* Goal: not (@eq (@Tpoint Tn) A C) *) (* Goal: @Par Tn E' U C'' C *) apply(par_trans _ _ A A''); Par. (* Goal: not (@eq (@Tpoint Tn) C C'') *) (* Goal: not (@eq (@Tpoint Tn) A C) *) intro. (* Goal: not (@eq (@Tpoint Tn) C C'') *) (* Goal: False *) subst C. (* Goal: not (@eq (@Tpoint Tn) C C'') *) (* Goal: False *) apply sum_B_null in HS. (* Goal: not (@eq (@Tpoint Tn) C C'') *) (* Goal: not (@Col Tn O E E') *) (* Goal: False *) contradiction. (* Goal: not (@eq (@Tpoint Tn) C C'') *) (* Goal: not (@Col Tn O E E') *) auto. (* Goal: not (@eq (@Tpoint Tn) C C'') *) intro. (* Goal: False *) subst C''. (* Goal: False *) induction H23. (* Goal: False *) (* Goal: False *) apply H23. (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B O) (@Col Tn X A'' C)) *) exists C. (* Goal: False *) (* Goal: and (@Col Tn C B O) (@Col Tn C A'' C) *) split; Col. (* Goal: False *) (* Goal: @Col Tn C B O *) ColR. (* Goal: False *) spliter. (* Goal: False *) apply H3. (* Goal: @Col Tn O E E' *) ColR. Qed. Lemma change_grid_sum_0 : 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' -> Sum O E E' A B C -> A = O -> Sum 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') (_ : @Sum Tn O E E' A B C) (_ : @eq (@Tpoint Tn) A O), @Sum Tn O' E' E A' B' C' *) intros. (* Goal: @Sum Tn O' E' E A' B' C' *) assert(HS:= H6). (* Goal: @Sum Tn O' E' E A' B' C' *) induction H6. (* Goal: @Sum Tn O' E' E A' B' C' *) ex_and H8 A1. (* Goal: @Sum Tn O' E' E A' B' C' *) ex_and H9 C1. (* Goal: @Sum Tn O' E' E A' B' C' *) unfold Ar1 in *. (* Goal: @Sum Tn O' E' E A' B' C' *) unfold Ar2 in H6. (* Goal: @Sum Tn O' E' E A' B' C' *) spliter. (* Goal: @Sum Tn O' E' E A' B' C' *) subst A. (* Goal: @Sum Tn O' E' E A' B' C' *) clean_duplicated_hyps. (* Goal: @Sum Tn O' E' E A' B' C' *) assert(A' = O'). (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) A' O' *) apply(l6_21 O' E' O O');Col. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) (* Goal: not (@eq (@Tpoint Tn) O O') *) (* Goal: not (@Col Tn O' E' O) *) intro. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) (* Goal: not (@eq (@Tpoint Tn) O O') *) (* Goal: False *) apply H. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) (* Goal: not (@eq (@Tpoint Tn) O O') *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists O. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) (* Goal: not (@eq (@Tpoint Tn) O O') *) (* Goal: and (@Col Tn O O E) (@Col Tn O O' E') *) split; Col. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) (* Goal: not (@eq (@Tpoint Tn) O O') *) intro. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) (* Goal: False *) apply H. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) subst O'. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O E')) *) exists O. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) (* Goal: and (@Col Tn O O E) (@Col Tn O O E') *) split; Col. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) unfold Pj in H3. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) induction H3. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) (* Goal: @Col Tn O O' A' *) induction H3. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) (* Goal: @Col Tn O O' A' *) (* Goal: @Col Tn O O' A' *) apply False_ind. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) (* Goal: @Col Tn O O' A' *) (* Goal: False *) apply H3. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) (* Goal: @Col Tn O O' A' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O O') (@Col Tn X O A')) *) exists O. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) (* Goal: @Col Tn O O' A' *) (* Goal: and (@Col Tn O O O') (@Col Tn O O A') *) split; Col. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) (* Goal: @Col Tn O O' A' *) spliter. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) (* Goal: @Col Tn O O' A' *) Col. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' A' *) subst A'. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' O *) Col. (* Goal: @Sum Tn O' E' E A' B' C' *) subst A'. (* Goal: @Sum Tn O' E' E O' B' C' *) assert(Sum O E E' O B B). (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @Sum Tn O E E' O B B *) apply sum_O_B. (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn O E B *) (* Goal: not (@Col Tn O E E') *) assumption. (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn O E B *) Col. (* Goal: @Sum Tn O' E' E O' B' C' *) unfold Sum in H7. (* Goal: @Sum Tn O' E' E O' B' C' *) assert(B = C). (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @eq (@Tpoint Tn) B C *) apply(sum_uniqueness O E E' O B); auto. (* Goal: @Sum Tn O' E' E O' B' C' *) subst C. (* Goal: @Sum Tn O' E' E O' B' C' *) assert(B' = C'). (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @eq (@Tpoint Tn) B' C' *) apply(l6_21 O' E' B B'); Col. (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: not (@eq (@Tpoint Tn) B B') *) (* Goal: not (@Col Tn O' E' B) *) intro. (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: not (@eq (@Tpoint Tn) B B') *) (* Goal: False *) apply H. (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) (* 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: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: not (@eq (@Tpoint Tn) B B') *) (* Goal: and (@Col Tn B O E) (@Col Tn B O' E') *) split; Col. (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: not (@eq (@Tpoint Tn) B B') *) intro. (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: False *) subst B'. (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: False *) apply H. (* Goal: @Sum Tn O' E' E O' 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: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: and (@Col Tn B O E) (@Col Tn B O' E') *) split; Col. (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) induction H5. (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: @Col Tn B B' C' *) induction H4. (* Goal: @Sum Tn O' E' E O' 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: @Sum Tn O' E' E O' 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: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: @Col Tn B B' C' *) induction H13. (* Goal: @Sum Tn O' E' E O' 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: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: False *) apply H13. (* Goal: @Sum Tn O' E' E O' 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: @Sum Tn O' E' E O' 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: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: @Col Tn B B' C' *) spliter. (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: @Col Tn B B' C' *) Col. (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: @Col Tn B B' C' *) subst B'. (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: @Col Tn B B C' *) Col. (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' C' *) subst C'. (* Goal: @Sum Tn O' E' E O' B' C' *) (* Goal: @Col Tn B B' B *) Col. (* Goal: @Sum Tn O' E' E O' B' C' *) subst C'. (* Goal: @Sum Tn O' E' E O' B' B' *) apply sum_O_B;Col. (* Goal: not (@Col Tn O' E' E) *) assert_ncols; Col. Qed. Lemma change_grid_sum : 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' -> Sum O E E' A B C -> Sum 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') (_ : @Sum Tn O E E' A B C), @Sum Tn O' E' E A' B' C' *) intros. (* Goal: @Sum Tn O' E' E A' B' C' *) induction(eq_dec_points A O). (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E A' B' C' *) subst A. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E A' B' C' *) apply(change_grid_sum_0 O E E' O B C); auto. (* Goal: @Sum Tn O' E' E A' B' C' *) assert(HS:= H6). (* Goal: @Sum Tn O' E' E A' B' C' *) induction H6. (* Goal: @Sum Tn O' E' E A' B' C' *) ex_and H8 A1. (* Goal: @Sum Tn O' E' E A' B' C' *) ex_and H9 C1. (* Goal: @Sum Tn O' E' E A' B' C' *) unfold Ar1 in *. (* Goal: @Sum Tn O' E' E A' B' C' *) unfold Ar2 in H6. (* Goal: @Sum Tn O' E' E A' B' C' *) spliter. (* Goal: @Sum Tn O' E' E A' B' C' *) assert(HG:=grid_not_par O E E' H6). (* Goal: @Sum Tn O' E' E A' B' C' *) spliter. (* Goal: @Sum Tn O' E' E A' B' C' *) assert(~Col O' E' E). (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: not (@Col Tn O' E' E) *) intro. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) apply H. (* Goal: @Sum 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 E. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn E O E) (@Col Tn E O' E') *) split; Col. (* Goal: @Sum Tn O' E' E A' B' C' *) assert(HG:=grid_not_par O' E' E H28). (* Goal: @Sum Tn O' E' E A' B' C' *) spliter. (* Goal: @Sum Tn O' E' E A' B' C' *) clean_duplicated_hyps. (* Goal: @Sum Tn O' E' E A' B' C' *) induction(eq_dec_points B O). (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E A' B' C' *) subst B. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E A' B' C' *) apply sum_comm; Col. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E B' A' C' *) apply sum_comm in HS; Col. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E B' A' C' *) apply(change_grid_sum_0 O E E' O A C); auto. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Ar1 Tn O' E' B' A' C' *) (* Goal: @Ar1 Tn O E O A C *) repeat split; auto. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Ar1 Tn O' E' B' A' C' *) repeat split; auto. (* Goal: @Sum Tn O' E' E A' B' C' *) assert(A' <> O). (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) intro. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) subst A'. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) induction H3. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) induction H3. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H3. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O O') (@Col Tn X A O)) *) exists O. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn O O O') (@Col Tn O A O) *) split; Col. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) apply H. (* Goal: @Sum 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 O' E')) *) exists O'. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: and (@Col Tn O' O E) (@Col Tn O' O' E') *) split; Col. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: @Col Tn O' O E *) ColR. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) contradiction. (* Goal: @Sum Tn O' E' E A' B' C' *) assert(~Col O A A'). (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: not (@Col Tn O A A') *) intro. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) apply H. (* Goal: @Sum 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: @Sum Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn A' O E) (@Col Tn A' O' E') *) split; Col. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn A' O E *) ColR. (* Goal: @Sum Tn O' E' E A' B' C' *) assert(A' <> O'). (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: not (@eq (@Tpoint Tn) A' O') *) intro. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) subst A'. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) induction H3. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) induction H3. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H3. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O O') (@Col Tn X A O')) *) exists O'. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn O' O O') (@Col Tn O' A O') *) split; Col. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) contradiction. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) subst A. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: False *) apply H15. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' O' *) Col. (* Goal: @Sum Tn O' E' E A' B' C' *) assert(Parallelogram_flat O A C B). (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Parallelogram_flat Tn O A C B *) apply(sum_cong O E E' H6 A B C HS). (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O)) *) left. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: not (@eq (@Tpoint Tn) A O) *) auto. (* Goal: @Sum Tn O' E' E A' B' C' *) unfold Parallelogram_flat in H32. (* Goal: @Sum Tn O' E' E A' B' C' *) spliter. (* Goal: @Sum Tn O' E' E A' B' C' *) assert(Proj O O' O' E' E E'). (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Proj Tn O O' O' E' E E' *) unfold Proj. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: and (not (@eq (@Tpoint Tn) O' E')) (and (not (@eq (@Tpoint Tn) E E')) (and (not (@Par Tn O' E' E E')) (and (@Col Tn O' E' O') (or (@Par Tn O O' E E') (@eq (@Tpoint Tn) O O'))))) *) repeat split; Col. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn O O' E E') (@eq (@Tpoint Tn) O O') *) (* Goal: not (@Par Tn O' E' E E') *) intro. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn O O' E E') (@eq (@Tpoint Tn) O O') *) (* Goal: False *) apply H29. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn O O' E E') (@eq (@Tpoint Tn) O O') *) (* Goal: @Par Tn O' E' E' E *) Par. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn O O' E E') (@eq (@Tpoint Tn) O O') *) induction H2. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn O O' E E') (@eq (@Tpoint Tn) O O') *) (* Goal: or (@Par Tn O O' E E') (@eq (@Tpoint Tn) O O') *) left; Par. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn O O' E E') (@eq (@Tpoint Tn) O O') *) subst E'. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn O O' E E) (@eq (@Tpoint Tn) O O') *) tauto. (* Goal: @Sum Tn O' E' E A' B' C' *) assert(Proj A A' O' E' E E'). (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Proj Tn A A' O' E' E E' *) unfold Proj. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: and (not (@eq (@Tpoint Tn) O' E')) (and (not (@eq (@Tpoint Tn) E E')) (and (not (@Par Tn O' E' E E')) (and (@Col Tn O' E' A') (or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A'))))) *) repeat split; Col. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: not (@Par Tn O' E' E E') *) intro. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: False *) apply H29. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: @Par Tn O' E' E' E *) Par. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) induction H3. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) left. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: @Par Tn A A' E E' *) induction H2. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn A A' E E' *) apply (par_trans _ _ O O'); Par. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: @Par Tn A A' E E' *) subst E'. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) (* Goal: @Par Tn A A' E E *) tauto. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn A A' E E') (@eq (@Tpoint Tn) A A') *) subst A'. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn A A E E') (@eq (@Tpoint Tn) A A) *) right. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) A A *) auto. (* Goal: @Sum Tn O' E' E A' B' C' *) assert(Proj C C' O' E' E E'). (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Proj Tn C C' O' E' E E' *) unfold Proj. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: and (not (@eq (@Tpoint Tn) O' E')) (and (not (@eq (@Tpoint Tn) E E')) (and (not (@Par Tn O' E' E E')) (and (@Col Tn O' E' C') (or (@Par Tn C C' E E') (@eq (@Tpoint Tn) C C'))))) *) repeat split; Col. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn C C' E E') (@eq (@Tpoint Tn) C C') *) (* Goal: not (@Par Tn O' E' E E') *) intro. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn C C' E E') (@eq (@Tpoint Tn) C C') *) (* Goal: False *) apply H29. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn C C' E E') (@eq (@Tpoint Tn) C C') *) (* Goal: @Par Tn O' E' E' E *) Par. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn C C' E E') (@eq (@Tpoint Tn) C C') *) induction H5. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn C C' E E') (@eq (@Tpoint Tn) C C') *) (* Goal: or (@Par Tn C C' E E') (@eq (@Tpoint Tn) C C') *) left. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn C C' E E') (@eq (@Tpoint Tn) C C') *) (* Goal: @Par Tn C C' E E' *) induction H2. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn C C' E E') (@eq (@Tpoint Tn) C C') *) (* Goal: @Par Tn C C' E E' *) (* Goal: @Par Tn C C' E E' *) apply (par_trans _ _ O O'); Par. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn C C' E E') (@eq (@Tpoint Tn) C C') *) (* Goal: @Par Tn C C' E E' *) subst E'. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn C C' E E') (@eq (@Tpoint Tn) C C') *) (* Goal: @Par Tn C C' E E *) tauto. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn C C' E E') (@eq (@Tpoint Tn) C C') *) right. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) C C' *) auto. (* Goal: @Sum Tn O' E' E A' B' C' *) assert(Proj B B' O' E' E E'). (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Proj Tn B B' O' E' E E' *) unfold Proj. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: and (not (@eq (@Tpoint Tn) O' E')) (and (not (@eq (@Tpoint Tn) E E')) (and (not (@Par Tn O' E' E E')) (and (@Col Tn O' E' B') (or (@Par Tn B B' E E') (@eq (@Tpoint Tn) B B'))))) *) repeat split; Col. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn B B' E E') (@eq (@Tpoint Tn) B B') *) (* Goal: not (@Par Tn O' E' E E') *) intro. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn B B' E E') (@eq (@Tpoint Tn) B B') *) (* Goal: False *) apply H29. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn B B' E E') (@eq (@Tpoint Tn) B B') *) (* Goal: @Par Tn O' E' E' E *) Par. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn B B' E E') (@eq (@Tpoint Tn) B B') *) induction H4. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn B B' E E') (@eq (@Tpoint Tn) B B') *) (* Goal: or (@Par Tn B B' E E') (@eq (@Tpoint Tn) B B') *) left. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn B B' E E') (@eq (@Tpoint Tn) B B') *) (* Goal: @Par Tn B B' E E' *) induction H2. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn B B' E E') (@eq (@Tpoint Tn) B B') *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' E E' *) apply (par_trans _ _ O O'); Par. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn B B' E E') (@eq (@Tpoint Tn) B B') *) (* Goal: @Par Tn B B' E E' *) subst E'. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn B B' E E') (@eq (@Tpoint Tn) B B') *) (* Goal: @Par Tn B B' E E *) tauto. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Par Tn B B' E E') (@eq (@Tpoint Tn) B B') *) right. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) B B' *) auto. (* Goal: @Sum Tn O' E' E A' B' C' *) assert(EqV O A B C). (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @EqV Tn O A B C *) unfold EqV. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (@Parallelogram Tn O A C B) (and (@eq (@Tpoint Tn) O A) (@eq (@Tpoint Tn) B C)) *) left. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Parallelogram Tn O A C B *) right. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Parallelogram_flat Tn O A C B *) apply plgf_permut. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Parallelogram_flat Tn B O A C *) unfold Parallelogram_flat. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn B O A) (and (@Col Tn B O C) (and (@Cong Tn B O A C) (and (@Cong Tn B C A O) (or (not (@eq (@Tpoint Tn) B A)) (not (@eq (@Tpoint Tn) O C)))))) *) repeat split; Col; Cong. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (not (@eq (@Tpoint Tn) B A)) (not (@eq (@Tpoint Tn) O C)) *) (* Goal: @Col Tn B O C *) ColR. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (not (@eq (@Tpoint Tn) B A)) (not (@eq (@Tpoint Tn) O C)) *) induction H38. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (not (@eq (@Tpoint Tn) B A)) (not (@eq (@Tpoint Tn) O C)) *) (* Goal: or (not (@eq (@Tpoint Tn) B A)) (not (@eq (@Tpoint Tn) O C)) *) right. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (not (@eq (@Tpoint Tn) B A)) (not (@eq (@Tpoint Tn) O C)) *) (* Goal: not (@eq (@Tpoint Tn) O C) *) auto. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: or (not (@eq (@Tpoint Tn) B A)) (not (@eq (@Tpoint Tn) O C)) *) left. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: not (@eq (@Tpoint Tn) B A) *) auto. (* Goal: @Sum Tn O' E' E A' B' C' *) assert(HH:=project_preserves_eqv O A B C O' A' B' C' O' E' E E' H43 H39 H40 H42 H41). (* Goal: @Sum Tn O' E' E A' B' C' *) unfold EqV in HH. (* Goal: @Sum Tn O' E' E A' B' C' *) induction HH. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E A' B' C' *) assert(Parallelogram_flat O' A' C' B'). (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Parallelogram_flat Tn O' A' C' B' *) induction H44. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Parallelogram_flat Tn O' A' C' B' *) (* Goal: @Parallelogram_flat Tn O' A' C' B' *) induction H44. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Parallelogram_flat Tn O' A' C' B' *) (* Goal: @Parallelogram_flat Tn O' A' C' B' *) unfold TS in H44. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Parallelogram_flat Tn O' A' C' B' *) (* Goal: @Parallelogram_flat Tn O' A' C' B' *) spliter. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Parallelogram_flat Tn O' A' C' B' *) (* Goal: @Parallelogram_flat Tn O' A' C' B' *) apply False_ind. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Parallelogram_flat Tn O' A' C' B' *) (* Goal: False *) apply H47. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Parallelogram_flat Tn O' A' C' B' *) (* Goal: @Col Tn B' O' C' *) ColR. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Parallelogram_flat Tn O' A' C' B' *) assumption. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E A' B' C' *) unfold Parallelogram_flat in H45. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E A' B' C' *) spliter. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Sum Tn O' E' E A' B' C' *) apply cong_sum; auto. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Cong Tn O' B' A' C' *) (* Goal: @Cong Tn O' A' B' C' *) (* Goal: @Ar2 Tn O' E' E A' B' C' *) (* Goal: or (not (@eq (@Tpoint Tn) O' C')) (not (@eq (@Tpoint Tn) B' A')) *) induction H49. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Cong Tn O' B' A' C' *) (* Goal: @Cong Tn O' A' B' C' *) (* Goal: @Ar2 Tn O' E' E A' B' C' *) (* Goal: or (not (@eq (@Tpoint Tn) O' C')) (not (@eq (@Tpoint Tn) B' A')) *) (* Goal: or (not (@eq (@Tpoint Tn) O' C')) (not (@eq (@Tpoint Tn) B' A')) *) left; auto. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Cong Tn O' B' A' C' *) (* Goal: @Cong Tn O' A' B' C' *) (* Goal: @Ar2 Tn O' E' E A' B' C' *) (* Goal: or (not (@eq (@Tpoint Tn) O' C')) (not (@eq (@Tpoint Tn) B' A')) *) right; auto. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Cong Tn O' B' A' C' *) (* Goal: @Cong Tn O' A' B' C' *) (* Goal: @Ar2 Tn O' E' E A' B' C' *) repeat split; Col. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Cong Tn O' B' A' C' *) (* Goal: @Cong Tn O' A' B' C' *) Cong. (* Goal: @Sum Tn O' E' E A' B' C' *) (* Goal: @Cong Tn O' B' A' C' *) Cong. (* Goal: @Sum Tn O' E' E A' B' C' *) spliter. (* Goal: @Sum Tn O' E' E A' B' C' *) subst A'. (* Goal: @Sum Tn O' E' E O' B' C' *) tauto. Qed. Lemma double_null_null : forall O E E' A, Sum O E E' A A O -> A = O. Proof. (* Goal: forall (O E E' A : @Tpoint Tn) (_ : @Sum Tn O E E' A A O), @eq (@Tpoint Tn) A O *) intros. (* Goal: @eq (@Tpoint Tn) A O *) induction (eq_dec_points A O). (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) assumption. (* Goal: @eq (@Tpoint Tn) A O *) assert(HS:= H). (* Goal: @eq (@Tpoint Tn) A O *) unfold Sum in H. (* Goal: @eq (@Tpoint Tn) A O *) spliter. (* Goal: @eq (@Tpoint Tn) A O *) unfold Ar2 in H. (* Goal: @eq (@Tpoint Tn) A O *) spliter. (* Goal: @eq (@Tpoint Tn) A O *) assert(Parallelogram_flat O A O A). (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @Parallelogram_flat Tn O A O A *) apply(sum_cong O E E' H A A O HS). (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) A O)) *) left; auto. (* Goal: @eq (@Tpoint Tn) A O *) unfold Parallelogram_flat in H5. (* Goal: @eq (@Tpoint Tn) A O *) tauto. Qed. Lemma not_null_double_not_null : forall O E E' A C, Sum O E E' A A C -> A <> O -> C <> O. Proof. (* Goal: forall (O E E' A C : @Tpoint Tn) (_ : @Sum Tn O E E' A A C) (_ : not (@eq (@Tpoint Tn) A O)), not (@eq (@Tpoint Tn) C O) *) intros. (* Goal: not (@eq (@Tpoint Tn) C O) *) intro. (* Goal: False *) subst C. (* Goal: False *) apply double_null_null in H. (* Goal: False *) contradiction. Qed. Lemma double_not_null_not_nul : forall O E E' A C, Sum O E E' A A C -> C <> O -> A <> O. Proof. (* Goal: forall (O E E' A C : @Tpoint Tn) (_ : @Sum Tn O E E' A A C) (_ : not (@eq (@Tpoint Tn) C O)), not (@eq (@Tpoint Tn) A O) *) intros. (* Goal: not (@eq (@Tpoint Tn) A O) *) intro. (* Goal: False *) subst A. (* Goal: False *) assert(HS:= H). (* Goal: False *) unfold Sum in H. (* Goal: False *) spliter. (* Goal: False *) unfold Ar2 in H. (* Goal: False *) spliter. (* Goal: False *) assert(HH:= sum_O_O O E E' H). (* Goal: False *) apply H0. (* Goal: @eq (@Tpoint Tn) C O *) apply (sum_uniqueness O E E' O O); assumption. Qed. Lemma diff_ar2 : forall O E E' A B AMB, Diff O E E' A B AMB -> Ar2 O E E' A B AMB. Proof. (* Goal: forall (O E E' A B AMB : @Tpoint Tn) (_ : @Diff Tn O E E' A B AMB), @Ar2 Tn O E E' A B AMB *) intros. (* Goal: @Ar2 Tn O E E' A B AMB *) unfold Diff in H. (* Goal: @Ar2 Tn O E E' A B AMB *) ex_and H MA. (* Goal: @Ar2 Tn O E E' A B AMB *) unfold Opp in H. (* Goal: @Ar2 Tn O E E' A B AMB *) unfold Sum in *. (* Goal: @Ar2 Tn O E E' A B AMB *) spliter. (* Goal: @Ar2 Tn O E E' A B AMB *) unfold Ar2 in *. (* Goal: and (not (@Col Tn O E E')) (and (@Col Tn O E A) (and (@Col Tn O E B) (@Col Tn O E AMB))) *) spliter. (* Goal: and (not (@Col Tn O E E')) (and (@Col Tn O E A) (and (@Col Tn O E B) (@Col Tn O E AMB))) *) repeat split; auto. Qed. Lemma diff_null : forall O E E' A, ~Col O E E' -> Col O E A -> Diff O E E' A A O. Proof. (* Goal: forall (O E E' A : @Tpoint Tn) (_ : not (@Col Tn O E E')) (_ : @Col Tn O E A), @Diff Tn O E E' A A O *) intros. (* Goal: @Diff Tn O E E' A A O *) unfold Diff. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Opp Tn O E E' A B') (@Sum Tn O E E' A B' O)) *) assert(Hop:=opp_exists O E E' H A H0). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Opp Tn O E E' A B') (@Sum Tn O E E' A B' O)) *) ex_and Hop MB. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Opp Tn O E E' A B') (@Sum Tn O E E' A B' O)) *) exists MB. (* Goal: and (@Opp Tn O E E' A MB) (@Sum Tn O E E' A MB O) *) split; auto. (* Goal: @Sum Tn O E E' A MB O *) unfold Opp in H1. (* Goal: @Sum Tn O E E' A MB O *) apply sum_comm; auto. Qed. Lemma diff_exists : forall O E E' A B, ~Col O E E' -> Col O E A -> Col O E B -> exists D, Diff O E E' A B D. Proof. (* Goal: forall (O E E' A B : @Tpoint Tn) (_ : not (@Col Tn O E E')) (_ : @Col Tn O E A) (_ : @Col Tn O E B), @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Diff Tn O E E' A B D) *) intros. (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Diff Tn O E E' A B D) *) assert(Hop:=opp_exists O E E' H B H1). (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Diff Tn O E E' A B D) *) ex_and Hop MB. (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Diff Tn O E E' A B D) *) assert(Col O E MB). (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Diff Tn O E E' A B D) *) (* Goal: @Col Tn O E MB *) unfold Opp in H2. (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Diff Tn O E E' A B D) *) (* Goal: @Col Tn O E MB *) unfold Sum in H2. (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Diff Tn O E E' A B D) *) (* Goal: @Col Tn O E MB *) spliter. (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Diff Tn O E E' A B D) *) (* Goal: @Col Tn O E MB *) unfold Ar2 in H2. (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Diff Tn O E E' A B D) *) (* Goal: @Col Tn O E MB *) tauto. (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Diff Tn O E E' A B D) *) assert(HS:=sum_exists O E E' H A MB H0 H3). (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Diff Tn O E E' A B D) *) ex_and HS C. (* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Diff Tn O E E' A B D) *) exists C. (* Goal: @Diff Tn O E E' A B C *) unfold Diff. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Opp Tn O E E' B B') (@Sum Tn O E E' A B' C)) *) exists MB. (* Goal: and (@Opp Tn O E E' B MB) (@Sum Tn O E E' A MB C) *) split; assumption. Qed. Lemma diff_uniqueness : forall O E E' A B D1 D2, Diff O E E' A B D1 -> Diff O E E' A B D2 -> D1 = D2. Proof. (* Goal: forall (O E E' A B D1 D2 : @Tpoint Tn) (_ : @Diff Tn O E E' A B D1) (_ : @Diff Tn O E E' A B D2), @eq (@Tpoint Tn) D1 D2 *) intros. (* Goal: @eq (@Tpoint Tn) D1 D2 *) assert(Ar2 O E E' A B D1). (* Goal: @eq (@Tpoint Tn) D1 D2 *) (* Goal: @Ar2 Tn O E E' A B D1 *) apply (diff_ar2); assumption. (* Goal: @eq (@Tpoint Tn) D1 D2 *) unfold Ar2 in H1. (* Goal: @eq (@Tpoint Tn) D1 D2 *) spliter. (* Goal: @eq (@Tpoint Tn) D1 D2 *) unfold Diff in *. (* Goal: @eq (@Tpoint Tn) D1 D2 *) ex_and H MB1. (* Goal: @eq (@Tpoint Tn) D1 D2 *) ex_and H0 MB2. (* Goal: @eq (@Tpoint Tn) D1 D2 *) assert(MB1 = MB2). (* Goal: @eq (@Tpoint Tn) D1 D2 *) (* Goal: @eq (@Tpoint Tn) MB1 MB2 *) apply (opp_uniqueness O E E' H1 B); assumption. (* Goal: @eq (@Tpoint Tn) D1 D2 *) subst MB2. (* Goal: @eq (@Tpoint Tn) D1 D2 *) apply(sum_uniqueness O E E' A MB1); assumption. Qed. Lemma sum_ar2 : forall O E E' A B C, Sum O E E' A B C -> Ar2 O E E' A B C. Proof. (* Goal: forall (O E E' A B C : @Tpoint Tn) (_ : @Sum Tn O E E' A B C), @Ar2 Tn O E E' A B C *) intros. (* Goal: @Ar2 Tn O E E' A B C *) unfold Sum in H. (* Goal: @Ar2 Tn O E E' A B C *) tauto. Qed. Lemma diff_A_O : forall O E E' A, ~Col O E E' -> Col O E A -> Diff O E E' A O A. Proof. (* Goal: forall (O E E' A : @Tpoint Tn) (_ : not (@Col Tn O E E')) (_ : @Col Tn O E A), @Diff Tn O E E' A O A *) intros. (* Goal: @Diff Tn O E E' A O A *) unfold Diff. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Opp Tn O E E' O B') (@Sum Tn O E E' A B' A)) *) exists O. (* Goal: and (@Opp Tn O E E' O O) (@Sum Tn O E E' A O A) *) split. (* Goal: @Sum Tn O E E' A O A *) (* Goal: @Opp Tn O E E' O O *) unfold Opp. (* Goal: @Sum Tn O E E' A O A *) (* Goal: @Sum Tn O E E' O O O *) apply sum_O_O; auto. (* Goal: @Sum Tn O E E' A O A *) apply sum_A_O;auto. Qed. Lemma diff_O_A : forall O E E' A mA, ~ Col O E E' -> Opp O E E' A mA -> Diff O E E' O A mA. Proof. (* Goal: forall (O E E' A mA : @Tpoint Tn) (_ : not (@Col Tn O E E')) (_ : @Opp Tn O E E' A mA), @Diff Tn O E E' O A mA *) intros. (* Goal: @Diff Tn O E E' O A mA *) assert (Col O E A) by (unfold Opp, Sum, Ar2 in *; spliter; auto). (* Goal: @Diff Tn O E E' O A mA *) assert (Col O E mA) by (unfold Opp, Sum, Ar2 in *; spliter; auto). (* Goal: @Diff Tn O E E' O A mA *) revert H0; revert H1; revert H2; intros. (* Goal: @Diff Tn O E E' O A mA *) unfold Diff. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Opp Tn O E E' A B') (@Sum Tn O E E' O B' mA)) *) exists mA. (* Goal: and (@Opp Tn O E E' A mA) (@Sum Tn O E E' O mA mA) *) split. (* Goal: @Sum Tn O E E' O mA mA *) (* Goal: @Opp Tn O E E' A mA *) assumption. (* Goal: @Sum Tn O E E' O mA mA *) apply sum_O_B; auto. Qed. Lemma diff_O_A_opp : forall O E E' A mA, Diff O E E' O A mA -> Opp O E E' A mA. Proof. (* Goal: forall (O E E' A mA : @Tpoint Tn) (_ : @Diff Tn O E E' O A mA), @Opp Tn O E E' A mA *) intros. (* Goal: @Opp Tn O E E' A mA *) assert(Ar2 O E E' O A mA). (* Goal: @Opp Tn O E E' A mA *) (* Goal: @Ar2 Tn O E E' O A mA *) apply diff_ar2;auto. (* Goal: @Opp Tn O E E' A mA *) unfold Diff in H. (* Goal: @Opp Tn O E E' A mA *) ex_and H A'. (* Goal: @Opp Tn O E E' A mA *) assert(Ar2 O E E' O A' mA). (* Goal: @Opp Tn O E E' A mA *) (* Goal: @Ar2 Tn O E E' O A' mA *) apply sum_ar2; auto. (* Goal: @Opp Tn O E E' A mA *) unfold Ar2 in *. (* Goal: @Opp Tn O E E' A mA *) spliter. (* Goal: @Opp Tn O E E' A mA *) clean_duplicated_hyps. (* Goal: @Opp Tn O E E' A mA *) assert(Sum O E E' O A' A'). (* Goal: @Opp Tn O E E' A mA *) (* Goal: @Sum Tn O E E' O A' A' *) apply (sum_O_B); auto. (* Goal: @Opp Tn O E E' A mA *) assert(mA = A'). (* Goal: @Opp Tn O E E' A mA *) (* Goal: @eq (@Tpoint Tn) mA A' *) apply(sum_uniqueness O E E' O A'); auto. (* Goal: @Opp Tn O E E' A mA *) subst A'. (* Goal: @Opp Tn O E E' A mA *) assumption. Qed. Lemma diff_uniquenessA : forall O E E' A A' B C, Diff O E E' A B C -> Diff O E E' A' B C -> A = A'. Proof. (* Goal: forall (O E E' A A' B C : @Tpoint Tn) (_ : @Diff Tn O E E' A B C) (_ : @Diff Tn O E E' A' B C), @eq (@Tpoint Tn) A A' *) intros. (* Goal: @eq (@Tpoint Tn) A A' *) assert(Ar2 O E E' A B C). (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @Ar2 Tn O E E' A B C *) apply diff_ar2; auto. (* Goal: @eq (@Tpoint Tn) A A' *) assert(Ar2 O E E' A' B C). (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @Ar2 Tn O E E' A' B C *) apply diff_ar2; auto. (* 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' *) unfold Diff in *. (* Goal: @eq (@Tpoint Tn) A A' *) ex_and H mB. (* Goal: @eq (@Tpoint Tn) A A' *) ex_and H0 mB'. (* Goal: @eq (@Tpoint Tn) A A' *) assert(mB = mB'). (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) mB mB' *) apply(opp_uniqueness O E E' H1 B); auto. (* Goal: @eq (@Tpoint Tn) A A' *) subst mB'. (* Goal: @eq (@Tpoint Tn) A A' *) apply (sum_uniquenessA O E E' H1 mB A A' C); auto. Qed. Lemma diff_uniquenessB : forall O E E' A B B' C, Diff O E E' A B C -> Diff O E E' A B' C -> B = B'. Proof. (* Goal: forall (O E E' A B B' C : @Tpoint Tn) (_ : @Diff Tn O E E' A B C) (_ : @Diff Tn O E E' A B' C), @eq (@Tpoint Tn) B B' *) intros. (* Goal: @eq (@Tpoint Tn) B B' *) assert(Ar2 O E E' A B C). (* Goal: @eq (@Tpoint Tn) B B' *) (* Goal: @Ar2 Tn O E E' A B C *) apply diff_ar2; auto. (* Goal: @eq (@Tpoint Tn) B B' *) assert(Ar2 O E E' A B' C). (* Goal: @eq (@Tpoint Tn) B B' *) (* Goal: @Ar2 Tn O E E' A B' C *) apply diff_ar2; auto. (* Goal: @eq (@Tpoint Tn) B B' *) unfold Ar2 in *. (* Goal: @eq (@Tpoint Tn) B B' *) spliter. (* Goal: @eq (@Tpoint Tn) B B' *) clean_duplicated_hyps. (* Goal: @eq (@Tpoint Tn) B B' *) unfold Diff in *. (* Goal: @eq (@Tpoint Tn) B B' *) ex_and H mB. (* Goal: @eq (@Tpoint Tn) B B' *) ex_and H0 mB'. (* Goal: @eq (@Tpoint Tn) B B' *) assert(mB = mB'). (* Goal: @eq (@Tpoint Tn) B B' *) (* Goal: @eq (@Tpoint Tn) mB mB' *) apply (sum_uniquenessA O E E' H1 A mB mB' C); apply sum_comm; auto. (* Goal: @eq (@Tpoint Tn) B B' *) subst mB'. (* Goal: @eq (@Tpoint Tn) B B' *) apply (opp_uniqueness O E E' H1 mB); apply opp_comm; auto. Qed. Lemma diff_null_eq : forall O E E' A B, Diff O E E' A B O -> A = B. Proof. (* Goal: forall (O E E' A B : @Tpoint Tn) (_ : @Diff Tn O E E' A B O), @eq (@Tpoint Tn) A B *) intros. (* Goal: @eq (@Tpoint Tn) A B *) assert(Ar2 O E E' A B O). (* Goal: @eq (@Tpoint Tn) A B *) (* Goal: @Ar2 Tn O E E' A B O *) apply diff_ar2; auto. (* Goal: @eq (@Tpoint Tn) A B *) unfold Ar2 in H0. (* Goal: @eq (@Tpoint Tn) A B *) spliter. (* Goal: @eq (@Tpoint Tn) A B *) clear H3. (* Goal: @eq (@Tpoint Tn) A B *) assert(Diff O E E' A A O). (* Goal: @eq (@Tpoint Tn) A B *) (* Goal: @Diff Tn O E E' A A O *) apply diff_null; Col. (* Goal: @eq (@Tpoint Tn) A B *) apply (diff_uniquenessB O E E' A _ _ O); auto. Qed. Lemma midpoint_opp: forall O E E' A B, Ar2 O E E' O A B -> Midpoint O A B -> Opp O E E' A B. Proof. (* Goal: forall (O E E' A B : @Tpoint Tn) (_ : @Ar2 Tn O E E' O A B) (_ : @Midpoint Tn O A B), @Opp Tn O E E' A B *) intros. (* Goal: @Opp Tn O E E' A B *) unfold Ar2. (* Goal: @Opp Tn O E E' A B *) unfold Ar2 in H. (* Goal: @Opp Tn O E E' A B *) spliter. (* Goal: @Opp Tn O E E' A B *) clear H1. (* Goal: @Opp Tn O E E' A B *) unfold Midpoint in H0. (* Goal: @Opp Tn O E E' A B *) spliter. (* Goal: @Opp Tn O E E' A B *) induction (eq_dec_points A B). (* Goal: @Opp Tn O E E' A B *) (* Goal: @Opp Tn O E E' A B *) subst B. (* Goal: @Opp Tn O E E' A B *) (* Goal: @Opp Tn O E E' A A *) apply between_identity in H0. (* Goal: @Opp Tn O E E' A B *) (* Goal: @Opp Tn O E E' A A *) subst A. (* Goal: @Opp Tn O E E' A B *) (* Goal: @Opp Tn O E E' O O *) apply opp0; auto. (* Goal: @Opp Tn O E E' A B *) unfold Opp. (* Goal: @Sum Tn O E E' B A O *) apply cong_sum; auto. (* Goal: @Cong Tn O A B O *) (* Goal: @Cong Tn O B A O *) (* Goal: @Ar2 Tn O E E' B A O *) unfold Ar2. (* Goal: @Cong Tn O A B O *) (* Goal: @Cong Tn O B A O *) (* Goal: and (not (@Col Tn O E E')) (and (@Col Tn O E B) (and (@Col Tn O E A) (@Col Tn O E O))) *) repeat split; Col. (* Goal: @Cong Tn O A B O *) (* Goal: @Cong Tn O B A O *) Cong. (* Goal: @Cong Tn O A B O *) Cong. Qed. Lemma sum_diff : forall O E E' A B S, Sum O E E' A B S -> Diff O E E' S A B. Proof. (* Goal: forall (O E E' A B S : @Tpoint Tn) (_ : @Sum Tn O E E' A B S), @Diff Tn O E E' S A B *) intros. (* Goal: @Diff Tn O E E' S A B *) assert(Ar2 O E E' A B S). (* Goal: @Diff Tn O E E' S A B *) (* Goal: @Ar2 Tn O E E' A B S *) apply sum_ar2; auto. (* Goal: @Diff Tn O E E' S A B *) unfold Ar2 in H0. (* Goal: @Diff Tn O E E' S A B *) spliter. (* Goal: @Diff Tn O E E' S A B *) assert(HH:=opp_exists O E E' H0 A H1). (* Goal: @Diff Tn O E E' S A B *) ex_and HH mA. (* Goal: @Diff Tn O E E' S A B *) exists mA. (* Goal: and (@Opp Tn O E E' A mA) (@Sum Tn O E E' S mA B) *) split; auto. (* Goal: @Sum Tn O E E' S mA B *) unfold Opp in H4. (* Goal: @Sum Tn O E E' S mA B *) assert(Ar2 O E E' mA A O). (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Ar2 Tn O E E' mA A O *) apply sum_ar2; auto. (* Goal: @Sum Tn O E E' S mA B *) unfold Ar2 in H5. (* Goal: @Sum Tn O E E' S mA B *) spliter. (* Goal: @Sum Tn O E E' S mA B *) clean_duplicated_hyps. (* Goal: @Sum Tn O E E' S mA B *) clear H8. (* Goal: @Sum Tn O E E' S mA B *) induction(eq_dec_points A O). (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) subst A. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) assert(B = S). (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @eq (@Tpoint Tn) B S *) apply (sum_uniqueness O E E' O B); auto. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' O B B *) apply sum_O_B; auto. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) subst S. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' B mA B *) assert(mA = O). (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' B mA B *) (* Goal: @eq (@Tpoint Tn) mA O *) apply (sum_uniqueness O E E' mA O); auto. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' B mA B *) (* Goal: @Sum Tn O E E' mA O mA *) apply sum_A_O; auto. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' B mA B *) subst mA. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' B O B *) apply sum_A_O; auto. (* Goal: @Sum Tn O E E' S mA B *) induction(eq_dec_points B O). (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) subst B. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA O *) assert(A = S). (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA O *) (* Goal: @eq (@Tpoint Tn) A S *) apply (sum_uniqueness O E E' A O); auto. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA O *) (* Goal: @Sum Tn O E E' A O A *) apply sum_A_O; auto. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA O *) subst S. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' A mA O *) apply sum_comm; auto. (* Goal: @Sum Tn O E E' S mA B *) apply sum_cong in H; auto. (* Goal: @Sum Tn O E E' S mA B *) apply sum_cong in H4; auto. (* Goal: @Sum Tn O E E' S mA B *) assert(E <> O). (* Goal: @Sum Tn O E E' S mA B *) (* Goal: not (@eq (@Tpoint Tn) E O) *) intro. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: False *) subst E. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: False *) apply H0. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Col Tn O O E' *) Col. (* Goal: @Sum Tn O E E' S mA B *) assert(Parallelogram O mA B S \/ O = mA /\ O = A /\ S = B /\ O = S). (* Goal: @Sum Tn O E E' S mA B *) (* Goal: or (@Parallelogram Tn O mA B S) (and (@eq (@Tpoint Tn) O mA) (and (@eq (@Tpoint Tn) O A) (and (@eq (@Tpoint Tn) S B) (@eq (@Tpoint Tn) O S)))) *) apply(plg_pseudo_trans O mA O A S B); auto. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Parallelogram Tn O A S B *) (* Goal: @Parallelogram Tn O mA O A *) right; auto. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Parallelogram Tn O A S B *) right; auto. (* Goal: @Sum Tn O E E' S mA B *) induction H9. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) induction H9. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) apply False_ind. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) (* Goal: False *) unfold Parallelogram_strict in H9. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) (* Goal: False *) spliter. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) (* Goal: False *) unfold TS in H9. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) (* Goal: False *) spliter. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) (* Goal: False *) apply H12. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Col Tn S O B *) ColR. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) unfold Parallelogram_flat in H. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) unfold Parallelogram_flat in H4. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) unfold Parallelogram_flat in H9. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) spliter. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Sum Tn O E E' S mA B *) apply cong_sum; auto. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Cong Tn O mA S B *) (* Goal: @Cong Tn O S mA B *) (* Goal: @Ar2 Tn O E E' S mA B *) repeat split; Col. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Cong Tn O mA S B *) (* Goal: @Cong Tn O S mA B *) Cong. (* Goal: @Sum Tn O E E' S mA B *) (* Goal: @Cong Tn O mA S B *) Cong. (* Goal: @Sum Tn O E E' S mA B *) spliter. (* Goal: @Sum Tn O E E' S mA B *) subst A. (* Goal: @Sum Tn O E E' S mA B *) tauto. Qed. Lemma diff_sum : forall O E E' A B S, Diff O E E' S A B -> Sum O E E' A B S. Proof. (* Goal: forall (O E E' A B S : @Tpoint Tn) (_ : @Diff Tn O E E' S A B), @Sum Tn O E E' A B S *) intros. (* Goal: @Sum Tn O E E' A B S *) assert(Ar2 O E E' S A B). (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Ar2 Tn O E E' S A B *) apply diff_ar2; auto. (* Goal: @Sum Tn O E E' A B S *) unfold Ar2 in H0. (* Goal: @Sum Tn O E E' A B S *) spliter. (* Goal: @Sum Tn O E E' A B S *) induction(eq_dec_points A O). (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B S *) subst A. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' O B S *) assert(HH:=diff_A_O O E E' S H0 H1). (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' O B S *) assert(S = B). (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' O B S *) (* Goal: @eq (@Tpoint Tn) S B *) apply (diff_uniqueness O E E' S O); auto. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' O B S *) subst B. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' O S S *) apply sum_O_B; auto. (* Goal: @Sum Tn O E E' A B S *) unfold Diff in H. (* Goal: @Sum Tn O E E' A B S *) ex_and H mA. (* Goal: @Sum Tn O E E' A B S *) assert(mA <> O). (* Goal: @Sum Tn O E E' A B S *) (* Goal: not (@eq (@Tpoint Tn) mA O) *) intro. (* Goal: @Sum Tn O E E' A B S *) (* Goal: False *) subst mA. (* Goal: @Sum Tn O E E' A B S *) (* Goal: False *) assert(HH:=opp0 O E E' H0). (* Goal: @Sum Tn O E E' A B S *) (* Goal: False *) apply H4. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @eq (@Tpoint Tn) A O *) apply (opp_uniqueness O E E' H0 O); auto. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Opp Tn O E E' O A *) apply opp_comm; auto. (* Goal: @Sum Tn O E E' A B S *) unfold Opp in H. (* Goal: @Sum Tn O E E' A B S *) induction(eq_dec_points S O). (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B S *) subst S. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B O *) assert(mA = B). (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B O *) (* Goal: @eq (@Tpoint Tn) mA B *) apply (sum_O_B_eq O E E'); auto. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B O *) subst mA. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B O *) apply sum_comm; auto. (* Goal: @Sum Tn O E E' A B S *) apply sum_cong in H; auto. (* Goal: @Sum Tn O E E' A B S *) apply sum_cong in H5; auto. (* Goal: @Sum Tn O E E' A B S *) assert(E <> O). (* Goal: @Sum Tn O E E' A B S *) (* Goal: not (@eq (@Tpoint Tn) E O) *) intro. (* Goal: @Sum Tn O E E' A B S *) (* Goal: False *) subst E. (* Goal: @Sum Tn O E E' A B S *) (* Goal: False *) apply H0. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Col Tn O O E' *) Col. (* Goal: @Sum Tn O E E' A B S *) assert(Parallelogram O A S B \/ O = A /\ O = mA /\ B = S /\ O = B). (* Goal: @Sum Tn O E E' A B S *) (* Goal: or (@Parallelogram Tn O A S B) (and (@eq (@Tpoint Tn) O A) (and (@eq (@Tpoint Tn) O mA) (and (@eq (@Tpoint Tn) B S) (@eq (@Tpoint Tn) O B)))) *) apply(plg_pseudo_trans O A O mA B S). (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Parallelogram Tn O mA B S *) (* Goal: @Parallelogram Tn O A O mA *) apply plg_permut. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Parallelogram Tn O mA B S *) (* Goal: @Parallelogram Tn mA O A O *) apply plg_permut. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Parallelogram Tn O mA B S *) (* Goal: @Parallelogram Tn O mA O A *) right. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Parallelogram Tn O mA B S *) (* Goal: @Parallelogram_flat Tn O mA O A *) assumption. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Parallelogram Tn O mA B S *) apply plg_comm2. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Parallelogram Tn mA O S B *) apply plg_permut. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Parallelogram Tn B mA O S *) apply plg_permut. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Parallelogram Tn S B mA O *) apply plg_permut. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Parallelogram Tn O S B mA *) right. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Parallelogram_flat Tn O S B mA *) auto. (* Goal: @Sum Tn O E E' A B S *) induction H9. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B S *) induction H9. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B S *) apply False_ind. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B S *) (* Goal: False *) unfold Parallelogram_strict in H9. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B S *) (* Goal: False *) spliter. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B S *) (* Goal: False *) unfold TS in H9. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B S *) (* Goal: False *) spliter. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B S *) (* Goal: False *) apply H12. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Col Tn B O S *) ColR. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B S *) unfold Parallelogram_flat in H. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B S *) unfold Parallelogram_flat in H5. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B S *) unfold Parallelogram_flat in H9. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B S *) spliter. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Sum Tn O E E' A B S *) apply cong_sum; Cong. (* Goal: @Sum Tn O E E' A B S *) (* Goal: @Ar2 Tn O E E' A B S *) repeat split; Col. (* Goal: @Sum Tn O E E' A B S *) spliter. (* Goal: @Sum Tn O E E' A B S *) subst A. (* Goal: @Sum Tn O E E' O B S *) tauto. Qed. Lemma diff_opp : forall O E E' A B AmB BmA, Diff O E E' A B AmB -> Diff O E E' B A BmA -> Opp O E E' AmB BmA. Proof. (* Goal: forall (O E E' A B AmB BmA : @Tpoint Tn) (_ : @Diff Tn O E E' A B AmB) (_ : @Diff Tn O E E' B A BmA), @Opp Tn O E E' AmB BmA *) intros. (* Goal: @Opp Tn O E E' AmB BmA *) assert(Ar2 O E E' A B AmB). (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Ar2 Tn O E E' A B AmB *) apply diff_ar2; auto. (* Goal: @Opp Tn O E E' AmB BmA *) assert(Ar2 O E E' B A BmA). (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Ar2 Tn O E E' B A BmA *) apply diff_ar2; auto. (* Goal: @Opp Tn O E E' AmB BmA *) unfold Ar2 in *. (* Goal: @Opp Tn O E E' AmB BmA *) spliter. (* Goal: @Opp Tn O E E' AmB BmA *) clean_duplicated_hyps. (* Goal: @Opp Tn O E E' AmB BmA *) apply diff_sum in H. (* Goal: @Opp Tn O E E' AmB BmA *) apply diff_sum in H0. (* Goal: @Opp Tn O E E' AmB BmA *) induction(eq_dec_points A O). (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) subst A. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) assert(BmA = B). (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @eq (@Tpoint Tn) BmA B *) apply(sum_O_B_eq O E E'); auto. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) subst BmA. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB B *) unfold Opp. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Sum Tn O E E' B AmB O *) assumption. (* Goal: @Opp Tn O E E' AmB BmA *) induction(eq_dec_points B O). (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) subst B. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) assert(AmB = A). (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @eq (@Tpoint Tn) AmB A *) apply(sum_O_B_eq O E E'); auto. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) subst AmB. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' A BmA *) unfold Opp. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Sum Tn O E E' BmA A O *) apply sum_comm; auto. (* Goal: @Opp Tn O E E' AmB BmA *) apply sum_cong in H0; auto. (* Goal: @Opp Tn O E E' AmB BmA *) apply sum_cong in H; auto. (* Goal: @Opp Tn O E E' AmB BmA *) assert(Parallelogram A O BmA B). (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Parallelogram Tn A O BmA B *) apply plg_comm2. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Parallelogram Tn O A B BmA *) right. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Parallelogram_flat Tn O A B BmA *) assumption. (* Goal: @Opp Tn O E E' AmB BmA *) apply plg_permut in H4. (* Goal: @Opp Tn O E E' AmB BmA *) apply plg_permut in H4. (* Goal: @Opp Tn O E E' AmB BmA *) apply plg_permut in H4. (* Goal: @Opp Tn O E E' AmB BmA *) assert(Parallelogram AmB O BmA O \/ AmB = O /\ B = A /\ O = BmA /\ AmB = O). (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: or (@Parallelogram Tn AmB O BmA O) (and (@eq (@Tpoint Tn) AmB O) (and (@eq (@Tpoint Tn) B A) (and (@eq (@Tpoint Tn) O BmA) (@eq (@Tpoint Tn) AmB O)))) *) apply(plg_pseudo_trans AmB O B A O BmA). (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Parallelogram Tn B A O BmA *) (* Goal: @Parallelogram Tn AmB O B A *) apply plg_permut. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Parallelogram Tn B A O BmA *) (* Goal: @Parallelogram Tn A AmB O B *) apply plg_permut. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Parallelogram Tn B A O BmA *) (* Goal: @Parallelogram Tn B A AmB O *) apply plg_permut. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Parallelogram Tn B A O BmA *) (* Goal: @Parallelogram Tn O B A AmB *) right; assumption. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Parallelogram Tn B A O BmA *) assumption. (* Goal: @Opp Tn O E E' AmB BmA *) assert(E <> O). (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: not (@eq (@Tpoint Tn) E O) *) intro. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: False *) subst E. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: False *) apply H1. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Col Tn O O E' *) Col. (* Goal: @Opp Tn O E E' AmB BmA *) induction H9. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) induction H9. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) apply False_ind. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: False *) unfold Parallelogram_strict in H9. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: False *) unfold TS in H9. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: False *) spliter. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: False *) apply H13. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Col Tn O AmB BmA *) ColR. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) unfold Parallelogram_flat in H. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) unfold Parallelogram_flat in H0. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) unfold Parallelogram_flat in H9. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) spliter. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Opp Tn O E E' AmB BmA *) unfold Opp. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Sum Tn O E E' BmA AmB O *) apply cong_sum; Cong. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Ar2 Tn O E E' BmA AmB O *) (* Goal: or (not (@eq (@Tpoint Tn) O O)) (not (@eq (@Tpoint Tn) AmB BmA)) *) right. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Ar2 Tn O E E' BmA AmB O *) (* Goal: not (@eq (@Tpoint Tn) AmB BmA) *) intro. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Ar2 Tn O E E' BmA AmB O *) (* Goal: False *) subst BmA. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Ar2 Tn O E E' BmA AmB O *) (* Goal: False *) tauto. (* Goal: @Opp Tn O E E' AmB BmA *) (* Goal: @Ar2 Tn O E E' BmA AmB O *) repeat split; Col. (* Goal: @Opp Tn O E E' AmB BmA *) spliter. (* Goal: @Opp Tn O E E' AmB BmA *) subst AmB. (* Goal: @Opp Tn O E E' O BmA *) subst BmA. (* Goal: @Opp Tn O E E' O O *) unfold Opp. (* Goal: @Sum Tn O E E' O O O *) apply sum_O_O; auto. Qed. Lemma sum_stable : forall O E E' A B C S1 S2 , A = B -> Sum O E E' A C S1 -> Sum O E E' B C S2 -> S1 = S2. Proof. (* Goal: forall (O E E' A B C S1 S2 : @Tpoint Tn) (_ : @eq (@Tpoint Tn) A B) (_ : @Sum Tn O E E' A C S1) (_ : @Sum Tn O E E' B C S2), @eq (@Tpoint Tn) S1 S2 *) intros. (* Goal: @eq (@Tpoint Tn) S1 S2 *) subst B. (* Goal: @eq (@Tpoint Tn) S1 S2 *) apply (sum_uniqueness O E E' A C); auto. Qed. Lemma diff_stable : forall O E E' A B C D1 D2 , A = B -> Diff O E E' A C D1 -> Diff O E E' B C D2 -> D1 = D2. Proof. (* Goal: forall (O E E' A B C D1 D2 : @Tpoint Tn) (_ : @eq (@Tpoint Tn) A B) (_ : @Diff Tn O E E' A C D1) (_ : @Diff Tn O E E' B C D2), @eq (@Tpoint Tn) D1 D2 *) intros. (* Goal: @eq (@Tpoint Tn) D1 D2 *) subst B. (* Goal: @eq (@Tpoint Tn) D1 D2 *) apply(diff_uniqueness O E E' A C); auto. Qed. Lemma plg_to_sum : forall O E E' A B C, Ar2 O E E' A B C ->Parallelogram_flat O A C B -> Sum O E E' A B C. Proof. (* Goal: forall (O E E' A B C : @Tpoint Tn) (_ : @Ar2 Tn O E E' A B C) (_ : @Parallelogram_flat Tn O A C B), @Sum Tn O E E' A B C *) intros. (* Goal: @Sum Tn O E E' A B C *) induction(eq_dec_points A B). (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A B C *) subst B. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A A C *) unfold Parallelogram_flat in H0. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A A C *) spliter. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A A C *) assert(O = C \/ Midpoint A O C). (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A A C *) (* Goal: or (@eq (@Tpoint Tn) O C) (@Midpoint Tn A O C) *) apply(l7_20 A O C H0). (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A A C *) (* Goal: @Cong Tn A O A C *) Cong. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A A C *) induction H5. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A A C *) (* Goal: @Sum Tn O E E' A A C *) subst C. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A A C *) (* Goal: @Sum Tn O E E' A A O *) tauto. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Sum Tn O E E' A A C *) apply cong_sum; auto. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Cong Tn O A A C *) (* Goal: @Cong Tn O A A C *) (* Goal: not (@Col Tn O E E') *) unfold Ar2 in H. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Cong Tn O A A C *) (* Goal: @Cong Tn O A A C *) (* Goal: not (@Col Tn O E E') *) tauto. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Cong Tn O A A C *) (* Goal: @Cong Tn O A A C *) unfold Midpoint in H5. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Cong Tn O A A C *) (* Goal: @Cong Tn O A A C *) tauto. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Cong Tn O A A C *) unfold Midpoint in H5. (* Goal: @Sum Tn O E E' A B C *) (* Goal: @Cong Tn O A A C *) tauto. (* Goal: @Sum Tn O E E' A B C *) unfold Ar2 in H. (* Goal: @Sum Tn O E E' A B C *) unfold Parallelogram_flat in H0. (* Goal: @Sum Tn O E E' A B C *) spliter. (* Goal: @Sum Tn O E E' A B C *) apply cong_sum; auto. (* Goal: @Cong Tn O B A C *) (* Goal: @Cong Tn O A B C *) (* Goal: @Ar2 Tn O E E' A B C *) repeat split; auto. (* Goal: @Cong Tn O B A C *) (* Goal: @Cong Tn O A B C *) Cong. (* Goal: @Cong Tn O B A C *) Cong. Qed. Lemma opp_midpoint : forall O E E' A MA, Opp O E E' A MA -> Midpoint O A MA. Proof. (* Goal: forall (O E E' A MA : @Tpoint Tn) (_ : @Opp Tn O E E' A MA), @Midpoint Tn O A MA *) intros. (* Goal: @Midpoint Tn O A MA *) unfold Opp in H. (* Goal: @Midpoint Tn O A MA *) assert(HS:=H). (* Goal: @Midpoint Tn O A MA *) unfold Sum in H. (* Goal: @Midpoint Tn O A MA *) spliter. (* Goal: @Midpoint Tn O A MA *) unfold Ar2 in H. (* Goal: @Midpoint Tn O A MA *) spliter. (* Goal: @Midpoint Tn O A MA *) induction (eq_dec_points A O). (* Goal: @Midpoint Tn O A MA *) (* Goal: @Midpoint Tn O A MA *) subst A. (* Goal: @Midpoint Tn O A MA *) (* Goal: @Midpoint Tn O O MA *) assert(HH:= sum_A_O_eq O E E' H MA O HS). (* Goal: @Midpoint Tn O A MA *) (* Goal: @Midpoint Tn O O MA *) subst MA. (* Goal: @Midpoint Tn O A MA *) (* Goal: @Midpoint Tn O O O *) unfold Midpoint. (* Goal: @Midpoint Tn O A MA *) (* Goal: and (@Bet Tn O O O) (@Cong Tn O O O O) *) split; Cong. (* Goal: @Midpoint Tn O A MA *) (* Goal: @Bet Tn O O O *) apply between_trivial. (* Goal: @Midpoint Tn O A MA *) assert(Parallelogram_flat O MA O A). (* Goal: @Midpoint Tn O A MA *) (* Goal: @Parallelogram_flat Tn O MA O A *) apply(sum_cong O E E' H MA A O HS). (* Goal: @Midpoint Tn O A MA *) (* Goal: or (not (@eq (@Tpoint Tn) MA O)) (not (@eq (@Tpoint Tn) A O)) *) tauto. (* Goal: @Midpoint Tn O A MA *) unfold Parallelogram_flat in H5. (* Goal: @Midpoint Tn O A MA *) spliter. (* Goal: @Midpoint Tn O A MA *) assert(A = MA \/ Midpoint O A MA). (* Goal: @Midpoint Tn O A MA *) (* Goal: or (@eq (@Tpoint Tn) A MA) (@Midpoint Tn O A MA) *) apply(l7_20 O A MA). (* Goal: @Midpoint Tn O A MA *) (* Goal: @Cong Tn O A O MA *) (* Goal: @Col Tn A O MA *) Col. (* Goal: @Midpoint Tn O A MA *) (* Goal: @Cong Tn O A O MA *) Cong. (* Goal: @Midpoint Tn O A MA *) induction H10. (* Goal: @Midpoint Tn O A MA *) (* Goal: @Midpoint Tn O A MA *) subst MA. (* Goal: @Midpoint Tn O A MA *) (* Goal: @Midpoint Tn O A A *) tauto. (* Goal: @Midpoint Tn O A MA *) assumption. Qed. Lemma diff_to_plg : forall O E E' A B dBA, A <> O \/ B <> O -> Diff O E E' B A dBA -> Parallelogram_flat O A B dBA. Proof. (* Goal: forall (O E E' A B dBA : @Tpoint Tn) (_ : or (not (@eq (@Tpoint Tn) A O)) (not (@eq (@Tpoint Tn) B O))) (_ : @Diff Tn O E E' B A dBA), @Parallelogram_flat Tn O A B dBA *) intros. (* Goal: @Parallelogram_flat Tn O A B dBA *) assert(Ar2 O E E' B A dBA). (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Ar2 Tn O E E' B A dBA *) apply diff_ar2; auto. (* Goal: @Parallelogram_flat Tn O A B dBA *) unfold Ar2 in H1. (* Goal: @Parallelogram_flat Tn O A B dBA *) spliter. (* Goal: @Parallelogram_flat Tn O A B dBA *) apply diff_sum in H0. (* Goal: @Parallelogram_flat Tn O A B dBA *) induction(eq_dec_points A O). (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Parallelogram_flat Tn O A B dBA *) subst A. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Parallelogram_flat Tn O O B dBA *) assert(dBA = B). (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Parallelogram_flat Tn O O B dBA *) (* Goal: @eq (@Tpoint Tn) dBA B *) apply(sum_O_B_eq O E E'); auto. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Parallelogram_flat Tn O O B dBA *) subst dBA. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Parallelogram_flat Tn O O B B *) apply plgf_permut. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Parallelogram_flat Tn B O O B *) apply plgf_trivial. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: not (@eq (@Tpoint Tn) B O) *) induction H; tauto. (* Goal: @Parallelogram_flat Tn O A B dBA *) assert(E <> O). (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: not (@eq (@Tpoint Tn) E O) *) intro. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: False *) subst E. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: False *) apply H1. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Col Tn O O E' *) Col. (* Goal: @Parallelogram_flat Tn O A B dBA *) induction(eq_dec_points B O). (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Parallelogram_flat Tn O A B dBA *) subst B. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Parallelogram_flat Tn O A O dBA *) assert(Opp O E E' dBA A). (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Parallelogram_flat Tn O A O dBA *) (* Goal: @Opp Tn O E E' dBA A *) unfold Opp. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Parallelogram_flat Tn O A O dBA *) (* Goal: @Sum Tn O E E' A dBA O *) auto. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Parallelogram_flat Tn O A O dBA *) apply opp_midpoint in H7. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Parallelogram_flat Tn O A O dBA *) unfold Midpoint in H7. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Parallelogram_flat Tn O A O dBA *) spliter. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Parallelogram_flat Tn O A O dBA *) unfold Parallelogram_flat. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: and (@Col Tn O A O) (and (@Col Tn O A dBA) (and (@Cong Tn O A O dBA) (and (@Cong Tn O dBA O A) (or (not (@eq (@Tpoint Tn) O O)) (not (@eq (@Tpoint Tn) A dBA)))))) *) repeat split; try ColR. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Cong Tn O dBA O A *) (* Goal: @Cong Tn O A O dBA *) Cong. (* Goal: @Parallelogram_flat Tn O A B dBA *) (* Goal: @Cong Tn O dBA O A *) Cong. (* Goal: @Parallelogram_flat Tn O A B dBA *) apply sum_cong in H0; auto. Qed. Lemma sum3_col : forall O E E' A B C S, sum3 O E E' A B C S -> ~Col O E E' /\ Col O E A /\ Col O E B /\ Col O E C /\ Col O E S. Proof. (* Goal: forall (O E E' A B C S : @Tpoint Tn) (_ : @sum3 Tn O E E' A B C S), 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 S)))) *) intros. (* 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 S)))) *) unfold sum3 in H. (* 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 S)))) *) ex_and H AB. (* 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 S)))) *) assert(Ar2 O E E' A B AB). (* 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 S)))) *) (* Goal: @Ar2 Tn O E E' A B AB *) apply sum_ar2; auto. (* 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 S)))) *) assert(Ar2 O E E' AB C S). (* 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 S)))) *) (* Goal: @Ar2 Tn O E E' AB C S *) apply sum_ar2; auto. (* 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 S)))) *) unfold Ar2 in *. (* 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 S)))) *) spliter. (* 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 S)))) *) repeat split; auto. Qed. Lemma sum3_permut : forall O E E' A B C S, sum3 O E E' A B C S -> sum3 O E E' C A B S. Proof. (* Goal: forall (O E E' A B C S : @Tpoint Tn) (_ : @sum3 Tn O E E' A B C S), @sum3 Tn O E E' C A B S *) intros. (* Goal: @sum3 Tn O E E' C A B S *) assert(~Col O E E' /\ Col O E A /\ Col O E B /\ Col O E C /\ Col O E S). (* Goal: @sum3 Tn O E E' C A B S *) (* 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 S)))) *) apply sum3_col; auto. (* Goal: @sum3 Tn O E E' C A B S *) spliter. (* Goal: @sum3 Tn O E E' C A B S *) unfold sum3 in H. (* Goal: @sum3 Tn O E E' C A B S *) ex_and H AB. (* Goal: @sum3 Tn O E E' C A B S *) assert(HH:= sum_exists O E E' H0 A C H1 H3). (* Goal: @sum3 Tn O E E' C A B S *) ex_and HH AC. (* Goal: @sum3 Tn O E E' C A B S *) unfold sum3. (* Goal: @ex (@Tpoint Tn) (fun AB : @Tpoint Tn => and (@Sum Tn O E E' C A AB) (@Sum Tn O E E' AB B S)) *) exists AC. (* Goal: and (@Sum Tn O E E' C A AC) (@Sum Tn O E E' AC B S) *) split. (* Goal: @Sum Tn O E E' AC B S *) (* Goal: @Sum Tn O E E' C A AC *) apply sum_comm; auto. (* Goal: @Sum Tn O E E' AC B S *) apply sum_comm in H5; auto. (* Goal: @Sum Tn O E E' AC B S *) apply sum_comm in H6; auto. (* Goal: @Sum Tn O E E' AC B S *) assert(HH:=sum_assoc O E E' C A B AC AB S H6 H). (* Goal: @Sum Tn O E E' AC B S *) destruct HH. (* Goal: @Sum Tn O E E' AC B S *) apply H7; auto. Qed. Lemma sum3_comm_1_2 : forall O E E' A B C S, sum3 O E E' A B C S -> sum3 O E E' B A C S. Proof. (* Goal: forall (O E E' A B C S : @Tpoint Tn) (_ : @sum3 Tn O E E' A B C S), @sum3 Tn O E E' B A C S *) intros. (* Goal: @sum3 Tn O E E' B A C S *) assert(~Col O E E' /\ Col O E A /\ Col O E B /\ Col O E C /\ Col O E S). (* Goal: @sum3 Tn O E E' B A C S *) (* 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 S)))) *) apply sum3_col; auto. (* Goal: @sum3 Tn O E E' B A C S *) spliter. (* Goal: @sum3 Tn O E E' B A C S *) unfold sum3 in H. (* Goal: @sum3 Tn O E E' B A C S *) ex_and H AB. (* Goal: @sum3 Tn O E E' B A C S *) unfold sum3. (* Goal: @ex (@Tpoint Tn) (fun AB : @Tpoint Tn => and (@Sum Tn O E E' B A AB) (@Sum Tn O E E' AB C S)) *) exists AB. (* Goal: and (@Sum Tn O E E' B A AB) (@Sum Tn O E E' AB C S) *) split. (* Goal: @Sum Tn O E E' AB C S *) (* Goal: @Sum Tn O E E' B A AB *) apply sum_comm; auto. (* Goal: @Sum Tn O E E' AB C S *) auto. Qed. Lemma sum3_comm_2_3 : forall O E E' A B C S, sum3 O E E' A B C S -> sum3 O E E' A C B S. Proof. (* Goal: forall (O E E' A B C S : @Tpoint Tn) (_ : @sum3 Tn O E E' A B C S), @sum3 Tn O E E' A C B S *) intros. (* Goal: @sum3 Tn O E E' A C B S *) apply sum3_permut in H. (* Goal: @sum3 Tn O E E' A C B S *) apply sum3_comm_1_2 in H. (* Goal: @sum3 Tn O E E' A C B S *) assumption. Qed. Lemma sum3_exists : forall O E E' A B C, Ar2 O E E' A B C -> exists S, sum3 O E E' A B C S. Proof. (* Goal: forall (O E E' A B C : @Tpoint Tn) (_ : @Ar2 Tn O E E' A B C), @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @sum3 Tn O E E' A B C S) *) intros. (* Goal: @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @sum3 Tn O E E' A B C S) *) unfold Ar2 in *. (* Goal: @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @sum3 Tn O E E' A B C S) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @sum3 Tn O E E' A B C S) *) assert(HH:=sum_exists O E E' H A B H0 H1). (* Goal: @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @sum3 Tn O E E' A B C S) *) ex_and HH AB. (* Goal: @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @sum3 Tn O E E' A B C S) *) assert(Ar2 O E E' A B AB). (* Goal: @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @sum3 Tn O E E' A B C S) *) (* Goal: @Ar2 Tn O E E' A B AB *) apply sum_ar2; auto. (* Goal: @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @sum3 Tn O E E' A B C S) *) unfold Ar2 in H4. (* Goal: @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @sum3 Tn O E E' A B C S) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @sum3 Tn O E E' A B C S) *) clean_duplicated_hyps. (* Goal: @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @sum3 Tn O E E' A B C S) *) assert(HH:=sum_exists O E E' H AB C H7 H2). (* Goal: @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @sum3 Tn O E E' A B C S) *) ex_and HH ABC. (* Goal: @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @sum3 Tn O E E' A B C S) *) exists ABC. (* Goal: @sum3 Tn O E E' A B C ABC *) unfold sum3. (* Goal: @ex (@Tpoint Tn) (fun AB : @Tpoint Tn => and (@Sum Tn O E E' A B AB) (@Sum Tn O E E' AB C ABC)) *) exists AB. (* Goal: and (@Sum Tn O E E' A B AB) (@Sum Tn O E E' AB C ABC) *) split; auto. Qed. Lemma sum3_uniqueness : forall O E E' A B C S1 S2, sum3 O E E' A B C S1 -> sum3 O E E' A B C S2 -> S1 = S2. Proof. (* Goal: forall (O E E' A B C S1 S2 : @Tpoint Tn) (_ : @sum3 Tn O E E' A B C S1) (_ : @sum3 Tn O E E' A B C S2), @eq (@Tpoint Tn) S1 S2 *) intros. (* Goal: @eq (@Tpoint Tn) S1 S2 *) unfold sum3 in H. (* Goal: @eq (@Tpoint Tn) S1 S2 *) unfold sum3 in H0. (* Goal: @eq (@Tpoint Tn) S1 S2 *) ex_and H AB1. (* Goal: @eq (@Tpoint Tn) S1 S2 *) ex_and H0 AB2. (* Goal: @eq (@Tpoint Tn) S1 S2 *) assert(AB1 = AB2). (* Goal: @eq (@Tpoint Tn) S1 S2 *) (* Goal: @eq (@Tpoint Tn) AB1 AB2 *) apply(sum_uniqueness O E E' A B); auto. (* Goal: @eq (@Tpoint Tn) S1 S2 *) subst AB2. (* Goal: @eq (@Tpoint Tn) S1 S2 *) apply (sum_uniqueness O E E' AB1 C); auto. Qed. Lemma sum4_col : forall O E E' A B C D S, Sum4 O E E' A B C D S -> ~Col O E E' /\ Col O E A /\ Col O E B /\ Col O E C /\ Col O E D /\ Col O E S. Proof. (* Goal: forall (O E E' A B C D S : @Tpoint Tn) (_ : @Sum4 Tn O E E' A B C D S), 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) intros. (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) unfold Sum4 in H. (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) ex_and H ABC. (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) assert(HH:=sum3_col O E E' A B C ABC H). (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) assert(Ar2 O E E' ABC D S). (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) (* Goal: @Ar2 Tn O E E' ABC D S *) apply sum_ar2; auto. (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) unfold Ar2 in *. (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) spliter. (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) repeat split; auto. Qed. Lemma sum22_col : forall O E E' A B C D S, sum22 O E E' A B C D S -> ~Col O E E' /\ Col O E A /\ Col O E B /\ Col O E C /\ Col O E D /\ Col O E S. Proof. (* Goal: forall (O E E' A B C D S : @Tpoint Tn) (_ : @sum22 Tn O E E' A B C D S), 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) intros. (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) unfold sum22 in H. (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) ex_and H AB. (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) ex_and H0 CD. (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) assert(Ar2 O E E' A B AB). (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) (* Goal: @Ar2 Tn O E E' A B AB *) apply sum_ar2; auto. (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) assert(Ar2 O E E' C D CD). (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) (* Goal: @Ar2 Tn O E E' C D CD *) apply sum_ar2; auto. (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) assert(Ar2 O E E' AB CD S). (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) (* Goal: @Ar2 Tn O E E' AB CD S *) apply sum_ar2; auto. (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) unfold Ar2 in *. (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) spliter. (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) repeat split; auto. Qed. Lemma sum_to_sum3 : forall O E E' A B AB X S, Sum O E E' A B AB -> Sum O E E' AB X S -> sum3 O E E' A B X S. Proof. (* Goal: forall (O E E' A B AB X S : @Tpoint Tn) (_ : @Sum Tn O E E' A B AB) (_ : @Sum Tn O E E' AB X S), @sum3 Tn O E E' A B X S *) intros. (* Goal: @sum3 Tn O E E' A B X S *) unfold sum3. (* Goal: @ex (@Tpoint Tn) (fun AB : @Tpoint Tn => and (@Sum Tn O E E' A B AB) (@Sum Tn O E E' AB X S)) *) exists AB. (* Goal: and (@Sum Tn O E E' A B AB) (@Sum Tn O E E' AB X S) *) split; auto. Qed. Lemma sum3_to_sum4 : forall O E E' A B C X ABC S , sum3 O E E' A B C ABC -> Sum O E E' ABC X S -> Sum4 O E E' A B C X S. Proof. (* Goal: forall (O E E' A B C X ABC S : @Tpoint Tn) (_ : @sum3 Tn O E E' A B C ABC) (_ : @Sum Tn O E E' ABC X S), @Sum4 Tn O E E' A B C X S *) intros. (* Goal: @Sum4 Tn O E E' A B C X S *) assert(~Col O E E' /\ Col O E A /\ Col O E B /\ Col O E C /\ Col O E ABC). (* Goal: @Sum4 Tn O E E' A B C X S *) (* 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 ABC)))) *) apply sum3_col; auto. (* Goal: @Sum4 Tn O E E' A B C X S *) assert(Ar2 O E E' ABC X S). (* Goal: @Sum4 Tn O E E' A B C X S *) (* Goal: @Ar2 Tn O E E' ABC X S *) apply sum_ar2; auto. (* Goal: @Sum4 Tn O E E' A B C X S *) unfold Ar2 in H2. (* Goal: @Sum4 Tn O E E' A B C X S *) spliter. (* Goal: @Sum4 Tn O E E' A B C X S *) clean_duplicated_hyps. (* Goal: @Sum4 Tn O E E' A B C X S *) unfold Sum4. (* Goal: @ex (@Tpoint Tn) (fun ABC : @Tpoint Tn => and (@sum3 Tn O E E' A B C ABC) (@Sum Tn O E E' ABC X S)) *) exists ABC. (* Goal: and (@sum3 Tn O E E' A B C ABC) (@Sum Tn O E E' ABC X S) *) split; auto. Qed. Lemma sum_A_exists : forall O E E' A AB, Ar2 O E E' A AB O -> exists B, Sum O E E' A B AB. Proof. (* Goal: forall (O E E' A AB : @Tpoint Tn) (_ : @Ar2 Tn O E E' A AB O), @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @Sum Tn O E E' A B AB) *) intros. (* Goal: @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @Sum Tn O E E' A B AB) *) unfold Ar2 in *. (* Goal: @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @Sum Tn O E E' A B AB) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @Sum Tn O E E' A B AB) *) assert(HH:=diff_exists O E E' AB A H H1 H0). (* Goal: @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @Sum Tn O E E' A B AB) *) ex_and HH B. (* Goal: @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @Sum Tn O E E' A B AB) *) exists B. (* Goal: @Sum Tn O E E' A B AB *) apply diff_sum in H3. (* Goal: @Sum Tn O E E' A B AB *) assumption. Qed. Lemma sum_B_exists : forall O E E' B AB, Ar2 O E E' B AB O -> exists A, Sum O E E' A B AB. Proof. (* Goal: forall (O E E' B AB : @Tpoint Tn) (_ : @Ar2 Tn O E E' B AB O), @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @Sum Tn O E E' A B AB) *) intros. (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @Sum Tn O E E' A B AB) *) unfold Ar2 in *. (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @Sum Tn O E E' A B AB) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @Sum Tn O E E' A B AB) *) assert(HH:=diff_exists O E E' AB B H H1 H0). (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @Sum Tn O E E' A B AB) *) ex_and HH A. (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @Sum Tn O E E' A B AB) *) exists A. (* Goal: @Sum Tn O E E' A B AB *) apply diff_sum in H3. (* Goal: @Sum Tn O E E' A B AB *) apply sum_comm; auto. Qed. Lemma sum4_equiv : forall O E E' A B C D S, Sum4 O E E' A B C D S <-> sum22 O E E' A B C D S. Proof. (* Goal: forall O E E' A B C D S : @Tpoint Tn, iff (@Sum4 Tn O E E' A B C D S) (@sum22 Tn O E E' A B C D S) *) intros. (* Goal: iff (@Sum4 Tn O E E' A B C D S) (@sum22 Tn O E E' A B C D S) *) split. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: forall _ : @Sum4 Tn O E E' A B C D S, @sum22 Tn O E E' A B C D S *) intro. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @sum22 Tn O E E' A B C D S *) assert(~Col O E E' /\ Col O E A /\ Col O E B /\ Col O E C /\ Col O E D /\ Col O E S). (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @sum22 Tn O E E' A B C D S *) (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) apply sum4_col; auto. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @sum22 Tn O E E' A B C D S *) spliter. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @sum22 Tn O E E' A B C D S *) assert(HS1:= sum_exists O E E' H0 A B H1 H2). (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @sum22 Tn O E E' A B C D S *) assert(HS2:= sum_exists O E E' H0 C D H3 H4). (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @sum22 Tn O E E' A B C D S *) ex_and HS1 AB. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @sum22 Tn O E E' A B C D S *) ex_and HS2 CD. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @sum22 Tn O E E' A B C D S *) unfold sum22. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @ex (@Tpoint Tn) (fun AB : @Tpoint Tn => @ex (@Tpoint Tn) (fun CD : @Tpoint Tn => and (@Sum Tn O E E' A B AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S)))) *) exists AB. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @ex (@Tpoint Tn) (fun CD : @Tpoint Tn => and (@Sum Tn O E E' A B AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S))) *) exists CD. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: and (@Sum Tn O E E' A B AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S)) *) assert(Ar2 O E E' A B AB). (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: and (@Sum Tn O E E' A B AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S)) *) (* Goal: @Ar2 Tn O E E' A B AB *) apply sum_ar2; auto. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: and (@Sum Tn O E E' A B AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S)) *) assert(Ar2 O E E' C D CD). (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: and (@Sum Tn O E E' A B AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S)) *) (* Goal: @Ar2 Tn O E E' C D CD *) apply sum_ar2; auto. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: and (@Sum Tn O E E' A B AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S)) *) unfold Ar2 in *. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: and (@Sum Tn O E E' A B AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S)) *) spliter. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: and (@Sum Tn O E E' A B AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S)) *) clean_duplicated_hyps. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: and (@Sum Tn O E E' A B AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S)) *) split; auto. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S) *) split; auto. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @Sum Tn O E E' AB CD S *) unfold Sum4 in H. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @Sum Tn O E E' AB CD S *) ex_and H ABC. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @Sum Tn O E E' AB CD S *) unfold sum3 in H. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @Sum Tn O E E' AB CD S *) ex_and H AB'. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @Sum Tn O E E' AB CD S *) assert(AB' = AB). (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @Sum Tn O E E' AB CD S *) (* Goal: @eq (@Tpoint Tn) AB' AB *) apply(sum_uniqueness O E E' A B); auto. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @Sum Tn O E E' AB CD S *) subst AB'. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @Sum Tn O E E' AB CD S *) assert(HH:= sum_assoc O E E' AB C D ABC CD S H9 H7). (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @Sum Tn O E E' AB CD S *) destruct HH. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @Sum Tn O E E' AB CD S *) apply H11. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) (* Goal: @Sum Tn O E E' ABC D S *) assumption. (* Goal: forall _ : @sum22 Tn O E E' A B C D S, @Sum4 Tn O E E' A B C D S *) intro. (* Goal: @Sum4 Tn O E E' A B C D S *) unfold sum22 in H. (* Goal: @Sum4 Tn O E E' A B C D S *) ex_and H AB. (* Goal: @Sum4 Tn O E E' A B C D S *) ex_and H0 CD. (* Goal: @Sum4 Tn O E E' A B C D S *) assert(Ar2 O E E' A B AB). (* Goal: @Sum4 Tn O E E' A B C D S *) (* Goal: @Ar2 Tn O E E' A B AB *) apply sum_ar2; auto. (* Goal: @Sum4 Tn O E E' A B C D S *) assert(Ar2 O E E' C D CD). (* Goal: @Sum4 Tn O E E' A B C D S *) (* Goal: @Ar2 Tn O E E' C D CD *) apply sum_ar2; auto. (* Goal: @Sum4 Tn O E E' A B C D S *) assert(Ar2 O E E' AB CD S). (* Goal: @Sum4 Tn O E E' A B C D S *) (* Goal: @Ar2 Tn O E E' AB CD S *) apply sum_ar2; auto. (* Goal: @Sum4 Tn O E E' A B C D S *) unfold Ar2 in *. (* Goal: @Sum4 Tn O E E' A B C D S *) spliter. (* Goal: @Sum4 Tn O E E' A B C D S *) clean_duplicated_hyps. (* Goal: @Sum4 Tn O E E' A B C D S *) unfold Sum4. (* Goal: @ex (@Tpoint Tn) (fun ABC : @Tpoint Tn => and (@sum3 Tn O E E' A B C ABC) (@Sum Tn O E E' ABC D S)) *) assert(HS:=sum_exists O E E' H2 AB C H13 H8). (* Goal: @ex (@Tpoint Tn) (fun ABC : @Tpoint Tn => and (@sum3 Tn O E E' A B C ABC) (@Sum Tn O E E' ABC D S)) *) ex_and HS ABC. (* Goal: @ex (@Tpoint Tn) (fun ABC : @Tpoint Tn => and (@sum3 Tn O E E' A B C ABC) (@Sum Tn O E E' ABC D S)) *) exists ABC. (* Goal: and (@sum3 Tn O E E' A B C ABC) (@Sum Tn O E E' ABC D S) *) split. (* Goal: @Sum Tn O E E' ABC D S *) (* Goal: @sum3 Tn O E E' A B C ABC *) unfold sum3. (* Goal: @Sum Tn O E E' ABC D S *) (* Goal: @ex (@Tpoint Tn) (fun AB : @Tpoint Tn => and (@Sum Tn O E E' A B AB) (@Sum Tn O E E' AB C ABC)) *) exists AB. (* Goal: @Sum Tn O E E' ABC D S *) (* Goal: and (@Sum Tn O E E' A B AB) (@Sum Tn O E E' AB C ABC) *) split; auto. (* Goal: @Sum Tn O E E' ABC D S *) assert(HH:= sum_assoc O E E' AB C D ABC CD S H3 H0). (* Goal: @Sum Tn O E E' ABC D S *) destruct HH. (* Goal: @Sum Tn O E E' ABC D S *) apply H4. (* Goal: @Sum Tn O E E' AB CD S *) assumption. Qed. Lemma sum4_permut: forall O E E' A B C D S, Sum4 O E E' A B C D S -> Sum4 O E E' D A B C S. Proof. (* Goal: forall (O E E' A B C D S : @Tpoint Tn) (_ : @Sum4 Tn O E E' A B C D S), @Sum4 Tn O E E' D A B C S *) intros. (* Goal: @Sum4 Tn O E E' D A B C S *) assert( ~Col O E E' /\ Col O E A /\ Col O E B /\ Col O E C /\ Col O E D /\ Col O E S). (* Goal: @Sum4 Tn O E E' D A B C S *) (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) apply sum4_col; auto. (* Goal: @Sum4 Tn O E E' D A B C S *) spliter. (* Goal: @Sum4 Tn O E E' D A B C S *) assert(HH:=sum4_equiv O E E' A B C D S). (* Goal: @Sum4 Tn O E E' D A B C S *) destruct HH. (* Goal: @Sum4 Tn O E E' D A B C S *) assert(sum22 O E E' A B C D S). (* Goal: @Sum4 Tn O E E' D A B C S *) (* Goal: @sum22 Tn O E E' A B C D S *) apply H6; auto. (* Goal: @Sum4 Tn O E E' D A B C S *) unfold sum22 in H8. (* Goal: @Sum4 Tn O E E' D A B C S *) ex_and H8 AB. (* Goal: @Sum4 Tn O E E' D A B C S *) ex_and H9 CD. (* Goal: @Sum4 Tn O E E' D A B C S *) apply sum_comm in H9; auto. (* Goal: @Sum4 Tn O E E' D A B C S *) apply sum_comm in H10; auto. (* Goal: @Sum4 Tn O E E' D A B C S *) unfold Sum4 in H. (* Goal: @Sum4 Tn O E E' D A B C S *) ex_and H ABC. (* Goal: @Sum4 Tn O E E' D A B C S *) assert(HH:= sum_assoc O E E' D C AB CD ABC S H9). (* Goal: @Sum4 Tn O E E' D A B C S *) assert(HP:=sum3_permut O E E' A B C ABC H). (* Goal: @Sum4 Tn O E E' D A B C S *) unfold sum3 in HP. (* Goal: @Sum4 Tn O E E' D A B C S *) ex_and HP AC. (* Goal: @Sum4 Tn O E E' D A B C S *) assert(HP:= sum_assoc O E E' C A B AC AB ABC H12 H8). (* Goal: @Sum4 Tn O E E' D A B C S *) destruct HP. (* Goal: @Sum4 Tn O E E' D A B C S *) assert(Sum O E E' C AB ABC). (* Goal: @Sum4 Tn O E E' D A B C S *) (* Goal: @Sum Tn O E E' C AB ABC *) apply H15; auto. (* Goal: @Sum4 Tn O E E' D A B C S *) apply HH in H16. (* Goal: @Sum4 Tn O E E' D A B C S *) destruct H16. (* Goal: @Sum4 Tn O E E' D A B C S *) assert(Sum O E E' D ABC S). (* Goal: @Sum4 Tn O E E' D A B C S *) (* Goal: @Sum Tn O E E' D ABC S *) apply H17; auto. (* Goal: @Sum4 Tn O E E' D A B C S *) assert(HP:= sum_exists O E E' H0 D A H4 H1); auto. (* Goal: @Sum4 Tn O E E' D A B C S *) ex_and HP AD. (* Goal: @Sum4 Tn O E E' D A B C S *) assert(Ar2 O E E' D A AD). (* Goal: @Sum4 Tn O E E' D A B C S *) (* Goal: @Ar2 Tn O E E' D A AD *) apply sum_ar2; auto. (* Goal: @Sum4 Tn O E E' D A B C S *) unfold Ar2 in H20. (* Goal: @Sum4 Tn O E E' D A B C S *) spliter. (* Goal: @Sum4 Tn O E E' D A B C S *) clean_trivial_hyps. (* Goal: @Sum4 Tn O E E' D A B C S *) assert(HP:= sum_exists O E E' H0 AD B H23 H2); auto. (* Goal: @Sum4 Tn O E E' D A B C S *) ex_and HP ABD. (* Goal: @Sum4 Tn O E E' D A B C S *) assert(HP:= sum_assoc O E E' D A B AD AB ABD H19 H8). (* Goal: @Sum4 Tn O E E' D A B C S *) destruct HP. (* Goal: @Sum4 Tn O E E' D A B C S *) apply H26 in H24. (* Goal: @Sum4 Tn O E E' D A B C S *) unfold Sum4. (* Goal: @ex (@Tpoint Tn) (fun ABC : @Tpoint Tn => and (@sum3 Tn O E E' D A B ABC) (@Sum Tn O E E' ABC C S)) *) exists ABD. (* Goal: and (@sum3 Tn O E E' D A B ABD) (@Sum Tn O E E' ABD C S) *) split. (* Goal: @Sum Tn O E E' ABD C S *) (* Goal: @sum3 Tn O E E' D A B ABD *) unfold sum3. (* Goal: @Sum Tn O E E' ABD C S *) (* Goal: @ex (@Tpoint Tn) (fun AB : @Tpoint Tn => and (@Sum Tn O E E' D A AB) (@Sum Tn O E E' AB B ABD)) *) exists AD. (* Goal: @Sum Tn O E E' ABD C S *) (* Goal: and (@Sum Tn O E E' D A AD) (@Sum Tn O E E' AD B ABD) *) split; auto. (* Goal: @Sum Tn O E E' ABD C S *) unfold sum3 in H. (* Goal: @Sum Tn O E E' ABD C S *) ex_and H AB'. (* Goal: @Sum Tn O E E' ABD C S *) assert(AB'=AB). (* Goal: @Sum Tn O E E' ABD C S *) (* Goal: @eq (@Tpoint Tn) AB' AB *) apply (sum_uniqueness O E E' A B); auto. (* Goal: @Sum Tn O E E' ABD C S *) subst AB'. (* Goal: @Sum Tn O E E' ABD C S *) assert(HP:= sum_assoc O E E' D AB C ABD ABC S H24 H27). (* Goal: @Sum Tn O E E' ABD C S *) destruct HP. (* Goal: @Sum Tn O E E' ABD C S *) apply H28. (* Goal: @Sum Tn O E E' D ABC S *) auto. Qed. Lemma sum22_permut : forall O E E' A B C D S, sum22 O E E' A B C D S -> sum22 O E E' D A B C S. Proof. (* Goal: forall (O E E' A B C D S : @Tpoint Tn) (_ : @sum22 Tn O E E' A B C D S), @sum22 Tn O E E' D A B C S *) intros. (* Goal: @sum22 Tn O E E' D A B C S *) assert(HH:= sum4_equiv O E E' A B C D S). (* Goal: @sum22 Tn O E E' D A B C S *) destruct HH. (* Goal: @sum22 Tn O E E' D A B C S *) assert(Sum4 O E E' A B C D S). (* Goal: @sum22 Tn O E E' D A B C S *) (* Goal: @Sum4 Tn O E E' A B C D S *) apply H1; auto. (* Goal: @sum22 Tn O E E' D A B C S *) assert(Sum4 O E E' D A B C S). (* Goal: @sum22 Tn O E E' D A B C S *) (* Goal: @Sum4 Tn O E E' D A B C S *) apply sum4_permut; auto. (* Goal: @sum22 Tn O E E' D A B C S *) assert(HH:= sum4_equiv O E E' D A B C S). (* Goal: @sum22 Tn O E E' D A B C S *) destruct HH. (* Goal: @sum22 Tn O E E' D A B C S *) apply H4. (* Goal: @Sum4 Tn O E E' D A B C S *) auto. Qed. Lemma sum4_comm : forall O E E' A B C D S, Sum4 O E E' A B C D S -> Sum4 O E E' B A C D S. Proof. (* Goal: forall (O E E' A B C D S : @Tpoint Tn) (_ : @Sum4 Tn O E E' A B C D S), @Sum4 Tn O E E' B A C D S *) intros. (* Goal: @Sum4 Tn O E E' B A C D S *) assert(~Col O E E' /\ Col O E A /\ Col O E B /\ Col O E C /\ Col O E D /\ Col O E S). (* Goal: @Sum4 Tn O E E' B A C D S *) (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) apply sum4_col; auto. (* Goal: @Sum4 Tn O E E' B A C D S *) spliter. (* Goal: @Sum4 Tn O E E' B A C D S *) assert(HH:= sum4_equiv O E E' A B C D S). (* Goal: @Sum4 Tn O E E' B A C D S *) destruct HH. (* Goal: @Sum4 Tn O E E' B A C D S *) apply H6 in H. (* Goal: @Sum4 Tn O E E' B A C D S *) unfold sum22 in H. (* Goal: @Sum4 Tn O E E' B A C D S *) ex_and H AB. (* Goal: @Sum4 Tn O E E' B A C D S *) ex_and H8 CD. (* Goal: @Sum4 Tn O E E' B A C D S *) apply sum_comm in H; auto. (* Goal: @Sum4 Tn O E E' B A C D S *) assert(sum22 O E E' B A C D S). (* Goal: @Sum4 Tn O E E' B A C D S *) (* Goal: @sum22 Tn O E E' B A C D S *) unfold sum22. (* Goal: @Sum4 Tn O E E' B A C D S *) (* Goal: @ex (@Tpoint Tn) (fun AB : @Tpoint Tn => @ex (@Tpoint Tn) (fun CD : @Tpoint Tn => and (@Sum Tn O E E' B A AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S)))) *) exists AB. (* Goal: @Sum4 Tn O E E' B A C D S *) (* Goal: @ex (@Tpoint Tn) (fun CD : @Tpoint Tn => and (@Sum Tn O E E' B A AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S))) *) exists CD. (* Goal: @Sum4 Tn O E E' B A C D S *) (* Goal: and (@Sum Tn O E E' B A AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S)) *) split; auto. (* Goal: @Sum4 Tn O E E' B A C D S *) assert(HH:= sum4_equiv O E E' B A C D S). (* Goal: @Sum4 Tn O E E' B A C D S *) destruct HH. (* Goal: @Sum4 Tn O E E' B A C D S *) apply H12; auto. Qed. Lemma sum22_comm : forall O E E' A B C D S, sum22 O E E' A B C D S -> sum22 O E E' B A C D S. Proof. (* Goal: forall (O E E' A B C D S : @Tpoint Tn) (_ : @sum22 Tn O E E' A B C D S), @sum22 Tn O E E' B A C D S *) intros. (* Goal: @sum22 Tn O E E' B A C D S *) assert(~Col O E E' /\ Col O E A /\ Col O E B /\ Col O E C /\ Col O E D /\ Col O E S). (* Goal: @sum22 Tn O E E' B A C D S *) (* 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) (and (@Col Tn O E D) (@Col Tn O E S))))) *) apply sum22_col; auto. (* Goal: @sum22 Tn O E E' B A C D S *) spliter. (* Goal: @sum22 Tn O E E' B A C D S *) unfold sum22 in H. (* Goal: @sum22 Tn O E E' B A C D S *) ex_and H AB. (* Goal: @sum22 Tn O E E' B A C D S *) ex_and H6 CD. (* Goal: @sum22 Tn O E E' B A C D S *) unfold sum22. (* Goal: @ex (@Tpoint Tn) (fun AB : @Tpoint Tn => @ex (@Tpoint Tn) (fun CD : @Tpoint Tn => and (@Sum Tn O E E' B A AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S)))) *) exists AB. (* Goal: @ex (@Tpoint Tn) (fun CD : @Tpoint Tn => and (@Sum Tn O E E' B A AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S))) *) exists CD. (* Goal: and (@Sum Tn O E E' B A AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S)) *) split; auto. (* Goal: @Sum Tn O E E' B A AB *) apply sum_comm; auto. Qed. Lemma sum_abcd : forall O E E' A B C D AB CD BC AD S, Sum O E E' A B AB -> Sum O E E' C D CD -> Sum O E E' B C BC -> Sum O E E' A D AD -> Sum O E E' AB CD S -> Sum O E E' BC AD S. Proof. (* Goal: forall (O E E' A B C D AB CD BC AD S : @Tpoint Tn) (_ : @Sum Tn O E E' A B AB) (_ : @Sum Tn O E E' C D CD) (_ : @Sum Tn O E E' B C BC) (_ : @Sum Tn O E E' A D AD) (_ : @Sum Tn O E E' AB CD S), @Sum Tn O E E' BC AD S *) intros. (* Goal: @Sum Tn O E E' BC AD S *) assert(Ar2 O E E' A B AB). (* Goal: @Sum Tn O E E' BC AD S *) (* Goal: @Ar2 Tn O E E' A B AB *) apply sum_ar2;auto. (* Goal: @Sum Tn O E E' BC AD S *) assert(Ar2 O E E' C D CD). (* Goal: @Sum Tn O E E' BC AD S *) (* Goal: @Ar2 Tn O E E' C D CD *) apply sum_ar2;auto. (* Goal: @Sum Tn O E E' BC AD S *) assert(Ar2 O E E' B C BC). (* Goal: @Sum Tn O E E' BC AD S *) (* Goal: @Ar2 Tn O E E' B C BC *) apply sum_ar2;auto. (* Goal: @Sum Tn O E E' BC AD S *) assert(Ar2 O E E' A D AD). (* Goal: @Sum Tn O E E' BC AD S *) (* Goal: @Ar2 Tn O E E' A D AD *) apply sum_ar2;auto. (* Goal: @Sum Tn O E E' BC AD S *) assert(Ar2 O E E' AB CD S). (* Goal: @Sum Tn O E E' BC AD S *) (* Goal: @Ar2 Tn O E E' AB CD S *) apply sum_ar2;auto. (* Goal: @Sum Tn O E E' BC AD S *) unfold Ar2 in *. (* Goal: @Sum Tn O E E' BC AD S *) spliter. (* Goal: @Sum Tn O E E' BC AD S *) clean_duplicated_hyps. (* Goal: @Sum Tn O E E' BC AD S *) assert(sum22 O E E' A B C D S). (* Goal: @Sum Tn O E E' BC AD S *) (* Goal: @sum22 Tn O E E' A B C D S *) unfold sum22. (* Goal: @Sum Tn O E E' BC AD S *) (* Goal: @ex (@Tpoint Tn) (fun AB : @Tpoint Tn => @ex (@Tpoint Tn) (fun CD : @Tpoint Tn => and (@Sum Tn O E E' A B AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S)))) *) exists AB. (* Goal: @Sum Tn O E E' BC AD S *) (* Goal: @ex (@Tpoint Tn) (fun CD : @Tpoint Tn => and (@Sum Tn O E E' A B AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S))) *) exists CD. (* Goal: @Sum Tn O E E' BC AD S *) (* Goal: and (@Sum Tn O E E' A B AB) (and (@Sum Tn O E E' C D CD) (@Sum Tn O E E' AB CD S)) *) split; auto. (* Goal: @Sum Tn O E E' BC AD S *) apply sum22_permut in H5. (* Goal: @Sum Tn O E E' BC AD S *) unfold sum22 in H5. (* Goal: @Sum Tn O E E' BC AD S *) ex_and H5 AD'. (* Goal: @Sum Tn O E E' BC AD S *) ex_and H6 BC'. (* Goal: @Sum Tn O E E' BC AD S *) assert(AD' = AD). (* Goal: @Sum Tn O E E' BC AD S *) (* Goal: @eq (@Tpoint Tn) AD' AD *) apply sum_comm in H2; auto. (* Goal: @Sum Tn O E E' BC AD S *) (* Goal: @eq (@Tpoint Tn) AD' AD *) apply (sum_uniqueness O E E' D A); auto. (* Goal: @Sum Tn O E E' BC AD S *) subst AD'. (* Goal: @Sum Tn O E E' BC AD S *) assert(BC' = BC). (* Goal: @Sum Tn O E E' BC AD S *) (* Goal: @eq (@Tpoint Tn) BC' BC *) apply (sum_uniqueness O E E' B C); auto. (* Goal: @Sum Tn O E E' BC AD S *) subst BC'. (* Goal: @Sum Tn O E E' BC AD S *) apply sum_comm; auto. Qed. Lemma sum_diff_diff_a : forall O E E' A B C dBA dCB dCA, Diff O E E' B A dBA -> Diff O E E' C B dCB -> Diff O E E' C A dCA -> Sum O E E' dCB dBA dCA. Proof. (* Goal: forall (O E E' A B C dBA dCB dCA : @Tpoint Tn) (_ : @Diff Tn O E E' B A dBA) (_ : @Diff Tn O E E' C B dCB) (_ : @Diff Tn O E E' C A dCA), @Sum Tn O E E' dCB dBA dCA *) intros. (* Goal: @Sum Tn O E E' dCB dBA dCA *) assert(Ar2 O E E' B A dBA). (* Goal: @Sum Tn O E E' dCB dBA dCA *) (* Goal: @Ar2 Tn O E E' B A dBA *) apply diff_ar2; auto. (* Goal: @Sum Tn O E E' dCB dBA dCA *) assert(Ar2 O E E' C B dCB). (* Goal: @Sum Tn O E E' dCB dBA dCA *) (* Goal: @Ar2 Tn O E E' C B dCB *) apply diff_ar2; auto. (* Goal: @Sum Tn O E E' dCB dBA dCA *) assert(Ar2 O E E' C A dCA). (* Goal: @Sum Tn O E E' dCB dBA dCA *) (* Goal: @Ar2 Tn O E E' C A dCA *) apply diff_ar2; auto. (* Goal: @Sum Tn O E E' dCB dBA dCA *) unfold Ar2 in *. (* Goal: @Sum Tn O E E' dCB dBA dCA *) spliter. (* Goal: @Sum Tn O E E' dCB dBA dCA *) clean_duplicated_hyps. (* Goal: @Sum Tn O E E' dCB dBA dCA *) unfold Diff in H. (* Goal: @Sum Tn O E E' dCB dBA dCA *) ex_and H mA. (* Goal: @Sum Tn O E E' dCB dBA dCA *) unfold Diff in H0. (* Goal: @Sum Tn O E E' dCB dBA dCA *) ex_and H0 mB. (* Goal: @Sum Tn O E E' dCB dBA dCA *) unfold Diff in H1. (* Goal: @Sum Tn O E E' dCB dBA dCA *) ex_and H1 mA'. (* Goal: @Sum Tn O E E' dCB dBA dCA *) assert(mA' = mA). (* Goal: @Sum Tn O E E' dCB dBA dCA *) (* Goal: @eq (@Tpoint Tn) mA' mA *) apply (opp_uniqueness O E E' H2 A); auto. (* Goal: @Sum Tn O E E' dCB dBA dCA *) subst mA'. (* Goal: @Sum Tn O E E' dCB dBA dCA *) assert(HH:=sum_exists O E E' H2 dBA dCB H13 H10). (* Goal: @Sum Tn O E E' dCB dBA dCA *) ex_and HH Sd. (* Goal: @Sum Tn O E E' dCB dBA dCA *) assert(sum22 O E E' B mA C mB Sd). (* Goal: @Sum Tn O E E' dCB dBA dCA *) (* Goal: @sum22 Tn O E E' B mA C mB Sd *) unfold sum22. (* Goal: @Sum Tn O E E' dCB dBA dCA *) (* Goal: @ex (@Tpoint Tn) (fun AB : @Tpoint Tn => @ex (@Tpoint Tn) (fun CD : @Tpoint Tn => and (@Sum Tn O E E' B mA AB) (and (@Sum Tn O E E' C mB CD) (@Sum Tn O E E' AB CD Sd)))) *) exists dBA. (* Goal: @Sum Tn O E E' dCB dBA dCA *) (* Goal: @ex (@Tpoint Tn) (fun CD : @Tpoint Tn => and (@Sum Tn O E E' B mA dBA) (and (@Sum Tn O E E' C mB CD) (@Sum Tn O E E' dBA CD Sd))) *) exists dCB. (* Goal: @Sum Tn O E E' dCB dBA dCA *) (* Goal: and (@Sum Tn O E E' B mA dBA) (and (@Sum Tn O E E' C mB dCB) (@Sum Tn O E E' dBA dCB Sd)) *) split; auto. (* Goal: @Sum Tn O E E' dCB dBA dCA *) apply sum22_permut in H9. (* Goal: @Sum Tn O E E' dCB dBA dCA *) unfold sum22 in H9. (* Goal: @Sum Tn O E E' dCB dBA dCA *) ex_and H9 O'. (* Goal: @Sum Tn O E E' dCB dBA dCA *) ex_and H14 dCA'. (* Goal: @Sum Tn O E E' dCB dBA dCA *) assert(O' = O). (* Goal: @Sum Tn O E E' dCB dBA dCA *) (* Goal: @eq (@Tpoint Tn) O' O *) apply (sum_uniqueness O E E' mB B); auto. (* Goal: @Sum Tn O E E' dCB dBA dCA *) subst O'. (* Goal: @Sum Tn O E E' dCB dBA dCA *) assert(dCA'=dCA). (* Goal: @Sum Tn O E E' dCB dBA dCA *) (* Goal: @eq (@Tpoint Tn) dCA' dCA *) apply (sum_uniqueness O E E' C mA); auto. (* Goal: @Sum Tn O E E' dCB dBA dCA *) (* Goal: @Sum Tn O E E' C mA dCA' *) apply sum_comm; auto. (* Goal: @Sum Tn O E E' dCB dBA dCA *) subst dCA'. (* Goal: @Sum Tn O E E' dCB dBA dCA *) assert(dCA=Sd). (* Goal: @Sum Tn O E E' dCB dBA dCA *) (* Goal: @eq (@Tpoint Tn) dCA Sd *) apply (sum_O_B_eq O E E'); auto. (* Goal: @Sum Tn O E E' dCB dBA dCA *) subst Sd. (* Goal: @Sum Tn O E E' dCB dBA dCA *) apply sum_comm; auto. Qed. Lemma sum_diff_diff_b : forall O E E' A B C dBA dCB dCA, Diff O E E' B A dBA -> Diff O E E' C B dCB -> Sum O E E' dCB dBA dCA -> Diff O E E' C A dCA. Proof. (* Goal: forall (O E E' A B C dBA dCB dCA : @Tpoint Tn) (_ : @Diff Tn O E E' B A dBA) (_ : @Diff Tn O E E' C B dCB) (_ : @Sum Tn O E E' dCB dBA dCA), @Diff Tn O E E' C A dCA *) intros. (* Goal: @Diff Tn O E E' C A dCA *) assert(Ar2 O E E' B A dBA). (* Goal: @Diff Tn O E E' C A dCA *) (* Goal: @Ar2 Tn O E E' B A dBA *) apply diff_ar2; auto. (* Goal: @Diff Tn O E E' C A dCA *) assert(Ar2 O E E' C B dCB). (* Goal: @Diff Tn O E E' C A dCA *) (* Goal: @Ar2 Tn O E E' C B dCB *) apply diff_ar2; auto. (* Goal: @Diff Tn O E E' C A dCA *) assert(Ar2 O E E' dCB dBA dCA). (* Goal: @Diff Tn O E E' C A dCA *) (* Goal: @Ar2 Tn O E E' dCB dBA dCA *) apply sum_ar2; auto. (* Goal: @Diff Tn O E E' C A dCA *) unfold Ar2 in *. (* Goal: @Diff Tn O E E' C A dCA *) spliter. (* Goal: @Diff Tn O E E' C A dCA *) clean_duplicated_hyps. (* Goal: @Diff Tn O E E' C A dCA *) unfold Diff in H. (* Goal: @Diff Tn O E E' C A dCA *) ex_and H mA. (* Goal: @Diff Tn O E E' C A dCA *) unfold Diff in H0. (* Goal: @Diff Tn O E E' C A dCA *) ex_and H0 mB. (* Goal: @Diff Tn O E E' C A dCA *) assert(sum22 O E E' B mA C mB dCA). (* Goal: @Diff Tn O E E' C A dCA *) (* Goal: @sum22 Tn O E E' B mA C mB dCA *) unfold sum22. (* Goal: @Diff Tn O E E' C A dCA *) (* Goal: @ex (@Tpoint Tn) (fun AB : @Tpoint Tn => @ex (@Tpoint Tn) (fun CD : @Tpoint Tn => and (@Sum Tn O E E' B mA AB) (and (@Sum Tn O E E' C mB CD) (@Sum Tn O E E' AB CD dCA)))) *) exists dBA. (* Goal: @Diff Tn O E E' C A dCA *) (* Goal: @ex (@Tpoint Tn) (fun CD : @Tpoint Tn => and (@Sum Tn O E E' B mA dBA) (and (@Sum Tn O E E' C mB CD) (@Sum Tn O E E' dBA CD dCA))) *) exists dCB. (* Goal: @Diff Tn O E E' C A dCA *) (* Goal: and (@Sum Tn O E E' B mA dBA) (and (@Sum Tn O E E' C mB dCB) (@Sum Tn O E E' dBA dCB dCA)) *) split; auto. (* Goal: @Diff Tn O E E' C A dCA *) (* Goal: and (@Sum Tn O E E' C mB dCB) (@Sum Tn O E E' dBA dCB dCA) *) split; auto. (* Goal: @Diff Tn O E E' C A dCA *) (* Goal: @Sum Tn O E E' dBA dCB dCA *) apply sum_comm; auto. (* Goal: @Diff Tn O E E' C A dCA *) apply sum22_permut in H5. (* Goal: @Diff Tn O E E' C A dCA *) unfold sum22 in H5. (* Goal: @Diff Tn O E E' C A dCA *) ex_and H5 O'. (* Goal: @Diff Tn O E E' C A dCA *) ex_and H6 dCA'. (* Goal: @Diff Tn O E E' C A dCA *) assert(O'=O). (* Goal: @Diff Tn O E E' C A dCA *) (* Goal: @eq (@Tpoint Tn) O' O *) apply (sum_uniqueness O E E' mB B); auto. (* Goal: @Diff Tn O E E' C A dCA *) subst O'. (* Goal: @Diff Tn O E E' C A dCA *) assert(dCA' = dCA). (* Goal: @Diff Tn O E E' C A dCA *) (* Goal: @eq (@Tpoint Tn) dCA' dCA *) apply(sum_O_B_eq O E E'); auto. (* Goal: @Diff Tn O E E' C A dCA *) subst dCA'. (* Goal: @Diff Tn O E E' C A dCA *) unfold Diff. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Opp Tn O E E' A B') (@Sum Tn O E E' C B' dCA)) *) exists mA. (* Goal: and (@Opp Tn O E E' A mA) (@Sum Tn O E E' C mA dCA) *) split; auto. (* Goal: @Sum Tn O E E' C mA dCA *) apply sum_comm; auto. Qed. Lemma sum_diff2_diff_sum2_a : forall O E E' A B C X Y Z dXA dYB dZC, Sum O E E' A B C -> Sum O E E' X Y Z -> Diff O E E' X A dXA -> Diff O E E' Y B dYB -> Sum O E E' dXA dYB dZC -> Diff O E E' Z C dZC. Proof. (* Goal: forall (O E E' A B C X Y Z dXA dYB dZC : @Tpoint Tn) (_ : @Sum Tn O E E' A B C) (_ : @Sum Tn O E E' X Y Z) (_ : @Diff Tn O E E' X A dXA) (_ : @Diff Tn O E E' Y B dYB) (_ : @Sum Tn O E E' dXA dYB dZC), @Diff Tn O E E' Z C dZC *) intros. (* Goal: @Diff Tn O E E' Z C dZC *) assert(Ar2 O E E' A B C). (* Goal: @Diff Tn O E E' Z C dZC *) (* Goal: @Ar2 Tn O E E' A B C *) apply sum_ar2; auto. (* Goal: @Diff Tn O E E' Z C dZC *) assert(Ar2 O E E' X Y Z). (* Goal: @Diff Tn O E E' Z C dZC *) (* Goal: @Ar2 Tn O E E' X Y Z *) apply sum_ar2; auto. (* Goal: @Diff Tn O E E' Z C dZC *) assert(Ar2 O E E' dXA dYB dZC). (* Goal: @Diff Tn O E E' Z C dZC *) (* Goal: @Ar2 Tn O E E' dXA dYB dZC *) apply sum_ar2; auto. (* Goal: @Diff Tn O E E' Z C dZC *) unfold Ar2 in *. (* Goal: @Diff Tn O E E' Z C dZC *) spliter. (* Goal: @Diff Tn O E E' Z C dZC *) clean_duplicated_hyps. (* Goal: @Diff Tn O E E' Z C dZC *) apply diff_sum in H1. (* Goal: @Diff Tn O E E' Z C dZC *) apply diff_sum in H2. (* Goal: @Diff Tn O E E' Z C dZC *) apply sum_diff. (* Goal: @Sum Tn O E E' C dZC Z *) assert(HH:=sum_exists O E E' H4 C dZC H15 H9); auto. (* Goal: @Sum Tn O E E' C dZC Z *) ex_and HH Z'. (* Goal: @Sum Tn O E E' C dZC Z *) assert(sum22 O E E' A B dXA dYB Z'). (* Goal: @Sum Tn O E E' C dZC Z *) (* Goal: @sum22 Tn O E E' A B dXA dYB Z' *) unfold sum22. (* Goal: @Sum Tn O E E' C dZC Z *) (* Goal: @ex (@Tpoint Tn) (fun AB : @Tpoint Tn => @ex (@Tpoint Tn) (fun CD : @Tpoint Tn => and (@Sum Tn O E E' A B AB) (and (@Sum Tn O E E' dXA dYB CD) (@Sum Tn O E E' AB CD Z')))) *) exists C. (* Goal: @Sum Tn O E E' C dZC Z *) (* Goal: @ex (@Tpoint Tn) (fun CD : @Tpoint Tn => and (@Sum Tn O E E' A B C) (and (@Sum Tn O E E' dXA dYB CD) (@Sum Tn O E E' C CD Z'))) *) exists dZC. (* Goal: @Sum Tn O E E' C dZC Z *) (* Goal: and (@Sum Tn O E E' A B C) (and (@Sum Tn O E E' dXA dYB dZC) (@Sum Tn O E E' C dZC Z')) *) auto. (* Goal: @Sum Tn O E E' C dZC Z *) apply sum22_comm in H6. (* Goal: @Sum Tn O E E' C dZC Z *) apply sum22_permut in H6. (* Goal: @Sum Tn O E E' C dZC Z *) apply sum22_comm in H6. (* Goal: @Sum Tn O E E' C dZC Z *) unfold sum22 in H6. (* Goal: @Sum Tn O E E' C dZC Z *) ex_and H6 Y'. (* Goal: @Sum Tn O E E' C dZC Z *) ex_and H16 X'. (* Goal: @Sum Tn O E E' C dZC Z *) assert(X' = X). (* Goal: @Sum Tn O E E' C dZC Z *) (* Goal: @eq (@Tpoint Tn) X' X *) apply(sum_uniqueness O E E' A dXA); auto. (* Goal: @Sum Tn O E E' C dZC Z *) subst X'. (* Goal: @Sum Tn O E E' C dZC Z *) assert(Y'=Y). (* Goal: @Sum Tn O E E' C dZC Z *) (* Goal: @eq (@Tpoint Tn) Y' Y *) apply(sum_uniqueness O E E' B dYB); auto. (* Goal: @Sum Tn O E E' C dZC Z *) subst Y'. (* Goal: @Sum Tn O E E' C dZC Z *) assert( Z'= Z). (* Goal: @Sum Tn O E E' C dZC Z *) (* Goal: @eq (@Tpoint Tn) Z' Z *) apply(sum_uniqueness O E E' X Y); auto. (* Goal: @Sum Tn O E E' C dZC Z *) (* Goal: @Sum Tn O E E' X Y Z' *) apply sum_comm; auto. (* Goal: @Sum Tn O E E' C dZC Z *) subst Z'. (* Goal: @Sum Tn O E E' C dZC Z *) assumption. Qed. Lemma sum_diff2_diff_sum2_b : forall O E E' A B C X Y Z dXA dYB dZC, Sum O E E' A B C -> Sum O E E' X Y Z -> Diff O E E' X A dXA -> Diff O E E' Y B dYB -> Diff O E E' Z C dZC -> Sum O E E' dXA dYB dZC . Proof. (* Goal: forall (O E E' A B C X Y Z dXA dYB dZC : @Tpoint Tn) (_ : @Sum Tn O E E' A B C) (_ : @Sum Tn O E E' X Y Z) (_ : @Diff Tn O E E' X A dXA) (_ : @Diff Tn O E E' Y B dYB) (_ : @Diff Tn O E E' Z C dZC), @Sum Tn O E E' dXA dYB dZC *) intros. (* Goal: @Sum Tn O E E' dXA dYB dZC *) assert(Ar2 O E E' A B C). (* Goal: @Sum Tn O E E' dXA dYB dZC *) (* Goal: @Ar2 Tn O E E' A B C *) apply sum_ar2; auto. (* Goal: @Sum Tn O E E' dXA dYB dZC *) assert(Ar2 O E E' X Y Z). (* Goal: @Sum Tn O E E' dXA dYB dZC *) (* Goal: @Ar2 Tn O E E' X Y Z *) apply sum_ar2; auto. (* Goal: @Sum Tn O E E' dXA dYB dZC *) assert(Ar2 O E E' X A dXA). (* Goal: @Sum Tn O E E' dXA dYB dZC *) (* Goal: @Ar2 Tn O E E' X A dXA *) apply diff_ar2; auto. (* Goal: @Sum Tn O E E' dXA dYB dZC *) assert(Ar2 O E E' Y B dYB). (* Goal: @Sum Tn O E E' dXA dYB dZC *) (* Goal: @Ar2 Tn O E E' Y B dYB *) apply diff_ar2; auto. (* Goal: @Sum Tn O E E' dXA dYB dZC *) assert(Ar2 O E E' Z C dZC). (* Goal: @Sum Tn O E E' dXA dYB dZC *) (* Goal: @Ar2 Tn O E E' Z C dZC *) apply diff_ar2; auto. (* Goal: @Sum Tn O E E' dXA dYB dZC *) unfold Ar2 in *. (* Goal: @Sum Tn O E E' dXA dYB dZC *) spliter. (* Goal: @Sum Tn O E E' dXA dYB dZC *) clean_duplicated_hyps. (* Goal: @Sum Tn O E E' dXA dYB dZC *) assert(HH:=sum_exists O E E' H4 dXA dYB H17 H14). (* Goal: @Sum Tn O E E' dXA dYB dZC *) ex_and HH dZC'. (* Goal: @Sum Tn O E E' dXA dYB dZC *) assert(HH:=sum_diff2_diff_sum2_a O E E' A B C X Y Z dXA dYB dZC' H H0 H1 H2 H5). (* Goal: @Sum Tn O E E' dXA dYB dZC *) assert( dZC' = dZC). (* Goal: @Sum Tn O E E' dXA dYB dZC *) (* Goal: @eq (@Tpoint Tn) dZC' dZC *) apply(diff_uniqueness O E E' Z C); auto. (* Goal: @Sum Tn O E E' dXA dYB dZC *) subst dZC'. (* Goal: @Sum Tn O E E' dXA dYB dZC *) assumption. Qed. Lemma sum_opp : forall O E E' X MX, Sum O E E' X MX O -> Opp O E E' X MX. Proof. (* Goal: forall (O E E' X MX : @Tpoint Tn) (_ : @Sum Tn O E E' X MX O), @Opp Tn O E E' X MX *) intros O E E' X MX HSum. (* Goal: @Opp Tn O E E' X MX *) apply diff_O_A_opp; apply sum_diff; auto. Qed. Lemma sum_diff_diff : forall O E E' AX BX CX AXMBX AXMCX BXMCX, Diff O E E' AX BX AXMBX -> Diff O E E' AX CX AXMCX -> Diff O E E' BX CX BXMCX -> Sum O E E' AXMBX BXMCX AXMCX. Proof. (* Goal: forall (O E E' AX BX CX AXMBX AXMCX BXMCX : @Tpoint Tn) (_ : @Diff Tn O E E' AX BX AXMBX) (_ : @Diff Tn O E E' AX CX AXMCX) (_ : @Diff Tn O E E' BX CX BXMCX), @Sum Tn O E E' AXMBX BXMCX AXMCX *) intros O E E' AX BX CX AXMBX AXMCX BXMCX HAXMBX HAXMCX HBXMCX. (* Goal: @Sum Tn O E E' AXMBX BXMCX AXMCX *) assert (HNC : ~ Col O E E') by (unfold Diff, Sum, Ar2 in *; destruct HAXMBX; spliter; auto). (* Goal: @Sum Tn O E E' AXMBX BXMCX AXMCX *) assert (HColAX : Col O E AX) by (unfold Diff, Sum, Ar2 in *; destruct HAXMBX; spliter; auto). (* Goal: @Sum Tn O E E' AXMBX BXMCX AXMCX *) assert (HColBX : Col O E BX) by (unfold Diff, Sum, Ar2 in *; destruct HBXMCX; spliter; auto). (* Goal: @Sum Tn O E E' AXMBX BXMCX AXMCX *) assert (HColCX : Col O E CX) by (unfold Diff, Opp, Sum, Ar2 in *; destruct HBXMCX; spliter; auto). (* Goal: @Sum Tn O E E' AXMBX BXMCX AXMCX *) assert (HColAXMBX : Col O E AXMBX) by (unfold Diff, Sum, Ar2 in *; destruct HAXMBX; spliter; auto). (* Goal: @Sum Tn O E E' AXMBX BXMCX AXMCX *) assert (HColAXMCX : Col O E AXMCX) by (unfold Diff, Sum, Ar2 in *; destruct HAXMCX; spliter; auto). (* Goal: @Sum Tn O E E' AXMBX BXMCX AXMCX *) assert (HColBXMCX : Col O E BXMCX) by (unfold Diff, Sum, Ar2 in *; destruct HBXMCX; spliter; auto). (* Goal: @Sum Tn O E E' AXMBX BXMCX AXMCX *) destruct (opp_exists O E E' HNC BX) as [MBX HMBX]; Col. (* Goal: @Sum Tn O E E' AXMBX BXMCX AXMCX *) assert (HSum1 : Sum O E E' AX MBX AXMBX). (* Goal: @Sum Tn O E E' AXMBX BXMCX AXMCX *) (* Goal: @Sum Tn O E E' AX MBX AXMBX *) { (* Goal: @Sum Tn O E E' AX MBX AXMBX *) apply diff_sum in HAXMBX; apply sum_assoc_1 with AXMBX BX O; apply sum_comm; auto; apply sum_O_B; Col. (* BG Goal: @Sum Tn O E E' AXMBX BXMCX AXMCX *) } (* Goal: @Sum Tn O E E' AXMBX BXMCX AXMCX *) destruct (opp_exists O E E' HNC CX) as [MCX HMCX]; Col. (* Goal: @Sum Tn O E E' AXMBX BXMCX AXMCX *) assert (HSum2 : Sum O E E' BX MCX BXMCX). (* Goal: @Sum Tn O E E' AXMBX BXMCX AXMCX *) (* Goal: @Sum Tn O E E' BX MCX BXMCX *) { (* Goal: @Sum Tn O E E' BX MCX BXMCX *) apply diff_sum in HBXMCX; apply sum_assoc_1 with BXMCX CX O; apply sum_comm; auto; apply sum_O_B; Col. (* BG Goal: @Sum Tn O E E' AXMBX BXMCX AXMCX *) } (* Goal: @Sum Tn O E E' AXMBX BXMCX AXMCX *) apply sum_assoc_1 with AX MBX MCX; auto. (* Goal: @Sum Tn O E E' AX MCX AXMCX *) (* Goal: @Sum Tn O E E' MBX BXMCX MCX *) { (* Goal: @Sum Tn O E E' MBX BXMCX MCX *) apply sum_assoc_2 with BX MCX O; auto; apply sum_O_B; Col. (* Goal: @Col Tn O E MCX *) unfold Opp, Sum, Ar2 in *; spliter; Col. (* BG Goal: @Sum Tn O E E' AX MCX AXMCX *) } (* Goal: @Sum Tn O E E' AX MCX AXMCX *) { (* Goal: @Sum Tn O E E' AX MCX AXMCX *) apply diff_sum in HAXMCX; apply sum_assoc_1 with AXMCX CX O; apply sum_comm; auto; apply sum_O_B; Col. Qed. End T14_sum.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrfun ssrbool eqtype ssrnat seq div choice. From mathcomp Require Import fintype prime finset fingroup morphism automorphism. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Import GroupScope. Section Cosets. Variables (gT : finGroupType) (Q A : {set gT}). Notation H := <<A>>. Definition coset_range := [pred B in rcosets H 'N(A)]. Record coset_of : Type := Coset { set_of_coset :> GroupSet.sort gT; _ : coset_range set_of_coset }. Canonical coset_subType := Eval hnf in [subType for set_of_coset]. Definition coset_eqMixin := Eval hnf in [eqMixin of coset_of by <:]. Canonical coset_eqType := Eval hnf in EqType coset_of coset_eqMixin. Definition coset_choiceMixin := [choiceMixin of coset_of by <:]. Canonical coset_choiceType := Eval hnf in ChoiceType coset_of coset_choiceMixin. Definition coset_countMixin := [countMixin of coset_of by <:]. Canonical coset_countType := Eval hnf in CountType coset_of coset_countMixin. Canonical coset_subCountType := Eval hnf in [subCountType of coset_of]. Definition coset_finMixin := [finMixin of coset_of by <:]. Canonical coset_finType := Eval hnf in FinType coset_of coset_finMixin. Canonical coset_subFinType := Eval hnf in [subFinType of coset_of]. Lemma coset_one_proof : coset_range H. Proof. (* Goal: is_true (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) coset_range (@generated gT A)) *) by apply/rcosetsP; exists (1 : gT); rewrite (group1, mulg1). Qed. Definition coset_one := Coset coset_one_proof. Let nNH := subsetP (norm_gen A). Lemma coset_range_mul (B C : coset_of) : coset_range (B * C). Proof. (* Goal: is_true (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) coset_range (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (set_of_coset B) (set_of_coset C))) *) case: B C => _ /= /rcosetsP[x Nx ->] [_ /= /rcosetsP[y Ny ->]]. (* Goal: is_true (@in_mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@generated gT A) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@generated gT A) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@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))) (@rcosets gT (@generated gT A) (@normaliser gT A))))) *) by apply/rcosetsP; exists (x * y); rewrite !(groupM, rcoset_mul, nNH). Qed. Definition coset_mul B C := Coset (coset_range_mul B C). Lemma coset_range_inv (B : coset_of) : coset_range B^-1. Proof. (* Goal: is_true (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) coset_range (@invg (group_set_of_baseGroupType (FinGroup.base gT)) (set_of_coset B))) *) case: B => _ /= /rcosetsP[x Nx ->]; rewrite norm_rlcoset ?nNH // invg_lcoset. (* Goal: is_true (@in_mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT (@generated_group gT A)) (@set1 (FinGroup.finType (FinGroup.base gT)) (@invg (FinGroup.base gT) x))) (@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))) (@rcosets gT (@generated gT A) (@normaliser gT A))))) *) by apply/rcosetsP; exists x^-1; rewrite ?groupV. Qed. Definition coset_inv B := Coset (coset_range_inv B). Lemma coset_mulP : associative coset_mul. Proof. (* Goal: @associative coset_of coset_mul *) by move=> B C D; apply: val_inj; rewrite /= mulgA. Qed. Lemma coset_oneP : left_id coset_one coset_mul. Proof. (* Goal: @left_id coset_of coset_of coset_one coset_mul *) case=> B coB; apply: val_inj => /=; case/rcosetsP: coB => x Hx ->{B}. (* Goal: @eq (GroupSet.sort (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@generated gT A) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@generated gT A) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@generated gT A) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) *) by rewrite mulgA mulGid. Qed. Lemma coset_invP : left_inverse coset_one coset_inv coset_mul. Proof. (* Goal: @left_inverse coset_of coset_of coset_of coset_one coset_inv coset_mul *) case=> B coB; apply: val_inj => /=; case/rcosetsP: coB => x Hx ->{B}. (* Goal: @eq (GroupSet.sort (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@invg (group_set_of_baseGroupType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@generated gT A) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@generated gT A) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@generated gT A) *) rewrite invg_rcoset -mulgA (mulgA H) mulGid. (* Goal: @eq (GroupSet.sort (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.finType (FinGroup.base gT)) (@invg (FinGroup.base gT) x)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT (@generated_group gT A)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@generated gT A) *) by rewrite norm_rlcoset ?nNH // -lcosetM mulVg mul1g. Qed. Definition coset_of_groupMixin := FinGroup.Mixin coset_mulP coset_oneP coset_invP. Canonical coset_baseGroupType := Eval hnf in BaseFinGroupType coset_of coset_of_groupMixin. Canonical coset_groupType := FinGroupType coset_invP. Definition coset x : coset_of := insubd (1 : coset_of) (H :* x). Lemma val_coset_prim x : x \in 'N(A) -> coset x :=: H :* 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 A)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (set_of_coset (coset x)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@generated gT A) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) *) by move=> Nx; rewrite val_insubd /= mem_rcosets -{1}(mul1g x) mem_mulg. Qed. Lemma coset_morphM : {in 'N(A) &, {morph coset : x y / x * y}}. Canonical coset_morphism := Morphism coset_morphM. Lemma ker_coset_prim : 'ker coset = 'N_H(A). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@ker gT coset_groupType (@normaliser gT A) coset_morphism (@MorPhantom gT coset_groupType coset)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT A) (@normaliser gT A)) *) apply/setP=> z; rewrite !in_setI andbC 2!inE -val_eqE /=. (* Goal: @eq bool (andb (@eq_op (Choice.eqType (group_set_choiceType (FinGroup.base gT))) (set_of_coset (coset z)) (@generated gT A)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) 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)) (@normaliser gT A))))) (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) 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)) (@generated gT A)))) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) 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)) (@normaliser gT A))))) *) case Nz: (z \in 'N(A)); rewrite ?andbF ?val_coset_prim // !andbT. (* Goal: @eq bool (@eq_op (Choice.eqType (group_set_choiceType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@generated gT A) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) z)) (@generated gT A)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) 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)) (@generated gT A)))) *) by apply/eqP/idP=> [<-| Az]; rewrite (rcoset_refl, rcoset_id). Qed. Implicit Type xbar : coset_of. Lemma coset_mem y xbar : y \in xbar -> coset y = xbar. 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)) (set_of_coset xbar)))), @eq coset_of (coset y) xbar *) case: xbar => /= Hx NHx Hxy; apply: val_inj=> /=. (* Goal: @eq (GroupSet.sort (FinGroup.base gT)) (set_of_coset (coset y)) Hx *) case/rcosetsP: NHx (NHx) Hxy => x Nx -> NHx Hxy. (* Goal: @eq (GroupSet.sort (FinGroup.base gT)) (set_of_coset (coset y)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@generated gT A) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) *) by rewrite val_insubd /= (rcoset_eqP Hxy) NHx. Qed. Lemma mem_repr_coset xbar : repr xbar \in xbar. Proof. (* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@repr (FinGroup.base gT) (set_of_coset xbar)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (set_of_coset xbar)))) *) by case: xbar => /= _ /rcosetsP[x _ ->]; apply: mem_repr_rcoset. Qed. Lemma repr_coset1 : repr (1 : coset_of) = 1. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@repr (FinGroup.base gT) (set_of_coset (oneg coset_baseGroupType : coset_of))) (oneg (FinGroup.base gT)) *) exact: repr_group. Qed. Lemma coset_reprK : cancel (fun xbar => repr xbar) coset. Proof. (* Goal: @cancel (FinGroup.sort (FinGroup.base gT)) coset_of (fun xbar : coset_of => @repr (FinGroup.base gT) (set_of_coset xbar)) coset *) by move=> xbar; apply: coset_mem (mem_repr_coset xbar). Qed. Lemma cosetP xbar : {x | x \in 'N(A) & xbar = coset x}. Proof. (* Goal: @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)) (@normaliser gT A))))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq coset_of xbar (coset x)) *) pose x := repr 'N_xbar(A). (* Goal: @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)) (@normaliser gT A))))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq coset_of xbar (coset x)) *) have [xbar_x Nx]: x \in xbar /\ x \in 'N(A). (* Goal: @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)) (@normaliser gT A))))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq coset_of xbar (coset x)) *) (* Goal: and (is_true (@in_mem (FinGroup.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)) (set_of_coset xbar))))) (is_true (@in_mem (FinGroup.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)) (@normaliser gT A))))) *) apply/setIP; rewrite {}/x; case: xbar => /= _ /rcosetsP[y Ny ->]. (* Goal: @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)) (@normaliser gT A))))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq coset_of xbar (coset x)) *) (* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@repr (FinGroup.base gT) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@generated gT A) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y)) (@normaliser gT A))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@generated gT A) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y)) (@normaliser gT A))))) *) by apply: (mem_repr y); rewrite inE rcoset_refl. (* Goal: @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)) (@normaliser gT A))))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq coset_of xbar (coset x)) *) by exists x; last rewrite (coset_mem xbar_x). Qed. Lemma coset_id x : x \in A -> coset x = 1. 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))), @eq coset_of (coset x) (oneg coset_baseGroupType) *) by move=> Ax; apply: coset_mem; apply: mem_gen. Qed. Lemma im_coset : coset @* 'N(A) = setT. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base coset_groupType)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base coset_groupType))))) (@morphim gT coset_groupType (@normaliser gT A) coset_morphism (@MorPhantom gT coset_groupType coset) (@normaliser gT A)) (@setTfor (FinGroup.finType (FinGroup.base coset_groupType)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base coset_groupType))))) *) by apply/setP=> xbar; case: (cosetP xbar) => x Nx ->; rewrite inE mem_morphim. Qed. Lemma sub_im_coset (C : {set coset_of}) : C \subset coset @* 'N(A). Proof. (* Goal: is_true (@subset coset_finType (@mem (Finite.sort coset_finType) (predPredType (Finite.sort coset_finType)) (@SetDef.pred_of_set coset_finType C)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base coset_groupType))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base coset_groupType)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base coset_groupType)) (@morphim gT coset_groupType (@normaliser gT A) coset_morphism (@MorPhantom gT coset_groupType coset) (@normaliser gT A))))) *) by rewrite im_coset subsetT. Qed. Lemma cosetpre_proper C D : (coset @*^-1 C \proper coset @*^-1 D) = (C \proper D). Proof. (* Goal: @eq bool (@proper (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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 (@normaliser gT A) coset_morphism (@MorPhantom gT coset_groupType coset) C))) (@mem (Finite.sort (FinGroup.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 (@normaliser gT A) coset_morphism (@MorPhantom gT coset_groupType coset) D)))) (@proper (FinGroup.arg_finType (FinGroup.base coset_groupType)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base coset_groupType))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base coset_groupType)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base coset_groupType)) C)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base coset_groupType))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base coset_groupType)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base coset_groupType)) D))) *) by rewrite morphpre_proper ?sub_im_coset. Qed. Definition quotient : {set coset_of} := coset @* Q. End Cosets. Arguments coset_of {gT} H%g : rename. Arguments coset {gT} H%g x%g : rename. Arguments quotient {gT} A%g H%g : rename. Arguments coset_reprK {gT H%g} xbar%g : rename. Bind Scope group_scope with coset_of. Notation "A / H" := (quotient A H) : group_scope. Section CosetOfGroupTheory. Variables (gT : finGroupType) (H : {group gT}). Implicit Types (A B : {set gT}) (G K : {group gT}) (xbar yb : coset_of H). Implicit Types (C D : {set coset_of H}) (L M : {group coset_of H}). Canonical quotient_group G A : {group coset_of A} := Eval hnf in [group of G / A]. Infix "/" := quotient_group : Group_scope. Lemma val_coset x : x \in 'N(H) -> coset H x :=: H :* 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 H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@set_of_coset gT (@gval gT H) (@coset gT (@gval gT H) x)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) *) by move=> Nx; rewrite val_coset_prim // genGid. Qed. Lemma coset_default x : (x \in 'N(H)) = false -> coset H x = 1. Lemma coset_norm xbar : xbar \subset 'N(H). 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)) (@set_of_coset gT (@gval gT H) xbar))) (@mem (Finite.sort (FinGroup.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: xbar => /= _ /rcosetsP[x Nx ->]. (* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@generated gT (@gval gT H)) (@set1 (FinGroup.arg_finType (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)) (@normaliser gT (@gval gT H))))) *) by rewrite genGid mul_subG ?sub1set ?normG. Qed. Lemma ker_coset : 'ker (coset H) = H. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@ker gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H)))) (@gval gT H) *) by rewrite ker_coset_prim genGid (setIidPl _) ?normG. Qed. Lemma coset_idr x : x \in 'N(H) -> coset H x = 1 -> x \in H. 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 H)))))) (_ : @eq (@coset_of gT (@gval gT H)) (@coset gT (@gval gT H) x) (oneg (@coset_baseGroupType gT (@gval gT 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)) (@gval gT H)))) *) by move=> Nx Hx1; rewrite -ker_coset mem_morphpre //= Hx1 set11. Qed. Lemma repr_coset_norm xbar : repr xbar \in 'N(H). Proof. (* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@repr (FinGroup.base gT) (@set_of_coset gT (@gval gT H) xbar)) (@mem (Finite.sort (FinGroup.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))))) *) exact: subsetP (coset_norm _) _ (mem_repr_coset _). Qed. Lemma imset_coset G : coset H @: G = G / H. Proof. (* Goal: @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (Finite.sort (@coset_finType gT (@gval gT H))))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (@coset_finType gT (@gval gT H)) (@coset 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)))) (@quotient gT (@gval gT G) (@gval gT H)) *) apply/eqP; rewrite eqEsubset andbC imsetS ?subsetIr //=. (* Goal: is_true (@subset (@coset_finType gT (@gval gT H)) (@mem (@coset_of gT (@gval gT H)) (predPredType (@coset_of gT (@gval gT H))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT H)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (@coset_finType gT (@gval gT H)) (@coset 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)) (@gval gT G)))))) (@mem (@coset_of gT (@gval gT H)) (predPredType (@coset_of gT (@gval gT H))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H))))) *) apply/subsetP=> _ /imsetP[x Gx ->]. (* Goal: is_true (@in_mem (Finite.sort (@coset_finType gT (@gval gT H))) (@coset gT (@gval gT H) x) (@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))))) *) by case Nx: (x \in 'N(H)); rewrite ?(coset_default Nx) ?mem_morphim ?group1. Qed. Lemma val_quotient A : val @: (A / H) = rcosets H 'N_A(H). Proof. (* Goal: @eq (@set_of (group_set_finType (FinGroup.base gT)) (Phant (Finite.sort (group_set_finType (FinGroup.base gT))))) (@Imset.imset (@subFinType_finType (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H))) (group_set_finType (FinGroup.base gT)) (@val (Choice.sort (Finite.choiceType (group_set_finType (FinGroup.base gT)))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@subFin_sort (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType 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 A (@gval gT H))))) (@rcosets gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (@normaliser gT (@gval gT H)))) *) apply/setP=> B; apply/imsetP/rcosetsP=> [[xbar Axbar]|[x /setIP[Ax Nx]]] ->{B}. (* Goal: @ex2 (Finite.sort (@subFinType_finType (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H)))) (fun x : Finite.sort (@subFinType_finType (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H))) => is_true (@in_mem (Finite.sort (@subFinType_finType (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H)))) x (@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 A (@gval gT H)))))) (fun x0 : Finite.sort (@subFinType_finType (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H))) => @eq (Finite.sort (group_set_finType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@val (Choice.sort (Finite.choiceType (group_set_finType (FinGroup.base gT)))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@subFin_sort (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H))) x0)) *) (* 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (@normaliser gT (@gval gT H))))))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@val (Choice.sort (Finite.choiceType (group_set_finType (FinGroup.base gT)))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@subFin_sort (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H))) xbar) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) *) case/morphimP: Axbar => x Nx Ax ->{xbar}. (* Goal: @ex2 (Finite.sort (@subFinType_finType (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H)))) (fun x : Finite.sort (@subFinType_finType (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H))) => is_true (@in_mem (Finite.sort (@subFinType_finType (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H)))) x (@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 A (@gval gT H)))))) (fun x0 : Finite.sort (@subFinType_finType (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H))) => @eq (Finite.sort (group_set_finType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@val (Choice.sort (Finite.choiceType (group_set_finType (FinGroup.base gT)))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@subFin_sort (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H))) x0)) *) (* 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (@normaliser gT (@gval gT H))))))) (fun x0 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@val (Choice.sort (Finite.choiceType (group_set_finType (FinGroup.base gT)))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@subFin_sort (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H))) (@mfun gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) x)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x0))) *) by exists x; [rewrite inE Ax | rewrite /= val_coset]. (* Goal: @ex2 (Finite.sort (@subFinType_finType (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H)))) (fun x : Finite.sort (@subFinType_finType (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H))) => is_true (@in_mem (Finite.sort (@subFinType_finType (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H)))) x (@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 A (@gval gT H)))))) (fun x0 : Finite.sort (@subFinType_finType (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H))) => @eq (Finite.sort (group_set_finType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@val (Choice.sort (Finite.choiceType (group_set_finType (FinGroup.base gT)))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@subFin_sort (Finite.choiceType (group_set_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subFinType gT (@gval gT H))) x0)) *) by exists (coset H x); [apply/morphimP; exists x | rewrite /= val_coset]. Qed. Lemma card_quotient_subnorm A : #|A / H| = #|'N_A(H) : H|. Proof. (* Goal: @eq nat (@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 A (@gval gT H))))) (@indexg gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (@normaliser gT (@gval gT H))) (@gval gT H)) *) by rewrite -(card_imset _ val_inj) val_quotient. Qed. Lemma leq_quotient A : #|A / H| <= #|A|. Proof. (* Goal: is_true (leq (@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 A (@gval gT H))))) (@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)))) *) exact: leq_morphim. Qed. Lemma ltn_quotient A : H :!=: 1 -> H \subset A -> #|A / H| < #|A|. Proof. (* Goal: forall (_ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H : @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)))))))) (_ : 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)) A)))), is_true (leq (S (@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 A (@gval gT H)))))) (@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)))) *) by move=> ntH sHA; rewrite ltn_morphim // ker_coset (setIidPr sHA) proper1G. Qed. Lemma card_quotient A : A \subset 'N(H) -> #|A / H| = #|A : 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)) 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))))), @eq nat (@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 A (@gval gT H))))) (@indexg gT A (@gval gT H)) *) by move=> nHA; rewrite card_quotient_subnorm (setIidPl nHA). Qed. Lemma divg_normal G : H <| G -> #|G| %/ #|H| = #|G / H|. Proof. (* Goal: forall _ : is_true (@normal gT (@gval gT H) (@gval gT G)), @eq nat (divn (@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 gT)) (@mem (Finite.sort (FinGroup.arg_finType (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))))) (@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))))) *) by case/andP=> sHG nHG; rewrite divgS ?card_quotient. Qed. Lemma coset1 : coset H 1 :=: H. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@set_of_coset gT (@gval gT H) (@coset gT (@gval gT H) (oneg (FinGroup.base gT)))) (@gval gT H) *) by rewrite morph1 /= genGid. Qed. Lemma cosetpre1 : coset H @*^-1 1 = H. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (oneg (group_set_of_baseGroupType (FinGroup.base (@coset_groupType gT (@gval gT H)))))) (@gval gT H) *) by rewrite -kerE ker_coset. Qed. Lemma im_quotient : 'N(H) / H = setT. Proof. (* Goal: @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@normaliser gT (@gval gT H)) (@gval gT H)) (@setTfor (@coset_finType gT (@gval gT H)) (Phant (Finite.sort (@coset_finType gT (@gval gT H))))) *) exact: im_coset. Qed. Lemma quotientT : setT / H = setT. Proof. (* Goal: @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H)) (@setTfor (@coset_finType gT (@gval gT H)) (Phant (Finite.sort (@coset_finType gT (@gval gT H))))) *) by rewrite -im_quotient; apply: morphimT. Qed. Lemma quotientInorm A : 'N_A(H) / H = A / H. Proof. (* Goal: @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (@normaliser gT (@gval gT H))) (@gval gT H)) (@quotient gT A (@gval gT H)) *) by rewrite /quotient setIC morphimIdom. Qed. Lemma quotient_setIpre A D : (A :&: coset H @*^-1 D) / H = A / H :&: D. Proof. (* Goal: @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) D)) (@gval gT H)) (@setI (@coset_finType gT (@gval gT H)) (@quotient gT A (@gval gT H)) D) *) exact: morphim_setIpre. Qed. Lemma mem_quotient x G : x \in G -> coset H x \in G / H. 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 (@coset_of gT (@gval gT H)) (@coset gT (@gval gT H) x) (@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))))) *) by move=> Gx; rewrite -imset_coset mem_imset. Qed. Lemma quotientS A B : A \subset B -> A / H \subset B / 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)) 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 (@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 A (@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 B (@gval gT H))))) *) exact: morphimS. Qed. Lemma quotient0 : set0 / H = set0. Proof. (* Goal: @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H)) (@set0 (@coset_finType gT (@gval gT H))) *) exact: morphim0. Qed. Lemma quotient_set1 x : x \in 'N(H) -> [set x] / H = [set coset H 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 H))))), @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@gval gT H)) (@set1 (@coset_finType gT (@gval gT H)) (@coset gT (@gval gT H) x)) *) exact: morphim_set1. Qed. Lemma quotient1 : 1 / H = 1. Proof. (* Goal: @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@gval gT H)) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT H)))) *) exact: morphim1. Qed. Lemma quotientV A : A^-1 / H = (A / H)^-1. Proof. (* Goal: @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@invg (group_set_of_baseGroupType (FinGroup.base gT)) A) (@gval gT H)) (@invg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT H))) (@quotient gT A (@gval gT H))) *) exact: morphimV. Qed. Lemma quotientMl A B : A \subset 'N(H) -> A * B / H = (A / H) * (B / 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)) 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))))), @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT H)) (@mulg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT H))) (@quotient gT A (@gval gT H)) (@quotient gT B (@gval gT H))) *) exact: morphimMl. Qed. Lemma quotientMr A B : B \subset 'N(H) -> A * B / H = (A / H) * (B / 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)) 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 (@gval gT H))))), @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT H)) (@mulg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT H))) (@quotient gT A (@gval gT H)) (@quotient gT B (@gval gT H))) *) exact: morphimMr. Qed. Lemma cosetpreM C D : coset H @*^-1 (C * D) = coset H @*^-1 C * coset H @*^-1 D. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@mulg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT H))) C D)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) C) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) D)) *) by rewrite morphpreMl ?sub_im_coset. Qed. Lemma quotientJ A x : x \in 'N(H) -> A :^ x / H = (A / H) :^ coset H 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 H))))), @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@conjugate gT A x) (@gval gT H)) (@conjugate (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (@coset gT (@gval gT H) x)) *) exact: morphimJ. Qed. Lemma quotientU A B : (A :|: B) / H = A / H :|: B / H. Proof. (* Goal: @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@setU (FinGroup.arg_finType (FinGroup.base gT)) A B) (@gval gT H)) (@setU (@coset_finType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (@quotient gT B (@gval gT H))) *) exact: morphimU. Qed. Lemma quotientI A B : (A :&: B) / H \subset A / H :&: B / 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 B) (@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)) (@quotient gT B (@gval gT H)))))) *) exact: morphimI. Qed. Lemma quotientY A B : A \subset 'N(H) -> B \subset 'N(H) -> (A <*> B) / H = (A / H) <*> (B / 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)) 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)))))) (_ : 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)) (@normaliser gT (@gval gT H)))))), @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@joing gT A B) (@gval gT H)) (@joing (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (@quotient gT B (@gval gT H))) *) exact: morphimY. Qed. Lemma quotient_homg A : A \subset 'N(H) -> homg (A / H) 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)) (@normaliser gT (@gval gT H))))), is_true (@homg (@coset_groupType gT (@gval gT H)) gT (@quotient gT A (@gval gT H)) A) *) exact: morphim_homg. Qed. Lemma coset_kerl x y : x \in H -> coset H (x * y) = coset H 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)) (@gval gT H)))), @eq (@coset_of gT (@gval gT H)) (@coset gT (@gval gT H) (@mulg (FinGroup.base gT) x y)) (@coset gT (@gval gT H) y) *) move=> Hx; case Ny: (y \in 'N(H)); first by rewrite mkerl ?ker_coset. (* Goal: @eq (@coset_of gT (@gval gT H)) (@coset gT (@gval gT H) (@mulg (FinGroup.base gT) x y)) (@coset gT (@gval gT H) y) *) by rewrite !coset_default ?groupMl // (subsetP (normG H)). Qed. Lemma coset_kerr x y : y \in H -> coset H (x * y) = coset H 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 H)))), @eq (@coset_of gT (@gval gT H)) (@coset gT (@gval gT H) (@mulg (FinGroup.base gT) x y)) (@coset gT (@gval gT H) x) *) move=> Hy; case Nx: (x \in 'N(H)); first by rewrite mkerr ?ker_coset. (* Goal: @eq (@coset_of gT (@gval gT H)) (@coset gT (@gval gT H) (@mulg (FinGroup.base gT) x y)) (@coset gT (@gval gT H) x) *) by rewrite !coset_default ?groupMr // (subsetP (normG H)). Qed. Lemma rcoset_kercosetP x y : x \in 'N(H) -> y \in 'N(H) -> reflect (coset H x = coset H y) (x \in H :* 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)) (@normaliser gT (@gval gT H)))))) (_ : 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)) (@normaliser gT (@gval gT H)))))), Bool.reflect (@eq (@coset_of gT (@gval gT H)) (@coset gT (@gval gT H) x) (@coset gT (@gval gT H) y)) (@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) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))))) *) by rewrite -{6}ker_coset; apply: rcoset_kerP. Qed. Lemma kercoset_rcoset x y : x \in 'N(H) -> y \in 'N(H) -> coset H x = coset H y -> exists2 z, z \in H & x = z * 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)) (@normaliser gT (@gval gT H)))))) (_ : 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)) (@normaliser gT (@gval gT H)))))) (_ : @eq (@coset_of gT (@gval gT H)) (@coset gT (@gval gT H) x) (@coset gT (@gval gT H) y)), @ex2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun z : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => 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)) (@gval gT H))))) (fun z : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mulg (FinGroup.base gT) z y)) *) by move=> Nx Ny eqfxy; rewrite -ker_coset; apply: ker_rcoset. Qed. Lemma quotientGI G A : H \subset G -> (G :&: A) / H = G / H :&: A / 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)))), @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) A) (@gval gT H)) (@setI (@coset_finType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT A (@gval gT H))) *) by rewrite -{1}ker_coset; apply: morphimGI. Qed. Lemma quotientIG A G : H \subset G -> (A :&: G) / H = A / H :&: 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 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 (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (@gval gT G)) (@gval gT H)) (@setI (@coset_finType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H))) *) by rewrite -{1}ker_coset; apply: morphimIG. Qed. Lemma quotientD A B : A / H :\: B / H \subset (A :\: B) / 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)) (@setD (@coset_finType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (@quotient gT B (@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 (@setD (FinGroup.arg_finType (FinGroup.base gT)) A B) (@gval gT H))))) *) exact: morphimD. Qed. Lemma quotientD1 A : (A / H)^# \subset 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)) (@setD (@coset_finType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (@set1 (FinGroup.finType (@coset_baseGroupType gT (@gval gT H))) (oneg (@coset_baseGroupType 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 (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))) (@gval gT H))))) *) exact: morphimD1. Qed. Lemma quotientDG A G : H \subset G -> (A :\: G) / H = A / H :\: 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 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 (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@gval gT G)) (@gval gT H)) (@setD (@coset_finType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H))) *) by rewrite -{1}ker_coset; apply: morphimDG. Qed. Lemma quotientK A : A \subset 'N(H) -> coset H @*^-1 (A / H) = H * 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)) (@normaliser gT (@gval gT H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@quotient gT A (@gval gT H))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) A) *) by rewrite -{8}ker_coset; apply: morphimK. Qed. Lemma quotientYK G : G \subset 'N(H) -> coset H @*^-1 (G / H) = H <*> 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))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@quotient gT (@gval gT G) (@gval gT H))) (@joing gT (@gval gT H) (@gval gT G)) *) by move=> nHG; rewrite quotientK ?norm_joinEr. Qed. Lemma quotientGK G : H <| G -> coset H @*^-1 (G / H) = G. Proof. (* Goal: forall _ : is_true (@normal gT (@gval gT H) (@gval gT G)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@quotient gT (@gval gT G) (@gval gT H))) (@gval gT G) *) by case/andP; rewrite -{1}ker_coset; apply: morphimGK. Qed. Lemma quotient_class x A : x \in 'N(H) -> A \subset 'N(H) -> x ^: A / H = coset H x ^: (A / H). 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 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)) (@normaliser gT (@gval gT H)))))), @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@class gT x A) (@gval gT H)) (@class (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H) x) (@quotient gT A (@gval gT H))) *) exact: morphim_class. Qed. Lemma classes_quotient A : A \subset 'N(H) -> classes (A / H) = [set xA / H | xA in classes 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)) (@normaliser gT (@gval gT H))))), @eq (@set_of (set_of_finType (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT H))))) (Phant (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT H)))))))) (@classes (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H))) (@Imset.imset (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (set_of_finType (@coset_finType gT (@gval gT H))) (fun xA : Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) => @quotient gT xA (@gval gT H)) (@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 A)))) *) exact: classes_morphim. Qed. Lemma cosetpre_set1 x : x \in 'N(H) -> coset H @*^-1 [set coset H x] = H :* 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 H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@set1 (@coset_finType gT (@gval gT H)) (@coset gT (@gval gT H) x))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) *) by rewrite -{9}ker_coset; apply: morphpre_set1. Qed. Lemma cosetpre_set1_coset xbar : coset H @*^-1 [set xbar] = xbar. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@set1 (@coset_finType gT (@gval gT H)) xbar)) (@set_of_coset gT (@gval gT H) xbar) *) by case: (cosetP xbar) => x Nx ->; rewrite cosetpre_set1 ?val_coset. Qed. Lemma cosetpreK C : coset H @*^-1 C / H = C. Lemma trivg_quotient : H / H = 1. Proof. (* Goal: @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@gval gT H) (@gval gT H)) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT H)))) *) by rewrite -{3}ker_coset /quotient morphim_ker. Qed. Lemma quotientS1 G : G \subset H -> G / H = 1. 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)))), @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@gval gT G) (@gval gT H)) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT H)))) *) by move=> sGH; apply/trivgP; rewrite -trivg_quotient quotientS. Qed. Lemma sub_cosetpre M : H \subset coset H @*^-1 M. 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)) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval (@coset_groupType gT (@gval gT H)) M))))) *) by rewrite -{1}ker_coset; apply: ker_sub_pre. Qed. Lemma quotient_proper G K : H <| G -> H <| K -> (G / H \proper K / H) = (G \proper K). Proof. (* Goal: forall (_ : is_true (@normal gT (@gval gT H) (@gval gT G))) (_ : is_true (@normal gT (@gval gT H) (@gval gT K))), @eq bool (@proper (@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)))) (@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 K) (@gval gT H))))) (@proper (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (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 K)))) *) by move=> nHG nHK; rewrite -cosetpre_proper ?quotientGK. Qed. Lemma normal_cosetpre M : H <| coset H @*^-1 M. Proof. (* Goal: is_true (@normal gT (@gval gT H) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval (@coset_groupType gT (@gval gT H)) M))) *) by rewrite -{1}ker_coset; apply: ker_normal_pre. Qed. Lemma cosetpreSK C D : (coset H @*^-1 C \subset coset H @*^-1 D) = (C \subset D). 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)) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) C))) (@mem (Finite.sort (FinGroup.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 (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) D)))) (@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)) C)) (@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)) D))) *) by rewrite morphpreSK ?sub_im_coset. Qed. Lemma sub_quotient_pre A C : A \subset 'N(H) -> (A / H \subset C) = (A \subset coset H @*^-1 C). 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)) (@normaliser gT (@gval gT H))))), @eq bool (@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 A (@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)) C))) (@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)) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) C)))) *) exact: sub_morphim_pre. Qed. Lemma sub_cosetpre_quo C G : H <| G -> (coset H @*^-1 C \subset G) = (C \subset G / H). Proof. (* Goal: forall _ : is_true (@normal gT (@gval gT H) (@gval gT G)), @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)) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) C))) (@mem (Finite.sort (FinGroup.arg_finType (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 (@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)) C)) (@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))))) *) by move=> nHG; rewrite -cosetpreSK quotientGK. Qed. Lemma quotient_sub1 A : A \subset 'N(H) -> (A / H \subset [1]) = (A \subset 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)) 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))))), @eq bool (@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 A (@gval gT H)))) (@mem (Finite.sort (FinGroup.finType (@coset_baseGroupType gT (@gval gT H)))) (predPredType (Finite.sort (FinGroup.finType (@coset_baseGroupType gT (@gval gT H))))) (@SetDef.pred_of_set (FinGroup.finType (@coset_baseGroupType gT (@gval gT H))) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT H))) : @set_of (FinGroup.finType (@coset_baseGroupType gT (@gval gT H))) (Phant (FinGroup.sort (@coset_baseGroupType gT (@gval gT H)))))))) (@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)))) *) by move=> nHA /=; rewrite -{10}ker_coset ker_trivg_morphim nHA. Qed. Lemma quotientSK A B : A \subset 'N(H) -> (A / H \subset B / H) = (A \subset H * 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)) (@normaliser gT (@gval gT H))))), @eq bool (@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 A (@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 B (@gval gT H))))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) B)))) *) by move=> nHA; rewrite morphimSK ?ker_coset. Qed. Lemma quotientSGK A G : A \subset 'N(H) -> H \subset G -> (A / H \subset G / H) = (A \subset 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)) 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)))))) (_ : 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 bool (@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 A (@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))))) (@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)))) *) by rewrite -{2}ker_coset; apply: morphimSGK. Qed. Lemma quotient_injG : {in [pred G : {group gT} | H <| G] &, injective (fun G => G / H)}. Proof. (* Goal: @prop_in2 (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (simplPredType (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SimplPred (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @normal gT (@gval gT H) (@gval gT G)))) (fun x1 x2 : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => forall _ : @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) ((fun G : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @quotient gT (@gval gT G) (@gval gT H)) x1) ((fun G : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @quotient gT (@gval gT G) (@gval gT H)) x2), @eq (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) x1 x2) (inPhantom (@injective (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @quotient gT (@gval gT G) (@gval gT H)))) *) by rewrite /normal -{1}ker_coset; apply: morphim_injG. Qed. Lemma quotient_inj G1 G2 : H <| G1 -> H <| G2 -> G1 / H = G2 / H -> G1 :=: G2. Proof. (* Goal: forall (_ : is_true (@normal gT (@gval gT H) (@gval gT G1))) (_ : is_true (@normal gT (@gval gT H) (@gval gT G2))) (_ : @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@gval gT G1) (@gval gT H)) (@quotient gT (@gval gT G2) (@gval gT H))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT G1) (@gval gT G2) *) by rewrite /normal -[in mem H]ker_coset; apply: morphim_inj. Qed. Lemma quotient_neq1 A : H <| A -> (A / H != 1) = (H \proper A). Proof. (* Goal: forall _ : is_true (@normal gT (@gval gT H) A), @eq bool (negb (@eq_op (set_of_eqType (@coset_finType gT (@gval gT H))) (@quotient gT A (@gval gT H)) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT H)))))) (@proper (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (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)) A))) *) case/andP=> sHA nHA; rewrite /proper sHA -trivg_quotient eqEsubset andbC. (* Goal: @eq bool (negb (andb (@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 (@gval gT H) (@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 A (@gval gT H))))) (@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 A (@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 H) (@gval gT H))))))) (andb 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)) 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)))))) *) by rewrite quotientS //= quotientSGK. Qed. Lemma quotient_gen A : A \subset 'N(H) -> <<A>> / H = <<A / 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)) 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))))), @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@generated gT A) (@gval gT H)) (@generated (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H))) *) exact: morphim_gen. Qed. Lemma cosetpre_gen C : 1 \in C -> coset H @*^-1 <<C>> = <<coset H @*^-1 C>>. Proof. (* Goal: forall _ : is_true (@in_mem (FinGroup.sort (@coset_baseGroupType gT (@gval gT H))) (oneg (@coset_baseGroupType 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)) C))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@generated (@coset_groupType gT (@gval gT H)) C)) (@generated gT (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) C)) *) by move=> C1; rewrite morphpre_gen ?sub_im_coset. Qed. Lemma quotientR A B : A \subset 'N(H) -> B \subset 'N(H) -> [~: A, B] / H = [~: A / H, B / 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)) 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)))))) (_ : 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)) (@normaliser gT (@gval gT H)))))), @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@commutator gT A B) (@gval gT H)) (@commutator (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (@quotient gT B (@gval gT H))) *) exact: morphimR. Qed. Lemma quotient_norm A : 'N(A) / H \subset '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 (@normaliser gT A) (@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)))) (@normaliser (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H)))))) *) exact: morphim_norm. Qed. Lemma quotient_norms A B : A \subset 'N(B) -> A / H \subset 'N(B / 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)) 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 B)))), 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 A (@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)))) (@normaliser (@coset_groupType gT (@gval gT H)) (@quotient gT B (@gval gT H)))))) *) exact: morphim_norms. Qed. Lemma quotient_subnorm A B : 'N_A(B) / H \subset 'N_(A / H)(B / 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 (@normaliser gT B)) (@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)) (@normaliser (@coset_groupType gT (@gval gT H)) (@quotient gT B (@gval gT H))))))) *) exact: morphim_subnorm. Qed. Lemma quotient_normal A B : A <| B -> A / H <| B / H. Proof. (* Goal: forall _ : is_true (@normal gT A B), is_true (@normal (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (@quotient gT B (@gval gT H))) *) exact: morphim_normal. Qed. Lemma quotient_cent1 x : 'C[x] / H \subset 'C[coset H x]. 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 (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@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)))) (@normaliser (@coset_groupType gT (@gval gT H)) (@set1 (@coset_finType gT (@gval gT H)) (@coset gT (@gval gT H) x)))))) *) case Nx: (x \in 'N(H)); first exact: morphim_cent1. (* 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 (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@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)))) (@normaliser (@coset_groupType gT (@gval gT H)) (@set1 (@coset_finType gT (@gval gT H)) (@coset gT (@gval gT H) x)))))) *) by rewrite coset_default // cent11T subsetT. Qed. Lemma quotient_cent1s A x : A \subset 'C[x] -> A / H \subset 'C[coset H 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)) 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 (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))))), 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 A (@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)))) (@normaliser (@coset_groupType gT (@gval gT H)) (@set1 (@coset_finType gT (@gval gT H)) (@coset gT (@gval gT H) x)))))) *) by move=> sAC; apply: subset_trans (quotientS sAC) (quotient_cent1 x). Qed. Lemma quotient_subcent1 A x : 'C_A[x] / H \subset 'C_(A / H)[coset H x]. 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 (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@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)) (@normaliser (@coset_groupType gT (@gval gT H)) (@set1 (@coset_finType gT (@gval gT H)) (@coset gT (@gval gT H) x))))))) *) exact: subset_trans (quotientI _ _) (setIS _ (quotient_cent1 x)). Qed. Lemma quotient_cent A : 'C(A) / H \subset 'C(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 (@centraliser gT A) (@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)))) (@centraliser (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H)))))) *) exact: morphim_cent. Qed. Lemma quotient_cents A B : A \subset 'C(B) -> A / H \subset 'C(B / 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)) 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)) (@centraliser gT B)))), 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 A (@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)))) (@centraliser (@coset_groupType gT (@gval gT H)) (@quotient gT B (@gval gT H)))))) *) exact: morphim_cents. Qed. Lemma quotient_abelian A : abelian A -> abelian (A / H). Proof. (* Goal: forall _ : is_true (@abelian gT A), is_true (@abelian (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H))) *) exact: morphim_abelian. Qed. Lemma quotient_subcent A B : 'C_A(B) / H \subset 'C_(A / H)(B / 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 (@centraliser gT B)) (@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)) (@centraliser (@coset_groupType gT (@gval gT H)) (@quotient gT B (@gval gT H))))))) *) exact: morphim_subcent. Qed. Lemma norm_quotient_pre A C : A \subset 'N(H) -> A / H \subset 'N(C) -> A \subset 'N(coset H @*^-1 C). 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)) (@normaliser gT (@gval gT H)))))) (_ : 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 A (@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)))) (@normaliser (@coset_groupType gT (@gval gT H)) C))))), 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 (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) C))))) *) by move/sub_quotient_pre=> -> /subset_trans-> //; apply: morphpre_norm. Qed. Lemma cosetpre_normal C D : (coset H @*^-1 C <| coset H @*^-1 D) = (C <| D). Proof. (* Goal: @eq bool (@normal gT (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) C) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) D)) (@normal (@coset_groupType gT (@gval gT H)) C D) *) by rewrite morphpre_normal ?sub_im_coset. Qed. Lemma quotient_normG G : H <| G -> 'N(G) / H = 'N(G / H). Proof. (* Goal: forall _ : is_true (@normal gT (@gval gT H) (@gval gT G)), @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@normaliser gT (@gval gT G)) (@gval gT H)) (@normaliser (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H))) *) case/andP=> sHG nHG. (* Goal: @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@normaliser gT (@gval gT G)) (@gval gT H)) (@normaliser (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H))) *) by rewrite [_ / _]morphim_normG ?ker_coset // im_coset setTI. Qed. Lemma quotient_subnormG A G : H <| G -> 'N_A(G) / H = 'N_(A / H)(G / H). Proof. (* Goal: forall _ : is_true (@normal gT (@gval gT H) (@gval gT G)), @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (@normaliser gT (@gval gT G))) (@gval gT H)) (@setI (@coset_finType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (@normaliser (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)))) *) by case/andP=> sHG nHG; rewrite -morphim_subnormG ?ker_coset. Qed. Lemma cosetpre_cent1 x : 'C_('N(H))[x] \subset coset H @*^-1 'C[coset H 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT H)) (@normaliser gT (@set1 (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 (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@normaliser (@coset_groupType gT (@gval gT H)) (@set1 (@coset_finType gT (@gval gT H)) (@coset gT (@gval gT H) x))))))) *) case Nx: (x \in 'N(H)); first by rewrite morphpre_cent1. (* 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)) (@normaliser gT (@gval gT H)) (@normaliser gT (@set1 (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 (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@normaliser (@coset_groupType gT (@gval gT H)) (@set1 (@coset_finType gT (@gval gT H)) (@coset gT (@gval gT H) x))))))) *) by rewrite coset_default // cent11T morphpreT subsetIl. Qed. Lemma cosetpre_cent1s C x : coset H @*^-1 C \subset 'C[x] -> C \subset 'C[coset H x]. Lemma cosetpre_subcent1 C x : 'C_(coset H @*^-1 C)[x] \subset coset H @*^-1 'C_C[coset H 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) C) (@normaliser gT (@set1 (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 (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@setI (@coset_finType gT (@gval gT H)) C (@normaliser (@coset_groupType gT (@gval gT H)) (@set1 (@coset_finType gT (@gval gT H)) (@coset gT (@gval gT H) x)))))))) *) by rewrite -morphpreIdom -setIA setICA morphpreI setIS // cosetpre_cent1. Qed. Lemma cosetpre_cent A : 'C_('N(H))(A) \subset coset H @*^-1 'C(A / H). 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)) (@normaliser gT (@gval gT H)) (@centraliser 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)) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@centraliser (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H))))))) *) exact: morphpre_cent. Qed. Lemma cosetpre_cents A C : coset H @*^-1 C \subset 'C(A) -> C \subset 'C(A / 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)) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) C))) (@mem (Finite.sort (FinGroup.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 A)))), 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)) C)) (@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)))) (@centraliser (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H)))))) *) by apply: morphpre_cents; rewrite ?sub_im_coset. Qed. Lemma cosetpre_subcent C A : 'C_(coset H @*^-1 C)(A) \subset coset H @*^-1 'C_C(A / H). 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)) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) C) (@centraliser 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)) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@setI (@coset_finType gT (@gval gT H)) C (@centraliser (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H)))))))) *) exact: morphpre_subcent. Qed. Lemma restrm_quotientE G A (nHG : G \subset 'N(H)) : A \subset G -> restrm nHG (coset H) @* A = A / 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)) 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 (@coset_groupType gT (@gval gT H)))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT H))))))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@gval gT G) (@restrm_morphism gT (@coset_groupType gT (@gval gT H)) (@gval gT G) (@normaliser gT (@gval gT H)) nHG (@coset_morphism gT (@gval gT H))) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@restrm gT (@coset_groupType gT (@gval gT H)) (@gval gT G) (@normaliser gT (@gval gT H)) nHG (@coset gT (@gval gT H)))) A) (@quotient gT A (@gval gT H)) *) exact: restrmEsub. Qed. Section InverseImage. Variables (G : {group gT}) (Kbar : {group coset_of H}). Hypothesis nHG : H <| G. Variant inv_quotient_spec (P : pred {group gT}) : Prop := InvQuotientSpec K of Kbar :=: K / H & H \subset K & P K. Lemma inv_quotientS : Kbar \subset G / H -> inv_quotient_spec (fun K => K \subset G). Proof. (* Goal: forall _ : is_true (@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)) Kbar))) (@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))))), inv_quotient_spec (fun K : @group_of gT (Phant (FinGroup.arg_sort (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 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)))) *) case/andP: nHG => sHG nHG' sKbarG. (* Goal: inv_quotient_spec (fun K : @group_of gT (Phant (FinGroup.arg_sort (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 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)))) *) have sKdH: Kbar \subset 'N(H) / H by rewrite (subset_trans sKbarG) ?morphimS. (* Goal: inv_quotient_spec (fun K : @group_of gT (Phant (FinGroup.arg_sort (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 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)))) *) exists (coset H @*^-1 Kbar)%G; first by rewrite cosetpreK. (* 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 (@morphpre_group gT (@coset_groupType gT (@gval gT H)) (@normaliser_group gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) Kbar)))) (@mem (Finite.sort (FinGroup.arg_finType (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: 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 (@morphpre_group gT (@coset_groupType gT (@gval gT H)) (@normaliser_group gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) Kbar))))) *) by rewrite -{1}ker_coset morphpreS ?sub1G. (* 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 (@morphpre_group gT (@coset_groupType gT (@gval gT H)) (@normaliser_group gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) Kbar)))) (@mem (Finite.sort (FinGroup.arg_finType (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 sub_cosetpre_quo. Qed. Lemma inv_quotientN : Kbar <| G / H -> inv_quotient_spec (fun K => K <| G). Proof. (* Goal: forall _ : is_true (@normal (@coset_groupType gT (@gval gT H)) (@gval (@coset_groupType gT (@gval gT H)) Kbar) (@quotient gT (@gval gT G) (@gval gT H))), inv_quotient_spec (fun K : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @normal gT (@gval gT K) (@gval gT G)) *) move=> nKbar; case/inv_quotientS: (normal_sub nKbar) => K defKbar sHK sKG. (* Goal: inv_quotient_spec (fun K : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @normal gT (@gval gT K) (@gval gT G)) *) exists K => //; rewrite defKbar -cosetpre_normal !quotientGK // in nKbar. (* Goal: is_true (@normal gT (@gval gT H) (@gval gT K)) *) exact: normalS nHG. Qed. End InverseImage. Lemma quotientMidr A : A * H / H = A / H. Proof. (* Goal: @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@gval gT H)) (@gval gT H)) (@quotient gT A (@gval gT H)) *) by rewrite [_ /_]morphimMr ?normG //= -!quotientE trivg_quotient mulg1. Qed. Lemma quotientMidl A : H * A / H = A / H. Proof. (* Goal: @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) A) (@gval gT H)) (@quotient gT A (@gval gT H)) *) by rewrite [_ /_]morphimMl ?normG //= -!quotientE trivg_quotient mul1g. Qed. Lemma quotientYidr G : G \subset 'N(H) -> G <*> H / H = 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))))), @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@joing gT (@gval gT G) (@gval gT H)) (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) *) move=> nHG; rewrite -genM_join quotient_gen ?mul_subG ?normG //. (* Goal: @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@generated (@coset_groupType gT (@gval gT H)) (@quotient gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (@gval gT H))) (@quotient gT (@gval gT G) (@gval gT H)) *) by rewrite quotientMidr genGid. Qed. Lemma quotientYidl G : G \subset 'N(H) -> H <*> G / H = 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))))), @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@joing gT (@gval gT H) (@gval gT G)) (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) *) by move=> nHG; rewrite joingC quotientYidr. Qed. Section Injective. Variables (G : {group gT}). Hypotheses (nHG : G \subset 'N(H)) (tiHG : H :&: G = 1). Lemma quotient_isom : isom G (G / H) (restrm nHG (coset H)). Proof. (* Goal: is_true (@isom gT (@coset_groupType gT (@gval gT H)) (@gval gT G) (@quotient gT (@gval gT G) (@gval gT H)) (@restrm gT (@coset_groupType gT (@gval gT H)) (@gval gT G) (@normaliser gT (@gval gT H)) nHG (@coset gT (@gval gT H)))) *) by apply/isomP; rewrite ker_restrm setIC ker_coset tiHG im_restrm. Qed. Lemma quotient_isog : isog G (G / H). Proof. (* Goal: is_true (@isog gT (@coset_groupType gT (@gval gT H)) (@gval gT G) (@quotient gT (@gval gT G) (@gval gT H))) *) exact: isom_isog quotient_isom. Qed. End Injective. End CosetOfGroupTheory. Notation "A / H" := (quotient_group A H) : Group_scope. Section Quotient1. Variables (gT : finGroupType) (A : {set gT}). Lemma coset1_injm : 'injm (@coset gT 1). 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 (@coset_groupType gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@normaliser gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@coset_morphism gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@MorPhantom gT (@coset_groupType gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@coset gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))))) (@mem (Finite.sort (FinGroup.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_coset /=. Qed. Lemma quotient1_isom : isom A (A / 1) (coset 1). Proof. (* Goal: is_true (@isom gT (@coset_groupType gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) A (@quotient gT A (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@coset gT (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) *) by apply: sub_isom coset1_injm; rewrite ?norms1. Qed. Lemma quotient1_isog : isog A (A / 1). Proof. (* Goal: is_true (@isog gT (@coset_groupType gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) A (@quotient gT A (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) *) by apply: isom_isog quotient1_isom; apply: norms1. Qed. End Quotient1. Section QuotientMorphism. Variable (gT rT : finGroupType) (G H : {group gT}) (f : {morphism G >-> rT}). Implicit Types A : {set gT}. Implicit Types B : {set (coset_of H)}. Hypotheses (nsHG : H <| G). Let sHG : H \subset G := normal_sub nsHG. Let nHG : G \subset 'N(H) := normal_norm nsHG. Let nfHfG : f @* G \subset 'N(f @* H) := morphim_norms f nHG. Notation fH := (coset (f @* H) \o f). Lemma quotm_dom_proof : G \subset 'dom fH. 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)) (@dom gT (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@morphpre gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval rT (@normaliser_group rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))))) (@comp_morphism gT rT (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) G (@normaliser_group rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) f (@coset_morphism rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H)))) (@MorPhantom gT (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@funcomp (@coset_of rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (FinGroup.arg_sort (FinGroup.base gT)) tt (@coset rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@mfun gT rT (@gval gT G) f))))))) *) by rewrite -sub_morphim_pre. Qed. Notation fH_G := (restrm quotm_dom_proof fH). Lemma quotm_ker_proof : 'ker (coset H) \subset 'ker fH_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 (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset 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)) (@ker gT (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@gval gT G) (@restrm_morphism gT (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@gval gT G) (@dom gT (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@morphpre gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval rT (@normaliser_group rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))))) (@comp_morphism gT rT (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) G (@normaliser_group rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) f (@coset_morphism rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H)))) (@MorPhantom gT (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@funcomp (@coset_of rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (FinGroup.arg_sort (FinGroup.base gT)) tt (@coset rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@mfun gT rT (@gval gT G) f)))) quotm_dom_proof (@comp_morphism gT rT (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) G (@normaliser_group rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) f (@coset_morphism rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))))) (@MorPhantom gT (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@restrm gT (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@gval gT G) (@dom gT (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@morphpre gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval rT (@normaliser_group rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))))) (@comp_morphism gT rT (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) G (@normaliser_group rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) f (@coset_morphism rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H)))) (@MorPhantom gT (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@funcomp (@coset_of rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (FinGroup.arg_sort (FinGroup.base gT)) tt (@coset rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@mfun gT rT (@gval gT G) f)))) quotm_dom_proof (@funcomp (@coset_of rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (FinGroup.arg_sort (FinGroup.base gT)) tt (@coset rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@mfun gT rT (@gval gT G) f)))))))) *) by rewrite ker_restrm ker_comp !ker_coset morphpreIdom morphimK ?mulG_subr. Qed. Definition quotm := factm quotm_ker_proof nHG. Canonical quotm_morphism := [morphism G / H of quotm]. Lemma quotmE x : x \in G -> quotm (coset H x) = coset (f @* H) (f 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.sort (FinGroup.base (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))))) (quotm (@coset gT (@gval gT H) x)) (@coset rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H)) (@mfun gT rT (@gval gT G) f x)) *) exact: factmE. Qed. Lemma morphim_quotm A : quotm @* (A / H) = f @* A / f @* H. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H)))))))) (@morphim (@coset_groupType gT (@gval gT H)) (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@quotient gT (@gval gT G) (@gval gT H)) quotm_morphism (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) quotm) (@quotient gT A (@gval gT H))) (@quotient rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) A) (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) *) by rewrite morphim_factm morphim_restrm morphim_comp morphimIdom. Qed. Lemma morphpre_quotm Abar : quotm @*^-1 (Abar / f @* H) = f @*^-1 Abar / H. Proof. (* 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))))))) (@morphpre (@coset_groupType gT (@gval gT H)) (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@quotient gT (@gval gT G) (@gval gT H)) quotm_morphism (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) quotm) (@quotient rT Abar (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H)))) (@quotient gT (@morphpre gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) Abar) (@gval gT H)) *) rewrite morphpre_factm morphpre_restrm morphpre_comp /=. (* Goal: @eq (@set_of (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (Phant (@coset_of gT (@gval gT H)))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@morphpre gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@morphpre rT (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@normaliser rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@coset_morphism rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@MorPhantom rT (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@coset rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H)))) (@quotient rT Abar (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))))))) (@quotient gT (@morphpre gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) Abar) (@gval gT H)) *) rewrite morphpreIdom -[Abar / _]quotientInorm quotientK ?subsetIr //=. (* Goal: @eq (@set_of (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (Phant (@coset_of gT (@gval gT H)))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@morphpre gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H)) (@setI (FinGroup.arg_finType (FinGroup.base rT)) Abar (@normaliser rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))))))) (@quotient gT (@morphpre gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) Abar) (@gval gT H)) *) rewrite morphpreMl ?morphimS // morphimK // [_ * H]normC ?subIset ?nHG //. (* Goal: @eq (@set_of (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (Phant (@coset_of gT (@gval gT H)))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@ker gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)))) (@morphpre gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@setI (FinGroup.arg_finType (FinGroup.base rT)) Abar (@normaliser rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))))))) (@quotient gT (@morphpre gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) Abar) (@gval gT H)) *) rewrite -quotientE -mulgA quotientMidl /= setIC -morphpreIim setIA. (* Goal: @eq (@set_of (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@ker gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f))) (@morphpre gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@setI (FinGroup.finType (FinGroup.base rT)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT G)) (@normaliser rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H)))) Abar))) (@gval gT H)) (@quotient gT (@morphpre gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) Abar) (@gval gT H)) *) by rewrite (setIidPl nfHfG) morphpreIim -morphpreMl ?sub1G ?mul1g. Qed. Lemma ker_quotm : 'ker quotm = 'ker f / H. Proof. (* 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))))))) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@quotient gT (@gval gT G) (@gval gT H)) quotm_morphism (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) quotm)) (@quotient gT (@ker gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f))) (@gval gT H)) *) by rewrite -morphpre_quotm /quotient morphim1. Qed. Lemma injm_quotm : 'injm f -> 'injm quotm. 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) f (@MorPhantom gT rT (@mfun gT rT (@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 (@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)))) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) (@quotient gT (@gval gT G) (@gval gT H)) quotm_morphism (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H))) quotm)))) (@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)))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType gT (@gval gT H)))))))) *) by move/trivgP=> /= kf1; rewrite ker_quotm kf1 quotientE morphim1. Qed. Lemma qisom_ker_proof : 'ker (coset G) \subset 'ker (coset H). 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 (@coset_groupType gT (@gval gT G)) (@normaliser gT (@gval gT G)) (@coset_morphism gT (@gval gT G)) (@MorPhantom gT (@coset_groupType gT (@gval gT G)) (@coset 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)) (@ker gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))))))) *) by rewrite eqGH. Qed. Lemma qisom_restr_proof : setT \subset 'N(H) / G. Proof. (* Goal: is_true (@subset (@coset_finType gT (@gval gT G)) (@mem (Finite.sort (@coset_finType gT (@gval gT G))) (predPredType (Finite.sort (@coset_finType gT (@gval gT G)))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT G)) (@setTfor (@coset_finType gT (@gval gT G)) (Phant (Finite.sort (@coset_finType gT (@gval gT G))))))) (@mem (Finite.sort (@coset_finType gT (@gval gT G))) (predPredType (Finite.sort (@coset_finType gT (@gval gT G)))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT G)) (@quotient gT (@normaliser gT (@gval gT H)) (@gval gT G))))) *) by rewrite eqGH im_quotient. Qed. Definition qisom := restrm qisom_restr_proof (factm qisom_ker_proof im_qisom_proof). Canonical qisom_morphism := Eval hnf in [morphism of qisom]. Lemma qisomE x : qisom (coset G x) = coset H x. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base (@coset_groupType gT (@gval gT H)))) (qisom (@coset gT (@gval gT G) x)) (@coset gT (@gval gT H) x) *) case Nx: (x \in 'N(H)); first exact: factmE. (* Goal: @eq (FinGroup.sort (FinGroup.base (@coset_groupType gT (@gval gT H)))) (qisom (@coset gT (@gval gT G) x)) (@coset gT (@gval gT H) x) *) by rewrite !coset_default ?eqGH ?morph1. Qed. Lemma val_qisom Gx : val (qisom Gx) = val Gx. Proof. (* Goal: @eq (GroupSet.sort (FinGroup.base gT)) (@val (GroupSet.sort (FinGroup.base gT)) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT H))) (@coset_subType gT (@gval gT H)) (qisom Gx)) (@val (GroupSet.sort (FinGroup.base gT)) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@gval gT G))) (@coset_subType gT (@gval gT G)) Gx) *) by case: (cosetP Gx) => x Nx ->{Gx}; rewrite qisomE /= !val_coset -?eqGH. Qed. Lemma morphim_qisom A : qisom @* (A / G) = A / H. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT H)))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT H))))))) (@morphim (@coset_groupType gT (@gval gT G)) (@coset_groupType gT (@gval gT H)) (@setTfor (@coset_finType gT (@gval gT G)) (Phant (Finite.sort (@coset_finType gT (@gval gT G))))) qisom_morphism (@MorPhantom (@coset_groupType gT (@gval gT G)) (@coset_groupType gT (@gval gT H)) qisom) (@quotient gT A (@gval gT G))) (@quotient gT A (@gval gT H)) *) by rewrite morphim_restrm setTI morphim_factm. Qed. Lemma morphpre_qisom A : qisom @*^-1 (A / H) = A / G. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G))))))) (@morphpre (@coset_groupType gT (@gval gT G)) (@coset_groupType gT (@gval gT H)) (@setTfor (@coset_finType gT (@gval gT G)) (Phant (Finite.sort (@coset_finType gT (@gval gT G))))) qisom_morphism (@MorPhantom (@coset_groupType gT (@gval gT G)) (@coset_groupType gT (@gval gT H)) qisom) (@quotient gT A (@gval gT H))) (@quotient gT A (@gval gT G)) *) rewrite morphpre_restrm setTI morphpre_factm eqGH. (* 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))))))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@gval gT (@normaliser_group gT (@gval gT H))) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@mfun gT (@coset_groupType gT (@gval gT H)) (@gval gT (@normaliser_group gT (@gval gT H))) (@coset_morphism gT (@gval gT H)))) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@gval gT (@normaliser_group gT (@gval gT H))) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@mfun gT (@coset_groupType gT (@gval gT H)) (@gval gT (@normaliser_group gT (@gval gT H))) (@coset_morphism gT (@gval gT H)))) (@quotient gT A (@gval gT H)))) (@quotient gT A (@gval gT H)) *) by rewrite morphpreK // im_coset subsetT. Qed. Lemma injm_qisom : 'injm qisom. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G)))) (@ker (@coset_groupType gT (@gval gT G)) (@coset_groupType gT (@gval gT H)) (@setTfor (@coset_finType gT (@gval gT G)) (Phant (Finite.sort (@coset_finType gT (@gval gT G))))) qisom_morphism (@MorPhantom (@coset_groupType gT (@gval gT G)) (@coset_groupType gT (@gval gT H)) qisom)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G)))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType gT (@gval gT G)))))))) *) by rewrite -quotient1 -morphpre_qisom morphpreS ?sub1G. Qed. Lemma im_qisom : qisom @* setT = setT. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT H)))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT H))))))) (@morphim (@coset_groupType gT (@gval gT G)) (@coset_groupType gT (@gval gT H)) (@setTfor (@coset_finType gT (@gval gT G)) (Phant (Finite.sort (@coset_finType gT (@gval gT G))))) qisom_morphism (@MorPhantom (@coset_groupType gT (@gval gT G)) (@coset_groupType gT (@gval gT H)) qisom) (@setTfor (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G)))))))) (@setTfor (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT H)))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT H))))))) *) by rewrite -{2}im_quotient morphim_qisom eqGH im_quotient. Qed. Lemma qisom_isom : isom setT setT qisom. Proof. (* Goal: is_true (@isom (@coset_groupType gT (@gval gT G)) (@coset_groupType gT (@gval gT H)) (@setTfor (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G))))))) (@setTfor (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))))))) qisom) *) by apply/isomP; rewrite injm_qisom im_qisom. Qed. Lemma qisom_isog : [set: coset_of G] \isog [set: coset_of H]. Proof. (* Goal: is_true (@isog (@coset_groupType gT (@gval gT G)) (@coset_groupType gT (@gval gT H)) (@setTfor (@coset_finType gT (@gval gT G)) (Phant (@coset_of gT (@gval gT G)))) (@setTfor (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H))))) *) exact: isom_isog qisom_isom. Qed. Lemma qisom_inj : injective qisom. Proof. (* Goal: @injective (FinGroup.sort (FinGroup.base (@coset_groupType gT (@gval gT H)))) (FinGroup.arg_sort (FinGroup.base (@coset_groupType gT (@gval gT G)))) qisom *) by move=> x y; apply: (injmP injm_qisom); rewrite inE. Qed. Lemma morphim_qisom_inj : injective (fun Gx => qisom @* Gx). Proof. (* Goal: @injective (@set_of (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT H)))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT H))))))) (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G))))))) (fun Gx : @set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT G)))))) => @morphim (@coset_groupType gT (@gval gT G)) (@coset_groupType gT (@gval gT H)) (@setTfor (@coset_finType gT (@gval gT G)) (Phant (Finite.sort (@coset_finType gT (@gval gT G))))) qisom_morphism (@MorPhantom (@coset_groupType gT (@gval gT G)) (@coset_groupType gT (@gval gT H)) qisom) Gx) *) by move=> Gx Gy; apply: injm_morphim_inj; rewrite (injm_qisom, subsetT). Qed. End EqIso. Arguments qisom_inj {gT G H} eqGH [x1 x2]. Arguments morphim_qisom_inj {gT G H} eqGH [x1 x2]. Section FirstIsomorphism. Variables aT rT : finGroupType. Lemma first_isom (G : {group aT}) (f : {morphism G >-> rT}) : {g : {morphism G / 'ker f >-> rT} | 'injm g & forall A : {set aT}, g @* (A / 'ker f) = f @* A}. Proof. (* Goal: @sig2 (@morphism_for (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun g : @morphism_for (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType 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 (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))))) (@ker (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) g (@MorPhantom (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@mfun (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) g))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))))))))) (fun g : @morphism_for (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => forall 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 (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) g (@MorPhantom (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@mfun (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) g)) (@quotient aT A (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) A)) *) have nkG := ker_norm f. (* Goal: @sig2 (@morphism_for (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun g : @morphism_for (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType 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 (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))))) (@ker (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) g (@MorPhantom (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@mfun (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) g))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))))))))) (fun g : @morphism_for (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => forall 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 (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) g (@MorPhantom (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@mfun (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) g)) (@quotient aT A (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) A)) *) have skk: 'ker (coset ('ker f)) \subset 'ker f by rewrite ker_coset. (* Goal: @sig2 (@morphism_for (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun g : @morphism_for (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType 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 (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))))) (@ker (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) g (@MorPhantom (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@mfun (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) g))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))))))))) (fun g : @morphism_for (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => forall 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 (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) g (@MorPhantom (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@mfun (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) g)) (@quotient aT A (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) A)) *) exists (factm_morphism skk nkG) => /=; last exact: morphim_factm. (* Goal: is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@mem (@coset_of aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) (predPredType (@coset_of aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@ker (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) (@factm_morphism aT (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT G (@normaliser_group aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) f (@coset_morphism aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) skk nkG) (@MorPhantom (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@factm aT (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT G (@normaliser_group aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) f (@coset_morphism aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) skk nkG))))) (@mem (@coset_of aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) (predPredType (@coset_of aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (oneg (group_set_baseGroupType (@coset_baseGroupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))))))) *) by rewrite ker_factm -quotientE trivg_quotient. Qed. Variables (G H : {group aT}) (f : {morphism G >-> rT}). Hypothesis sHG : H \subset G. Lemma first_isog : (G / 'ker f) \isog (f @* G). Proof. (* Goal: is_true (@isog (@coset_groupType aT (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) rT (@quotient aT (@gval aT G) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G))) *) by case: (first_isom f) => g injg im_g; apply/isogP; exists g; rewrite ?im_g. Qed. Lemma first_isom_loc : {g : {morphism H / 'ker_H f >-> rT} | 'injm g & forall A : {set aT}, A \subset H -> g @* (A / 'ker_H f) = f @* A}. Proof. (* Goal: @sig2 (@morphism_for (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun g : @morphism_for (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType 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 (@coset_groupType 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)))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType 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))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType 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))))))) (@ker (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) g (@MorPhantom (@coset_groupType 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))))) rT (@mfun (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) g))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType 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)))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType 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))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType 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))))))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType 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)))))))))))) (fun g : @morphism_for (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => forall (A : @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)) 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 H))))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) g (@MorPhantom (@coset_groupType 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))))) rT (@mfun (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) g)) (@quotient aT A (@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)))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) A)) *) case: (first_isom (restrm_morphism sHG f)). (* Goal: forall (x : @morphism_for (@coset_groupType aT (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))) rT (@quotient aT (@gval aT H) (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f)))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))))) (@ker (@coset_groupType aT (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))) rT (@quotient aT (@gval aT H) (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))) x (@MorPhantom (@coset_groupType aT (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))) rT (@mfun (@coset_groupType aT (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))) rT (@quotient aT (@gval aT H) (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))) x))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f)))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType aT (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f)))))))))))) (_ : forall 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 (@coset_groupType aT (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))) rT (@quotient aT (@gval aT H) (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))) x (@MorPhantom (@coset_groupType aT (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))) rT (@mfun (@coset_groupType aT (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))) rT (@quotient aT (@gval aT H) (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))))) x)) (@quotient aT A (@ker aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f)))))) (@morphim aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f) (@MorPhantom aT rT (@mfun aT rT (@gval aT H) (@restrm_morphism aT rT (@gval aT H) (@gval aT G) sHG f))) A)), @sig2 (@morphism_for (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun g : @morphism_for (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType 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 (@coset_groupType 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)))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType 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))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType 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))))))) (@ker (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) g (@MorPhantom (@coset_groupType 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))))) rT (@mfun (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) g))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType 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)))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType 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))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType 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))))))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType 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)))))))))))) (fun g : @morphism_for (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => forall (A : @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)) 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 H))))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) g (@MorPhantom (@coset_groupType 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))))) rT (@mfun (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) g)) (@quotient aT A (@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)))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) A)) *) rewrite ker_restrm => g injg im_g; exists g => // A sAH. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) g (@MorPhantom (@coset_groupType 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))))) rT (@mfun (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) g)) (@quotient aT A (@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)))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) A) *) by rewrite im_g morphim_restrm (setIidPr sAH). Qed. Lemma first_isog_loc : (H / 'ker_H f) \isog (f @* H). Proof. (* Goal: is_true (@isog (@coset_groupType 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))))) rT (@quotient aT (@gval aT H) (@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))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT H))) *) by case: first_isom_loc => g injg im_g; apply/isogP; exists g; rewrite ?im_g. Qed. End FirstIsomorphism. Section SecondIsomorphism. Variables (gT : finGroupType) (H K : {group gT}). Hypothesis nKH : H \subset 'N(K). Lemma second_isom : {f : {morphism H / (K :&: H) >-> coset_of K} | 'injm f & forall A : {set gT}, A \subset H -> f @* (A / (K :&: H)) = A / K}. Proof. (* Goal: @sig2 (@morphism_for (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K)))) (fun f : @morphism_for (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K))) => is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))))) (@ker (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) f (@MorPhantom (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H)))))))))) (fun f : @morphism_for (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K))) => forall (A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (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)) 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))))), @eq (@set_of (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT K)))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT K))))))) (@morphim (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) f (@MorPhantom (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) f)) (@quotient gT A (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H)))) (@quotient gT A (@gval gT K))) *) have ->: K :&: H = 'ker_H (coset K) by rewrite ker_coset setIC. (* Goal: @sig2 (@morphism_for (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))) (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))) (Phant (@coset_of gT (@gval gT K)))) (fun f : @morphism_for (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))) (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))) (Phant (@coset_of gT (@gval gT K))) => is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K))))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))))) (@ker (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))) (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))) f (@MorPhantom (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))) (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K))))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K))))))))))))) (fun f : @morphism_for (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))) (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))) (Phant (@coset_of gT (@gval gT K))) => forall (A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (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)) 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))))), @eq (@set_of (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT K)))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT K))))))) (@morphim (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))) (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))) f (@MorPhantom (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))) (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K)))))) f)) (@quotient gT A (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@ker gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@coset gT (@gval gT K))))))) (@quotient gT A (@gval gT K))) *) exact: first_isom_loc. Qed. Lemma second_isog : H / (K :&: H) \isog H / K. Proof. (* Goal: is_true (@isog (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (@quotient gT (@gval gT H) (@gval gT K))) *) by rewrite setIC -{1 3}(ker_coset K); apply: first_isog_loc. Qed. Lemma weak_second_isog : H / (K :&: H) \isog H * K / K. Proof. (* Goal: is_true (@isog (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (@quotient gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)) (@gval gT K))) *) by rewrite quotientMidr; apply: second_isog. Qed. End SecondIsomorphism. Section ThirdIsomorphism. Variables (gT : finGroupType) (G H K : {group gT}). Lemma homg_quotientS (A : {set gT}) : A \subset 'N(H) -> A \subset 'N(K) -> H \subset K -> A / K \homg A / 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)) 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)))))) (_ : 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)))))) (_ : 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))))), is_true (@homg (@coset_groupType gT (@gval gT K)) (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT K)) (@quotient gT A (@gval gT H))) *) rewrite -!(gen_subG A) /=; set L := <<A>> => nHL nKL sKH. (* Goal: is_true (@homg (@coset_groupType gT (@gval gT K)) (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT K)) (@quotient gT A (@gval gT H))) *) have sub_ker: 'ker (restrm nHL (coset H)) \subset 'ker (restrm nKL (coset K)). (* Goal: is_true (@homg (@coset_groupType gT (@gval gT K)) (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT K)) (@quotient gT A (@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 (@coset_groupType gT (@gval gT H)) L (@restrm_morphism gT (@coset_groupType gT (@gval gT H)) L (@normaliser gT (@gval gT H)) nHL (@coset_morphism gT (@gval gT H))) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@restrm gT (@coset_groupType gT (@gval gT H)) L (@normaliser gT (@gval gT H)) nHL (@coset 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)) (@ker gT (@coset_groupType gT (@gval gT K)) L (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) L (@normaliser gT (@gval gT K)) nKL (@coset_morphism gT (@gval gT K))) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@restrm gT (@coset_groupType gT (@gval gT K)) L (@normaliser gT (@gval gT K)) nKL (@coset gT (@gval gT K)))))))) *) by rewrite !ker_restrm !ker_coset setIS. (* Goal: is_true (@homg (@coset_groupType gT (@gval gT K)) (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT K)) (@quotient gT A (@gval gT H))) *) have sAL: A \subset L := subset_gen A; rewrite -(setIidPr sAL). (* Goal: is_true (@homg (@coset_groupType gT (@gval gT K)) (@coset_groupType gT (@gval gT H)) (@quotient gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) L A) (@gval gT K)) (@quotient gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) L A) (@gval gT H))) *) rewrite -[_ / H](morphim_restrm nHL) -[_ / K](morphim_restrm nKL) /=. (* Goal: is_true (@homg (@coset_groupType gT (@gval gT K)) (@coset_groupType gT (@gval gT H)) (@morphim gT (@coset_groupType gT (@gval gT K)) L (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) L (@normaliser gT (@gval gT K)) nKL (@coset_morphism gT (@gval gT K))) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@restrm gT (@coset_groupType gT (@gval gT K)) L (@normaliser gT (@gval gT K)) nKL (@coset gT (@gval gT K)))) A) (@morphim gT (@coset_groupType gT (@gval gT H)) L (@restrm_morphism gT (@coset_groupType gT (@gval gT H)) L (@normaliser gT (@gval gT H)) nHL (@coset_morphism gT (@gval gT H))) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@restrm gT (@coset_groupType gT (@gval gT H)) L (@normaliser gT (@gval gT H)) nHL (@coset gT (@gval gT H)))) A)) *) by rewrite -(morphim_factm sub_ker (subxx L)) morphim_homg ?morphimS. Qed. Hypothesis sHK : H \subset K. Hypothesis snHG : H <| G. Hypothesis snKG : K <| G. Theorem third_isom : {f : {morphism (G / H) / (K / H) >-> coset_of K} | 'injm f & forall A : {set gT}, A \subset G -> f @* (A / H / (K / H)) = A / K}. Proof. (* Goal: @sig2 (@morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K)))) (fun f : @morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K))) => is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))) (@ker (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f (@MorPhantom (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))))))))) (fun f : @morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K))) => forall (A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (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)) 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 (@coset_groupType gT (@gval gT K)))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT K))))))) (@morphim (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f (@MorPhantom (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@quotient gT A (@gval gT K))) *) have [[sKG nKG] [sHG nHG]] := (andP snKG, andP snHG). (* Goal: @sig2 (@morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K)))) (fun f : @morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K))) => is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))) (@ker (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f (@MorPhantom (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))))))))) (fun f : @morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K))) => forall (A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (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)) 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 (@coset_groupType gT (@gval gT K)))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT K))))))) (@morphim (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f (@MorPhantom (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@quotient gT A (@gval gT K))) *) have sHker: 'ker (coset H) \subset 'ker (restrm nKG (coset K)). (* Goal: @sig2 (@morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K)))) (fun f : @morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K))) => is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))) (@ker (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f (@MorPhantom (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))))))))) (fun f : @morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K))) => forall (A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (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)) 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 (@coset_groupType gT (@gval gT K)))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT K))))))) (@morphim (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f (@MorPhantom (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@quotient gT A (@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)) (@ker gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset 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)) (@ker gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@MorPhantom gT (@coset_groupType gT (@gval gT K)) (@restrm gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset gT (@gval gT K)))))))) *) by rewrite ker_restrm !ker_coset subsetI sHG. (* Goal: @sig2 (@morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K)))) (fun f : @morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K))) => is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))) (@ker (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f (@MorPhantom (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))))))))) (fun f : @morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K))) => forall (A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (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)) 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 (@coset_groupType gT (@gval gT K)))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@gval gT K))))))) (@morphim (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f (@MorPhantom (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@quotient gT A (@gval gT K))) *) have:= first_isom_loc (factm_morphism sHker nHG) (subxx _) => /=. (* Goal: forall _ : @sig2 (@morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) (Phant (@coset_of gT (@gval gT K)))) (fun g : @morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) (Phant (@coset_of gT (@gval gT K))) => is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG)))))) (@mem (@coset_of (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) (predPredType (@coset_of (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG)))))) (@ker (@coset_groupType (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) g (@MorPhantom (@coset_groupType (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) g))))) (@mem (@coset_of (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) (predPredType (@coset_of (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG)))))) (oneg (group_set_baseGroupType (@coset_baseGroupType (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))))))))) (fun g : @morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) (Phant (@coset_of gT (@gval gT K))) => forall (A : @set_of (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (Phant (@coset_of gT (@gval gT H)))) (_ : is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@mem (@coset_of gT (@gval gT H)) (predPredType (@coset_of gT (@gval gT H))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) A)) (@mem (@coset_of gT (@gval gT H)) (predPredType (@coset_of gT (@gval gT H))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)))))), @eq (@set_of (FinGroup.finType (@coset_baseGroupType gT (@gval gT K))) (Phant (@coset_of gT (@gval gT K)))) (@morphim (@coset_groupType (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) g (@MorPhantom (@coset_groupType (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType (@coset_groupType gT (@gval gT H)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG))))) g)) (@quotient (@coset_groupType gT (@gval gT H)) A (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@ker (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG)))))) (@morphim (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG)) A)), @sig2 (@morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K)))) (fun f : @morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K))) => is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@mem (@coset_of (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (predPredType (@coset_of (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@ker (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f (@MorPhantom (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f))))) (@mem (@coset_of (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (predPredType (@coset_of (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (oneg (group_set_baseGroupType (@coset_baseGroupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))))))) (fun f : @morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K))) => forall (A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : 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)) (@gval gT G))))), @eq (@set_of (FinGroup.finType (@coset_baseGroupType gT (@gval gT K))) (Phant (@coset_of gT (@gval gT K)))) (@morphim (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f (@MorPhantom (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@quotient gT A (@gval gT K))) *) rewrite ker_factm_loc ker_restrm ker_coset !(setIidPr sKG) /= -!quotientE. (* Goal: forall _ : @sig2 (@morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K)))) (fun g : @morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K))) => is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@mem (@coset_of (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (predPredType (@coset_of (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@ker (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@quotient gT (@gval gT K) (@gval gT H))) g (@MorPhantom (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@quotient gT (@gval gT K) (@gval gT H))) g))))) (@mem (@coset_of (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (predPredType (@coset_of (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (oneg (group_set_baseGroupType (@coset_baseGroupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))))))) (fun g : @morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K))) => forall (A : @set_of (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (Phant (@coset_of gT (@gval gT H)))) (_ : is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@mem (@coset_of gT (@gval gT H)) (predPredType (@coset_of gT (@gval gT H))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) A)) (@mem (@coset_of gT (@gval gT H)) (predPredType (@coset_of gT (@gval gT H))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT H))) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)))))), @eq (@set_of (FinGroup.finType (@coset_baseGroupType gT (@gval gT K))) (Phant (@coset_of gT (@gval gT K)))) (@morphim (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@quotient gT (@gval gT K) (@gval gT H))) g (@MorPhantom (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@quotient gT (@gval gT K) (@gval gT H))) g)) (@quotient (@coset_groupType gT (@gval gT H)) A (@quotient gT (@gval gT K) (@gval gT H)))) (@morphim (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG)) A)), @sig2 (@morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K)))) (fun f : @morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K))) => is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@mem (@coset_of (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (predPredType (@coset_of (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@ker (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f (@MorPhantom (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f))))) (@mem (@coset_of (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (predPredType (@coset_of (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (oneg (group_set_baseGroupType (@coset_baseGroupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))))))))) (fun f : @morphism_for (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (Phant (@coset_of gT (@gval gT K))) => forall (A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : 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)) (@gval gT G))))), @eq (@set_of (FinGroup.finType (@coset_baseGroupType gT (@gval gT K))) (Phant (@coset_of gT (@gval gT K)))) (@morphim (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f (@MorPhantom (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@mfun (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) f)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H)))) (@quotient gT A (@gval gT K))) *) case=> f injf im_f; exists f => // A sAG; rewrite im_f ?morphimS //. (* Goal: @eq (@set_of (FinGroup.finType (@coset_baseGroupType gT (@gval gT K))) (Phant (@coset_of gT (@gval gT K)))) (@morphim (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@morphim gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval gT G)) (@factm_morphism gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG) (@MorPhantom (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) (@factm gT (@coset_groupType gT (@gval gT H)) (@coset_groupType gT (@gval gT K)) G (@normaliser_group gT (@gval gT H)) (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT G) (@normaliser gT (@gval gT K)) nKG (@coset_morphism gT (@gval gT K))) (@coset_morphism gT (@gval gT H)) sHker nHG)) (@quotient gT A (@gval gT H))) (@quotient gT A (@gval gT K)) *) by rewrite morphim_factm morphim_restrm (setIidPr sAG). Qed. Theorem third_isog : (G / H / (K / H)) \isog (G / K). Proof. (* Goal: is_true (@isog (@coset_groupType (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@coset_groupType gT (@gval gT K)) (@quotient (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@quotient gT (@gval gT G) (@gval gT K))) *) by case: third_isom => f inj_f im_f; apply/isogP; exists f; rewrite ?im_f. Qed. End ThirdIsomorphism. Lemma char_from_quotient (gT : finGroupType) (G H K : {group gT}) : H <| K -> H \char G -> K / H \char G / H -> K \char G. Section CardMorphism. Variables (aT rT : finGroupType) (D : {group aT}) (f : {morphism D >-> rT}). Implicit Types G H : {group aT}. Implicit Types L M : {group rT}. Lemma card_morphim G : #|f @* G| = #|D :&: G : 'ker f|. Proof. (* Goal: @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)) (@gval aT G))))) (@indexg aT (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@gval aT G)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))) *) rewrite -morphimIdom -indexgI -card_quotient; last first. (* Goal: @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)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@gval aT G)))))) (@card (@coset_finType aT (@gval aT (@setI_group aT (@setI_group aT D G) (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))) (@mem (Finite.sort (@coset_finType aT (@gval aT (@setI_group aT (@setI_group aT D G) (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))))) (predPredType (Finite.sort (@coset_finType aT (@gval aT (@setI_group aT (@setI_group aT D G) (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))))) (@SetDef.pred_of_set (@coset_finType aT (@gval aT (@setI_group aT (@setI_group aT D G) (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))) (@quotient aT (@gval aT (@setI_group aT D G)) (@gval aT (@setI_group aT (@setI_group aT D G) (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))))))) *) (* 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 (@setI_group aT D 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 (@setI_group aT (@setI_group aT D G) (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))))))) *) by rewrite normsI ?normG ?subIset ?ker_norm. (* Goal: @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)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@gval aT G)))))) (@card (@coset_finType aT (@gval aT (@setI_group aT (@setI_group aT D G) (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))) (@mem (Finite.sort (@coset_finType aT (@gval aT (@setI_group aT (@setI_group aT D G) (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))))) (predPredType (Finite.sort (@coset_finType aT (@gval aT (@setI_group aT (@setI_group aT D G) (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))))) (@SetDef.pred_of_set (@coset_finType aT (@gval aT (@setI_group aT (@setI_group aT D G) (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))) (@quotient aT (@gval aT (@setI_group aT D G)) (@gval aT (@setI_group aT (@setI_group aT D G) (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))))))) *) by apply: esym (card_isog _); rewrite first_isog_loc ?subsetIl. Qed. Lemma dvdn_morphim G : #|f @* G| %| #|G|. Proof. (* Goal: is_true (dvdn (@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 G))))) (@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))))) *) rewrite card_morphim (dvdn_trans (dvdn_indexg _ _)) //. (* Goal: is_true (dvdn (@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 (@setI_group aT D G))))) (@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 cardSg ?subsetIr. Qed. Lemma logn_morphim p G : logn p #|f @* G| <= logn p #|G|. Proof. (* Goal: is_true (leq (logn p (@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 G)))))) (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 G)))))) *) by rewrite dvdn_leq_log ?dvdn_morphim. Qed. Lemma coprime_morphl G p : coprime #|G| p -> coprime #|f @* G| p. Proof. (* Goal: forall _ : is_true (coprime (@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)))) p), is_true (coprime (@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 G))))) p) *) exact: coprime_dvdl (dvdn_morphim G). Qed. Lemma coprime_morphr G p : coprime p #|G| -> coprime p #|f @* G|. Proof. (* Goal: forall _ : is_true (coprime 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 G))))), is_true (coprime p (@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 G)))))) *) exact: coprime_dvdr (dvdn_morphim G). Qed. Lemma coprime_morph G H : coprime #|G| #|H| -> coprime #|f @* G| #|f @* H|. Proof. (* Goal: forall _ : is_true (coprime (@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 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))))), is_true (coprime (@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 G))))) (@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 H)))))) *) by move=> coGH; rewrite coprime_morphl // coprime_morphr. Qed. Lemma index_morphim_ker G H : H \subset G -> G \subset D -> (#|f @* G : f @* H| * #|'ker_G f : H|)%N = #|G : H|. Lemma index_morphim G H : G :&: H \subset D -> #|f @* G : f @* H| %| #|G : H|. Lemma index_injm G H : 'injm f -> G \subset D -> #|f @* G : f @* H| = #|G : H|. 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)) (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)) (@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 nat (@indexg 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))) (@indexg aT (@gval aT G) (@gval aT H)) *) move=> injf dG; rewrite -{2}(setIidPr dG) -(indexgI _ H) /=. (* Goal: @eq nat (@indexg 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))) (@indexg aT (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@gval aT G)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@gval aT G)) (@gval aT H))) *) rewrite -index_morphim_ker ?subsetIl ?subsetIr //= setIAC morphimIdom setIC. (* Goal: @eq nat (@indexg 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))) (muln (@indexg 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)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@gval aT H))))) (@indexg aT (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@gval aT G)) (@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 G) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@gval aT H))))) *) rewrite injmI ?subsetIr // indexgI /= morphimIdom setIC ker_injm //. (* Goal: @eq nat (@indexg 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))) (muln (@indexg 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))) (@indexg aT (@setI (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_of_baseGroupType (FinGroup.base aT))) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@gval aT G))) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@gval aT H))))) *) by rewrite -(indexgI (1 :&: _)) /= -setIA !(setIidPl (sub1G _)) indexgg muln1. Qed. Lemma card_morphpre L : L \subset f @* D -> #|f @*^-1 L| = (#|'ker f| * #|L|)%N. 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 L))) (@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 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)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval rT L))))) (muln (@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)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))) (@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 L))))) *) move/morphpreK=> {2} <-; rewrite card_morphim morphpreIdom. (* 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)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval rT L))))) (muln (@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)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))) (@indexg aT (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval rT L)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))) *) by rewrite Lagrange // morphpreS ?sub1G. Qed. Lemma index_morphpre L M : L \subset f @* D -> #|f @*^-1 L : f @*^-1 M| = #|L : M|. 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 L))) (@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 nat (@indexg aT (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval rT L)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval rT M))) (@indexg rT (@gval rT L) (@gval rT M)) *) move=> dL; rewrite -!divgI -morphpreI card_morphpre //. (* Goal: @eq nat (divn (muln (@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)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))) (@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 L))))) (@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)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT L) (@gval rT M))))))) (divn (@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 L)))) (@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)) (@setI (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT L) (@gval rT M)))))) *) have: L :&: M \subset f @* D by rewrite subIset ?dL. (* 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)) (@setI (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT L) (@gval rT M)))) (@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 nat (divn (muln (@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)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))) (@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 L))))) (@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)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT L) (@gval rT M))))))) (divn (@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 L)))) (@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)) (@setI (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT L) (@gval rT M)))))) *) by move/card_morphpre->; rewrite divnMl ?cardG_gt0. Qed. End CardMorphism. Lemma card_homg (aT rT : finGroupType) (G : {group aT}) (R : {group rT}) : G \homg R -> #|G| %| #|R|. Proof. (* Goal: forall _ : is_true (@homg aT rT (@gval aT G) (@gval rT R)), is_true (dvdn (@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 R))))) *) by case/homgP=> f <-; rewrite card_morphim setIid dvdn_indexg. Qed. Section CardCosetpre. Variables (gT : finGroupType) (G H K : {group gT}) (L M : {group coset_of H}). Lemma dvdn_quotient : #|G / H| %| #|G|. Proof. (* Goal: is_true (dvdn (@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))))) (@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: dvdn_morphim. Qed. Lemma index_quotient_ker : K \subset G -> G \subset 'N(H) -> (#|G / H : K / H| * #|G :&: H : K|)%N = #|G : 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)) (@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 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 (muln (@indexg (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@indexg gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (@gval gT K))) (@indexg gT (@gval gT G) (@gval gT K)) *) by rewrite -{5}(ker_coset H); apply: index_morphim_ker. Qed. Lemma index_quotient : G :&: K \subset 'N(H) -> #|G / H : K / H| %| #|G : 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@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)) (@normaliser gT (@gval gT H))))), is_true (dvdn (@indexg (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@indexg gT (@gval gT G) (@gval gT K))) *) exact: index_morphim. Qed. Lemma index_quotient_eq : G :&: H \subset K -> K \subset G -> G \subset 'N(H) -> #|G / H : K / H| = #|G : 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@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))))) (_ : 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 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 (@indexg (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@indexg gT (@gval gT G) (@gval gT K)) *) move=> sGH_K sKG sGN; rewrite -index_quotient_ker {sKG sGN}//. (* Goal: @eq nat (@indexg (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (muln (@indexg (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@quotient gT (@gval gT K) (@gval gT H))) (@indexg gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (@gval gT K))) *) by rewrite -(indexgI _ K) (setIidPl sGH_K) indexgg muln1. Qed. Lemma card_cosetpre : #|coset H @*^-1 L| = (#|H| * #|L|)%N. Proof. (* 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)) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval (@coset_groupType gT (@gval gT H)) L))))) (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 H)))) (@card (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)) L))))) *) by rewrite card_morphpre ?ker_coset ?sub_im_coset. Qed. Lemma index_cosetpre : #|coset H @*^-1 L : coset H @*^-1 M| = #|L : M|. Proof. (* Goal: @eq nat (@indexg gT (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval (@coset_groupType gT (@gval gT H)) L)) (@morphpre gT (@coset_groupType gT (@gval gT H)) (@normaliser gT (@gval gT H)) (@coset_morphism gT (@gval gT H)) (@MorPhantom gT (@coset_groupType gT (@gval gT H)) (@coset gT (@gval gT H))) (@gval (@coset_groupType gT (@gval gT H)) M))) (@indexg (@coset_groupType gT (@gval gT H)) (@gval (@coset_groupType gT (@gval gT H)) L) (@gval (@coset_groupType gT (@gval gT H)) M)) *) by rewrite index_morphpre ?sub_im_coset. Qed. End CardCosetpre.
Set Implicit Arguments. Unset Strict Implicit. Require Export Sub_group. Require Export Abelian_group_cat. Section Group. Variable E : Setoid. Variable genlaw : E -> E -> E. Variable e : E. Variable geninv : E -> E. Hypothesis fcomp : forall x x' y y' : E, Equal x x' -> Equal y y' -> Equal (genlaw x y) (genlaw x' y'). Hypothesis genlawassoc : forall x y z : E, Equal (genlaw (genlaw x y) z) (genlaw x (genlaw y z)). Hypothesis eunitgenlawr : forall x : E, Equal (genlaw x e) x. Hypothesis invcomp : forall x y : E, Equal x y -> Equal (geninv x) (geninv y). Hypothesis geninvr : forall x : E, Equal (genlaw x (geninv x)) e. Lemma geninvl : forall x : E, Equal (genlaw (geninv x) x) e. Proof. (* Goal: forall x : Carrier E, @Equal E (genlaw (geninv x) x) e *) intros x; try assumption. (* Goal: @Equal E (genlaw (geninv x) x) e *) apply Trans with (genlaw (genlaw (geninv x) x) e); auto with algebra. (* Goal: @Equal E (genlaw (genlaw (geninv x) x) e) e *) apply Trans with (genlaw (genlaw (geninv x) x) (genlaw (geninv x) (geninv (geninv x)))); auto with algebra. (* Goal: @Equal E (genlaw (genlaw (geninv x) x) (genlaw (geninv x) (geninv (geninv x)))) e *) apply Trans with (genlaw (geninv x) (genlaw x (genlaw (geninv x) (geninv (geninv x))))); auto with algebra. (* Goal: @Equal E (genlaw (geninv x) (genlaw x (genlaw (geninv x) (geninv (geninv x))))) e *) apply Trans with (genlaw (geninv x) (genlaw (genlaw x (geninv x)) (geninv (geninv x)))); auto with algebra. (* Goal: @Equal E (genlaw (geninv x) (genlaw (genlaw x (geninv x)) (geninv (geninv x)))) e *) apply Trans with (genlaw (geninv x) (genlaw e (geninv (geninv x)))); auto with algebra. (* Goal: @Equal E (genlaw (geninv x) (genlaw e (geninv (geninv x)))) e *) apply Trans with (genlaw (genlaw (geninv x) e) (geninv (geninv x))); auto with algebra. (* Goal: @Equal E (genlaw (genlaw (geninv x) e) (geninv (geninv x))) e *) apply Trans with (genlaw (geninv x) (geninv (geninv x))); auto with algebra. Qed. Hint Resolve geninvl: algebra. Lemma eunitgenlawl : forall x : E, Equal (genlaw e x) x. Proof. (* Goal: forall x : Carrier E, @Equal E (genlaw e x) x *) intros x; try assumption. (* Goal: @Equal E (genlaw e x) x *) apply Trans with (genlaw (genlaw x (geninv x)) x); auto with algebra. (* Goal: @Equal E (genlaw (genlaw x (geninv x)) x) x *) apply Trans with (genlaw x (genlaw (geninv x) x)); auto with algebra. (* Goal: @Equal E (genlaw x (genlaw (geninv x) x)) x *) apply Trans with (genlaw x e); auto with algebra. Qed. Hint Resolve eunitgenlawl: algebra. Definition f := uncurry fcomp. Lemma fassoc : associative f. Proof. (* Goal: @associative E f *) red in |- *. (* Goal: forall x y z : Carrier E, @Equal E (@Ap (cart E E) E f (@couple E E (@Ap (cart E E) E f (@couple E E x y)) z)) (@Ap (cart E E) E f (@couple E E x (@Ap (cart E E) E f (@couple E E y z)))) *) simpl in |- *; auto with algebra. Qed. Lemma eunitr : unit_r f e. Proof. (* Goal: @unit_r E f e *) red in |- *. (* Goal: forall x : Carrier E, @Equal E (@Ap (cart E E) E f (@couple E E x e)) x *) simpl in |- *; auto with algebra. Qed. Lemma eunitl : unit_l f e. Proof. (* Goal: @unit_l E f e *) red in |- *. (* Goal: forall x : Carrier E, @Equal E (@Ap (cart E E) E f (@couple E E e x)) x *) simpl in |- *; auto with algebra. Qed. Definition inv := Build_Map (Ap:=geninv) invcomp. Lemma invr : inverse_r f e inv. Proof. (* Goal: @inverse_r E f e inv *) red in |- *. (* Goal: forall x : Carrier E, @Equal E (@Ap (cart E E) E f (@couple E E x (@Ap E E inv x))) e *) simpl in |- *; auto with algebra. Qed. Lemma invl : inverse_l f e inv. Proof. (* Goal: @inverse_l E f e inv *) red in |- *. (* Goal: forall x : Carrier E, @Equal E (@Ap (cart E E) E f (@couple E E (@Ap E E inv x) x)) e *) simpl in |- *; auto with algebra. Qed. Definition sg := Build_sgroup (Build_sgroup_on fassoc). Definition m := Build_monoid (Build_monoid_on (A:=sg) (monoid_unit:=e) eunitr eunitl). Definition BUILD_GROUP : GROUP := Build_group (Build_group_on (G:=m) (group_inverse_map:=inv) invr invl). End Group. Section Abelian_group. Variable E : Setoid. Variable genlaw : E -> E -> E. Variable e : E. Variable geninv : E -> E. Hypothesis fcomp : forall x x' y y' : E, Equal x x' -> Equal y y' -> Equal (genlaw x y) (genlaw x' y'). Hypothesis genlawassoc : forall x y z : E, Equal (genlaw (genlaw x y) z) (genlaw x (genlaw y z)). Hypothesis eunitgenlawr : forall x : E, Equal (genlaw x e) x. Hypothesis invcomp : forall x y : E, Equal x y -> Equal (geninv x) (geninv y). Hypothesis geninvr : forall x : E, Equal (genlaw x (geninv x)) e. Hypothesis fcom : forall x y : E, Equal (genlaw x y) (genlaw y x). Definition G := BUILD_GROUP fcomp genlawassoc eunitgenlawr invcomp geninvr. Definition asg : abelian_sgroup. Proof. (* Goal: abelian_sgroup *) apply (Build_abelian_sgroup (abelian_sgroup_sgroup:=G)). (* Goal: abelian_sgroup_on (monoid_sgroup (group_monoid G)) *) apply (Build_abelian_sgroup_on (A:=G)). (* Goal: @commutative (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_law_map (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_on_def (monoid_sgroup (group_monoid G)))) *) abstract (red in |- *; simpl in |- *; auto with algebra). Qed. Definition BUILD_ABELIAN_GROUP : ABELIAN_GROUP := Build_abelian_group (Build_abelian_group_on (G:=G) (Build_abelian_monoid (Build_abelian_monoid_on (M:=G) asg))). End Abelian_group. Section Hom. Variable G G' : GROUP. Variable ff : G -> G'. Hypothesis ffcomp : forall x y : G, Equal x y -> Equal (ff x) (ff y). Hypothesis fflaw : forall x y : G, Equal (ff (sgroup_law _ x y)) (sgroup_law _ (ff x) (ff y)). Hypothesis ffunit : Equal (ff (monoid_unit G)) (monoid_unit G'). Definition f2 := Build_Map ffcomp. Definition fhomsg := Build_sgroup_hom (sgroup_map:=f2) fflaw. Definition BUILD_HOM_GROUP : Hom G G' := Build_monoid_hom (monoid_sgroup_hom:=fhomsg) ffunit. End Hom. Section Build_sub_group. Variable G : GROUP. Variable H : part_set G. Hypothesis Hlaw : forall x y : G, in_part x H -> in_part y H -> in_part (sgroup_law _ x y) H. Hypothesis Hunit : in_part (monoid_unit G) H. Hypothesis Hinv : forall x : G, in_part x H -> in_part (group_inverse _ x) H. Definition BUILD_SUB_GROUP : subgroup G := Build_subgroup (G:=G) (subgroup_submonoid:=Build_submonoid (G:=G) (submonoid_subsgroup:=Build_subsgroup Hlaw) Hunit) Hinv. End Build_sub_group.
From mathcomp Require Import ssreflect ssrnat seq. From LemmaOverloading Require Import prefix. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Definition invariant A s r i (e : A) := onth r i = Some e /\ prefix s r. Example unit_test A (x1 x2 x3 x y : A): (forall s e (f : XFind s e), nth x1 seq_of index_of = e -> e = x) -> x = x. Proof. move=>test_form. apply: (test_form [::]). simpl. apply: (test_form [:: x1; x]). simpl. apply: (test_form [:: x1; x2; x; x3]). simpl. apply: (test_form [:: x1; x2; x3]). rewrite [seq_of]/=. rewrite [index_of]/=. simpl. Abort. Lemma bla A (x : A) s (C : XFind s x) : onth seq_of index_of = Some x. Proof. (* Goal: @eq (option A) (@onth A (@seq_of A s x C) (@index_of A s x C)) (@Some A x) *) by case: xfind. Qed.
Require Import sur_les_relations. Section YokouchiS. Variable A : Set. Variable R S : A -> A -> Prop. Hypothesis C : explicit_confluence _ R. Hypothesis N : explicit_noetherian _ R. Hypothesis SC : explicit_strong_confluence _ S. Definition Rstar_S_Rstar := explicit_comp_rel _ (explicit_star _ R) (explicit_comp_rel _ S (explicit_star _ R)). Hypothesis commut1 : forall f g h : A, R f h -> S f g -> exists k : A, explicit_star _ R g k /\ Rstar_S_Rstar h k. Goal forall f g h : A, explicit_star _ R f g -> Rstar_S_Rstar g h -> Rstar_S_Rstar f h. intros f g h H1 H2. elim (comp_case A (explicit_star _ R) (explicit_comp_rel _ S (explicit_star _ R)) g h H2). intros f' H3; elim H3; intros H4 H5. red in |- *; apply comp_2rel with f'. apply star_trans with g; assumption. assumption. Save comp_l. Goal forall f g h : A, Rstar_S_Rstar f g -> explicit_star _ R g h -> Rstar_S_Rstar f h. intros f g h H1 H2. elim (comp_case A (explicit_star _ R) (explicit_comp_rel _ S (explicit_star _ R)) f g H1). intros f' H3; elim H3; intros H4 H5. elim (comp_case A S (explicit_star _ R) f' g H5). intros f'' H6; elim H6; intros H7 H8. red in |- *; apply comp_2rel with f'. assumption. apply comp_2rel with f''. assumption. apply star_trans with g; assumption. Save comp_r. Goal forall f g h : A, explicit_star _ R f h -> S f g -> exists k : A, explicit_star _ R g k /\ Rstar_S_Rstar h k. intro f; pattern f in |- *; apply (noetherian_induction A R N); intros f0 H g h H1 H2. elim (star_case A R f0 h H1); intro H3. exists g; split. apply star_refl. elim H3; red in |- *; apply comp_2rel with f0. apply star_refl. apply comp_2rel with g; [ assumption | apply star_refl ]. elim H3; intros f1 H4; elim H4; intros H5 H6. cut (exists k : A, explicit_star _ R g k /\ Rstar_S_Rstar f1 k). intro H7; elim H7; intros g1 H8; elim H8; intros H9 H10. 2: apply commut1 with f0; assumption. cut (exists f2 : A, explicit_star _ R f1 f2 /\ explicit_comp_rel _ S (explicit_star _ R) f2 g1). 2: apply comp_case; assumption. intro H11; elim H11; intros f2 H12; elim H12; intros H13 H14. cut (exists f3 : A, S f2 f3 /\ explicit_star _ R f3 g1). 2: apply comp_case; assumption. intro H15; elim H15; intros f3 H16; elim H16; intros H17 H18. elim (C f1 h f2 H6 H13); intros h1 H19; elim H19; intros H20 H21. elim (H f2) with f3 h1. 2: apply comp_relplus; apply comp_2rel with f1; assumption. 2: assumption. 2: assumption. intros h2 H22; elim H22; intros H23 H24. elim (C f3 h2 g1 H23 H18); intros k H25; elim H25; intros H26 H27. exists k; split. apply star_trans with g1; assumption. apply comp_l with h1. assumption. apply comp_r with h2; assumption. Save commut2. Theorem Yokouchi : explicit_strong_confluence _ Rstar_S_Rstar. End YokouchiS.
Require Import securite. Lemma POinvprel3 : forall (l l0 : list C) (k k0 k1 k2 : K) (c c0 c1 c2 : C) (d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 : D), inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> invP (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> rel3 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) -> invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0). Proof. (* Goal: forall (l l0 : list C) (k k0 k1 k2 : K) (c c0 c1 c2 : C) (d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 : D) (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : invP (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : rel3 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0)), invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) do 32 intro. (* Goal: forall (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : invP (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : rel3 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0)), invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) unfold inv0, invP, rel3 in |- *; intros know_c_c0_l Inv1 know_Kab and1. (* Goal: not (known_in (B2C (K2B (KeyAB Aid Bid))) (@app C l0 rngDDKKeyABminusKab)) *) elim know_c_c0_l; intros know_c_l know_c0_l. (* Goal: not (known_in (B2C (K2B (KeyAB Aid Bid))) (@app C l0 rngDDKKeyABminusKab)) *) elim and1; intros eq_l0 t1. (* Goal: not (known_in (B2C (K2B (KeyAB Aid Bid))) (@app C l0 rngDDKKeyABminusKab)) *) clear know_c_c0_l Inv1 and1 t1. (* Goal: not (known_in (B2C (K2B (KeyAB Aid Bid))) (@app C l0 rngDDKKeyABminusKab)) *) rewrite eq_l0. (* Goal: not (known_in (B2C (K2B (KeyAB Aid Bid))) (@app C (@cons C (quint (B2C (D2B d4)) (B2C (D2B d5)) (B2C (D2B Bid)) c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))) l) rngDDKKeyABminusKab)) *) unfold quint in |- *. (* Goal: not (known_in (B2C (K2B (KeyAB Aid Bid))) (@app C (@cons C (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) l) rngDDKKeyABminusKab)) *) apply D2. (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@app C (@cons C (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) l) rngDDKKeyABminusKab) *) simpl in |- *. (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) (@app C l rngDDKKeyABminusKab)) *) repeat apply C2 || apply C3 || apply C4. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C c (@cons C (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)) (@app C l rngDDKKeyABminusKab))) *) apply equivncomp with (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid) :: l ++ rngDDKKeyABminusKab). (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)) (@app C l rngDDKKeyABminusKab)) *) (* Goal: equivS (@cons C (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)) (@app C l rngDDKKeyABminusKab)) (@cons C c (@cons C (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)) (@app C l rngDDKKeyABminusKab))) *) apply AlreadyIn; apply E0; apply EP0; assumption. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)) (@app C l rngDDKKeyABminusKab)) *) unfold quad in |- *. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid)) (@app C l rngDDKKeyABminusKab)) *) repeat apply C2 || apply C3 || apply C4. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d17))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d16))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@app C l rngDDKKeyABminusKab) *) apply D1; assumption. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d17))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d16))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d17))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d16))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d17))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d17))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d17))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d17))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B Bid))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d5))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d4))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d5)) (Pair (B2C (D2B Bid)) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid))))))) *) discriminate. Qed.
Require Import securite. Lemma POinvprel2 : forall (l l0 : list C) (k k0 k1 k2 : K) (c c0 c1 c2 : C) (d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 : D), inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> invP (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> rel2 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) -> invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0). Proof. (* Goal: forall (l l0 : list C) (k k0 k1 k2 : K) (c c0 c1 c2 : C) (d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 : D) (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : invP (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : rel2 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0)), invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) do 32 intro. (* Goal: forall (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : invP (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : rel2 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0)), invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) unfold rel2 in |- *. (* Goal: forall (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : invP (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : and (known_in (quad (B2C (D2B d15)) (B2C (D2B d16)) (B2C (D2B Bid)) c1) l) (and (@eq AState (MBNaKab d7 d8 d9 k0) (MBNaKab d18 d19 d20 k2)) (and (@eq SState (MABNaNbKeyK d d0 d1 d2 d3) (MABNaNbKeyK d10 d11 d12 d13 d14)) (and (@eq (list C) l l0) (and (@eq D d6 d17) (and (@eq K k k1) (@eq C c0 c2))))))), invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) intros Inv0 Inv1 InvP and1. (* Goal: invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) elim and1; intros t1 and2; elim and2; intros t2 and3; elim and3; intros t3 and4; elim and4; intros eq_l0 t4. (* Goal: invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) elim eq_l0; assumption. Qed.
Require Export GeoCoq.Elements.OriginalProofs.lemma_parallelsymmetric. Require Export GeoCoq.Elements.OriginalProofs.lemma_paralleldef2B. Require Export GeoCoq.Elements.OriginalProofs.lemma_parallelNC. Require Export GeoCoq.Elements.OriginalProofs.lemma_planeseparation. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_parallelPasch : forall A B C D E, PG A B C D -> BetS A D E -> exists X, BetS B X E /\ BetS C X D. Proof. (* Goal: forall (A B C D E : @Point Ax0) (_ : @PG Ax0 A B C D) (_ : @BetS Ax0 A D E), @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) intros. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (Par A B C D) by (conclude_def PG ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (Par A D B C) by (conclude_def PG ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (Par C D A B) by (conclude lemma_parallelsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (TP C D A B) by (conclude lemma_paralleldef2B). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (OS A B C D) by (conclude_def TP ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (OS B A C D) by (forward_using lemma_samesidesymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (eq D D) by (conclude cn_equalityreflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (neq A D) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (Col A D D) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (Col A D E) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (Col D D E) by (conclude lemma_collinear4). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (Col E D D) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (Col C D D) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (nCol A C D) by (forward_using lemma_parallelNC). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (nCol C D A) by (forward_using lemma_NCorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (TS A C D E) by (conclude_def TS ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (TS B C D E) by (conclude lemma_planeseparation). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) rename_H H;let Tf:=fresh in assert (Tf:exists H, (BetS B H E /\ Col C D H /\ nCol C D B)) by (conclude_def TS );destruct Tf as [H];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (BetS E H B) by (conclude axiom_betweennesssymmetry). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (Col D C H) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (neq A D) by (conclude_def Par ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (~ Meet A D B C) by (conclude_def Par ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (~ Meet E D C B). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) (* Goal: not (@Meet Ax0 E D C B) *) { (* Goal: not (@Meet Ax0 E D C B) *) intro. (* Goal: False *) let Tf:=fresh in assert (Tf:exists p, (neq E D /\ neq C B /\ Col E D p /\ Col C B p)) by (conclude_def Meet );destruct Tf as [p];spliter. (* Goal: False *) assert (neq B C) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col B C p) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col E D A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col D A p) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A D p) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Meet A D B C) by (conclude_def Meet ). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (eq C C) by (conclude cn_equalityreflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (neq D E) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (neq E D) by (conclude lemma_inequalitysymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (neq B C) by (conclude_def Par ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (neq C B) by (conclude lemma_inequalitysymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (Col C C B) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (BetS D H C) by (conclude lemma_collinearbetween). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) assert (BetS C H D) by (conclude axiom_betweennesssymmetry). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 B X E) (@BetS Ax0 C X D)) *) close. Qed. End Euclid.
Require Import Coq.Lists.List. Require Import Coq.Logic.Eqdep_dec. Require Import Coq.omega.Omega. Fixpoint arrow (xs : list Type) (res : Type) : Type := match xs with | nil => res | cons y ys => y -> arrow ys res end. Fixpoint tuple (xs : list Type) : Type := match xs with | nil => unit | cons y ys => (y * tuple ys)%type end. Definition apply_tuple (xs : list Type) (res : Type) (f : arrow xs res) (arg : tuple xs) : res. Proof. (* Goal: res *) induction xs as [ | ? ? IH ]; simpl. (* Goal: res *) (* Goal: res *) exact f. (* Goal: res *) exact (IH (f (fst arg)) (snd arg)). Qed. Fixpoint tr_list_rev (A : Type) (xs : list A) (acc : list A) : list A := match xs with | nil => acc | cons y ys => tr_list_rev A ys (cons y acc) end. Arguments tr_list_rev [ A ]. Definition list_rev (A : Type) (xs : list A) : list A := tr_list_rev xs nil. Arguments list_rev [ A ]. Definition tr_tuple_rev (xs : list Type) (ab : tuple xs) (acc : list Type) (acc' : tuple acc) : tuple (tr_list_rev xs acc). Proof. (* Goal: tuple (@tr_list_rev Type xs acc) *) generalize dependent acc. (* Goal: forall (acc : list Type) (_ : tuple acc), tuple (@tr_list_rev Type xs acc) *) induction xs as [ | ? ? IH ]; simpl; intros acc acc'. (* Goal: tuple (@tr_list_rev Type xs (@cons Type a acc)) *) (* Goal: tuple acc *) exact acc'. (* Goal: tuple (@tr_list_rev Type xs (@cons Type a acc)) *) exact (IH (snd ab) (a :: acc) (fst ab, acc')). Qed. Definition tuple_rev (xs : list Type) (ab : tuple xs) : tuple (list_rev xs) := tr_tuple_rev xs ab nil tt. Lemma eq_unit_dec : forall (x y : unit), {x = y} + {x <> y}. Proof. (* Goal: forall x y : unit, sumbool (@eq unit x y) (not (@eq unit x y)) *) decide equality. Qed. Lemma eq_pair_dec : forall (A B : Type), (forall x y : A, {x = y} + {x <> y}) -> (forall x y : B, {x = y} + {x <> y}) -> (forall x y : A * B, {x = y} + {x <> y}). Proof. (* Goal: forall (A B : Type) (_ : forall x y : A, sumbool (@eq A x y) (not (@eq A x y))) (_ : forall x y : B, sumbool (@eq B x y) (not (@eq B x y))) (x y : prod A B), sumbool (@eq (prod A B) x y) (not (@eq (prod A B) x y)) *) decide equality. Qed. Hint Resolve eq_unit_dec eq_pair_dec : eq_dec. Ltac uniqueness icount := intros; try (match goal with |- _ = ?f _ => symmetry end); let lhs := match goal with |- ?lhs = _ => constr:(lhs) end in let rhs := match goal with |- _ = ?rhs => constr:(rhs) end in let sort := match type of rhs with | ?pred => match type of pred with ?sort => sort end end in let rec get_pred_type i pred := match i with | O => pred | S ?n => match pred with ?f ?x => get_pred_type n f end end in let pred := get_pred_type icount ltac:(type of rhs) in let rec get_ind_types i pred acc := match i with | O => acc | S ?n => match pred with | ?f ?x => let ind := type of x in get_ind_types n f (@cons Type ind acc) end end in let ind_types := get_ind_types icount ltac:(type of rhs) (@nil Type) in let rec get_inds i pred acc := match i with | O => acc | S ?n => match pred with ?f ?x => get_inds n f (x, acc) end end in let inds := get_inds icount ltac:(type of rhs) tt in let rind_types := constr:(list_rev ind_types) in let rinds := constr:(tuple_rev ind_types inds) in let core := constr:(fun (ainds : tuple rind_types) (rhs : apply_tuple (list_rev rind_types) sort pred (tuple_rev rind_types ainds)) => forall eqpf : rinds = ainds, @eq (apply_tuple (list_rev rind_types) sort pred (tuple_rev rind_types ainds)) (@eq_rect (tuple rind_types) rinds (fun rinds2 => apply_tuple (list_rev rind_types) sort pred (tuple_rev rind_types rinds2)) lhs ainds eqpf) rhs) in let core := eval simpl in core in let rec curry f := match type of f with | forall _ : (unit), _ => constr:(f tt) | forall _ : (_ * unit), _ => constr:(fun a => f (a, tt)) | forall _ : (_ * _), _ => let f' := constr:(fun b a => f (a, b)) in curry f' end in let core := curry core in let core := eval simpl in core in let rec apply_core f args := match args with | tt => constr:(f) | (?x, ?xs) => apply_core (f x) xs end in let core := apply_core core inds in let core := constr:(core rhs) in change lhs with (@eq_rect (tuple rind_types) rinds (fun rinds2 => apply_tuple (list_rev rind_types) sort pred (tuple_rev rind_types rinds2)) lhs rinds (refl_equal rinds)); generalize (refl_equal rinds); change core; case rhs; unfold list_rev, tuple_rev in *; simpl tr_list_rev in *; simpl tr_tuple_rev in *; repeat (match goal with | |- (_, _) = (_, _) -> _ => let H := fresh in intros H; try discriminate; injection H | _ => progress intro end); subst; try (rewrite <- eq_rect_eq_dec; [ f_equal; auto | auto with eq_dec ]).
Require Export GeoCoq.Elements.OriginalProofs.lemma_collinearorder. Section Euclid. Context `{Ax1:euclidean_neutral}. Lemma lemma_NCorder : forall A B C, nCol A B C -> nCol B A C /\ nCol B C A /\ nCol C A B /\ nCol A C B /\ nCol C B A. Proof. (* Goal: forall (A B C : @Point Ax1) (_ : @nCol Ax1 A B C), and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) intros. (* Goal: and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) assert (~ Col B A C). (* Goal: and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) (* Goal: not (@Col Ax1 B A C) *) { (* Goal: not (@Col Ax1 B A C) *) intro. (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) } (* Goal: and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) assert (~ Col B C A). (* Goal: and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) (* Goal: not (@Col Ax1 B C A) *) { (* Goal: not (@Col Ax1 B C A) *) intro. (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) } (* Goal: and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) assert (~ Col C A B). (* Goal: and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) (* Goal: not (@Col Ax1 C A B) *) { (* Goal: not (@Col Ax1 C A B) *) intro. (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) } (* Goal: and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) assert (~ Col A C B). (* Goal: and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) (* Goal: not (@Col Ax1 A C B) *) { (* Goal: not (@Col Ax1 A C B) *) intro. (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) } (* Goal: and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) assert (~ Col C B A). (* Goal: and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) (* Goal: not (@Col Ax1 C B A) *) { (* Goal: not (@Col Ax1 C B A) *) intro. (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) } (* Goal: and (@nCol Ax1 B A C) (and (@nCol Ax1 B C A) (and (@nCol Ax1 C A B) (and (@nCol Ax1 A C B) (@nCol Ax1 C B A)))) *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.proposition_47. Require Export GeoCoq.Elements.OriginalProofs.lemma_squaresequal. Require Export GeoCoq.Elements.OriginalProofs.lemma_rectanglerotate. Require Export GeoCoq.Elements.OriginalProofs.lemma_paste5. Require Export GeoCoq.Elements.OriginalProofs.proposition_48A. Require Export GeoCoq.Elements.OriginalProofs.proposition_08. Section Euclid. Context `{Ax:area}. Lemma proposition_48 : forall A B C D E F G H K L M, Triangle A B C -> SQ A B F G -> SQ A C K H -> SQ B C E D -> BetS B M C -> BetS E L D -> EF A B F G B M L D -> EF A C K H M C E L -> RE M C E L -> Per B A C. Proof. (* Goal: forall (A B C D E F G H K L M : @Point Ax0) (_ : @Triangle Ax0 A B C) (_ : @SQ Ax0 A B F G) (_ : @SQ Ax0 A C K H) (_ : @SQ Ax0 B C E D) (_ : @BetS Ax0 B M C) (_ : @BetS Ax0 E L D) (_ : @EF Ax0 Ax1 Ax2 Ax A B F G B M L D) (_ : @EF Ax0 Ax1 Ax2 Ax A C K H M C E L) (_ : @RE Ax0 M C E L), @Per Ax0 B A C *) intros. (* Goal: @Per Ax0 B A C *) assert (nCol A B C) by (conclude_def Triangle ). (* Goal: @Per Ax0 B A C *) assert (neq A C) by (forward_using lemma_NCdistinct). (* Goal: @Per Ax0 B A C *) assert (neq A B) by (forward_using lemma_NCdistinct). (* Goal: @Per Ax0 B A C *) assert (neq B A) by (conclude lemma_inequalitysymmetric). (* Goal: @Per Ax0 B A C *) let Tf:=fresh in assert (Tf:exists R, (BetS B A R /\ Cong A R A B)) by (conclude lemma_extension);destruct Tf as [R];spliter. (* Goal: @Per Ax0 B A C *) assert (Col B A R) by (conclude_def Col ). (* Goal: @Per Ax0 B A C *) assert (Col A B R) by (forward_using lemma_collinearorder). (* Goal: @Per Ax0 B A C *) assert (eq B B) by (conclude cn_equalityreflexive). (* Goal: @Per Ax0 B A C *) assert (Col A B B) by (conclude_def Col ). (* Goal: @Per Ax0 B A C *) assert (neq B R) by (forward_using lemma_betweennotequal). (* Goal: @Per Ax0 B A C *) assert (neq R B) by (conclude lemma_inequalitysymmetric). (* Goal: @Per Ax0 B A C *) assert (nCol R B C) by (conclude lemma_NChelper). (* Goal: @Per Ax0 B A C *) assert (nCol B R C) by (forward_using lemma_NCorder). (* Goal: @Per Ax0 B A C *) let Tf:=fresh in assert (Tf:exists Q, (Per B A Q /\ TS Q B R C)) by (conclude proposition_11B);destruct Tf as [Q];spliter. (* Goal: @Per Ax0 B A C *) assert (nCol B A Q) by (conclude lemma_rightangleNC). (* Goal: @Per Ax0 B A C *) assert (neq A Q) by (forward_using lemma_NCdistinct). (* Goal: @Per Ax0 B A C *) let Tf:=fresh in assert (Tf:exists c, (Out A Q c /\ Cong A c A C)) by (conclude lemma_layoff);destruct Tf as [c];spliter. (* Goal: @Per Ax0 B A C *) assert (Per B A c) by (conclude lemma_8_3). (* Goal: @Per Ax0 B A C *) assert (nCol B A c) by (conclude lemma_rightangleNC). (* Goal: @Per Ax0 B A C *) assert (nCol A B c) by (forward_using lemma_NCorder). (* Goal: @Per Ax0 B A C *) let Tf:=fresh in assert (Tf:exists f g, (SQ A B f g /\ TS g A B c /\ PG A B f g)) by (conclude proposition_46);destruct Tf as [f[g]];spliter. (* Goal: @Per Ax0 B A C *) assert (neq A c) by (forward_using lemma_NCdistinct). (* Goal: @Per Ax0 B A C *) assert (nCol A c B) by (forward_using lemma_NCorder). (* Goal: @Per Ax0 B A C *) let Tf:=fresh in assert (Tf:exists k h, (SQ A c k h /\ TS h A c B /\ PG A c k h)) by (conclude proposition_46);destruct Tf as [k[h]];spliter. (* Goal: @Per Ax0 B A C *) assert (neq B c) by (forward_using lemma_NCdistinct). (* Goal: @Per Ax0 B A C *) assert (nCol B c A) by (forward_using lemma_NCorder). (* Goal: @Per Ax0 B A C *) let Tf:=fresh in assert (Tf:exists e d, (SQ B c e d /\ TS d B c A /\ PG B c e d)) by (conclude proposition_46);destruct Tf as [e[d]];spliter. (* Goal: @Per Ax0 B A C *) assert (Triangle A B c) by (conclude_def Triangle ). (* Goal: @Per Ax0 B A C *) assert (TS g B A c) by (conclude lemma_oppositesideflip). (* Goal: @Per Ax0 B A C *) assert (TS h c A B) by (conclude lemma_oppositesideflip). (* Goal: @Per Ax0 B A C *) assert (TS d c B A) by (conclude lemma_oppositesideflip). (* Goal: @Per Ax0 B A C *) let Tf:=fresh in assert (Tf:exists m l, (PG B m l d /\ BetS B m c /\ PG m c e l /\ BetS d l e /\ EF A B f g B m l d /\ EF A c k h m c e l)) by (conclude proposition_47);destruct Tf as [m[l]];spliter. (* Goal: @Per Ax0 B A C *) assert (Cong A C A c) by (conclude lemma_congruencesymmetric). (* Goal: @Per Ax0 B A C *) assert (EF A C K H A c k h) by (conclude lemma_squaresequal). (* Goal: @Per Ax0 B A C *) assert (Cong A B A B) by (conclude cn_congruencereflexive). (* Goal: @Per Ax0 B A C *) assert (EF A B F G A B f g) by (conclude lemma_squaresequal). (* Goal: @Per Ax0 B A C *) assert (EF A B F G B m l d) by (conclude axiom_EFtransitive). (* Goal: @Per Ax0 B A C *) assert (EF B M L D A B F G) by (conclude axiom_EFsymmetric). (* Goal: @Per Ax0 B A C *) assert (EF B M L D B m l d) by (conclude axiom_EFtransitive). (* Goal: @Per Ax0 B A C *) assert (EF M C E L A C K H) by (conclude axiom_EFsymmetric). (* Goal: @Per Ax0 B A C *) assert (EF M C E L A c k h) by (conclude axiom_EFtransitive). (* Goal: @Per Ax0 B A C *) assert (EF M C E L m c e l) by (conclude axiom_EFtransitive). (* Goal: @Per Ax0 B A C *) assert (BetS e l d) by (conclude axiom_betweennesssymmetry). (* Goal: @Per Ax0 B A C *) assert (Per B c e) by (conclude_def SQ ). (* Goal: @Per Ax0 B A C *) assert (neq m c) by (forward_using lemma_betweennotequal). (* Goal: @Per Ax0 B A C *) assert (Col B m c) by (conclude_def Col ). (* Goal: @Per Ax0 B A C *) assert (Col B c m) by (forward_using lemma_collinearorder). (* Goal: @Per Ax0 B A C *) assert (Per m c e) by (conclude lemma_collinearright). (* Goal: @Per Ax0 B A C *) assert (PG c e l m) by (conclude lemma_PGrotate). (* Goal: @Per Ax0 B A C *) assert (RE c e l m) by (conclude lemma_PGrectangle). (* Goal: @Per Ax0 B A C *) assert (RE e l m c) by (conclude lemma_rectanglerotate). (* Goal: @Per Ax0 B A C *) assert (RE l m c e) by (conclude lemma_rectanglerotate). (* Goal: @Per Ax0 B A C *) assert (RE m c e l) by (conclude lemma_rectanglerotate). (* Goal: @Per Ax0 B A C *) assert (EF B C E D B c e d) by (conclude lemma_paste5). (* Goal: @Per Ax0 B A C *) assert (Cong B C B c) by (conclude proposition_48A). (* Goal: @Per Ax0 B A C *) assert (Cong A C A c) by (conclude lemma_congruencesymmetric). (* Goal: @Per Ax0 B A C *) assert (Triangle A B c) by (conclude_def Triangle ). (* Goal: @Per Ax0 B A C *) assert (CongA B A C B A c) by (apply (proposition_08 A B C A B c);auto). (* Goal: @Per Ax0 B A C *) assert (Per B A C) by (conclude lemma_equaltorightisright). (* Goal: @Per Ax0 B A C *) close. Qed. End Euclid.
From mathcomp Require Import ssreflect ssrbool seq eqtype. From LemmaOverloading Require Import heaps. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Definition scan_axiom h s := def h -> uniq s /\ forall x, x \in s -> x \in dom h. Lemma scanE x h (f : Scan h): def h -> x \in seq_of -> x \in dom h. Proof. (* Goal: forall (_ : is_true (def h)) (_ : is_true (@in_mem (Equality.sort ptr_eqType) x (@mem (Equality.sort ptr_eqType) (seq_predType ptr_eqType) (@seq_of h f)))), is_true (@in_mem (Equality.sort ptr_eqType) x (@mem ptr (predPredType ptr) (dom h))) *) move=>D; case:f=>s /= [//|_]; apply. Qed. Example ex_find (x y z : ptr) : x \in [:: z; x; y]. Proof. rewrite search. Abort. Definition search2_axiom (x y : ptr) (s : seq ptr) := [/\ x \in s, y \in s & uniq s -> x != y]. Lemma find2E x y s (f : Search2 x y s) : uniq s -> x != y. Proof. (* Goal: forall _ : is_true (@uniq ptr_eqType s), is_true (negb (@eq_op ptr_eqType x y)) *) by move: f=>[[_ _]]; apply. Qed. Arguments find2E [x y s f]. Example ex_find2 (w x y z : ptr) : uniq [:: z; y; w; x] -> x != y. move=>H. rewrite (find2E H). Abort. Lemma noaliasR h x y (sc : Scan h) (s2 : Search2 x y seq_of): def h -> x != y. Proof. (* Goal: forall _ : is_true (def h), is_true (negb (@eq_op ptr_eqType x y)) *) move=>D. (* Goal: is_true (negb (@eq_op ptr_eqType x y)) *) by case: sc s2=>s /= [//|] U _ [/= [_ _ H3]]; apply: H3. Qed. Arguments noaliasR [h x y sc s2]. Hint Extern 20 (Search2 _ _ _) => progress simpl : typeclass_instances. Example ex_noalias x1 x2 : def (x2 :-> 1 :+ x1 :-> 2) -> x1 != x2. Proof. move=>D. by eapply (noaliasR D). Abort. Example ex_noalias2 x1 x2 h : def (x2 :-> 1 :+ h :+ x1 :-> 2) -> x1 != x2. Proof. move=>D. by eapply (noaliasR D). Abort. Example exnc A (x1 x2 x3 x4 : ptr) (v1 v2 : A) (h1 h2 : heap) : def (h1 :+ x2 :-> 1 :+ h2 :+ x1 :-> v2 :+ (x3 :-> v1 :+ empty)) -> (x1 != x2) /\ (x1 != x2) && (x2 != x3) && (x3 != x1) /\ (x2 == x3) = false /\ (x1 == x2) = false /\ ((x1 != x2) && (x2 != x3)) = (x1 != x2) /\ ((x1 != x2) && (x2 != x3)) = (x1 != x2) /\ ((x1 != x2) && (x2 != x3)) = (x1 != x2) /\ ((x1 != x2) && (x2 != x3)) = (x1 != x2) /\ (x1 != x2) && (x2 != x3) && (x1 != x4) && (x3 != x1). Proof. move=>D. split. - by apply: (noaliasR D). split. - by rewrite !(noaliasR D). split. - by rewrite [x2 == x3](negbTE (noaliasR D)). split. - by rewrite (negbTE (noaliasR D)). split. - by rewrite [x2 != x3](noaliasR D) andbT. split. - by rewrite (noaliasR (x := x2) D) andbT. split. - by rewrite (noaliasR (y := x3) D) andbT. split. - by rewrite (noaliasR (x := x2) (y := x3) D) andbT. rewrite !(negbTE (noaliasR D)). admit. Abort.
Require Export GeoCoq.Elements.OriginalProofs.lemma_congruenceflip. Require Export GeoCoq.Elements.OriginalProofs.lemma_lessthancongruence. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_TGsymmetric : forall A B C a b c, TG A a B b C c -> TG B b A a C c. Proof. (* Goal: forall (A B C a b c : @Point Ax0) (_ : @TG Ax0 A a B b C c), @TG Ax0 B b A a C c *) intros. (* Goal: @TG Ax0 B b A a C c *) rename_H H; let Tf:=fresh in assert (Tf:exists H, (BetS A a H /\ Cong a H B b /\ Lt C c A H)) by (conclude_def TG );destruct Tf as [H];spliter. (* Goal: @TG Ax0 B b A a C c *) assert (neq a H) by (forward_using lemma_betweennotequal). (* Goal: @TG Ax0 B b A a C c *) assert (neq B b) by (conclude axiom_nocollapse). (* Goal: @TG Ax0 B b A a C c *) assert (neq A a) by (forward_using lemma_betweennotequal). (* Goal: @TG Ax0 B b A a C c *) let Tf:=fresh in assert (Tf:exists F, (BetS B b F /\ Cong b F A a)) by (conclude lemma_extension);destruct Tf as [F];spliter. (* Goal: @TG Ax0 B b A a C c *) assert (Cong a A F b) by (forward_using lemma_doublereverse). (* Goal: @TG Ax0 B b A a C c *) assert (Cong A a F b) by (forward_using lemma_congruenceflip). (* Goal: @TG Ax0 B b A a C c *) assert (Cong a H b B) by (forward_using lemma_congruenceflip). (* Goal: @TG Ax0 B b A a C c *) assert (BetS F b B) by (conclude axiom_betweennesssymmetry). (* Goal: @TG Ax0 B b A a C c *) assert (Cong A H F B) by (conclude cn_sumofparts). (* Goal: @TG Ax0 B b A a C c *) assert (Cong A H B F) by (forward_using lemma_congruenceflip). (* Goal: @TG Ax0 B b A a C c *) assert (Lt C c B F) by (conclude lemma_lessthancongruence). (* Goal: @TG Ax0 B b A a C c *) assert (TG B b A a C c) by (conclude_def TG ). (* Goal: @TG Ax0 B b A a C c *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.lemma_8_7. Require Export GeoCoq.Elements.OriginalProofs.lemma_NCdistinct. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_rectangleparallelogram : forall A B C D, RE A B C D -> PG A B C D. Proof. (* Goal: forall (A B C D : @Point Ax0) (_ : @RE Ax0 A B C D), @PG Ax0 A B C D *) intros. (* Goal: @PG Ax0 A B C D *) assert ((Per D A B /\ Per A B C /\ Per B C D /\ Per C D A /\ CR A C B D)) by (conclude_def RE ). (* Goal: @PG Ax0 A B C D *) assert (nCol D A B) by (conclude lemma_rightangleNC). (* Goal: @PG Ax0 A B C D *) assert (nCol A B C) by (conclude lemma_rightangleNC). (* Goal: @PG Ax0 A B C D *) assert (nCol C D A) by (conclude lemma_rightangleNC). (* Goal: @PG Ax0 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: @PG Ax0 A B C D *) assert (~ Meet A B C D). (* Goal: @PG 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 P, (neq A B /\ neq C D /\ Col A B P /\ Col C D P)) by (conclude_def Meet );destruct Tf as [P];spliter. (* Goal: False *) assert (~ eq A P). (* Goal: False *) (* Goal: not (@eq Ax0 A P) *) { (* Goal: not (@eq Ax0 A P) *) intro. (* Goal: False *) assert (Col C D A) by (conclude cn_equalitysub). (* Goal: False *) contradict. (* BG Goal: @PG Ax0 A B C D *) (* BG Goal: False *) } (* Goal: False *) assert (~ eq D P). (* Goal: False *) (* Goal: not (@eq Ax0 D P) *) { (* Goal: not (@eq Ax0 D P) *) intro. (* Goal: False *) assert (Col A B D) by (conclude cn_equalitysub). (* Goal: False *) assert (Col D A B) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @PG Ax0 A B C D *) (* BG Goal: False *) } (* Goal: False *) assert (Per B A D) by (conclude lemma_8_2). (* Goal: False *) assert (Col B A P) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq P A) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Per P A D) by (conclude lemma_collinearright). (* Goal: False *) assert (neq P D) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Per P D A) by (conclude lemma_collinearright). (* Goal: False *) assert (Per A D P) by (conclude lemma_8_2). (* Goal: False *) assert (~ Per P A D) by (conclude lemma_8_7). (* Goal: False *) contradict. (* BG Goal: @PG Ax0 A B C D *) } (* Goal: @PG Ax0 A B C D *) assert (neq A B) by (forward_using lemma_NCdistinct). (* Goal: @PG Ax0 A B C D *) assert (neq C D) by (forward_using lemma_NCdistinct). (* Goal: @PG Ax0 A B C D *) assert (neq D C) by (forward_using lemma_NCdistinct). (* Goal: @PG Ax0 A B C D *) assert (eq A A) by (conclude cn_equalityreflexive). (* Goal: @PG Ax0 A B C D *) assert (Col A B A) by (conclude_def Col ). (* Goal: @PG Ax0 A B C D *) assert (eq B B) by (conclude cn_equalityreflexive). (* Goal: @PG Ax0 A B C D *) assert (Col A B B) by (conclude_def Col ). (* Goal: @PG Ax0 A B C D *) assert (eq C C) by (conclude cn_equalityreflexive). (* Goal: @PG Ax0 A B C D *) assert (Col C D C) by (conclude_def Col ). (* Goal: @PG Ax0 A B C D *) assert (eq D D) by (conclude cn_equalityreflexive). (* Goal: @PG Ax0 A B C D *) assert (Col C D D) by (conclude_def Col ). (* Goal: @PG Ax0 A B C D *) assert (BetS D M B) by (conclude axiom_betweennesssymmetry). (* Goal: @PG Ax0 A B C D *) assert (Par A B C D) by (conclude_def Par ). (* Goal: @PG Ax0 A B C D *) assert (~ Meet A D B C). (* Goal: @PG Ax0 A B C D *) (* Goal: not (@Meet Ax0 A D B C) *) { (* Goal: not (@Meet Ax0 A D B C) *) intro. (* Goal: False *) let Tf:=fresh in assert (Tf:exists P, (neq A D /\ neq B C /\ Col A D P /\ Col B C P)) by (conclude_def Meet );destruct Tf as [P];spliter. (* Goal: False *) assert (~ eq A P). (* Goal: False *) (* Goal: not (@eq Ax0 A P) *) { (* Goal: not (@eq Ax0 A P) *) intro. (* Goal: False *) assert (Col B C A) by (conclude cn_equalitysub). (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @PG Ax0 A B C D *) (* BG Goal: False *) } (* Goal: False *) assert (~ eq B P). (* Goal: False *) (* Goal: not (@eq Ax0 B P) *) { (* Goal: not (@eq Ax0 B P) *) intro. (* Goal: False *) assert (Col A D B) by (conclude cn_equalitysub). (* Goal: False *) assert (Col D A B) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @PG Ax0 A B C D *) (* BG Goal: False *) } (* Goal: False *) assert (neq P A) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col D A P) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Per P A B) by (conclude lemma_collinearright). (* Goal: False *) assert (Per C B A) by (conclude lemma_8_2). (* Goal: False *) assert (Col C B P) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq P B) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Per P B A) by (conclude lemma_collinearright). (* Goal: False *) assert (Per B A P) by (conclude lemma_8_2). (* Goal: False *) assert (~ Per P B A) by (conclude lemma_8_7). (* Goal: False *) contradict. (* BG Goal: @PG Ax0 A B C D *) } (* Goal: @PG Ax0 A B C D *) assert (neq A D) by (forward_using lemma_NCdistinct). (* Goal: @PG Ax0 A B C D *) assert (neq B C) by (forward_using lemma_NCdistinct). (* Goal: @PG Ax0 A B C D *) assert (eq D D) by (conclude cn_equalityreflexive). (* Goal: @PG Ax0 A B C D *) assert (Col A D A) by (conclude_def Col ). (* Goal: @PG Ax0 A B C D *) assert (Col A D D) by (conclude_def Col ). (* Goal: @PG Ax0 A B C D *) assert (Col B C B) by (conclude_def Col ). (* Goal: @PG Ax0 A B C D *) assert (Col B C C) by (conclude_def Col ). (* Goal: @PG Ax0 A B C D *) assert (Par A D B C) by (conclude_def Par ). (* Goal: @PG Ax0 A B C D *) assert (PG A B C D) by (conclude_def PG ). (* Goal: @PG Ax0 A B C D *) close. Qed. End Euclid.
Set Implicit Arguments. Unset Strict Implicit. Require Export Sub_monoid. Require Export Abelian_group_cat. Section Monoid. Variable E : Setoid. Variable genlaw : E -> E -> E. Variable e : E. Hypothesis fcomp : forall x x' y y' : E, Equal x x' -> Equal y y' -> Equal (genlaw x y) (genlaw x' y'). Hypothesis genlawassoc : forall x y z : E, Equal (genlaw (genlaw x y) z) (genlaw x (genlaw y z)). Hypothesis eunitgenlawr : forall x : E, Equal (genlaw x e) x. Hypothesis eunitgenlawl : forall x : E, Equal (genlaw e x) x. Definition f := uncurry fcomp. Lemma fassoc : associative f. Proof. (* Goal: @associative E f *) red in |- *. (* Goal: forall x y z : Carrier E, @Equal E (@Ap (cart E E) E f (@couple E E (@Ap (cart E E) E f (@couple E E x y)) z)) (@Ap (cart E E) E f (@couple E E x (@Ap (cart E E) E f (@couple E E y z)))) *) simpl in |- *; auto with algebra. Qed. Lemma eunitr : unit_r f e. Proof. (* Goal: @unit_r E f e *) red in |- *. (* Goal: forall x : Carrier E, @Equal E (@Ap (cart E E) E f (@couple E E x e)) x *) simpl in |- *; auto with algebra. Qed. Lemma eunitl : unit_l f e. Proof. (* Goal: @unit_l E f e *) red in |- *. (* Goal: forall x : Carrier E, @Equal E (@Ap (cart E E) E f (@couple E E e x)) x *) simpl in |- *; auto with algebra. Qed. Definition sg := Build_sgroup (Build_sgroup_on fassoc). Definition BUILD_MONOID : MONOID := Build_monoid (Build_monoid_on (A:=sg) (monoid_unit:=e) eunitr eunitl). End Monoid. Section Abelian_monoid. Variable E : Setoid. Variable genlaw : E -> E -> E. Variable e : E. Hypothesis fcomp : forall x x' y y' : E, Equal x x' -> Equal y y' -> Equal (genlaw x y) (genlaw x' y'). Hypothesis genlawassoc : forall x y z : E, Equal (genlaw (genlaw x y) z) (genlaw x (genlaw y z)). Hypothesis eunitgenlawr : forall x : E, Equal (genlaw x e) x. Hypothesis eunitgenlawl : forall x : E, Equal (genlaw e x) x. Hypothesis fcom : forall x y : E, Equal (genlaw x y) (genlaw y x). Definition M := BUILD_MONOID fcomp genlawassoc eunitgenlawr eunitgenlawl. Definition asg : abelian_sgroup. Proof. (* Goal: abelian_sgroup *) apply (Build_abelian_sgroup (abelian_sgroup_sgroup:=M)). (* Goal: abelian_sgroup_on (monoid_sgroup M) *) apply (Build_abelian_sgroup_on (A:=M)). (* Goal: @commutative (sgroup_set (monoid_sgroup M)) (@sgroup_law_map (sgroup_set (monoid_sgroup M)) (sgroup_on_def (monoid_sgroup M))) *) abstract (red in |- *; simpl in |- *; exact fcom). Qed. Definition BUILD_ABELIAN_MONOID : ABELIAN_MONOID := Build_abelian_monoid (Build_abelian_monoid_on (M:=M) asg). End Abelian_monoid. Section Hom. Variable G G' : MONOID. Variable ff : G -> G'. Hypothesis ffcomp : forall x y : G, Equal x y -> Equal (ff x) (ff y). Hypothesis fflaw : forall x y : G, Equal (ff (sgroup_law _ x y)) (sgroup_law _ (ff x) (ff y)). Hypothesis ffunit : Equal (ff (monoid_unit G)) (monoid_unit G'). Definition f2 := Build_Map ffcomp. Definition fhomsg := Build_sgroup_hom (sgroup_map:=f2) fflaw. Definition BUILD_HOM_MONOID : Hom G G' := Build_monoid_hom (monoid_sgroup_hom:=fhomsg) ffunit. End Hom. Section Build_sub_monoid. Variable G : MONOID. Variable H : part_set G. Hypothesis Hlaw : forall x y : G, in_part x H -> in_part y H -> in_part (sgroup_law _ x y) H. Hypothesis Hunit : in_part (monoid_unit G) H. Definition BUILD_SUB_MONOID : submonoid G := Build_submonoid (G:=G) (submonoid_subsgroup:=Build_subsgroup Hlaw) Hunit. End Build_sub_monoid.
Require Import Bool Arith Div2. Require Import BellantoniCook.Lib BellantoniCook.Bitstring BellantoniCook.BC. Definition zero_e (n s:nat) : BC := comp n s zero nil nil. Lemma zero_correct n s l1 l2: bs2nat (sem (zero_e n s) l1 l2) = 0. Proof. (* Goal: @eq nat (bs2nat (sem (zero_e n s) l1 l2)) O *) intros; simpl; trivial. Qed. Definition one_e n s := comp n s (comp 0 0 (succ true) nil [zero]) nil nil. Definition succ_e : BC := rec (one_e 0 0) (comp 1 1 (succ true) nil [proj 1 1 0]) (comp 1 1 (succ false) nil [proj 1 1 1]). Lemma succ_correct : forall n, bs2nat (sem succ_e [n] nil) = S (bs2nat n). Proof. (* Goal: forall n : list bool, @eq nat (bs2nat (sem succ_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (S (bs2nat n)) *) induction n; simpl in *; trivial. (* Goal: @eq nat (bs2nat (if a then @cons bool false (sem_rec (fun _ _ : list (list bool) => @cons bool true (@nil bool)) (fun vnl _ : list (list bool) => @cons bool true (@List.nth (list bool) O vnl (@nil bool))) (fun _ vsl : list (list bool) => @cons bool false (@List.nth (list bool) O vsl (@nil bool))) n (@nil (list bool)) (@nil (list bool))) else @cons bool true n)) (S (if a then S (Init.Nat.add (bs2nat n) (Init.Nat.add (bs2nat n) O)) else Init.Nat.add (bs2nat n) (Init.Nat.add (bs2nat n) O))) *) case a; simpl; [rewrite IHn | ]; ring. Qed. Global Opaque succ_e. Definition is_zero_e : BC := rec (one_e 0 0) (proj 1 1 1) (zero_e 1 1). Lemma is_zero_correct v : bs2bool (sem is_zero_e [v] nil) = true <-> bs2nat v = 0. Proof. (* Goal: iff (@eq bool (bs2bool (sem is_zero_e (@cons (list bool) v (@nil (list bool))) (@nil (list bool)))) true) (@eq nat (bs2nat v) O) *) intros; split; induction v; simpl; trivial. (* Goal: forall _ : @eq nat (if a 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)) O, @eq bool (bs2bool (if a then @nil bool else sem_rec (fun _ _ : list (list bool) => @cons bool true (@nil bool)) (fun _ vsl : list (list bool) => @List.nth (list bool) O vsl (@nil bool)) (fun _ _ : list (list bool) => @nil bool) v (@nil (list bool)) (@nil (list bool)))) true *) (* Goal: forall _ : @eq bool (bs2bool (if a then @nil bool else sem_rec (fun _ _ : list (list bool) => @cons bool true (@nil bool)) (fun _ vsl : list (list bool) => @List.nth (list bool) O vsl (@nil bool)) (fun _ _ : list (list bool) => @nil bool) v (@nil (list bool)) (@nil (list bool)))) true, @eq nat (if a 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)) O *) case a; intros; simpl in *. (* Goal: forall _ : @eq nat (if a 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)) O, @eq bool (bs2bool (if a then @nil bool else sem_rec (fun _ _ : list (list bool) => @cons bool true (@nil bool)) (fun _ vsl : list (list bool) => @List.nth (list bool) O vsl (@nil bool)) (fun _ _ : list (list bool) => @nil bool) v (@nil (list bool)) (@nil (list bool)))) true *) (* Goal: @eq nat (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) O *) (* Goal: @eq nat (S (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O))) O *) discriminate. (* Goal: forall _ : @eq nat (if a 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)) O, @eq bool (bs2bool (if a then @nil bool else sem_rec (fun _ _ : list (list bool) => @cons bool true (@nil bool)) (fun _ vsl : list (list bool) => @List.nth (list bool) O vsl (@nil bool)) (fun _ _ : list (list bool) => @nil bool) v (@nil (list bool)) (@nil (list bool)))) true *) (* Goal: @eq nat (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) O *) rewrite IHv; trivial. (* Goal: forall _ : @eq nat (if a 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)) O, @eq bool (bs2bool (if a then @nil bool else sem_rec (fun _ _ : list (list bool) => @cons bool true (@nil bool)) (fun _ vsl : list (list bool) => @List.nth (list bool) O vsl (@nil bool)) (fun _ _ : list (list bool) => @nil bool) v (@nil (list bool)) (@nil (list bool)))) true *) case a; intros; simpl in *. (* Goal: @eq bool (bs2bool (sem_rec (fun _ _ : list (list bool) => @cons bool true (@nil bool)) (fun _ vsl : list (list bool) => @List.nth (list bool) O vsl (@nil bool)) (fun _ _ : list (list bool) => @nil bool) v (@nil (list bool)) (@nil (list bool)))) true *) (* Goal: @eq bool false true *) contradict H; omega. (* Goal: @eq bool (bs2bool (sem_rec (fun _ _ : list (list bool) => @cons bool true (@nil bool)) (fun _ vsl : list (list bool) => @List.nth (list bool) O vsl (@nil bool)) (fun _ _ : list (list bool) => @nil bool) v (@nil (list bool)) (@nil (list bool)))) true *) apply IHv; omega. Qed. Lemma is_zero_correct_conv v : bs2bool (sem is_zero_e [v] nil) = false <-> bs2nat v <> 0. Proof. (* Goal: iff (@eq bool (bs2bool (sem is_zero_e (@cons (list bool) v (@nil (list bool))) (@nil (list bool)))) false) (not (@eq nat (bs2nat v) O)) *) intros; split; intros. (* Goal: @eq bool (bs2bool (sem is_zero_e (@cons (list bool) v (@nil (list bool))) (@nil (list bool)))) false *) (* Goal: not (@eq nat (bs2nat v) O) *) intro. (* Goal: @eq bool (bs2bool (sem is_zero_e (@cons (list bool) v (@nil (list bool))) (@nil (list bool)))) false *) (* Goal: False *) apply is_zero_correct in H0. (* Goal: @eq bool (bs2bool (sem is_zero_e (@cons (list bool) v (@nil (list bool))) (@nil (list bool)))) false *) (* Goal: False *) rewrite H in H0; discriminate. (* Goal: @eq bool (bs2bool (sem is_zero_e (@cons (list bool) v (@nil (list bool))) (@nil (list bool)))) false *) apply not_true_is_false. (* Goal: not (@eq bool (bs2bool (sem is_zero_e (@cons (list bool) v (@nil (list bool))) (@nil (list bool)))) true) *) intro; apply is_zero_correct in H0. (* Goal: False *) rewrite H0 in H; auto. Qed. Global Opaque is_zero_e. Definition pred_pos_e : BC := rec (zero_e 0 0) (comp 1 1 (succ true) nil [proj 1 1 1]) (comp 1 1 (succ false) nil [proj 1 1 0]). Lemma pred_pos_correct n : bs2nat n <> 0 -> bs2nat (sem pred_pos_e [n] nil) = Peano.pred (bs2nat n). Proof. (* Goal: forall _ : not (@eq nat (bs2nat n) O), @eq nat (bs2nat (sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) intros; induction n; simpl in *; trivial. (* Goal: @eq nat (bs2nat (if a then @cons bool false n else @cons bool true (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun _ vsl : list (list bool) => @cons bool true (@List.nth (list bool) O vsl (@nil bool))) (fun vnl _ : list (list bool) => @cons bool false (@List.nth (list bool) O vnl (@nil bool))) n (@nil (list bool)) (@nil (list bool))))) (Init.Nat.pred (if a then S (Init.Nat.add (bs2nat n) (Init.Nat.add (bs2nat n) O)) else Init.Nat.add (bs2nat n) (Init.Nat.add (bs2nat n) O))) *) destruct a; simpl. (* Goal: @eq nat (S (Init.Nat.add (bs2nat (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun _ vsl : list (list bool) => @cons bool true (@List.nth (list bool) O vsl (@nil bool))) (fun vnl _ : list (list bool) => @cons bool false (@List.nth (list bool) O vnl (@nil bool))) n (@nil (list bool)) (@nil (list bool)))) (Init.Nat.add (bs2nat (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun _ vsl : list (list bool) => @cons bool true (@List.nth (list bool) O vsl (@nil bool))) (fun vnl _ : list (list bool) => @cons bool false (@List.nth (list bool) O vnl (@nil bool))) n (@nil (list bool)) (@nil (list bool)))) O))) (Init.Nat.pred (Init.Nat.add (bs2nat n) (Init.Nat.add (bs2nat n) O))) *) (* Goal: @eq nat (Init.Nat.add (bs2nat n) (Init.Nat.add (bs2nat n) O)) (Init.Nat.add (bs2nat n) (Init.Nat.add (bs2nat n) O)) *) trivial. (* Goal: @eq nat (S (Init.Nat.add (bs2nat (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun _ vsl : list (list bool) => @cons bool true (@List.nth (list bool) O vsl (@nil bool))) (fun vnl _ : list (list bool) => @cons bool false (@List.nth (list bool) O vnl (@nil bool))) n (@nil (list bool)) (@nil (list bool)))) (Init.Nat.add (bs2nat (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun _ vsl : list (list bool) => @cons bool true (@List.nth (list bool) O vsl (@nil bool))) (fun vnl _ : list (list bool) => @cons bool false (@List.nth (list bool) O vnl (@nil bool))) n (@nil (list bool)) (@nil (list bool)))) O))) (Init.Nat.pred (Init.Nat.add (bs2nat n) (Init.Nat.add (bs2nat n) O))) *) rewrite IHn. (* Goal: not (@eq nat (bs2nat n) O) *) (* Goal: @eq nat (S (Init.Nat.add (Init.Nat.pred (bs2nat n)) (Init.Nat.add (Init.Nat.pred (bs2nat n)) O))) (Init.Nat.pred (Init.Nat.add (bs2nat n) (Init.Nat.add (bs2nat n) O))) *) destruct (bs2nat n). (* Goal: not (@eq nat (bs2nat n) O) *) (* Goal: @eq nat (S (Init.Nat.add (Init.Nat.pred (S n0)) (Init.Nat.add (Init.Nat.pred (S n0)) O))) (Init.Nat.pred (Init.Nat.add (S n0) (Init.Nat.add (S n0) O))) *) (* Goal: @eq nat (S (Init.Nat.add (Init.Nat.pred O) (Init.Nat.add (Init.Nat.pred O) O))) (Init.Nat.pred (Init.Nat.add O (Init.Nat.add O O))) *) elim H; trivial. (* Goal: not (@eq nat (bs2nat n) O) *) (* Goal: @eq nat (S (Init.Nat.add (Init.Nat.pred (S n0)) (Init.Nat.add (Init.Nat.pred (S n0)) O))) (Init.Nat.pred (Init.Nat.add (S n0) (Init.Nat.add (S n0) O))) *) simpl. (* Goal: not (@eq nat (bs2nat n) O) *) (* Goal: @eq nat (S (Init.Nat.add n0 (Init.Nat.add n0 O))) (Init.Nat.add n0 (S (Init.Nat.add n0 O))) *) ring. (* Goal: not (@eq nat (bs2nat n) O) *) omega. Qed. Global Opaque pred_pos_e. Definition pred_e : BC := comp 1 0 cond nil [is_zero_e; pred_pos_e; zero_e 1 0; pred_pos_e]. Lemma pred_correct n : bs2nat (sem pred_e [n] nil) = Peano.pred (bs2nat n). Proof. (* Goal: @eq nat (bs2nat (sem pred_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) simpl; intros. (* Goal: @eq nat (bs2nat match sem is_zero_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)) with | nil => sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)) | cons (true as b) l => @nil bool | cons (false as b) l => sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)) end) (Init.Nat.pred (bs2nat n)) *) case_eq (sem is_zero_e [n] nil); intros. (* Goal: @eq nat (bs2nat (if b then @nil bool else sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) (* Goal: @eq nat (bs2nat (sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) assert (bs2bool (sem is_zero_e [n] nil) = false). (* Goal: @eq nat (bs2nat (if b then @nil bool else sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) (* Goal: @eq nat (bs2nat (sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) (* Goal: @eq bool (bs2bool (sem is_zero_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) false *) rewrite H; simpl; trivial. (* Goal: @eq nat (bs2nat (if b then @nil bool else sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) (* Goal: @eq nat (bs2nat (sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) apply is_zero_correct_conv in H0. (* Goal: @eq nat (bs2nat (if b then @nil bool else sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) (* Goal: @eq nat (bs2nat (sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) apply pred_pos_correct; trivial. (* Goal: @eq nat (bs2nat (if b then @nil bool else sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) destruct b. (* Goal: @eq nat (bs2nat (sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) (* Goal: @eq nat (bs2nat (@nil bool)) (Init.Nat.pred (bs2nat n)) *) assert (bs2bool (sem is_zero_e [n] nil) = true). (* Goal: @eq nat (bs2nat (sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) (* Goal: @eq nat (bs2nat (@nil bool)) (Init.Nat.pred (bs2nat n)) *) (* Goal: @eq bool (bs2bool (sem is_zero_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) true *) rewrite H; simpl; trivial. (* Goal: @eq nat (bs2nat (sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) (* Goal: @eq nat (bs2nat (@nil bool)) (Init.Nat.pred (bs2nat n)) *) apply is_zero_correct in H0. (* Goal: @eq nat (bs2nat (sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) (* Goal: @eq nat (bs2nat (@nil bool)) (Init.Nat.pred (bs2nat n)) *) rewrite H0; simpl; trivial. (* Goal: @eq nat (bs2nat (sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) assert (bs2bool (sem is_zero_e [n] nil) = false). (* Goal: @eq nat (bs2nat (sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) (* Goal: @eq bool (bs2bool (sem is_zero_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) false *) rewrite H; simpl; trivial. (* Goal: @eq nat (bs2nat (sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) apply is_zero_correct_conv in H0. (* Goal: @eq nat (bs2nat (sem pred_pos_e (@cons (list bool) n (@nil (list bool))) (@nil (list bool)))) (Init.Nat.pred (bs2nat n)) *) apply pred_pos_correct; trivial. Qed. Global Opaque pred_e. Notation div2_e := pred. Lemma div2_correct : forall v, bs2nat (sem pred nil [v]) = div2 (bs2nat v). Proof. (* Goal: forall v : list bool, @eq nat (bs2nat (sem pred (@nil (list bool)) (@cons (list bool) v (@nil (list bool))))) (Nat.div2 (bs2nat v)) *) intros v; case v; simpl; trivial; intros. (* Goal: @eq nat (bs2nat l) (Nat.div2 (if b then S (Init.Nat.add (bs2nat l) (Init.Nat.add (bs2nat l) O)) else Init.Nat.add (bs2nat l) (Init.Nat.add (bs2nat l) O))) *) case b. (* Goal: @eq nat (bs2nat l) (Nat.div2 (Init.Nat.add (bs2nat l) (Init.Nat.add (bs2nat l) O))) *) (* Goal: @eq nat (bs2nat l) (Nat.div2 (S (Init.Nat.add (bs2nat l) (Init.Nat.add (bs2nat l) O)))) *) replace (bs2nat l + (bs2nat l + 0)) with (2 * (bs2nat l)). (* Goal: @eq nat (bs2nat l) (Nat.div2 (Init.Nat.add (bs2nat l) (Init.Nat.add (bs2nat l) O))) *) (* Goal: @eq nat (Init.Nat.mul (S (S O)) (bs2nat l)) (Init.Nat.add (bs2nat l) (Init.Nat.add (bs2nat l) O)) *) (* Goal: @eq nat (bs2nat l) (Nat.div2 (S (Init.Nat.mul (S (S O)) (bs2nat l)))) *) rewrite div2_double_plus_one; trivial. (* Goal: @eq nat (bs2nat l) (Nat.div2 (Init.Nat.add (bs2nat l) (Init.Nat.add (bs2nat l) O))) *) (* Goal: @eq nat (Init.Nat.mul (S (S O)) (bs2nat l)) (Init.Nat.add (bs2nat l) (Init.Nat.add (bs2nat l) O)) *) ring. (* Goal: @eq nat (bs2nat l) (Nat.div2 (Init.Nat.add (bs2nat l) (Init.Nat.add (bs2nat l) O))) *) replace (bs2nat l + (bs2nat l + 0)) with (2 * (bs2nat l)). (* Goal: @eq nat (Init.Nat.mul (S (S O)) (bs2nat l)) (Init.Nat.add (bs2nat l) (Init.Nat.add (bs2nat l) O)) *) (* Goal: @eq nat (bs2nat l) (Nat.div2 (Init.Nat.mul (S (S O)) (bs2nat l))) *) rewrite div2_double; trivial. (* Goal: @eq nat (Init.Nat.mul (S (S O)) (bs2nat l)) (Init.Nat.add (bs2nat l) (Init.Nat.add (bs2nat l) O)) *) omega. Qed.
Require Export GeoCoq.Tarski_dev.Ch02_cong. Section T2_1. Context `{Tn:Tarski_neutral_dimensionless}. Lemma bet_col : forall A B C, Bet A B C -> Col A B C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : @Bet Tn A B C), @Col Tn A B C *) intros;unfold Col;auto. Qed. Lemma between_trivial : forall A B : Tpoint, Bet A B B. Proof. (* Goal: forall A B : @Tpoint Tn, @Bet Tn A B B *) intros. (* Goal: @Bet Tn A B B *) prolong A B x B B. (* Goal: @Bet Tn A B B *) assert (x = B) by (apply cong_reverse_identity with B; Cong). (* Goal: @Bet Tn A B B *) subst;assumption. Qed. Lemma between_symmetry : forall A B C : Tpoint, Bet A B C -> Bet C B A. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : @Bet Tn A B C), @Bet Tn C B A *) intros. (* Goal: @Bet Tn C B A *) assert (Bet B C C) by (apply between_trivial). (* Goal: @Bet Tn C B A *) assert(exists x, Bet B x B /\ Bet C x A) by (apply inner_pasch with C;auto). (* Goal: @Bet Tn C B A *) ex_and H1 x. (* Goal: @Bet Tn C B A *) apply between_identity in H1; subst; assumption. Qed. Lemma Bet_cases : forall A B C, Bet A B C \/ Bet C B A -> Bet A B C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : or (@Bet Tn A B C) (@Bet Tn C B A)), @Bet Tn A B C *) intros. (* Goal: @Bet Tn A B C *) decompose [or] H; auto using between_symmetry. Qed. Lemma Bet_perm : forall A B C, Bet A B C -> Bet A B C /\ Bet C B A. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : @Bet Tn A B C), and (@Bet Tn A B C) (@Bet Tn C B A) *) intros. (* Goal: and (@Bet Tn A B C) (@Bet Tn C B A) *) auto using between_symmetry. Qed. Lemma between_trivial2 : forall A B : Tpoint, Bet A A B. Proof. (* Goal: forall A B : @Tpoint Tn, @Bet Tn A A B *) intros. (* Goal: @Bet Tn A A B *) apply between_symmetry. (* Goal: @Bet Tn B A A *) apply between_trivial. Qed. Lemma between_equality : forall A B C : Tpoint, Bet A B C -> Bet B A C -> A = B. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : @Bet Tn B A C), @eq (@Tpoint Tn) A B *) intros. (* Goal: @eq (@Tpoint Tn) A B *) assert (exists x, Bet B x B /\ Bet A x A) by (apply (inner_pasch A B C);assumption). (* Goal: @eq (@Tpoint Tn) A B *) ex_and H1 x. (* Goal: @eq (@Tpoint Tn) A B *) apply between_identity in H1. (* Goal: @eq (@Tpoint Tn) A B *) apply between_identity in H2. (* Goal: @eq (@Tpoint Tn) A B *) congruence. Qed. Lemma between_equality_2 : forall A B C : Tpoint, Bet A B C -> Bet A C B -> B = C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : @Bet Tn A C B), @eq (@Tpoint Tn) B C *) intros. (* Goal: @eq (@Tpoint Tn) B C *) apply between_equality with A; auto using between_symmetry. Qed. Lemma between_exchange3 : forall A B C D, Bet A B C -> Bet A C D -> Bet B C D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : @Bet Tn A C D), @Bet Tn B C D *) intros. (* Goal: @Bet Tn B C D *) assert (exists x, Bet C x C /\ Bet B x D) by (apply inner_pasch with A; apply between_symmetry; auto). (* Goal: @Bet Tn B C D *) ex_and H1 x. (* Goal: @Bet Tn B C D *) assert (C = x) by (apply between_identity; auto); subst; auto. Qed. Lemma bet_neq12__neq : forall A B C, Bet A B C -> A <> B -> A <> C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : not (@eq (@Tpoint Tn) A B)), not (@eq (@Tpoint Tn) A C) *) intros A B C HBet HAB Heq. (* Goal: False *) subst C; apply HAB, between_identity; trivial. Qed. Lemma bet_neq21__neq : forall A B C, Bet A B C -> B <> A -> A <> C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : not (@eq (@Tpoint Tn) B A)), not (@eq (@Tpoint Tn) A C) *) intros A B C HBet HAB. (* Goal: not (@eq (@Tpoint Tn) A C) *) apply bet_neq12__neq with B; auto. Qed. Lemma bet_neq23__neq : forall A B C, Bet A B C -> B <> C -> A <> C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : not (@eq (@Tpoint Tn) B C)), not (@eq (@Tpoint Tn) A C) *) intros A B C HBet HBC Heq. (* Goal: False *) subst C; apply HBC; symmetry. (* Goal: @eq (@Tpoint Tn) A B *) apply between_identity; trivial. Qed. Lemma bet_neq32__neq : forall A B C, Bet A B C -> C <> B -> A <> C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : not (@eq (@Tpoint Tn) C B)), not (@eq (@Tpoint Tn) A C) *) intros A B C HBet HAB. (* Goal: not (@eq (@Tpoint Tn) A C) *) apply bet_neq23__neq with B; auto. Qed. Lemma not_bet_distincts : forall A B C, ~ Bet A B C -> A <> B /\ B <> C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : not (@Bet Tn A B C)), and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) B C)) *) intros A B C HNBet. (* Goal: and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) B C)) *) repeat split; intro; subst B; apply HNBet. (* Goal: @Bet Tn A C C *) (* Goal: @Bet Tn A A C *) apply between_trivial2. (* Goal: @Bet Tn A C C *) apply between_trivial. Qed. End T2_1. Ltac not_exist_hyp_perm_col A B C := not_exist_hyp (Col A B C); not_exist_hyp (Col A C B); not_exist_hyp (Col B A C); not_exist_hyp (Col B C A); not_exist_hyp (Col C A B); not_exist_hyp (Col C B A). Ltac assert_cols := repeat match goal with | H:Bet ?X1 ?X2 ?X3 |- _ => not_exist_hyp_perm_col X1 X2 X3;assert (Col X1 X2 X3) by (apply bet_col;apply H) end. Ltac clean_trivial_hyps := repeat match goal with | H:(Cong ?X1 ?X1 ?X2 ?X2) |- _ => clear H | H:(Cong ?X1 ?X2 ?X2 ?X1) |- _ => clear H | H:(Cong ?X1 ?X2 ?X1 ?X2) |- _ => clear H | H:(Bet ?X1 ?X1 ?X2) |- _ => clear H | H:(Bet ?X2 ?X1 ?X1) |- _ => clear H | H:(Col ?X1 ?X1 ?X2) |- _ => clear H | H:(Col ?X2 ?X1 ?X1) |- _ => clear H | H:(Col ?X1 ?X2 ?X1) |- _ => clear H end. Ltac clean_reap_hyps := clean_duplicated_hyps; repeat match goal with | H:(Col ?A ?B ?C), H2 : Col ?A ?C ?B |- _ => clear H2 | H:(Col ?A ?B ?C), H2 : Col ?B ?A ?C |- _ => clear H2 | H:(Col ?A ?B ?C), H2 : Col ?B ?C ?A |- _ => clear H2 | H:(Col ?A ?B ?C), H2 : Col ?C ?B ?A |- _ => clear H2 | H:(Col ?A ?B ?C), H2 : Col ?C ?A ?B |- _ => clear H2 | H:(Bet ?A ?B ?C), H2 : Bet ?C ?B ?A |- _ => clear H2 | H:(Cong ?A ?B ?C ?D), H2 : Cong ?A ?B ?D ?C |- _ => clear H2 | H:(Cong ?A ?B ?C ?D), H2 : Cong ?C ?D ?A ?B |- _ => clear H2 | H:(Cong ?A ?B ?C ?D), H2 : Cong ?C ?D ?B ?A |- _ => clear H2 | H:(Cong ?A ?B ?C ?D), H2 : Cong ?D ?C ?B ?A |- _ => clear H2 | H:(Cong ?A ?B ?C ?D), H2 : Cong ?D ?C ?A ?B |- _ => clear H2 | H:(Cong ?A ?B ?C ?D), H2 : Cong ?B ?A ?C ?D |- _ => clear H2 | H:(Cong ?A ?B ?C ?D), H2 : Cong ?B ?A ?D ?C |- _ => clear H2 | H:(?A<>?B), H2 : (?B<>?A) |- _ => clear H2 end. Ltac clean := clean_trivial_hyps;clean_reap_hyps. Ltac smart_subst X := subst X;clean. Ltac treat_equalities_aux := repeat match goal with | H:(?X1 = ?X2) |- _ => smart_subst X2 end. Ltac treat_equalities := try treat_equalities_aux; repeat match goal with | H:(Cong ?X3 ?X3 ?X1 ?X2) |- _ => apply cong_symmetry in H; apply cong_identity in H;smart_subst X2 | H:(Cong ?X1 ?X2 ?X3 ?X3) |- _ => apply cong_identity in H;smart_subst X2 | H:(Bet ?X1 ?X2 ?X1) |- _ => apply between_identity in H;smart_subst X2 end. Ltac show_distinct X Y := assert (X<>Y);[unfold not;intro;treat_equalities|idtac]. Hint Resolve between_symmetry bet_col : between. Hint Resolve between_trivial between_trivial2 : between_no_eauto. Ltac eBetween := treat_equalities;eauto with between. Ltac Between := treat_equalities;auto with between between_no_eauto. Section T2_2. Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}. Lemma between_inner_transitivity : forall A B C D, Bet A B D -> Bet B C D -> Bet A B C. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @Bet Tn A B D) (_ : @Bet Tn B C D), @Bet Tn A B C *) intros. (* Goal: @Bet Tn A B C *) assert (exists x, Bet B x B /\ Bet C x A) by (apply inner_pasch with D;auto). (* Goal: @Bet Tn A B C *) ex_and H1 x. (* Goal: @Bet Tn A B C *) Between. Qed. Lemma outer_transitivity_between2 : forall A B C D, Bet A B C -> Bet B C D -> B<>C -> Bet A C D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : @Bet Tn B C D) (_ : not (@eq (@Tpoint Tn) B C)), @Bet Tn A C D *) intros. (* Goal: @Bet Tn A C D *) prolong A C x C D. (* Goal: @Bet Tn A C D *) assert (x = D) by (apply (construction_uniqueness B C C D); try apply (between_exchange3 A B C x); Cong). (* Goal: @Bet Tn A C D *) subst x;assumption. Qed. End T2_2. Hint Resolve outer_transitivity_between2 between_inner_transitivity between_exchange3 : between. Section T2_3. Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}. Lemma between_exchange2 : forall A B C D, Bet A B D -> Bet B C D -> Bet A C D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @Bet Tn A B D) (_ : @Bet Tn B C D), @Bet Tn A C D *) intros. (* Goal: @Bet Tn A C D *) induction (eq_dec_points B C);eBetween. Qed. Lemma outer_transitivity_between : forall A B C D, Bet A B C -> Bet B C D -> B<>C -> Bet A B D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : @Bet Tn B C D) (_ : not (@eq (@Tpoint Tn) B C)), @Bet Tn A B D *) intros. (* Goal: @Bet Tn A B D *) apply between_symmetry. (* Goal: @Bet Tn D B A *) apply (outer_transitivity_between2) with C; Between. Qed. Lemma between_exchange4 : forall A B C D, Bet A B C -> Bet A C D -> Bet A B D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : @Bet Tn A C D), @Bet Tn A B D *) intros. (* Goal: @Bet Tn A B D *) apply between_symmetry. (* Goal: @Bet Tn D B A *) apply between_exchange2 with C; Between. Qed. End T2_3. Hint Resolve between_exchange2 outer_transitivity_between between_exchange4 : between. Section T2_4. Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}. Lemma l3_9_4 : forall A1 A2 A3 A4, Bet_4 A1 A2 A3 A4 -> Bet_4 A4 A3 A2 A1. Proof. (* Goal: forall (A1 A2 A3 A4 : @Tpoint Tn) (_ : @Bet_4 Tn A1 A2 A3 A4), @Bet_4 Tn A4 A3 A2 A1 *) unfold Bet_4. (* Goal: forall (A1 A2 A3 A4 : @Tpoint Tn) (_ : and (@Bet Tn A1 A2 A3) (and (@Bet Tn A2 A3 A4) (and (@Bet Tn A1 A3 A4) (@Bet Tn A1 A2 A4)))), and (@Bet Tn A4 A3 A2) (and (@Bet Tn A3 A2 A1) (and (@Bet Tn A4 A2 A1) (@Bet Tn A4 A3 A1))) *) intros;spliter; auto with between. Qed. Lemma l3_17 : forall A B C A' B' P, Bet A B C -> Bet A' B' C -> Bet A P A' -> exists Q, Bet P Q C /\ Bet B Q B'. Proof. (* Goal: forall (A B C A' B' P : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : @Bet Tn A' B' C) (_ : @Bet Tn A P A'), @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Bet Tn P Q C) (@Bet Tn B Q B')) *) intros. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Bet Tn P Q C) (@Bet Tn B Q B')) *) assert (exists Q', Bet B' Q' A /\ Bet P Q' C) by (eapply inner_pasch;eBetween). (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Bet Tn P Q C) (@Bet Tn B Q B')) *) ex_and H2 x. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Bet Tn P Q C) (@Bet Tn B Q B')) *) assert (exists y, Bet x y C /\ Bet B y B') by (eapply inner_pasch;eBetween). (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Bet Tn P Q C) (@Bet Tn B Q B')) *) ex_and H4 y. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Bet Tn P Q C) (@Bet Tn B Q B')) *) exists y;eBetween. Qed. Lemma lower_dim_ex : exists A B C, ~ (Bet A B C \/ Bet B C A \/ Bet C A B). Proof. (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => not (or (@Bet Tn A B C) (or (@Bet Tn B C A) (@Bet Tn C A B)))))) *) exists PA. (* Goal: @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => not (or (@Bet Tn (@PA Tn) B C) (or (@Bet Tn B C (@PA Tn)) (@Bet Tn C (@PA Tn) B))))) *) exists PB. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => not (or (@Bet Tn (@PA Tn) (@PB Tn) C) (or (@Bet Tn (@PB Tn) C (@PA Tn)) (@Bet Tn C (@PA Tn) (@PB Tn))))) *) exists PC. (* Goal: not (or (@Bet Tn (@PA Tn) (@PB Tn) (@PC Tn)) (or (@Bet Tn (@PB Tn) (@PC Tn) (@PA Tn)) (@Bet Tn (@PC Tn) (@PA Tn) (@PB Tn)))) *) apply lower_dim. Qed. Lemma two_distinct_points : exists X, exists Y: Tpoint, X <> Y. Proof. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => not (@eq (@Tpoint Tn) X Y))) *) assert (ld:=lower_dim_ex). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => not (@eq (@Tpoint Tn) X Y))) *) ex_elim ld A. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => not (@eq (@Tpoint Tn) X Y))) *) ex_elim H B. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => not (@eq (@Tpoint Tn) X Y))) *) ex_elim H0 C. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => not (@eq (@Tpoint Tn) X Y))) *) exists A; exists B. (* Goal: not (@eq (@Tpoint Tn) A B) *) intro; subst; apply H. (* Goal: or (@Bet Tn B B C) (or (@Bet Tn B C B) (@Bet Tn C B B)) *) right; right; apply between_trivial. Qed. Lemma point_construction_different : forall A B, exists C, Bet A B C /\ B <> C. Proof. (* Goal: forall A B : @Tpoint Tn, @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Bet Tn A B C) (not (@eq (@Tpoint Tn) B C))) *) intros. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Bet Tn A B C) (not (@eq (@Tpoint Tn) B C))) *) assert (tdp := two_distinct_points). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Bet Tn A B C) (not (@eq (@Tpoint Tn) B C))) *) ex_elim tdp x. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Bet Tn A B C) (not (@eq (@Tpoint Tn) B C))) *) ex_elim H y. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Bet Tn A B C) (not (@eq (@Tpoint Tn) B C))) *) prolong A B F x y. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Bet Tn A B C) (not (@eq (@Tpoint Tn) B C))) *) exists F. (* Goal: and (@Bet Tn A B F) (not (@eq (@Tpoint Tn) B F)) *) show_distinct B F. (* Goal: and (@Bet Tn A B F) (not (@eq (@Tpoint Tn) B F)) *) (* Goal: False *) intuition. (* Goal: and (@Bet Tn A B F) (not (@eq (@Tpoint Tn) B F)) *) intuition. Qed. Lemma another_point : forall A: Tpoint, exists B, A<>B. Proof. (* Goal: forall A : @Tpoint Tn, @ex (@Tpoint Tn) (fun B : @Tpoint Tn => not (@eq (@Tpoint Tn) A B)) *) intros. (* Goal: @ex (@Tpoint Tn) (fun B : @Tpoint Tn => not (@eq (@Tpoint Tn) A B)) *) assert (pcd := point_construction_different A A). (* Goal: @ex (@Tpoint Tn) (fun B : @Tpoint Tn => not (@eq (@Tpoint Tn) A B)) *) ex_and pcd B. (* Goal: @ex (@Tpoint Tn) (fun B : @Tpoint Tn => not (@eq (@Tpoint Tn) A B)) *) exists B;assumption. Qed. End T2_4. Section Beeson_1. Context `{Tn:Tarski_neutral_dimensionless}. Variable Cong_stability : forall A B C D, ~ ~ Cong A B C D -> Cong A B C D. Lemma l2_11_b : forall A B C A' B' C', Bet A B C -> Bet A' B' C' -> Cong A B A' B' -> Cong B C B' C' -> Cong A C A' C'. Proof. (* Goal: forall (A B C A' B' C' : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : @Bet Tn A' B' C') (_ : @Cong Tn A B A' B') (_ : @Cong Tn B C B' C'), @Cong Tn A C A' C' *) intros. (* Goal: @Cong Tn A C A' C' *) apply Cong_stability; intro. (* Goal: False *) assert (A<>B). (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) A B) *) intro; subst. (* Goal: False *) (* Goal: False *) assert (A'=B') by (apply (cong_identity A' B' B); Cong). (* Goal: False *) (* Goal: False *) subst; tauto. (* Goal: False *) assert (Cong C A C' A') by (apply (five_segment _ _ _ _ _ _ _ _ H1 );auto using cong_trivial_identity, cong_commutativity). (* Goal: False *) apply H3; Cong. Qed. Lemma cong_dec_eq_dec_b : (forall A B:Tpoint, ~ A <> B -> A = B). Proof. (* Goal: forall (A B : @Tpoint Tn) (_ : not (not (@eq (@Tpoint Tn) A B))), @eq (@Tpoint Tn) A B *) intros A B HAB. (* Goal: @eq (@Tpoint Tn) A B *) apply cong_identity with A. (* Goal: @Cong Tn A B A A *) apply Cong_stability. (* Goal: not (not (@Cong Tn A B A A)) *) intro HNCong. (* Goal: False *) apply HAB. (* Goal: not (@eq (@Tpoint Tn) A B) *) intro HEq. (* Goal: False *) subst. (* Goal: False *) apply HNCong. (* Goal: @Cong Tn B B B B *) apply cong_pseudo_reflexivity. Qed. End Beeson_1. Section Beeson_2. Context `{Tn:Tarski_neutral_dimensionless}. Variable Bet_stability : forall A B C, ~ ~ Bet A B C -> Bet A B C. Lemma bet_dec_eq_dec_b : (forall A B:Tpoint, ~ A <> B -> A = B). Proof. (* Goal: forall (A B : @Tpoint Tn) (_ : not (not (@eq (@Tpoint Tn) A B))), @eq (@Tpoint Tn) A B *) intros A B HAB. (* Goal: @eq (@Tpoint Tn) A B *) apply between_identity. (* Goal: @Bet Tn A B A *) apply Bet_stability. (* Goal: not (not (@Bet Tn A B A)) *) intro HNBet. (* Goal: False *) apply HAB. (* Goal: not (@eq (@Tpoint Tn) A B) *) intro HEq. (* Goal: False *) subst. (* Goal: False *) apply HNBet. (* Goal: @Bet Tn B B B *) apply between_trivial. Qed. Lemma BetSEq : forall A B C, BetS A B C <-> Bet A B C /\ A <> B /\ A <> C /\ B <> C. Proof. (* Goal: forall A B C : @Tpoint Tn, iff (@BetS Tn A B C) (and (@Bet Tn A B C) (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A C)) (not (@eq (@Tpoint Tn) B C))))) *) intros; unfold BetS; split; intro; spliter; repeat split; auto; intro; treat_equalities; auto. Qed. End Beeson_2.
Require Import Arith. Require Import ZArith. Require Import Wf_nat. Require Import lemmas. Require Import natZ. Require Import dec. Require Import list. Require Import exp. Require Import divides. Require Import prime. Require Import modulo. Require Import modprime. Require Import fermat. Definition Order (b : Z) (q p : nat) := 0 < q /\ Mod (Exp b q) 1 p /\ (forall d : nat, 0 < d -> Mod (Exp b d) 1 p -> q <= d). Lemma orderdec : forall (b : Z) (q p : nat), Order b q p \/ ~ Order b q p. Proof. (* Goal: forall (b : Z) (q p : nat), or (Order b q p) (not (Order b q p)) *) intros. (* Goal: or (Order b q p) (not (Order b q p)) *) unfold Order in |- *. (* Goal: or (and (lt O q) (and (Mod (Exp b q) (Zpos xH) p) (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d))) (not (and (lt O q) (and (Mod (Exp b q) (Zpos xH) p) (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)))) *) apply anddec. (* Goal: or (and (Mod (Exp b q) (Zpos xH) p) (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) (not (and (Mod (Exp b q) (Zpos xH) p) (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d))) *) (* Goal: or (lt O q) (not (lt O q)) *) apply ltdec. (* Goal: or (and (Mod (Exp b q) (Zpos xH) p) (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) (not (and (Mod (Exp b q) (Zpos xH) p) (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d))) *) apply anddec. (* Goal: or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) (* Goal: or (Mod (Exp b q) (Zpos xH) p) (not (Mod (Exp b q) (Zpos xH) p)) *) apply moddec. (* Goal: or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) elim (exdec (fun d : nat => 0 < d /\ Mod (Exp b d) 1 p) q). (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) (* Goal: forall _ : @ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) right. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) (* Goal: not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) *) intros. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) (* Goal: not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) *) elim H. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) (* Goal: forall (x : nat) (_ : and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p))), not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) *) intro d. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) (* Goal: forall _ : and (lt d q) (and (lt O d) (Mod (Exp b d) (Zpos xH) p)), not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) *) intros. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) (* Goal: not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) *) elim H0. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) (* Goal: forall (_ : lt d q) (_ : and (lt O d) (Mod (Exp b d) (Zpos xH) p)), not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) *) intros. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) (* Goal: not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) *) elim H2. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) (* Goal: forall (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) *) intros. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) (* Goal: not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) *) intro. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) (* Goal: False *) elim (le_not_lt q d). (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) (* Goal: lt d q *) (* Goal: le q d *) apply H5. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) (* Goal: lt d q *) (* Goal: Mod (Exp b d) (Zpos xH) p *) (* Goal: lt O d *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) (* Goal: lt d q *) (* Goal: Mod (Exp b d) (Zpos xH) p *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) (* Goal: lt d q *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), or (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d) (not (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)) *) left. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d *) intros. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: le q d *) elim (le_or_lt q d). (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : lt d q, le q d *) (* Goal: forall _ : le q d, le q d *) intro. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : lt d q, le q d *) (* Goal: le q d *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : lt d q, le q d *) intro. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: le q d *) elim H. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: @ex nat (fun x : nat => and (lt x q) (and (lt O x) (Mod (Exp b x) (Zpos xH) p))) *) split with d. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: and (lt d q) (and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) split. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: and (lt O d) (Mod (Exp b d) (Zpos xH) p) *) (* Goal: lt d q *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: and (lt O d) (Mod (Exp b d) (Zpos xH) p) *) split. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: Mod (Exp b d) (Zpos xH) p *) (* Goal: lt O d *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: Mod (Exp b d) (Zpos xH) p *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) intro. (* Goal: or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) apply anddec. (* Goal: or (Mod (Exp b n) (Zpos xH) p) (not (Mod (Exp b n) (Zpos xH) p)) *) (* Goal: or (lt O n) (not (lt O n)) *) apply ltdec. (* Goal: or (Mod (Exp b n) (Zpos xH) p) (not (Mod (Exp b n) (Zpos xH) p)) *) apply moddec. Qed. Lemma order_ex1 : forall (b : Z) (p : nat), Prime p -> (exists d : nat, 0 < d /\ Mod (Exp b d) 1 p) -> exists x : nat, Order b x p. Proof. (* Goal: forall (b : Z) (p : nat) (_ : Prime p) (_ : @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p))), @ex nat (fun x : nat => Order b x p) *) intros. (* Goal: @ex nat (fun x : nat => Order b x p) *) elim H0. (* Goal: forall (x : nat) (_ : and (lt O x) (Mod (Exp b x) (Zpos xH) p)), @ex nat (fun x0 : nat => Order b x0 p) *) intro. (* Goal: forall _ : and (lt O x) (Mod (Exp b x) (Zpos xH) p), @ex nat (fun x : nat => Order b x p) *) apply (lt_wf_ind x). (* Goal: forall (n : nat) (_ : forall (m : nat) (_ : lt m n) (_ : and (lt O m) (Mod (Exp b m) (Zpos xH) p)), @ex nat (fun x : nat => Order b x p)) (_ : and (lt O n) (Mod (Exp b n) (Zpos xH) p)), @ex nat (fun x : nat => Order b x p) *) intros X IH. (* Goal: forall _ : and (lt O X) (Mod (Exp b X) (Zpos xH) p), @ex nat (fun x : nat => Order b x p) *) intros. (* Goal: @ex nat (fun x : nat => Order b x p) *) elim (exdec (fun m : nat => 0 < m /\ Mod (Exp b m) 1 p) X). (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) (* Goal: forall _ : @ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p))), @ex nat (fun x : nat => Order b x p) *) intro. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) (* Goal: @ex nat (fun x : nat => Order b x p) *) elim H2. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) (* Goal: forall (x : nat) (_ : and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p))), @ex nat (fun x0 : nat => Order b x0 p) *) intros. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) (* Goal: @ex nat (fun x : nat => Order b x p) *) elim H3. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) (* Goal: forall (_ : lt x0 X) (_ : and (lt O x0) (Mod (Exp b x0) (Zpos xH) p)), @ex nat (fun x : nat => Order b x p) *) intros. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) (* Goal: @ex nat (fun x : nat => Order b x p) *) elim H5. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) (* Goal: forall (_ : lt O x0) (_ : Mod (Exp b x0) (Zpos xH) p), @ex nat (fun x : nat => Order b x p) *) intros. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) (* Goal: @ex nat (fun x : nat => Order b x p) *) elim (IH x0). (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) (* Goal: and (lt O x0) (Mod (Exp b x0) (Zpos xH) p) *) (* Goal: lt x0 X *) (* Goal: forall (x : nat) (_ : Order b x p), @ex nat (fun x0 : nat => Order b x0 p) *) intros. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) (* Goal: and (lt O x0) (Mod (Exp b x0) (Zpos xH) p) *) (* Goal: lt x0 X *) (* Goal: @ex nat (fun x : nat => Order b x p) *) split with x1. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) (* Goal: and (lt O x0) (Mod (Exp b x0) (Zpos xH) p) *) (* Goal: lt x0 X *) (* Goal: Order b x1 p *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) (* Goal: and (lt O x0) (Mod (Exp b x0) (Zpos xH) p) *) (* Goal: lt x0 X *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) (* Goal: and (lt O x0) (Mod (Exp b x0) (Zpos xH) p) *) split. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) (* Goal: Mod (Exp b x0) (Zpos xH) p *) (* Goal: lt O x0 *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) (* Goal: Mod (Exp b x0) (Zpos xH) p *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p)))), @ex nat (fun x : nat => Order b x p) *) intros. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: @ex nat (fun x : nat => Order b x p) *) split with X. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: Order b X p *) elim H1. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall (_ : lt O X) (_ : Mod (Exp b X) (Zpos xH) p), Order b X p *) intros. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: Order b X p *) split. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: and (Mod (Exp b X) (Zpos xH) p) (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le X d) *) (* Goal: lt O X *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: and (Mod (Exp b X) (Zpos xH) p) (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le X d) *) split. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le X d *) (* Goal: Mod (Exp b X) (Zpos xH) p *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le X d *) intros. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: le X d *) elim (le_or_lt X d). (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : lt d X, le X d *) (* Goal: forall _ : le X d, le X d *) intro. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : lt d X, le X d *) (* Goal: le X d *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: forall _ : lt d X, le X d *) intros. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: le X d *) elim H2. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: @ex nat (fun x : nat => and (lt x X) (and (lt O x) (Mod (Exp b x) (Zpos xH) p))) *) split with d. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: and (lt d X) (and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) split. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: and (lt O d) (Mod (Exp b d) (Zpos xH) p) *) (* Goal: lt d X *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: and (lt O d) (Mod (Exp b d) (Zpos xH) p) *) split. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: Mod (Exp b d) (Zpos xH) p *) (* Goal: lt O d *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) (* Goal: Mod (Exp b d) (Zpos xH) p *) assumption. (* Goal: forall n : nat, or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) intro. (* Goal: or (and (lt O n) (Mod (Exp b n) (Zpos xH) p)) (not (and (lt O n) (Mod (Exp b n) (Zpos xH) p))) *) apply anddec. (* Goal: or (Mod (Exp b n) (Zpos xH) p) (not (Mod (Exp b n) (Zpos xH) p)) *) (* Goal: or (lt O n) (not (lt O n)) *) apply ltdec. (* Goal: or (Mod (Exp b n) (Zpos xH) p) (not (Mod (Exp b n) (Zpos xH) p)) *) apply moddec. Qed. Lemma order_ex : forall (b : Z) (p : nat), Prime p -> ~ Mod b 0 p -> exists x : nat, x < p /\ Order b x p. Proof. (* Goal: forall (b : Z) (p : nat) (_ : Prime p) (_ : not (Mod b Z0 p)), @ex nat (fun x : nat => and (lt x p) (Order b x p)) *) intros. (* Goal: @ex nat (fun x : nat => and (lt x p) (Order b x 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)), @ex nat (fun x : nat => and (lt x p) (Order b x p)) *) intros. (* Goal: @ex nat (fun x : nat => and (lt x p) (Order b x p)) *) elim (order_ex1 b p H). (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: forall (x : nat) (_ : Order b x p), @ex nat (fun x0 : nat => and (lt x0 p) (Order b x0 p)) *) intros. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: @ex nat (fun x : nat => and (lt x p) (Order b x p)) *) split with x. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: and (lt x p) (Order b x p) *) split. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: Order b x p *) (* Goal: lt x p *) apply le_lt_trans with (pred p). (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: Order b x p *) (* Goal: lt (Init.Nat.pred p) p *) (* Goal: le x (Init.Nat.pred p) *) elim H3. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: Order b x p *) (* Goal: lt (Init.Nat.pred p) p *) (* Goal: forall (_ : lt O x) (_ : and (Mod (Exp b x) (Zpos xH) p) (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le x d)), le x (Init.Nat.pred p) *) intros. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: Order b x p *) (* Goal: lt (Init.Nat.pred p) p *) (* Goal: le x (Init.Nat.pred p) *) elim H5. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: Order b x p *) (* Goal: lt (Init.Nat.pred p) p *) (* Goal: forall (_ : Mod (Exp b x) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le x d), le x (Init.Nat.pred p) *) intros. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: Order b x p *) (* Goal: lt (Init.Nat.pred p) p *) (* Goal: le x (Init.Nat.pred p) *) apply (H7 (pred p)). (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: Order b x p *) (* Goal: lt (Init.Nat.pred p) p *) (* Goal: Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p *) (* Goal: lt O (Init.Nat.pred p) *) apply lt_pred. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: Order b x p *) (* Goal: lt (Init.Nat.pred p) p *) (* Goal: Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p *) (* Goal: lt (S O) p *) assumption. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: Order b x p *) (* Goal: lt (Init.Nat.pred p) p *) (* Goal: Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p *) apply flt. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: Order b x p *) (* Goal: lt (Init.Nat.pred p) p *) (* Goal: not (Mod b Z0 p) *) (* Goal: Prime p *) assumption. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: Order b x p *) (* Goal: lt (Init.Nat.pred p) p *) (* Goal: not (Mod b Z0 p) *) assumption. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: Order b x p *) (* Goal: lt (Init.Nat.pred p) p *) apply lt_pred_n_n. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: Order b x p *) (* Goal: lt O p *) apply lt_trans with 1. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: Order b x p *) (* Goal: lt (S O) p *) (* Goal: lt O (S O) *) apply lt_O_Sn. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: Order b x p *) (* Goal: lt (S O) p *) assumption. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) (* Goal: Order b x p *) assumption. (* Goal: @ex nat (fun d : nat => and (lt O d) (Mod (Exp b d) (Zpos xH) p)) *) split with (pred p). (* Goal: and (lt O (Init.Nat.pred p)) (Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p) *) split. (* Goal: Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p *) (* Goal: lt O (Init.Nat.pred p) *) apply lt_pred. (* Goal: Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p *) (* Goal: lt (S O) p *) assumption. (* Goal: Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p *) apply flt. (* Goal: not (Mod b Z0 p) *) (* Goal: Prime p *) assumption. (* Goal: not (Mod b Z0 p) *) assumption. Qed. Lemma order_div : forall (b : Z) (x p : nat), Order b x p -> forall y : nat, 0 < y -> Mod (Exp b y) 1 p -> Divides x y. Proof. (* Goal: forall (b : Z) (x p : nat) (_ : Order b x p) (y : nat) (_ : lt O y) (_ : Mod (Exp b y) (Zpos xH) p), Divides x y *) intros. (* Goal: Divides x y *) elim H. (* Goal: forall (_ : lt O x) (_ : and (Mod (Exp b x) (Zpos xH) p) (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le x d)), Divides x y *) intros. (* Goal: Divides x y *) elim H3. (* Goal: forall (_ : Mod (Exp b x) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le x d), Divides x y *) intros. (* Goal: Divides x y *) elim (divdec y x). (* Goal: forall _ : not (Divides x y), Divides x y *) (* Goal: forall _ : Divides x y, Divides x y *) intro. (* Goal: forall _ : not (Divides x y), Divides x y *) (* Goal: Divides x y *) assumption. (* Goal: forall _ : not (Divides x y), Divides x y *) intro. (* Goal: Divides x y *) elim (notdiv_rem x y H2 H6). (* Goal: forall (x0 : nat) (_ : @ex nat (fun r : nat => and (lt O r) (and (lt r x) (@eq nat y (Init.Nat.add (Init.Nat.mul x0 x) r))))), Divides x y *) intro q. (* Goal: forall _ : @ex nat (fun r : nat => and (lt O r) (and (lt r x) (@eq nat y (Init.Nat.add (Init.Nat.mul q x) r)))), Divides x y *) intros. (* Goal: Divides x y *) elim H7. (* Goal: forall (x0 : nat) (_ : and (lt O x0) (and (lt x0 x) (@eq nat y (Init.Nat.add (Init.Nat.mul q x) x0)))), Divides x y *) intro r. (* Goal: forall _ : and (lt O r) (and (lt r x) (@eq nat y (Init.Nat.add (Init.Nat.mul q x) r))), Divides x y *) intros. (* Goal: Divides x y *) elim H8. (* Goal: forall (_ : lt O r) (_ : and (lt r x) (@eq nat y (Init.Nat.add (Init.Nat.mul q x) r))), Divides x y *) intros. (* Goal: Divides x y *) elim H10. (* Goal: forall (_ : lt r x) (_ : @eq nat y (Init.Nat.add (Init.Nat.mul q x) r)), Divides x y *) intros. (* Goal: Divides x y *) rewrite H12 in H1. (* Goal: Divides x y *) elim (lt_not_le r x). (* Goal: le x r *) (* Goal: lt r x *) assumption. (* Goal: le x r *) apply H5. (* Goal: Mod (Exp b r) (Zpos xH) p *) (* Goal: lt O r *) assumption. (* Goal: Mod (Exp b r) (Zpos xH) p *) apply mod_trans with (Exp b (q * x) * Exp b r)%Z. (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) (* Goal: Mod (Exp b r) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) apply mod_trans with (Exp (Exp b x) q * Exp b r)%Z. (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) (* Goal: Mod (Exp b r) (Z.mul (Exp (Exp b x) q) (Exp b r)) p *) pattern (Exp b r) at 1 in |- *. (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) (* Goal: (fun z : Z => Mod z (Z.mul (Exp (Exp b x) q) (Exp b r)) p) (Exp b r) *) replace (Exp b r) with (1 * Exp b r)%Z. (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) (* Goal: @eq Z (Z.mul (Zpos xH) (Exp b r)) (Exp b r) *) (* Goal: Mod (Z.mul (Zpos xH) (Exp b r)) (Z.mul (Exp (Exp b x) q) (Exp b r)) p *) apply mod_mult_compat. (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) (* Goal: @eq Z (Z.mul (Zpos xH) (Exp b r)) (Exp b r) *) (* Goal: Mod (Exp b r) (Exp b r) p *) (* Goal: Mod (Zpos xH) (Exp (Exp b x) q) p *) apply mod_sym. (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) (* Goal: @eq Z (Z.mul (Zpos xH) (Exp b r)) (Exp b r) *) (* Goal: Mod (Exp b r) (Exp b r) p *) (* Goal: Mod (Exp (Exp b x) q) (Zpos xH) p *) apply mod_exp1. (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) (* Goal: @eq Z (Z.mul (Zpos xH) (Exp b r)) (Exp b r) *) (* Goal: Mod (Exp b r) (Exp b r) p *) (* Goal: Mod (Exp b x) (Zpos xH) p *) assumption. (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) (* Goal: @eq Z (Z.mul (Zpos xH) (Exp b r)) (Exp b r) *) (* Goal: Mod (Exp b r) (Exp b r) p *) apply mod_refl. (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) (* Goal: @eq Z (Z.mul (Zpos xH) (Exp b r)) (Exp b r) *) apply Zmult_1_l. (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) p *) rewrite mult_comm. (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp b (Nat.mul x q)) (Exp b r)) p *) rewrite exp_mult. (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) (* Goal: Mod (Z.mul (Exp (Exp b x) q) (Exp b r)) (Z.mul (Exp (Exp b x) q) (Exp b r)) p *) apply mod_refl. (* Goal: Mod (Z.mul (Exp b (Init.Nat.mul q x)) (Exp b r)) (Zpos xH) p *) rewrite <- exp_plus. (* Goal: Mod (Exp b (Init.Nat.add (Init.Nat.mul q x) r)) (Zpos xH) p *) assumption. Qed. Lemma order_le_predp : forall (b : Z) (q p : nat), Prime p -> Order b q p -> q <= pred p. Proof. (* Goal: forall (b : Z) (q p : nat) (_ : Prime p) (_ : Order b q p), le q (Init.Nat.pred p) *) intros. (* Goal: le q (Init.Nat.pred 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)), le q (Init.Nat.pred p) *) intros. (* Goal: le q (Init.Nat.pred p) *) elim H0. (* Goal: forall (_ : lt O q) (_ : and (Mod (Exp b q) (Zpos xH) p) (forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d)), le q (Init.Nat.pred p) *) intros. (* Goal: le q (Init.Nat.pred p) *) elim H4. (* Goal: forall (_ : Mod (Exp b q) (Zpos xH) p) (_ : forall (d : nat) (_ : lt O d) (_ : Mod (Exp b d) (Zpos xH) p), le q d), le q (Init.Nat.pred p) *) intros. (* Goal: le q (Init.Nat.pred p) *) apply H6. (* Goal: Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p *) (* Goal: lt O (Init.Nat.pred p) *) apply lt_pred. (* Goal: Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p *) (* Goal: lt (S O) p *) assumption. (* Goal: Mod (Exp b (Init.Nat.pred p)) (Zpos xH) p *) apply flt. (* Goal: not (Mod b Z0 p) *) (* Goal: Prime p *) assumption. (* Goal: not (Mod b Z0 p) *) intro. (* Goal: False *) elim (mod_0not1 p). (* Goal: Mod Z0 (Zpos xH) p *) (* Goal: gt p (S O) *) assumption. (* Goal: Mod Z0 (Zpos xH) p *) apply mod_trans with (Exp b q). (* Goal: Mod (Exp b q) (Zpos xH) p *) (* Goal: Mod Z0 (Exp b q) p *) apply mod_sym. (* Goal: Mod (Exp b q) (Zpos xH) p *) (* Goal: Mod (Exp b q) Z0 p *) apply moda0_exp_compat. (* Goal: Mod (Exp b q) (Zpos xH) p *) (* Goal: gt q O *) (* Goal: Mod b Z0 p *) (* Goal: gt p O *) unfold gt in |- *. (* Goal: Mod (Exp b q) (Zpos xH) p *) (* Goal: gt q O *) (* Goal: Mod b Z0 p *) (* Goal: lt O p *) unfold gt in H1. (* Goal: Mod (Exp b q) (Zpos xH) p *) (* Goal: gt q O *) (* Goal: Mod b Z0 p *) (* Goal: lt O p *) unfold lt in |- *. (* Goal: Mod (Exp b q) (Zpos xH) p *) (* Goal: gt q O *) (* Goal: Mod b Z0 p *) (* Goal: le (S O) p *) apply lt_le_weak. (* Goal: Mod (Exp b q) (Zpos xH) p *) (* Goal: gt q O *) (* Goal: Mod b Z0 p *) (* Goal: lt (S O) p *) assumption. (* Goal: Mod (Exp b q) (Zpos xH) p *) (* Goal: gt q O *) (* Goal: Mod b Z0 p *) assumption. (* Goal: Mod (Exp b q) (Zpos xH) p *) (* Goal: gt q O *) assumption. (* Goal: Mod (Exp b q) (Zpos xH) p *) assumption. Qed.
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 finalg action. From mathcomp Require Import gproduct zmodp commutator cyclic center pgroup sylow frobenius. From mathcomp Require Import vector ssrnum ssrint intdiv algC algnum. From mathcomp Require Import classfun character integral_char. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Import GroupScope GRing.Theory Num.Theory. Local Open Scope ring_scope. Section Basics. Variables (gT : finGroupType) (B : {set gT}) (S : seq 'CF(B)) (A : {set gT}). Definition Zchar : pred_class := [pred phi in 'CF(B, A) | dec_Cint_span (in_tuple S) phi]. Canonical Zchar_keyed := KeyedPred Zchar_key. Lemma cfun0_zchar : 0 \in Zchar. Proof. (* Goal: is_true (@in_mem (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B))) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B))) (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B)) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B))) Zchar)) *) rewrite inE mem0v; apply/sumboolP; exists 0. (* Goal: @eq (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B))) (@BigOp.bigop (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (Finite.sort (ordinal_finType (@size (@classfun gT B) S))) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (index_enum (ordinal_finType (@size (@classfun gT B) S))) (fun i : ordinal (@size (@classfun gT B) S) => @BigBody (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (ordinal (@size (@classfun gT B) S)) i (@GRing.add (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) true (@intmul (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B)) (@nth (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (@tval (@size (@classfun gT B) S) (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (@in_tuple (@classfun gT B) S)) (@nat_of_ord (@size (@classfun gT B) S) i)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size (@classfun gT B) S)) int (GRing.zero (ffun_zmodType (exp_finIndexType (@size (@classfun gT B) S)) int_ZmodType)) i)))) *) by rewrite big1 // => i _; rewrite ffunE. Qed. Fact Zchar_zmod : zmod_closed Zchar. Proof. (* Goal: @GRing.zmod_closed (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B)) Zchar *) split; first exact: cfun0_zchar. (* Goal: @GRing.subr_2closed (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B)) Zchar *) move=> phi xi /andP[Aphi /sumboolP[a Da]] /andP[Axi /sumboolP[b Db]]. (* Goal: is_true (@in_mem (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B))) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B)) phi (@GRing.opp (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B)) xi)) (@mem (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B))) (predPredType (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B)))) Zchar)) *) rewrite inE rpredB // Da Db -sumrB; apply/sumboolP; exists (a - b). (* Goal: @eq (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (@BigOp.bigop (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B))) (Finite.sort (ordinal_finType (@size (@classfun gT B) S))) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B))) (index_enum (ordinal_finType (@size (@classfun gT B) S))) (fun i : Finite.sort (ordinal_finType (@size (@classfun gT B) S)) => @BigBody (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B))) (Finite.sort (ordinal_finType (@size (@classfun gT B) S))) i (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B))) true (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B)) (@intmul (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B)) (@nth (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (@tval (@size (@classfun gT B) S) (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (@in_tuple (@classfun gT B) S)) (@nat_of_ord (@size (@classfun gT B) S) i)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size (@classfun gT B) S)) int a i)) (@GRing.opp (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B)) (@intmul (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B)) (@nth (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (@tval (@size (@classfun gT B) S) (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (@in_tuple (@classfun gT B) S)) (@nat_of_ord (@size (@classfun gT B) S) i)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size (@classfun gT B) S)) int b i)))))) (@BigOp.bigop (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (Finite.sort (ordinal_finType (@size (@classfun gT B) S))) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (index_enum (ordinal_finType (@size (@classfun gT B) S))) (fun i : ordinal (@size (@classfun gT B) S) => @BigBody (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (ordinal (@size (@classfun gT B) S)) i (@GRing.add (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) true (@intmul (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B)) (@nth (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (@tval (@size (@classfun gT B) S) (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT B))) (@in_tuple (@classfun gT B) S)) (@nat_of_ord (@size (@classfun gT B) S) i)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size (@classfun gT B) S)) int (@GRing.add (ffun_zmodType (exp_finIndexType (@size (@classfun gT B) S)) int_ZmodType) a (@GRing.opp (ffun_zmodType (exp_finIndexType (@size (@classfun gT B) S)) int_ZmodType) b)) i)))) *) by apply: eq_bigr => i _; rewrite -mulrzBr !ffunE. Qed. Canonical Zchar_opprPred := OpprPred Zchar_zmod. Canonical Zchar_addrPred := AddrPred Zchar_zmod. Canonical Zchar_zmodPred := ZmodPred Zchar_zmod. Lemma scale_zchar a phi : a \in Cint -> phi \in Zchar -> a *: phi \in Zchar. Proof. (* Goal: forall (_ : is_true (@in_mem Algebraics.Implementation.type a (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint))) (_ : is_true (@in_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B)) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B))) Zchar))), is_true (@in_mem (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@Vector.lmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_vectType gT B))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@Vector.lmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_vectType gT B))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@Vector.lmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_vectType gT B)))))) (@GRing.scale Algebraics.Implementation.ringType (@Vector.lmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_vectType gT B)) a phi) (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B)) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT B))) Zchar)) *) by case/CintP=> m -> Zphi; rewrite scaler_int rpredMz. Qed. End Basics. Notation "''Z[' S , A ]" := (Zchar S A) (at level 8, format "''Z[' S , A ]") : group_scope. Notation "''Z[' S ]" := 'Z[S, setT] (at level 8, format "''Z[' S ]") : group_scope. Section Zchar. Variables (gT : finGroupType) (G : {group gT}). Implicit Types (A B : {set gT}) (S : seq 'CF(G)). Lemma zchar_split S A phi : phi \in 'Z[S, A] = (phi \in 'Z[S]) && (phi \in 'CF(G, A)). Proof. (* Goal: @eq bool (@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)))) (@Zchar gT (@gval gT G) S A))) (andb (@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)))) (@Zchar gT (@gval gT G) S (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@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))))) *) by rewrite !inE cfun_onT andbC. Qed. Lemma zcharD1E phi S : (phi \in 'Z[S, G^#]) = (phi \in 'Z[S]) && (phi 1%g == 0). Proof. (* Goal: @eq bool (@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)))) (@Zchar gT (@gval gT G) S (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT))))))) (andb (@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)))) (@Zchar gT (@gval gT G) S (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (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 zchar_split cfunD1E. Qed. Lemma zcharD1 phi S A : (phi \in 'Z[S, A^#]) = (phi \in 'Z[S, A]) && (phi 1%g == 0). Proof. (* Goal: @eq bool (@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)))) (@Zchar gT (@gval gT G) S (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT))))))) (andb (@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)))) (@Zchar gT (@gval gT G) S 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 zchar_split cfun_onD1 andbA -zchar_split. Qed. Lemma zcharW S A : {subset 'Z[S, A] <= 'Z[S]}. Proof. (* Goal: @sub_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@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)))) (@Zchar gT (@gval gT G) S 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)))) (@Zchar gT (@gval gT G) S (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) *) by move=> phi; rewrite zchar_split => /andP[]. Qed. Lemma zchar_on S A : {subset 'Z[S, A] <= 'CF(G, A)}. Proof. (* Goal: @sub_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@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)))) (@Zchar gT (@gval gT G) S 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 move=> phi /andP[]. Qed. Lemma zchar_onS A B S : A \subset B -> {subset 'Z[S, A] <= 'Z[S, 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))), @sub_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@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)))) (@Zchar gT (@gval gT G) S 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)))) (@Zchar gT (@gval gT G) S B)) *) move=> sAB phi; rewrite zchar_split (zchar_split _ B) => /andP[->]. (* 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 (andb 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) B))))) *) exact: cfun_onS. Qed. Lemma zchar_onG S : 'Z[S, G] =i 'Z[S]. Proof. (* Goal: @eq_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@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)))) (@Zchar gT (@gval gT G) S (@gval gT G))) (@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)))) (@Zchar gT (@gval gT G) S (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) *) by move=> phi; rewrite zchar_split cfun_onG andbT. Qed. Lemma irr_vchar_on A : {subset 'Z[irr G, A] <= 'CF(G, A)}. Proof. (* Goal: @sub_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr 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))) *) exact: zchar_on. Qed. Lemma support_zchar S A phi : phi \in 'Z[S, A] -> support phi \subset 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)))) (@Zchar gT (@gval gT G) S A))), 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)) A))) *) by move/zchar_on; rewrite cfun_onE. Qed. Lemma mem_zchar_on S A phi : phi \in 'CF(G, A) -> phi \in S -> phi \in 'Z[S, 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))) phi (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S))), 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)))) (@Zchar gT (@gval gT G) S A))) *) move=> Aphi /(@tnthP _ _ (in_tuple S))[i Dphi]; rewrite inE /= {}Aphi {phi}Dphi. (* Goal: is_true (andb true (@is_left (@inIntSpan (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G))) (@size (@classfun gT (@gval gT G)) S) (@in_tuple (@classfun gT (@gval gT G)) S) (@tnth (@size (@classfun gT (@gval gT G)) S) (Equality.sort (@cfun_eqType gT (@gval gT G))) (@in_tuple (@classfun gT (@gval gT G)) S) i)) (not (@inIntSpan (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G))) (@size (@classfun gT (@gval gT G)) S) (@in_tuple (@classfun gT (@gval gT G)) S) (@tnth (@size (@classfun gT (@gval gT G)) S) (Equality.sort (@cfun_eqType gT (@gval gT G))) (@in_tuple (@classfun gT (@gval gT G)) S) i))) (@dec_Cint_span (@cfun_vectType gT (@gval gT G)) (@size (@classfun gT (@gval gT G)) S) (@in_tuple (@classfun gT (@gval gT G)) S) (@tnth (@size (@classfun gT (@gval gT G)) S) (Equality.sort (@cfun_eqType gT (@gval gT G))) (@in_tuple (@classfun gT (@gval gT G)) S) i)))) *) apply/sumboolP; exists [ffun j => (j == i)%:Z]. (* Goal: @eq (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) (@tnth (@size (@classfun gT (@gval gT G)) S) (Equality.sort (@cfun_eqType gT (@gval gT G))) (@in_tuple (@classfun gT (@gval gT G)) S) i) (@BigOp.bigop (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) (Finite.sort (ordinal_finType (@size (@classfun gT (@gval gT G)) S))) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) (index_enum (ordinal_finType (@size (@classfun gT (@gval gT G)) S))) (fun i0 : ordinal (@size (@classfun gT (@gval gT G)) S) => @BigBody (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) (ordinal (@size (@classfun gT (@gval gT G)) S)) i0 (@GRing.add (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) true (@intmul (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G))) (@nth (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) (@tval (@size (@classfun gT (@gval gT G)) S) (GRing.Zmodule.sort (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) (@in_tuple (@classfun gT (@gval gT G)) S)) (@nat_of_ord (@size (@classfun gT (@gval gT G)) S) i0)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size (@classfun gT (@gval gT G)) S)) int (@FunFinfun.finfun (ordinal_finType (@size (@classfun gT (@gval gT G)) S)) int (fun j : Finite.sort (ordinal_finType (@size (@classfun gT (@gval gT G)) S)) => Posz (nat_of_bool (@eq_op (Finite.eqType (ordinal_finType (@size (@classfun gT (@gval gT G)) S))) j i)))) i0)))) *) rewrite (bigD1 i) //= ffunE eqxx (tnth_nth 0) big1 ?addr0 // => j i'j. (* Goal: @eq (@classfun gT (@gval gT G)) (@intmul (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G))) (@nth (@classfun gT (@gval gT G)) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) S (@nat_of_ord (@size (@classfun gT (@gval gT G)) S) j)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size (@classfun gT (@gval gT G)) S)) int (@FunFinfun.finfun (ordinal_finType (@size (@classfun gT (@gval gT G)) S)) int (fun j : ordinal (@size (@classfun gT (@gval gT G)) S) => Posz (nat_of_bool (@eq_op (Finite.eqType (ordinal_finType (@size (@classfun gT (@gval gT G)) S))) j i)))) j)) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) *) by rewrite ffunE (negPf i'j). Qed. Lemma mem_zchar S phi : phi \in S -> phi \in 'Z[S]. Proof. (* Goal: forall _ : is_true (@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))) S)), is_true (@in_mem (Equality.sort (@cfun_eqType 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)))) (@Zchar gT (@gval gT G) S (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) by move=> Sphi; rewrite mem_zchar_on ?cfun_onT. Qed. Lemma zchar_nth_expansion S A phi : phi \in 'Z[S, A] -> {z | forall i, z i \in Cint & phi = \sum_(i < size S) z i *: S`_i}. 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)))) (@Zchar gT (@gval gT G) S A))), @sig2 (forall _ : ordinal (@size (@classfun gT (@gval gT G)) S), Algebraics.Implementation.type) (fun z : forall _ : ordinal (@size (@classfun gT (@gval gT G)) S), Algebraics.Implementation.type => forall i : ordinal (@size (@classfun gT (@gval gT G)) S), is_true (@in_mem Algebraics.Implementation.type (z i) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint))) (fun z : forall _ : ordinal (@size (@classfun gT (@gval gT G)) S), Algebraics.Implementation.type => @eq (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) phi (@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)))))) (Finite.sort (ordinal_finType (@size (@classfun gT (@gval gT G)) S))) (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)))))) (index_enum (ordinal_finType (@size (@classfun gT (@gval gT G)) S))) (fun i : ordinal (@size (@classfun gT (@gval gT G)) S) => @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)))))) (ordinal (@size (@classfun gT (@gval gT G)) S)) 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.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) (z i) (@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)))))) *) case/andP=> _ /sumboolP/sig_eqW[/= z ->]. (* Goal: @sig2 (forall _ : ordinal (@size (@classfun gT (@gval gT G)) S), Algebraics.Implementation.type) (fun z : forall _ : ordinal (@size (@classfun gT (@gval gT G)) S), Algebraics.Implementation.type => forall i : ordinal (@size (@classfun gT (@gval gT G)) S), is_true (@in_mem Algebraics.Implementation.type (z i) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint))) (fun z0 : forall _ : ordinal (@size (@classfun gT (@gval gT G)) S), Algebraics.Implementation.type => @eq (@classfun gT (@gval gT G)) (@BigOp.bigop (@classfun gT (@gval gT G)) (ordinal (@size (@classfun gT (@gval gT G)) S)) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) (index_enum (ordinal_finType (@size (@classfun gT (@gval gT G)) S))) (fun i : ordinal (@size (@classfun gT (@gval gT G)) S) => @BigBody (@classfun gT (@gval gT G)) (ordinal (@size (@classfun gT (@gval gT G)) S)) i (@GRing.add (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) true (@intmul (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G))) (@nth (@classfun gT (@gval gT G)) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) S (@nat_of_ord (@size (@classfun gT (@gval gT G)) S) i)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size (@classfun gT (@gval gT G)) S)) int z i)))) (@BigOp.bigop (@classfun gT (@gval gT G)) (ordinal (@size (@classfun gT (@gval gT G)) S)) (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))))) (index_enum (ordinal_finType (@size (@classfun gT (@gval gT G)) S))) (fun i : ordinal (@size (@classfun gT (@gval gT G)) S) => @BigBody (@classfun gT (@gval gT G)) (ordinal (@size (@classfun gT (@gval gT G)) S)) i (@GRing.add (@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))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) (z0 i) (@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)))))) *) exists (intr \o z) => [i|]; first exact: Cint_int. (* Goal: @eq (@classfun gT (@gval gT G)) (@BigOp.bigop (@classfun gT (@gval gT G)) (ordinal (@size (@classfun gT (@gval gT G)) S)) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) (index_enum (ordinal_finType (@size (@classfun gT (@gval gT G)) S))) (fun i : ordinal (@size (@classfun gT (@gval gT G)) S) => @BigBody (@classfun gT (@gval gT G)) (ordinal (@size (@classfun gT (@gval gT G)) S)) i (@GRing.add (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) true (@intmul (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G))) (@nth (@classfun gT (@gval gT G)) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) S (@nat_of_ord (@size (@classfun gT (@gval gT G)) S) i)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size (@classfun gT (@gval gT G)) S)) int z i)))) (@BigOp.bigop (@classfun gT (@gval gT G)) (ordinal (@size (@classfun gT (@gval gT G)) S)) (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))))) (index_enum (ordinal_finType (@size (@classfun gT (@gval gT G)) S))) (fun i : ordinal (@size (@classfun gT (@gval gT G)) S) => @BigBody (@classfun gT (@gval gT G)) (ordinal (@size (@classfun gT (@gval gT G)) S)) i (@GRing.add (@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))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) (@funcomp (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) int (Finite.sort (exp_finIndexType (@size (@classfun gT (@gval gT G)) S))) tt (@intmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size (@classfun gT (@gval gT G)) S)) int z) i) (@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))))) *) by apply: eq_bigr => i _; rewrite scaler_int. Qed. Lemma zchar_tuple_expansion n (S : n.-tuple 'CF(G)) A phi : 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)))) (@Zchar gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S) A))), @sig2 (forall _ : ordinal n, Algebraics.Implementation.type) (fun z : forall _ : ordinal n, Algebraics.Implementation.type => forall i : ordinal n, is_true (@in_mem Algebraics.Implementation.type (z i) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint))) (fun z : forall _ : ordinal n, Algebraics.Implementation.type => @eq (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) phi (@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)))))) (Finite.sort (ordinal_finType n)) (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)))))) (index_enum (ordinal_finType n)) (fun i : ordinal n => @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)))))) (ordinal n) 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.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) (z i) (@nth (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S) (@nat_of_ord n i)))))) *) by move/zchar_nth_expansion; rewrite size_tuple. Qed. Lemma zchar_expansion S A phi : uniq S -> phi \in 'Z[S, A] -> {z | forall xi, z xi \in Cint & phi = \sum_(xi <- S) z xi *: xi}. Lemma zchar_span S A : {subset 'Z[S, A] <= <<S>>%VS}. Proof. (* Goal: @sub_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@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)))) (@Zchar gT (@gval gT G) S 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)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S))) *) move=> _ /zchar_nth_expansion[z Zz ->] /=. (* Goal: is_true (@in_mem (@classfun gT (@gval gT G)) (@BigOp.bigop (@classfun gT (@gval gT G)) (ordinal (@size (@classfun gT (@gval gT G)) S)) (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))))) (index_enum (ordinal_finType (@size (@classfun gT (@gval gT G)) S))) (fun i : ordinal (@size (@classfun gT (@gval gT G)) S) => @BigBody (@classfun gT (@gval gT G)) (ordinal (@size (@classfun gT (@gval gT G)) S)) i (@GRing.add (@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))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) (z i) (@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))))) (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@classfun gT (@gval gT G))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S)))) *) by apply: rpred_sum => i _; rewrite rpredZ // memv_span ?mem_nth. Qed. Lemma zchar_trans S1 S2 A B : {subset S1 <= 'Z[S2, B]} -> {subset 'Z[S1, A] <= 'Z[S2, A]}. 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 (@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)))) (@Zchar gT (@gval gT G) S2 B)), @sub_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@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)))) (@Zchar gT (@gval gT G) S1 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)))) (@Zchar gT (@gval gT G) S2 A)) *) move=> sS12 phi; rewrite !(zchar_split _ A) andbC => /andP[->]; rewrite andbT. (* 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)))) (@Zchar gT (@gval gT G) S1 (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), 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)))) (@Zchar gT (@gval gT G) S2 (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) case/zchar_nth_expansion=> z Zz ->; apply: rpred_sum => i _. (* Goal: is_true (@in_mem (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.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) (z i) (@nth (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) S1 (@nat_of_ord (@size (@classfun gT (@gval gT G)) S1) i))) (@mem (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (predPredType (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (@unkey_pred (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@Zchar gT (@gval gT G) S2 (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) (@GRing.Pred.add_key (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@Zchar gT (@gval gT G) S2 (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) (@Zchar_addrPred gT (@gval gT G) S2 (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) (@Zchar_keyed gT (@gval gT G) S2 (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))))) *) by rewrite scale_zchar // (@zcharW _ B) ?sS12 ?mem_nth. Qed. Lemma zchar_trans_on S1 S2 A : {subset S1 <= 'Z[S2, A]} -> {subset 'Z[S1] <= 'Z[S2, A]}. 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 (@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)))) (@Zchar gT (@gval gT G) S2 A)), @sub_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@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)))) (@Zchar gT (@gval gT G) S1 (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) (@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)))) (@Zchar gT (@gval gT G) S2 A)) *) move=> sS12 _ /zchar_nth_expansion[z Zz ->]; apply: rpred_sum => i _. (* Goal: is_true (@in_mem (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.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) (z i) (@nth (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) S1 (@nat_of_ord (@size (@classfun gT (@gval gT G)) S1) i))) (@mem (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (predPredType (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (@unkey_pred (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@Zchar gT (@gval gT G) S2 A) (@GRing.Pred.add_key (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@Zchar gT (@gval gT G) S2 A) (@Zchar_addrPred gT (@gval gT G) S2 A)) (@Zchar_keyed gT (@gval gT G) S2 A)))) *) by rewrite scale_zchar // sS12 ?mem_nth. Qed. Lemma zchar_sub_irr S A : {subset S <= 'Z[irr G]} -> {subset 'Z[S, A] <= 'Z[irr G, A]}. 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))) S) (@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)))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))), @sub_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@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)))) (@Zchar gT (@gval gT G) S 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)))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) A)) *) exact: zchar_trans. Qed. Lemma zchar_subset S1 S2 A : {subset S1 <= S2} -> {subset 'Z[S1, A] <= 'Z[S2, A]}. 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), @sub_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@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)))) (@Zchar gT (@gval gT G) S1 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)))) (@Zchar gT (@gval gT G) S2 A)) *) move=> sS12; apply: zchar_trans setT _ => // f /sS12 S2f. (* Goal: is_true (@in_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) f (@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)))) (@Zchar gT (@gval gT G) S2 (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) by rewrite mem_zchar. Qed. Lemma zchar_subseq S1 S2 A : subseq S1 S2 -> {subset 'Z[S1, A] <= 'Z[S2, A]}. Proof. (* Goal: forall _ : is_true (@subseq (@cfun_eqType gT (@gval gT G)) S1 S2), @sub_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@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)))) (@Zchar gT (@gval gT G) S1 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)))) (@Zchar gT (@gval gT G) S2 A)) *) by move/mem_subseq; apply: zchar_subset. Qed. Lemma zchar_filter S A (p : pred 'CF(G)) : {subset 'Z[filter p S, A] <= 'Z[S, A]}. Proof. (* Goal: @sub_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@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)))) (@Zchar gT (@gval gT G) (@filter (@classfun gT (@gval gT G)) p S) 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)))) (@Zchar gT (@gval gT G) S A)) *) by apply: zchar_subset=> f; apply/mem_subseq/filter_subseq. Qed. End Zchar. Section VChar. Variables (gT : finGroupType) (G : {group gT}). Implicit Types (A B : {set gT}) (phi chi : 'CF(G)) (S : seq 'CF(G)). Lemma char_vchar chi : chi \is a character -> chi \in 'Z[irr G]. Proof. (* Goal: forall _ : is_true (@in_mem (@classfun gT (@gval gT G)) chi (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@has_quality (S O) (@classfun gT (@gval gT G)) (@character gT (@gval gT G))))), is_true (@in_mem (@classfun gT (@gval gT G)) chi (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) case/char_sum_irr=> r ->; apply: rpred_sum => i _. (* Goal: is_true (@in_mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (predPredType (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G)))) (@unkey_pred (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) (@GRing.Pred.add_key (@cfun_zmodType gT (@gval gT G)) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) (@Zchar_addrPred gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) (@Zchar_keyed gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))))) *) by rewrite mem_zchar ?mem_tnth. Qed. Lemma irr_vchar i : 'chi[G]_i \in 'Z[irr G]. Proof. (* Goal: is_true (@in_mem (@classfun gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) exact/char_vchar/irr_char. Qed. Lemma vcharP phi : reflect (exists2 chi1, chi1 \is a character & exists2 chi2, chi2 \is a character & phi = chi1 - chi2) (phi \in 'Z[irr G]). Lemma Aint_vchar phi x : phi \in 'Z[irr G] -> phi x \in Aint. 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), is_true (@in_mem Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) phi x) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *) case/vcharP=> [chi1 Nchi1 [chi2 Nchi2 ->]]. (* Goal: is_true (@in_mem Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@GRing.add (@cfun_zmodType gT (@gval gT G)) chi1 (@GRing.opp (@cfun_zmodType gT (@gval gT G)) chi2)) x) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *) by rewrite !cfunE rpredB ?Aint_char. Qed. Lemma Cint_vchar1 phi : phi \in 'Z[irr G] -> phi 1%g \in Cint. 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), is_true (@in_mem Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) phi (oneg (FinGroup.base gT))) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint)) *) case/vcharP=> phi1 Nphi1 [phi2 Nphi2 ->]. (* Goal: is_true (@in_mem Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@GRing.add (@cfun_zmodType gT (@gval gT G)) phi1 (@GRing.opp (@cfun_zmodType gT (@gval gT G)) phi2)) (oneg (FinGroup.base gT))) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint)) *) by rewrite !cfunE rpredB // rpred_Cnat ?Cnat_char1. Qed. Lemma Cint_cfdot_vchar_irr i phi : phi \in 'Z[irr G] -> '[phi, 'chi_i] \in Cint. 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint)) *) case/vcharP=> chi1 Nchi1 [chi2 Nchi2 ->]. (* Goal: is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.add (@cfun_zmodType gT (@gval gT G)) chi1 (@GRing.opp (@cfun_zmodType gT (@gval gT G)) chi2)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint)) *) by rewrite cfdotBl rpredB // rpred_Cnat ?Cnat_cfdot_char_irr. Qed. Lemma cfdot_vchar_r phi psi : psi \in 'Z[irr G] -> '[phi, psi] = \sum_i '[phi, 'chi_i] * '[psi, 'chi_i]. Lemma Cint_cfdot_vchar : {in 'Z[irr G] &, forall phi psi, '[phi, psi] \in Cint}. Proof. (* Goal: @prop_in2 (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) (fun phi psi : @classfun gT (@gval gT G) => is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint))) (inPhantom (forall phi psi : @classfun gT (@gval gT G), is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint)))) *) move=> phi psi Zphi Zpsi; rewrite /= cfdot_vchar_r // rpred_sum // => k _. (* Goal: is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) phi (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) k)) (@cfdot gT (@gval gT G) psi (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) k))) (@mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (predPredType (GRing.Zmodule.sort Algebraics.Implementation.zmodType)) (@unkey_pred (GRing.Zmodule.sort Algebraics.Implementation.zmodType) Cint (@GRing.Pred.add_key Algebraics.Implementation.zmodType Cint Cint_addrPred) Cint_keyed))) *) by rewrite rpredM ?Cint_cfdot_vchar_irr. Qed. Lemma Cnat_cfnorm_vchar : {in 'Z[irr G], forall phi, '[phi] \in Cnat}. Proof. (* Goal: @prop_in1 (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) (fun phi : @classfun gT (@gval gT G) => is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cnat))) (inPhantom (forall phi : @classfun gT (@gval gT G), is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cnat)))) *) by move=> phi Zphi; rewrite /= CnatEint cfnorm_ge0 Cint_cfdot_vchar. Qed. Fact vchar_mulr_closed : mulr_closed 'Z[irr G]. Proof. (* Goal: @GRing.mulr_closed (@cfun_ringType gT (@gval gT G)) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) *) split; first exact: cfun1_vchar. (* Goal: @GRing.mulr_2closed (@cfun_ringType gT (@gval gT G)) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) *) move=> _ _ /vcharP[xi1 Nxi1 [xi2 Nxi2 ->]] /vcharP[xi3 Nxi3 [xi4 Nxi4 ->]]. (* Goal: is_true (@in_mem (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) (@GRing.mul (@cfun_ringType gT (@gval gT G)) (@GRing.add (@cfun_zmodType gT (@gval gT G)) xi1 (@GRing.opp (@cfun_zmodType gT (@gval gT G)) xi2)) (@GRing.add (@cfun_zmodType gT (@gval gT G)) xi3 (@GRing.opp (@cfun_zmodType gT (@gval gT G)) xi4))) (@mem (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) (predPredType (GRing.Ring.sort (@cfun_ringType gT (@gval gT G)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) by rewrite mulrBl !mulrBr !(rpredB, rpredD) // char_vchar ?rpredM. Qed. Canonical vchar_mulrPred := MulrPred vchar_mulr_closed. Canonical vchar_smulrPred := SmulrPred vchar_mulr_closed. Canonical vchar_semiringPred := SemiringPred vchar_mulr_closed. Canonical vchar_subringPred := SubringPred vchar_mulr_closed. Lemma mul_vchar A : {in 'Z[irr G, A] &, forall phi psi, phi * psi \in 'Z[irr G, A]}. Proof. (* Goal: @prop_in2 (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) A)) (fun (phi : @classfun gT (@gval gT G)) (psi : GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) => is_true (@in_mem (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) (@GRing.mul (@cfun_ringType 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) A)))) (inPhantom (forall (phi : @classfun gT (@gval gT G)) (psi : GRing.Ring.sort (@cfun_ringType gT (@gval gT G))), is_true (@in_mem (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) (@GRing.mul (@cfun_ringType 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) A))))) *) move=> phi psi; rewrite zchar_split => /andP[Zphi Aphi] /zcharW Zpsi. (* Goal: is_true (@in_mem (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) (@GRing.mul (@cfun_ringType 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) A))) *) rewrite zchar_split rpredM //; apply/cfun_onP=> x A'x. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@GRing.mul (@cfun_ringType gT (@gval gT G)) phi psi) x) (GRing.zero Algebraics.Implementation.zmodType) *) by rewrite cfunE (cfun_onP Aphi) ?mul0r. Qed. Section CfdotPairwiseOrthogonal. Variables (M : {group gT}) (S : seq 'CF(G)) (nu : 'CF(G) -> 'CF(M)). Hypotheses (Inu : {in 'Z[S] &, isometry nu}) (oSS : pairwise_orthogonal S). Let freeS := orthogonal_free oSS. Let uniqS : uniq S := free_uniq freeS. Let Z_S : {subset S <= 'Z[S]}. Proof. by move=> phi; apply: mem_zchar. Qed. Proof. (* 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))) S) (@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)))) (@Zchar gT (@gval gT G) S (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) *) by move=> phi; apply: mem_zchar. Qed. Let dotSS := proj2 (pairwise_orthogonalP oSS). Lemma map_pairwise_orthogonal : pairwise_orthogonal (map nu S). Lemma cfproj_sum_orthogonal P z phi : phi \in S -> '[\sum_(xi <- S | P xi) z xi *: nu xi, nu phi] = if P phi then z phi * '[phi] else 0. Proof. (* Goal: forall _ : 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)), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT M) (@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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) S (fun xi : @classfun gT (@gval gT G) => @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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) xi (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (P xi) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT M)) (z xi) (nu xi)))) (nu phi)) (if P phi then @GRing.mul Algebraics.Implementation.ringType (z phi) (@cfdot gT (@gval gT G) phi phi) else GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) *) move=> Sphi; have defS := perm_to_rem Sphi. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT M) (@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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) S (fun xi : @classfun gT (@gval gT G) => @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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) xi (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (P xi) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT M)) (z xi) (nu xi)))) (nu phi)) (if P phi then @GRing.mul Algebraics.Implementation.ringType (z phi) (@cfdot gT (@gval gT G) phi phi) else GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) *) rewrite cfdot_suml (eq_big_perm _ defS) big_cons /= cfdotZl Inu ?Z_S //. (* Goal: @eq Algebraics.Implementation.type (if P phi then @GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul Algebraics.Implementation.ringType (z phi) (@cfdot gT (@gval gT G) phi phi)) (@BigOp.bigop Algebraics.Implementation.type (@classfun gT (@gval gT G)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@rem (@cfun_eqType gT (@gval gT G)) phi S) (fun j : @classfun gT (@gval gT G) => @BigBody Algebraics.Implementation.type (@classfun gT (@gval gT G)) j (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (P j) (@cfdot gT (@gval gT M) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT M)) (z j) (nu j)) (nu phi)))) else @BigOp.bigop Algebraics.Implementation.type (@classfun gT (@gval gT G)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@rem (@cfun_eqType gT (@gval gT G)) phi S) (fun j : @classfun gT (@gval gT G) => @BigBody Algebraics.Implementation.type (@classfun gT (@gval gT G)) j (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (P j) (@cfdot gT (@gval gT M) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT M)) (z j) (nu j)) (nu phi)))) (if P phi then @GRing.mul Algebraics.Implementation.ringType (z phi) (@cfdot gT (@gval gT G) phi phi) else GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) *) rewrite big1_seq ?addr0 // => xi; rewrite mem_rem_uniq ?inE //. (* Goal: forall _ : is_true (andb (P xi) (andb (negb (@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)))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT M) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT M)) (z xi) (nu xi)) (nu phi)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) by case/and3P=> _ neq_xi Sxi; rewrite cfdotZl Inu ?Z_S // dotSS ?mulr0. Qed. Lemma cfdot_sum_orthogonal z1 z2 : '[\sum_(xi <- S) z1 xi *: nu xi, \sum_(xi <- S) z2 xi *: nu xi] = \sum_(xi <- S) z1 xi * (z2 xi)^* * '[xi]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT M) (@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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) S (fun xi : @classfun gT (@gval gT G) => @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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) xi (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT M)) (z1 xi) (nu xi)))) (@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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) S (fun xi : @classfun gT (@gval gT G) => @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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) xi (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT M)) (z2 xi) (nu xi))))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@classfun gT (@gval gT G)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@classfun gT (@gval gT G)) xi (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) true (@GRing.mul Algebraics.Implementation.ringType (@GRing.mul Algebraics.Implementation.ringType (z1 xi) (@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) (z2 xi))) (@cfdot gT (@gval gT G) xi xi)))) *) rewrite cfdot_sumr; apply: eq_big_seq => phi Sphi. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT M) (@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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) S (fun xi : @classfun gT (@gval gT G) => @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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) xi (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT M)) (z1 xi) (nu xi)))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT M)) (z2 phi) (nu phi))) (@GRing.mul Algebraics.Implementation.ringType (@GRing.mul Algebraics.Implementation.ringType (z1 phi) (@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) (z2 phi))) (@cfdot gT (@gval gT G) phi phi)) *) by rewrite cfdotZr cfproj_sum_orthogonal // mulrCA mulrA. Qed. Lemma cfnorm_sum_orthogonal z : '[\sum_(xi <- S) z xi *: nu xi] = \sum_(xi <- S) `|z xi| ^+ 2 * '[xi]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT M) (@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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) S (fun xi : @classfun gT (@gval gT G) => @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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) xi (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT M)) (z xi) (nu xi)))) (@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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) S (fun xi : @classfun gT (@gval gT G) => @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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) xi (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT M)) (z xi) (nu xi))))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) (@classfun gT (@gval gT G)) (GRing.zero (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) (@classfun gT (@gval gT G)) xi (@GRing.add (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) true (@GRing.mul (Num.NumDomain.ringType Algebraics.Implementation.numDomainType) (@GRing.exp (Num.NumDomain.ringType Algebraics.Implementation.numDomainType) (@Num.Def.normr Algebraics.Implementation.numDomainType (z xi)) (Datatypes.S (Datatypes.S O))) (@cfdot gT (@gval gT G) xi xi)))) *) by rewrite cfdot_sum_orthogonal; apply: eq_bigr => xi _; rewrite normCK. Qed. Lemma cfnorm_orthogonal : '[\sum_(xi <- S) nu xi] = \sum_(xi <- S) '[xi]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT M) (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT M))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT M))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT M))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT M))) true (nu xi))) (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT M))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT M))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT M))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT M))) true (nu xi)))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@classfun gT (@gval gT G)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@classfun gT (@gval gT G)) xi (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) true (@cfdot gT (@gval gT G) xi xi))) *) rewrite -(eq_bigr _ (fun _ _ => scale1r _)) cfnorm_sum_orthogonal. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) (@classfun gT (@gval gT G)) (GRing.zero (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) (@classfun gT (@gval gT G)) xi (@GRing.add (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) true (@GRing.mul (Num.NumDomain.ringType Algebraics.Implementation.numDomainType) (@GRing.exp (Num.NumDomain.ringType Algebraics.Implementation.numDomainType) (@Num.Def.normr Algebraics.Implementation.numDomainType (GRing.one Algebraics.Implementation.ringType)) (Datatypes.S (Datatypes.S O))) (@cfdot gT (@gval gT G) xi xi)))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@classfun gT (@gval gT G)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@classfun gT (@gval gT G)) xi (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) true (@cfdot gT (@gval gT G) xi xi))) *) by apply: eq_bigr => xi; rewrite normCK conjC1 !mul1r. Qed. End CfdotPairwiseOrthogonal. Lemma orthogonal_span S phi : pairwise_orthogonal S -> phi \in <<S>>%VS -> {z | z = fun xi => '[phi, xi] / '[xi] & phi = \sum_(xi <- S) z xi *: xi}. Proof. (* Goal: forall (_ : is_true (@pairwise_orthogonal gT (@gval gT G) S)) (_ : 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)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S))))), @sig2 (forall _ : @classfun gT (@gval gT G), GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (fun z : forall _ : @classfun gT (@gval gT G), GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) => @eq (forall _ : @classfun gT (@gval gT G), GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) z (fun xi : @classfun gT (@gval gT G) => @GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) phi xi) (@GRing.inv Algebraics.Implementation.unitRingType (@cfdot gT (@gval gT G) xi xi)))) (fun z : forall _ : @classfun gT (@gval gT G), GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) => @eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@classfun gT (@gval gT G)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@classfun gT (@gval gT G)) xi (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) true (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (z xi) xi)))) *) move=> oSS /free_span[|c -> _]; first exact: orthogonal_free. (* Goal: @sig2 (forall _ : @classfun gT (@gval gT G), GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (fun z : forall _ : @classfun gT (@gval gT G), GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) => @eq (forall _ : @classfun gT (@gval gT G), GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) z (fun xi : @classfun gT (@gval gT G) => @GRing.mul (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))))))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType 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))))))) S (fun x : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => @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))))))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) 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 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))) (c x) x))) xi) (@GRing.inv Algebraics.Implementation.unitRingType (@cfdot gT (@gval gT G) xi xi)))) (fun z : forall _ : @classfun gT (@gval gT G), GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) => @eq (@classfun 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))))))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType 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))))))) S (fun x : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => @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))))))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) 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 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))) (c x) x))) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@classfun gT (@gval gT G)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@classfun gT (@gval gT G)) xi (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) true (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (z xi) xi)))) *) set z := fun _ => _ : algC; exists z => //; apply: eq_big_seq => u Su. (* Goal: @eq (@classfun 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))) (c u) u) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (z u) u) *) rewrite /z cfproj_sum_orthogonal // mulfK // cfnorm_eq0. (* Goal: is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) u (GRing.zero (@cfun_zmodType gT (@gval gT G))))) *) by rewrite (memPn _ u Su); case/andP: oSS. Qed. Section CfDotOrthonormal. Variables (M : {group gT}) (S : seq 'CF(G)) (nu : 'CF(G) -> 'CF(M)). Hypotheses (Inu : {in 'Z[S] &, isometry nu}) (onS : orthonormal S). Let oSS := orthonormal_orthogonal onS. Let freeS := orthogonal_free oSS. Let nS1 : {in S, forall phi, '[phi] = 1}. Proof. (* Goal: @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 phi) (GRing.one (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 phi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) *) by move=> phi Sphi; case/orthonormalP: onS => _ -> //; rewrite eqxx. Qed. Lemma map_orthonormal : orthonormal (map nu S). Proof. (* Goal: is_true (@orthonormal gT (@gval gT M) (@map (@classfun gT (@gval gT G)) (@classfun gT (@gval gT M)) nu S)) *) rewrite !orthonormalE map_pairwise_orthogonal // andbT. (* Goal: is_true (@all (@classfun gT (@gval gT M)) (@pred_of_simpl (@classfun gT (@gval gT M)) (@SimplPred (@classfun gT (@gval gT M)) (fun phi : @classfun gT (@gval gT M) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT M) phi phi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))) (@map (@classfun gT (@gval gT G)) (@classfun gT (@gval gT M)) nu S)) *) by apply/allP=> _ /mapP[xi Sxi ->]; rewrite /= Inu ?nS1 // mem_zchar. Qed. Lemma cfproj_sum_orthonormal z phi : phi \in S -> '[\sum_(xi <- S) z xi *: nu xi, nu phi] = z phi. Proof. (* Goal: forall _ : 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)), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT M) (@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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) S (fun xi : @classfun gT (@gval gT G) => @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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) xi (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT M)) (z xi) (nu xi)))) (nu phi)) (z phi) *) by move=> Sphi; rewrite cfproj_sum_orthogonal // nS1 // mulr1. Qed. Lemma cfdot_sum_orthonormal z1 z2 : '[\sum_(xi <- S) z1 xi *: xi, \sum_(xi <- S) z2 xi *: xi] = \sum_(xi <- S) z1 xi * (z2 xi)^*. Proof. (* 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 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)))))) (@classfun gT (@gval gT G)) (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 xi : @classfun gT (@gval gT G) => @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)))))) (@classfun gT (@gval gT G)) xi (@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.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) (z1 xi) xi))) (@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)))))) (@classfun gT (@gval gT G)) (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 xi : @classfun gT (@gval gT G) => @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)))))) (@classfun gT (@gval gT G)) xi (@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.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) (z2 xi) xi)))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@classfun gT (@gval gT G)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@classfun gT (@gval gT G)) xi (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) true (@GRing.mul Algebraics.Implementation.ringType (z1 xi) (@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) (z2 xi))))) *) rewrite cfdot_sum_orthogonal //; apply: eq_big_seq => phi /nS1->. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul Algebraics.Implementation.ringType (@GRing.mul Algebraics.Implementation.ringType (z1 phi) (@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) (z2 phi))) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@GRing.mul Algebraics.Implementation.ringType (z1 phi) (@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) (z2 phi))) *) by rewrite mulr1. Qed. Lemma cfnorm_sum_orthonormal z : '[\sum_(xi <- S) z xi *: nu xi] = \sum_(xi <- S) `|z xi| ^+ 2. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT M) (@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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) S (fun xi : @classfun gT (@gval gT G) => @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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) xi (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT M)) (z xi) (nu xi)))) (@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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) S (fun xi : @classfun gT (@gval gT G) => @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 M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) (@classfun gT (@gval gT G)) xi (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT M)))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT M)) (z xi) (nu xi))))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) (@classfun gT (@gval gT G)) (GRing.zero (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) (@classfun gT (@gval gT G)) xi (@GRing.add (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) true (@GRing.exp (Num.NumDomain.ringType Algebraics.Implementation.numDomainType) (@Num.Def.normr Algebraics.Implementation.numDomainType (z xi)) (Datatypes.S (Datatypes.S O))))) *) rewrite cfnorm_sum_orthogonal //. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) (@classfun gT (@gval gT G)) (GRing.zero (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) (@classfun gT (@gval gT G)) xi (@GRing.add (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) true (@GRing.mul (Num.NumDomain.ringType Algebraics.Implementation.numDomainType) (@GRing.exp (Num.NumDomain.ringType Algebraics.Implementation.numDomainType) (@Num.Def.normr Algebraics.Implementation.numDomainType (z xi)) (Datatypes.S (Datatypes.S O))) (@cfdot gT (@gval gT G) xi xi)))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) (@classfun gT (@gval gT G)) (GRing.zero (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) (@classfun gT (@gval gT G)) xi (@GRing.add (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) true (@GRing.exp (Num.NumDomain.ringType Algebraics.Implementation.numDomainType) (@Num.Def.normr Algebraics.Implementation.numDomainType (z xi)) (Datatypes.S (Datatypes.S O))))) *) by apply: eq_big_seq => xi /nS1->; rewrite mulr1. Qed. Lemma cfnorm_map_orthonormal : '[\sum_(xi <- S) nu xi] = (size S)%:R. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT M) (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT M))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT M))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT M))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT M))) true (nu xi))) (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT M))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT M))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT M))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT M))) true (nu xi)))) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@size (@classfun gT (@gval gT G)) S)) *) by rewrite cfnorm_orthogonal // (eq_big_seq _ nS1) big_tnth sumr_const card_ord. Qed. Lemma orthonormal_span phi : phi \in <<S>>%VS -> {z | z = fun xi => '[phi, xi] & phi = \sum_(xi <- S) z xi *: xi}. 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)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S)))), @sig2 (forall _ : @classfun gT (@gval gT G), GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (fun z : forall _ : @classfun gT (@gval gT G), GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) => @eq (forall _ : @classfun gT (@gval gT G), GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) z (fun xi : @classfun gT (@gval gT G) => @cfdot gT (@gval gT G) phi xi)) (fun z : forall _ : @classfun gT (@gval gT G), GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) => @eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@classfun gT (@gval gT G)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@classfun gT (@gval gT G)) xi (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) true (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (z xi) xi)))) *) case/orthogonal_span=> // _ -> {2}->; set z := fun _ => _ : algC. (* Goal: @sig2 (forall _ : @classfun gT (@gval gT G), GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (fun z0 : forall _ : @classfun gT (@gval gT G), GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) => @eq (forall _ : @classfun gT (@gval gT G), GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) z0 z) (fun z : forall _ : @classfun gT (@gval gT G), GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) => @eq (@classfun gT (@gval gT G)) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@classfun gT (@gval gT G)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@classfun gT (@gval gT G)) xi (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) true (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) phi xi) (@GRing.inv Algebraics.Implementation.unitRingType (@cfdot gT (@gval gT G) xi xi))) xi))) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@classfun gT (@gval gT G)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@classfun gT (@gval gT G)) xi (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) true (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (z xi) xi)))) *) by exists z => //; apply: eq_big_seq => xi /nS1->; rewrite divr1. Qed. End CfDotOrthonormal. Lemma cfnorm_orthonormal S : orthonormal S -> '[\sum_(xi <- S) xi] = (size S)%:R. Proof. (* Goal: forall _ : is_true (@orthonormal gT (@gval gT G) S), @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))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)) (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) S (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi))) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@size (@classfun gT (@gval gT G)) S)) *) exact: cfnorm_map_orthonormal. Qed. Lemma vchar_orthonormalP S : {subset S <= 'Z[irr G]} -> reflect (exists I : {set Iirr G}, exists b : Iirr G -> bool, perm_eq S [seq (-1) ^+ b i *: 'chi_i | i in I]) (orthonormal S). Lemma vchar_norm1P phi : phi \in 'Z[irr G] -> '[phi] = 1 -> exists b : bool, exists i : Iirr G, phi = (-1) ^+ b *: 'chi_i. 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))))) (_ : @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))), @ex bool (fun b : bool => @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) 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)) (nat_of_bool b)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)))) *) move=> Zphi phiN1. (* Goal: @ex bool (fun b : bool => @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) 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)) (nat_of_bool b)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)))) *) have: orthonormal phi by rewrite /orthonormal/= phiN1 eqxx. (* Goal: forall _ : is_true (@orthonormal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) phi)), @ex bool (fun b : bool => @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) 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)) (nat_of_bool b)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)))) *) case/vchar_orthonormalP=> [xi /predU1P[->|] // | I [b def_phi]]. (* Goal: @ex bool (fun b : bool => @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) 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)) (nat_of_bool b)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)))) *) have: phi \in (phi : seq _) := mem_head _ _. (* Goal: forall _ : 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))) (@seq_of_cfun gT (@gval gT G) phi))), @ex bool (fun b : bool => @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) 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)) (nat_of_bool b)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)))) *) by rewrite (perm_eq_mem def_phi) => /mapP[i _ ->]; exists (b i), i. Qed. Lemma zchar_small_norm phi n : phi \in 'Z[irr G] -> '[phi] = n%:R -> (n < 4)%N -> {S : n.-tuple 'CF(G) | 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))))) (_ : @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) n)) (_ : is_true (leq (S n) (S (S (S (S O)))))), @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) move=> Zphi def_n lt_n_4. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) pose S := [seq '[phi, 'chi_i] *: 'chi_i | i in irr_constt phi]. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) have def_phi: phi = \sum_(xi <- S) xi. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) (* Goal: @eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S (fun xi : GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) xi (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) true xi)) *) rewrite big_map /= big_filter big_mkcond {1}[phi]cfun_sum_cfdot. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) (* Goal: @eq (@classfun gT (@gval gT G)) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (Finite.sort (ordinal_finType (Datatypes.S (@pred_Nirr gT (@gval gT G))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (index_enum (ordinal_finType (Datatypes.S (@pred_Nirr gT (@gval gT G))))) (fun i : Finite.sort (ordinal_finType (Datatypes.S (@pred_Nirr gT (@gval gT G)))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (Finite.sort (ordinal_finType (Datatypes.S (@pred_Nirr gT (@gval gT G))))) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) true (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)))) (@BigOp.bigop (@classfun gT (@gval gT G)) (ordinal (Datatypes.S (@pred_Nirr 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))))) (Finite.EnumDef.enum (ordinal_finType (Datatypes.S (@pred_Nirr gT (@gval gT G))))) (fun i : ordinal (Datatypes.S (@pred_Nirr gT (@gval gT G))) => @BigBody (@classfun gT (@gval gT G)) (ordinal (Datatypes.S (@pred_Nirr gT (@gval gT G)))) i (@Monoid.operator (@classfun 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))))) (GRing.add_monoid (@cfun_zmodType gT (@gval gT G)))) true (if @pred_of_simpl (Finite.sort (ordinal_finType (Datatypes.S (@pred_Nirr gT (@gval gT G))))) (@pred_of_mem_pred (Finite.sort (ordinal_finType (Datatypes.S (@pred_Nirr gT (@gval gT G))))) (@mem (ordinal (Datatypes.S (@pred_Nirr gT (@gval gT G)))) (simplPredType (ordinal (Datatypes.S (@pred_Nirr gT (@gval gT G))))) (@irr_constt gT (@gval gT G) phi))) i then @GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) else 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))))))) *) by apply: eq_bigr => i _; rewrite if_neg; case: eqP => // ->; rewrite scale0r. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) have orthS: orthonormal S. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) (* Goal: is_true (@orthonormal gT (@gval gT G) S) *) apply/orthonormalP; split=> [|_ _ /mapP[i phi_i ->] /mapP[j _ ->]]. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))) (@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)) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) (* Goal: is_true (@uniq (@cfun_eqType gT (@gval gT G)) S) *) rewrite map_inj_in_uniq ?enum_uniq // => i j; rewrite mem_enum => phi_i _. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))) (@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)) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) (* Goal: forall _ : @eq (Equality.sort (@cfun_eqType gT (@gval gT G))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)), @eq (Equality.sort (Finite.eqType (ordinal_finType (Datatypes.S (@pred_Nirr gT (@gval gT G)))))) i j *) by move/eqP; rewrite eq_scaled_irr (negbTE phi_i) => /andP[_ /= /eqP]. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))) (@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)) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) rewrite eq_scaled_irr cfdotZl cfdotZr cfdot_irr mulrA mulr_natr mulrb. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (if @eq_op (ordinal_eqType (Datatypes.S (@pred_Nirr gT (@gval gT G)))) i j then @GRing.mul Algebraics.Implementation.ringType (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@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 (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))) else GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (andb (@eq_op (GRing.Ring.eqType Algebraics.Implementation.ringType) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))) (orb (@eq_op (GRing.Ring.eqType Algebraics.Implementation.ringType) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (@eq_op (ordinal_eqType (Datatypes.S (@pred_Nirr gT (@gval gT G)))) i j))))) *) rewrite mem_enum in phi_i; rewrite (negbTE phi_i) andbC; case: eqP => // <-. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul Algebraics.Implementation.ringType (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@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 (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)))) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (andb (orb false true) (@eq_op (GRing.Ring.eqType Algebraics.Implementation.ringType) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)))))) *) have /CnatP[m def_m] := Cnat_norm_Cint (Cint_cfdot_vchar_irr i Zphi). (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul Algebraics.Implementation.ringType (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@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 (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)))) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (andb (orb false true) (@eq_op (GRing.Ring.eqType Algebraics.Implementation.ringType) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)))))) *) apply/eqP; rewrite eqxx /= -normCK def_m -natrX eqr_nat eqn_leq lt0n. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) (* Goal: is_true (andb (leq (expn m (Datatypes.S (Datatypes.S O))) (Datatypes.S O)) (negb (@eq_op nat_eqType (expn m (Datatypes.S (Datatypes.S O))) O))) *) rewrite expn_eq0 andbT -eqC_nat -def_m normr_eq0 [~~ _]phi_i andbT. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) (* Goal: is_true (leq (expn m (Datatypes.S (Datatypes.S O))) (Datatypes.S O)) *) rewrite (leq_exp2r _ 1) // -ltnS -(@ltn_exp2r _ _ 2) //. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) (* Goal: is_true (leq (Datatypes.S (expn m (Datatypes.S (Datatypes.S O)))) (expn (Datatypes.S (Datatypes.S O)) (Datatypes.S (Datatypes.S O)))) *) apply: leq_ltn_trans lt_n_4; rewrite -leC_nat -def_n natrX. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) (* Goal: is_true (@Num.Def.ler Algebraics.Implementation.numDomainType (@GRing.exp Algebraics.Implementation.ringType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) m) (Datatypes.S (Datatypes.S O))) (@cfdot gT (@gval gT G) phi phi)) *) rewrite cfdot_sum_irr (bigD1 i) //= -normCK def_m addrC -subr_ge0 addrK. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) (* Goal: is_true (@Num.Def.ler Algebraics.Implementation.numDomainType (GRing.zero (Num.NumDomain.zmodType Algebraics.Implementation.numDomainType)) (@BigOp.bigop Algebraics.Implementation.type (ordinal (Datatypes.S (@pred_Nirr gT (@gval gT G)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (ordinal_finType (Datatypes.S (@pred_Nirr gT (@gval gT G))))) (fun i0 : ordinal (Datatypes.S (@pred_Nirr gT (@gval gT G))) => @BigBody Algebraics.Implementation.type (ordinal (Datatypes.S (@pred_Nirr gT (@gval gT G)))) i0 (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (negb (@eq_op (Finite.eqType (ordinal_finType (Datatypes.S (@pred_Nirr gT (@gval gT G))))) i0 i)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i0)) (@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) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i0))))))) *) by rewrite sumr_ge0 // => ? _; apply: mul_conjC_ge0. (* Goal: @sig (tuple_of n (@classfun gT (@gval gT G))) (fun S0 : tuple_of n (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval n (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType n (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval n (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) have <-: size S = n. (* Goal: @sig (tuple_of (@size (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S) (@classfun gT (@gval gT G))) (fun S0 : tuple_of (@size (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S) (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval (@size (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S) (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType (@size (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S) (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval (@size (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S) (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) (* Goal: @eq nat (@size (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S) n *) by apply/eqP; rewrite -eqC_nat -def_n def_phi cfnorm_orthonormal. (* Goal: @sig (tuple_of (@size (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S) (@classfun gT (@gval gT G))) (fun S0 : tuple_of (@size (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S) (@classfun gT (@gval gT G)) => and3 (is_true (@orthonormal gT (@gval gT G) (@tval (@size (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S) (@classfun gT (@gval gT G)) S0))) (@sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (tuple_predType (@size (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S) (@cfun_eqType gT (@gval gT G))) S0) (@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)))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval (@size (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) S) (@classfun gT (@gval gT G)) S0) (fun xi : @classfun gT (@gval gT G) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)))) *) exists (in_tuple S); split=> // _ /mapP[i _ ->]. (* Goal: is_true (@in_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@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)))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) by rewrite scale_zchar ?irr_vchar // Cint_cfdot_vchar_irr. Qed. Lemma vchar_norm2 phi : phi \in 'Z[irr G, G^#] -> '[phi] = 2%:R -> exists i, exists2 j, j != i & phi = 'chi_i - 'chi_j. 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr 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 (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (S (S O)))), @ex (Equality.sort (ordinal_eqType (S (@pred_Nirr gT (@gval gT G))))) (fun i : Equality.sort (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) => @ex2 (Equality.sort (ordinal_eqType (S (@pred_Nirr gT (@gval gT G))))) (fun j : Equality.sort (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i))) (fun j : Equality.sort (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) => @eq (@classfun gT (@gval gT G)) phi (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) rewrite zchar_split cfunD1E => /andP[Zphi phi1_0]. (* Goal: forall _ : @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (S (S O))), @ex (Equality.sort (ordinal_eqType (S (@pred_Nirr gT (@gval gT G))))) (fun i : Equality.sort (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) => @ex2 (Equality.sort (ordinal_eqType (S (@pred_Nirr gT (@gval gT G))))) (fun j : Equality.sort (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i))) (fun j : Equality.sort (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) => @eq (@classfun gT (@gval gT G)) phi (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) case/zchar_small_norm => // [[[|chi [|xi [|?]]] //= S2]]. (* Goal: forall _ : and3 (is_true (@orthonormal gT (@gval gT G) (@cons (@classfun gT (@gval gT G)) chi (@cons (@classfun gT (@gval gT G)) xi (@nil (@classfun gT (@gval gT G))))))) (@sub_mem (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (tuple_predType (S (S O)) (@cfun_eqType gT (@gval gT G))) (@Tuple (S (S O)) (@classfun gT (@gval gT G)) (@cons (@classfun gT (@gval gT G)) chi (@cons (@classfun gT (@gval gT G)) xi (@nil (@classfun gT (@gval gT G))))) S2)) (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (@classfun gT (@gval gT G)) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) chi (@cons (@classfun gT (@gval gT G)) xi (@nil (@classfun gT (@gval gT G))))) (fun xi : @classfun gT (@gval gT G) => @BigBody (@classfun gT (@gval gT G)) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi))), @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @ex2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) phi (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) case=> /andP[/and3P[Nchi Nxi _] /= ochi] /allP/and3P[Zchi Zxi _]. (* Goal: forall _ : @eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (@classfun gT (@gval gT G)) (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) chi (@cons (@classfun gT (@gval gT G)) xi (@nil (@classfun gT (@gval gT G))))) (fun xi : @classfun gT (@gval gT G) => @BigBody (@classfun gT (@gval gT G)) (@classfun gT (@gval gT G)) xi (@GRing.add (@cfun_zmodType gT (@gval gT G))) true xi)), @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @ex2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) phi (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) rewrite big_cons big_seq1 => def_phi. (* Goal: @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @ex2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) phi (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) have [b [i def_chi]] := vchar_norm1P Zchi (eqP Nchi). (* Goal: @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @ex2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) phi (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) have [c [j def_xi]] := vchar_norm1P Zxi (eqP Nxi). (* Goal: @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @ex2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) phi (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) have neq_ji: j != i. (* Goal: @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @ex2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) phi (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) (* Goal: is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i)) *) apply: contraTneq ochi; rewrite !andbT def_chi def_xi => ->. (* Goal: @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @ex2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) phi (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) (* Goal: is_true (negb (@eq_op (GRing.Ring.eqType (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)) (nat_of_bool b)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@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)) (nat_of_bool c)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))) *) rewrite cfdotZl cfdotZr rmorph_sign cfnorm_irr mulr1 -signr_addb. (* Goal: @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @ex2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) phi (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) (* Goal: is_true (negb (@eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.exp Algebraics.Implementation.ringType (@GRing.opp (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType)) (nat_of_bool (addb b c))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))) *) by rewrite signr_eq0. (* Goal: @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @ex2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) phi (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) have neq_bc: b != c. (* Goal: @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @ex2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) phi (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) (* Goal: is_true (negb (@eq_op bool_eqType b c)) *) apply: contraTneq phi1_0; rewrite def_phi def_chi def_xi => ->. (* Goal: @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @ex2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) phi (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) (* Goal: is_true (negb (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) (@GRing.add (@cfun_zmodType 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)) (nat_of_bool c)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@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)) (nat_of_bool c)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))) (oneg (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType))) *) rewrite -scalerDr !cfunE mulf_eq0 signr_eq0 eqr_le ltr_geF //. (* Goal: @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @ex2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) phi (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) (* Goal: is_true (@Num.Def.ltr Algebraics.Implementation.numDomainType (GRing.zero (GRing.IntegralDomain.zmodType Algebraics.Implementation.idomainType)) (@GRing.add Algebraics.Implementation.zmodType (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (oneg (FinGroup.base gT))) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) (oneg (FinGroup.base gT))))) *) by rewrite ltr_paddl ?ltrW ?irr1_gt0. (* Goal: @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @ex2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) phi (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))))) *) rewrite {}def_phi {}def_chi {}def_xi !scaler_sign. (* Goal: @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i0 : ordinal (S (@pred_Nirr gT (@gval gT G))) => @ex2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i0))) (fun j0 : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) (@GRing.add (@cfun_zmodType gT (@gval gT G)) (if b then @GRing.opp (@GRing.Lmodule.zmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) else @tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (if c then @GRing.opp (@GRing.Lmodule.zmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) else @tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i0) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j0))))) *) case: b c neq_bc => [|] [|] // _; last by exists i, j. (* Goal: @ex (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun i0 : ordinal (S (@pred_Nirr gT (@gval gT G))) => @ex2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => is_true (negb (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) j i0))) (fun j0 : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@GRing.opp (@GRing.Lmodule.zmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@GRing.add (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i0) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j0))))) *) by exists j, i; rewrite 1?eq_sym // addrC. Qed. End VChar. Section Isometries. Variables (gT : finGroupType) (L G : {group gT}) (S : seq 'CF(L)). Implicit Type nu : {additive 'CF(L) -> 'CF(G)}. Lemma Zisometry_of_cfnorm (tauS : seq 'CF(G)) : pairwise_orthogonal S -> pairwise_orthogonal tauS -> map cfnorm tauS = map cfnorm S -> {subset tauS <= 'Z[irr G]} -> {tau : {linear 'CF(L) -> 'CF(G)} | map tau S = tauS & {in 'Z[S], isometry tau, to 'Z[irr G]}}. Proof. (* Goal: forall (_ : is_true (@pairwise_orthogonal gT (@gval gT L) S)) (_ : is_true (@pairwise_orthogonal gT (@gval gT G) tauS)) (_ : @eq (list (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@map (@classfun gT (@gval gT G)) (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfnorm_head gT (@gval gT G) tt) tauS) (@map (@classfun gT (@gval gT L)) (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfnorm_head gT (@gval gT L) tt) S)) (_ : @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))) tauS) (@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)))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), @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))) => @eq (list (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))))))) (@map (GRing.Zmodule.sort (@GRing.Lmodule.zmodType 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)))))) (@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) S) tauS) (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))) => @isometry_from_to gT gT (@gval gT L) (@gval gT G) (@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)))) (@Zchar gT (@gval gT L) S (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) (@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) (@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)))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) move=> oSS oTT /isometry_of_cfnorm[||tau defT Itau] // Z_T; exists tau => //. (* Goal: @isometry_from_to gT gT (@gval gT L) (@gval gT G) (@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)))) (@Zchar gT (@gval gT L) S (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) (@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) (@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)))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) *) split=> [|_ /zchar_nth_expansion[u Zu ->]]. (* Goal: is_true (@in_mem (@classfun 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 Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (Finite.sort (ordinal_finType (@size (@classfun gT (@gval gT L)) S))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (index_enum (ordinal_finType (@size (@classfun gT (@gval gT L)) S))) (fun i : ordinal (@size (@classfun gT (@gval gT L)) S) => @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 L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (ordinal (@size (@classfun gT (@gval gT L)) S)) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (u i) (@nth (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L))) (GRing.zero (@cfun_zmodType gT (@gval gT L))) S (@nat_of_ord (@size (@classfun gT (@gval gT L)) S) i)))))) (@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)))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) (* Goal: @prop_in2 (@classfun 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)))) (@Zchar gT (@gval gT L) S (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) (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))) *) by apply: sub_in2 Itau; apply: zchar_span. (* Goal: is_true (@in_mem (@classfun 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 Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (Finite.sort (ordinal_finType (@size (@classfun gT (@gval gT L)) S))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (index_enum (ordinal_finType (@size (@classfun gT (@gval gT L)) S))) (fun i : ordinal (@size (@classfun gT (@gval gT L)) S) => @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 L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (ordinal (@size (@classfun gT (@gval gT L)) S)) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (u i) (@nth (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L))) (GRing.zero (@cfun_zmodType gT (@gval gT L))) S (@nat_of_ord (@size (@classfun gT (@gval gT L)) S) i)))))) (@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)))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) rewrite big_seq linear_sum rpred_sum // => xi Sxi. (* Goal: is_true (@in_mem (GRing.Zmodule.sort (@cfun_zmodType 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 Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (u xi) (@nth (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L))) (GRing.zero (@cfun_zmodType gT (@gval gT L))) S (@nat_of_ord (@size (@classfun gT (@gval gT L)) S) xi)))) (@mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (predPredType (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G)))) (@unkey_pred (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) (@GRing.Pred.add_key (@cfun_zmodType gT (@gval gT G)) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) (@Zchar_addrPred gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) (@Zchar_keyed gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))))) *) by rewrite linearZ scale_zchar ?Z_T // -defT map_f ?mem_nth. Qed. Lemma Zisometry_of_iso f : free S -> {in S, isometry f, to 'Z[irr G]} -> {tau : {linear 'CF(L) -> 'CF(G)} | {in S, tau =1 f} & {in 'Z[S], isometry tau, to 'Z[irr G]}}. Proof. (* Goal: forall (_ : is_true (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT L)) S)) (_ : @isometry_from_to gT gT (@gval gT L) (@gval gT G) (@mem (Equality.sort (@cfun_eqType gT (@gval gT L))) (seq_predType (@cfun_eqType gT (@gval gT L))) S) f (@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)))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), @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))) => @isometry_from_to gT gT (@gval gT L) (@gval gT G) (@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)))) (@Zchar gT (@gval gT L) S (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) (@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) (@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)))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) move=> freeS [If Zf]; have [tau Dtau Itau] := isometry_of_free freeS If. (* 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))) => @isometry_from_to gT gT (@gval gT L) (@gval gT G) (@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)))) (@Zchar gT (@gval gT L) S (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) (@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) (@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)))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) exists tau => //; split; first by apply: sub_in2 Itau; apply: zchar_span. (* Goal: @prop_in1 (@classfun 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)))) (@Zchar gT (@gval gT L) S (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) (fun phi : @classfun gT (@gval gT L) => is_true (@in_mem (@classfun 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) (@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)))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))))) (inPhantom (forall phi : @classfun gT (@gval gT L), is_true (@in_mem (@classfun 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) (@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)))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))))) *) move=> _ /zchar_nth_expansion[a Za ->]; rewrite linear_sum rpred_sum // => i _. (* Goal: is_true (@in_mem (GRing.Zmodule.sort (@cfun_zmodType 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 Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (a i) (@nth (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L))) (GRing.zero (@cfun_zmodType gT (@gval gT L))) S (@nat_of_ord (@size (@classfun gT (@gval gT L)) S) i)))) (@mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (predPredType (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G)))) (@unkey_pred (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) (@GRing.Pred.add_key (@cfun_zmodType gT (@gval gT G)) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) (@Zchar_addrPred gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) (@Zchar_keyed gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))))) *) by rewrite linearZ rpredZ_Cint ?Dtau ?Zf ?mem_nth. Qed. Lemma Zisometry_inj A nu : {in 'Z[S, A] &, isometry nu} -> {in 'Z[S, A] &, injective nu}. Proof. (* Goal: forall _ : @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)))) (@Zchar gT (@gval gT L) S A)) (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))) nu 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))) nu 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))) nu))), @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)))) (@Zchar gT (@gval gT L) S A)) (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))) nu 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))) nu 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))) nu))) *) by move/isometry_raddf_inj; apply; apply: rpredB. Qed. Lemma isometry_in_zchar nu : {in S &, isometry nu} -> {in 'Z[S] &, isometry nu}. Proof. (* Goal: forall _ : @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) (@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))) nu 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))) nu 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))) nu))), @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)))) (@Zchar gT (@gval gT L) S (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) (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))) nu 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))) nu 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))) nu))) *) move=> Inu _ _ /zchar_nth_expansion[u Zu ->] /zchar_nth_expansion[v Zv ->]. (* Goal: @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))) nu (@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 L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (Finite.sort (ordinal_finType (@size (@classfun gT (@gval gT L)) S))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (index_enum (ordinal_finType (@size (@classfun gT (@gval gT L)) S))) (fun i : ordinal (@size (@classfun gT (@gval gT L)) S) => @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 L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (ordinal (@size (@classfun gT (@gval gT L)) S)) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (u i) (@nth (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L))) (GRing.zero (@cfun_zmodType gT (@gval gT L))) S (@nat_of_ord (@size (@classfun gT (@gval gT L)) S) i)))))) (@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))) nu (@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 L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (Finite.sort (ordinal_finType (@size (@classfun gT (@gval gT L)) S))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (index_enum (ordinal_finType (@size (@classfun gT (@gval gT L)) S))) (fun i : ordinal (@size (@classfun gT (@gval gT L)) S) => @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 L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (ordinal (@size (@classfun gT (@gval gT L)) S)) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (v i) (@nth (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L))) (GRing.zero (@cfun_zmodType gT (@gval gT L))) S (@nat_of_ord (@size (@classfun gT (@gval gT L)) S) i))))))) (@cfdot gT (@gval gT L) (@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 L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (Finite.sort (ordinal_finType (@size (@classfun gT (@gval gT L)) S))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (index_enum (ordinal_finType (@size (@classfun gT (@gval gT L)) S))) (fun i : ordinal (@size (@classfun gT (@gval gT L)) S) => @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 L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (ordinal (@size (@classfun gT (@gval gT L)) S)) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (u i) (@nth (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L))) (GRing.zero (@cfun_zmodType gT (@gval gT L))) S (@nat_of_ord (@size (@classfun gT (@gval gT L)) S) i))))) (@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 L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (Finite.sort (ordinal_finType (@size (@classfun gT (@gval gT L)) S))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (index_enum (ordinal_finType (@size (@classfun gT (@gval gT L)) S))) (fun i : ordinal (@size (@classfun gT (@gval gT L)) S) => @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 L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) (ordinal (@size (@classfun gT (@gval gT L)) S)) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (v i) (@nth (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L))) (GRing.zero (@cfun_zmodType gT (@gval gT L))) S (@nat_of_ord (@size (@classfun gT (@gval gT L)) S) i)))))) *) rewrite !raddf_sum; apply: eq_bigr => j _ /=. (* Goal: @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) (@BigOp.bigop (@classfun gT (@gval gT G)) (ordinal (@size (@classfun gT (@gval gT L)) S)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (index_enum (ordinal_finType (@size (@classfun gT (@gval gT L)) S))) (fun i : ordinal (@size (@classfun gT (@gval gT L)) S) => @BigBody (@classfun gT (@gval gT G)) (ordinal (@size (@classfun gT (@gval gT L)) S)) i (@GRing.add (@cfun_zmodType gT (@gval gT G))) true (@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))) nu (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (u i) (@nth (@classfun gT (@gval gT L)) (GRing.zero (@cfun_zmodType gT (@gval gT L))) S (@nat_of_ord (@size (@classfun gT (@gval gT L)) S) i)))))) (@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))) nu (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (v j) (@nth (@classfun gT (@gval gT L)) (GRing.zero (@cfun_zmodType gT (@gval gT L))) S (@nat_of_ord (@size (@classfun gT (@gval gT L)) S) j))))) (@cfdot gT (@gval gT L) (@BigOp.bigop (@classfun gT (@gval gT L)) (ordinal (@size (@classfun gT (@gval gT L)) S)) (GRing.zero (@GRing.Zmodule.Pack (@classfun gT (@gval gT L)) (@GRing.Zmodule.Class (@classfun gT (@gval gT L)) (@Choice.Class (@classfun gT (@gval gT L)) (@cfun_eqMixin gT (@gval gT L)) (@cfun_choiceMixin gT (@gval gT L))) (@cfun_zmodMixin gT (@gval gT L))))) (index_enum (ordinal_finType (@size (@classfun gT (@gval gT L)) S))) (fun i : ordinal (@size (@classfun gT (@gval gT L)) S) => @BigBody (@classfun gT (@gval gT L)) (ordinal (@size (@classfun gT (@gval gT L)) S)) i (@GRing.add (@GRing.Zmodule.Pack (@classfun gT (@gval gT L)) (@GRing.Zmodule.Class (@classfun gT (@gval gT L)) (@Choice.Class (@classfun gT (@gval gT L)) (@cfun_eqMixin gT (@gval gT L)) (@cfun_choiceMixin gT (@gval gT L))) (@cfun_zmodMixin gT (@gval gT L))))) true (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (u i) (@nth (@classfun gT (@gval gT L)) (GRing.zero (@cfun_zmodType gT (@gval gT L))) S (@nat_of_ord (@size (@classfun gT (@gval gT L)) S) i))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (v j) (@nth (@classfun gT (@gval gT L)) (GRing.zero (@cfun_zmodType gT (@gval gT L))) S (@nat_of_ord (@size (@classfun gT (@gval gT L)) S) j)))) *) rewrite !cfdot_suml; apply: eq_bigr => i _. (* Goal: @eq Algebraics.Implementation.type (@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))) nu (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (u i) (@nth (@classfun gT (@gval gT L)) (GRing.zero (@cfun_zmodType gT (@gval gT L))) S (@nat_of_ord (@size (@classfun gT (@gval gT L)) S) i)))) (@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))) nu (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (v j) (@nth (@classfun gT (@gval gT L)) (GRing.zero (@cfun_zmodType gT (@gval gT L))) S (@nat_of_ord (@size (@classfun gT (@gval gT L)) S) j))))) (@cfdot gT (@gval gT L) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (u i) (@nth (@classfun gT (@gval gT L)) (GRing.zero (@cfun_zmodType gT (@gval gT L))) S (@nat_of_ord (@size (@classfun gT (@gval gT L)) S) i))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (v j) (@nth (@classfun gT (@gval gT L)) (GRing.zero (@cfun_zmodType gT (@gval gT L))) S (@nat_of_ord (@size (@classfun gT (@gval gT L)) S) j)))) *) by rewrite !raddfZ_Cint //= !cfdotZl !cfdotZr Inu ?mem_nth. Qed. End Isometries. Section AutVchar. Variables (u : {rmorphism algC -> algC}) (gT : finGroupType) (G : {group gT}). Local Notation "alpha ^u" := (cfAut u alpha). Implicit Type (S : seq 'CF(G)) (phi chi : 'CF(G)). Lemma cfAut_zchar S A psi : cfAut_closed u S -> psi \in 'Z[S, A] -> psi^u \in 'Z[S, A]. Proof. (* Goal: forall (_ : @cfAut_closed gT (@gval gT G) u S) (_ : 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)))) (@Zchar gT (@gval gT G) S A)))), is_true (@in_mem (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u 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)))) (@Zchar gT (@gval gT G) S A))) *) rewrite zchar_split => SuS /andP[/zchar_nth_expansion[z Zz Dpsi] Apsi]. (* Goal: is_true (@in_mem (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u 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)))) (@Zchar gT (@gval gT G) S A))) *) rewrite zchar_split cfAut_on {}Apsi {psi}Dpsi rmorph_sum rpred_sum //= => i _. (* Goal: is_true (@in_mem (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) (z i) (@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)))) (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@Zchar gT (@gval gT G) S (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))))) *) by rewrite cfAutZ_Cint // scale_zchar // mem_zchar ?SuS ?mem_nth. Qed. Lemma cfAut_vchar A psi : psi \in 'Z[irr G, A] -> psi^u \in 'Z[irr 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))) 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) A))), is_true (@in_mem (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) A))) *) by apply: cfAut_zchar; apply: irr_aut_closed. Qed. Lemma sub_aut_zchar S A psi : {subset S <= 'Z[irr G]} -> psi \in 'Z[S, A] -> psi^u \in 'Z[S, A] -> psi - psi^u \in 'Z[S, A^#]. 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))) S) (@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)))) (@Zchar gT (@gval gT G) (@tval (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (_ : 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)))) (@Zchar gT (@gval gT G) S A)))) (_ : is_true (@in_mem (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u 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)))) (@Zchar gT (@gval gT G) S A)))), is_true (@in_mem (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.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) psi (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@cfAut gT (@gval gT G) u 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)))) (@Zchar gT (@gval gT G) S (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT))))))) *) move=> Z_S Spsi Spsi_u; rewrite zcharD1 !cfunE subr_eq0 rpredB //=. (* Goal: is_true (@eq_op (GRing.Zmodule.eqType Algebraics.Implementation.zmodType) (@fun_of_cfun gT (@gval gT G) psi (oneg (FinGroup.base gT))) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) u (@fun_of_cfun gT (@gval gT G) psi (oneg (FinGroup.base gT))))) *) by rewrite aut_Cint // Cint_vchar1 // (zchar_trans Z_S) ?(zcharW Spsi). Qed. Lemma conjC_vcharAut chi x : chi \in 'Z[irr G] -> (u (chi x))^* = u (chi x)^*. Proof. (* Goal: forall _ : is_true (@in_mem (@classfun gT (@gval gT G)) chi (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (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) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) u (@fun_of_cfun gT (@gval gT G) chi x))) (@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 G) chi x))) *) case/vcharP=> chi1 Nchi1 [chi2 Nchi2 ->]. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (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) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) u (@fun_of_cfun gT (@gval gT G) (@GRing.add (@cfun_zmodType gT (@gval gT G)) chi1 (@GRing.opp (@cfun_zmodType gT (@gval gT G)) chi2)) x))) (@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 G) (@GRing.add (@cfun_zmodType gT (@gval gT G)) chi1 (@GRing.opp (@cfun_zmodType gT (@gval gT G)) chi2)) x))) *) by rewrite !cfunE !rmorphB !conjC_charAut. Qed. Lemma cfdot_aut_vchar phi chi : chi \in 'Z[irr G] -> '[phi^u , chi^u] = u '[phi, chi]. Proof. (* Goal: forall _ : is_true (@in_mem (@classfun gT (@gval gT G)) chi (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@cfAut gT (@gval gT G) u phi) (@cfAut gT (@gval gT G) u chi)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) u (@cfdot gT (@gval gT G) phi chi)) *) case/vcharP=> chi1 Nchi1 [chi2 Nchi2 ->]. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@cfAut gT (@gval gT G) u phi) (@cfAut gT (@gval gT G) u (@GRing.add (@cfun_zmodType gT (@gval gT G)) chi1 (@GRing.opp (@cfun_zmodType gT (@gval gT G)) chi2)))) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) u (@cfdot gT (@gval gT G) phi (@GRing.add (@cfun_zmodType gT (@gval gT G)) chi1 (@GRing.opp (@cfun_zmodType gT (@gval gT G)) chi2)))) *) by rewrite !raddfB /= !cfdot_aut_char. Qed. Lemma vchar_aut A chi : (chi^u \in 'Z[irr G, A]) = (chi \in 'Z[irr G, A]). End AutVchar. Definition cfConjC_vchar := cfAut_vchar conjC. Section MoreVchar. Variables (gT : finGroupType) (G H : {group gT}). Lemma cfRes_vchar phi : phi \in 'Z[irr G] -> 'Res[H] phi \in 'Z[irr H]. 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), is_true (@in_mem (@classfun gT (@gval gT H)) (@cfRes gT (@gval gT H) (@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 H))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT H)))) (@Zchar gT (@gval gT H) (@tval (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) case/vcharP=> xi1 Nx1 [xi2 Nxi2 ->]. (* Goal: is_true (@in_mem (@classfun gT (@gval gT H)) (@cfRes gT (@gval gT H) (@gval gT G) (@GRing.add (@cfun_zmodType gT (@gval gT G)) xi1 (@GRing.opp (@cfun_zmodType gT (@gval gT G)) xi2))) (@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)))) (@Zchar gT (@gval gT H) (@tval (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) by rewrite raddfB rpredB ?char_vchar ?cfRes_char. Qed. Lemma cfRes_vchar_on A phi : H \subset G -> phi \in 'Z[irr G, A] -> 'Res[H] phi \in 'Z[irr H, 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)) (@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))) 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) A)))), is_true (@in_mem (@classfun gT (@gval gT H)) (@cfRes gT (@gval gT H) (@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 H))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT H)))) (@Zchar gT (@gval gT H) (@tval (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H))) A))) *) rewrite zchar_split => sHG /andP[Zphi Aphi]; rewrite zchar_split cfRes_vchar //. (* Goal: is_true (andb true (@in_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT H))) (@cfRes gT (@gval gT H) (@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 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))))) *) apply/cfun_onP=> x /(cfun_onP Aphi); rewrite !cfunElock !genGid sHG => ->. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul Algebraics.Implementation.zmodType (GRing.zero Algebraics.Implementation.zmodType) (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)))))) (GRing.zero Algebraics.Implementation.zmodType) *) exact: mul0rn. Qed. Lemma cfInd_vchar phi : phi \in 'Z[irr H] -> 'Ind[G] phi \in 'Z[irr G]. 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 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)))) (@Zchar gT (@gval gT H) (@tval (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), is_true (@in_mem (@classfun gT (@gval gT G)) (@cfInd gT (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) move=> /vcharP[xi1 Nx1 [xi2 Nxi2 ->]]. (* Goal: is_true (@in_mem (@classfun gT (@gval gT G)) (@cfInd gT (@gval gT G) (@gval gT H) (@GRing.add (@cfun_zmodType gT (@gval gT H)) xi1 (@GRing.opp (@cfun_zmodType gT (@gval gT H)) xi2))) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) by rewrite raddfB rpredB ?char_vchar ?cfInd_char. Qed. Lemma sub_conjC_vchar A phi : phi \in 'Z[irr G, A] -> phi - (phi^*)%CF \in 'Z[irr 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) A))), is_true (@in_mem (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.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) phi (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT))))))) *) move=> Zphi; rewrite sub_aut_zchar ?cfAut_zchar // => _ /irrP[i ->]. (* Goal: is_true (@in_mem (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))))) *) (* Goal: is_true (@in_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) exact: irr_vchar. (* Goal: is_true (@in_mem (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))))) *) exact: cfConjC_irr. Qed. Lemma Frobenius_kernel_exists : [Frobenius G with complement H] -> {K : {group gT} | [Frobenius G = K ><| H]}. Proof. (* Goal: forall _ : is_true (@Frobenius_group_with_complement gT (@gval gT G) (@gval gT H)), @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun K : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@Frobenius_group_with_kernel_and_complement gT (@gval gT G) (@gval gT K) (@gval gT H))) *) move=> frobG; have [_ ntiHG] := andP frobG. (* Goal: @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun K : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@Frobenius_group_with_kernel_and_complement gT (@gval gT G) (@gval gT K) (@gval gT H))) *) have [[_ sHG regGH][_ tiHG /eqP defNH]] := (normedTI_memJ_P ntiHG, and3P ntiHG). (* Goal: @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun K : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@Frobenius_group_with_kernel_and_complement gT (@gval gT G) (@gval gT K) (@gval gT H))) *) suffices /sigW[K defG]: exists K, gval K ><| H == G by exists K; apply/andP. (* Goal: @ex (group_type gT) (fun K : group_type gT => is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G))) *) pose K1 := G :\: cover (H^# :^: G). (* Goal: @ex (group_type gT) (fun K : group_type gT => is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G))) *) have oK1: #|K1| = #|G : H|. (* Goal: @ex (group_type gT) (fun K : group_type gT => is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT 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)) K1))) (@indexg gT (@gval gT G) (@gval gT H)) *) rewrite cardsD (setIidPr _); last first. (* Goal: @ex (group_type gT) (fun K : group_type gT => is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G))) *) (* Goal: @eq nat (subn (@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 gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cover (FinGroup.finType (FinGroup.base gT)) (@conjugates gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))) (@gval gT G))))))) (@indexg 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)) (@cover (FinGroup.finType (FinGroup.base gT)) (@conjugates gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (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)))) *) rewrite cover_imset; apply/bigcupsP=> x Gx. (* Goal: @ex (group_type gT) (fun K : group_type gT => is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G))) *) (* Goal: @eq nat (subn (@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 gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cover (FinGroup.finType (FinGroup.base gT)) (@conjugates gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))) (@gval gT G))))))) (@indexg 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)) (@conjugate gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (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)))) *) by rewrite sub_conjg conjGid ?groupV // (subset_trans (subsetDl _ _)). (* Goal: @ex (group_type gT) (fun K : group_type gT => is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G))) *) (* Goal: @eq nat (subn (@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 gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cover (FinGroup.finType (FinGroup.base gT)) (@conjugates gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))) (@gval gT G))))))) (@indexg gT (@gval gT G) (@gval gT H)) *) rewrite (cover_partition (partition_normedTI ntiHG)) -(Lagrange sHG). (* Goal: @ex (group_type gT) (fun K : group_type gT => is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G))) *) (* Goal: @eq nat (subn (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 H)))) (@indexg gT (@gval gT G) (@gval gT H))) (@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)) (@class_support gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))) (@gval gT G)))))) (@indexg gT (@gval gT G) (@gval gT H)) *) by rewrite (card_support_normedTI ntiHG) (cardsD1 1%g) group1 mulSn addnK. (* Goal: @ex (group_type gT) (fun K : group_type gT => is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G))) *) suffices extG i: {j | {in H, 'chi[G]_j =1 'chi[H]_i} & K1 \subset cfker 'chi_j}. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @ex (group_type gT) (fun K : group_type gT => is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G))) *) pose K := [group of \bigcap_i cfker 'chi_(s2val (extG i))]. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @ex (group_type gT) (fun K : group_type gT => is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G))) *) have nKH: H \subset 'N(K). (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @ex (group_type gT) (fun K : group_type gT => is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT 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)) (@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))))) *) by apply/norms_bigcap/bigcapsP=> i _; apply: subset_trans (cfker_norm _). (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @ex (group_type gT) (fun K : group_type gT => is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G))) *) have tiKH: K :&: H = 1%g. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @ex (group_type gT) (fun K : group_type gT => is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G))) *) (* 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 K) (@gval gT H)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) apply/trivgP; rewrite -(TI_cfker_irr H) /= setIC; apply/bigcapsP=> i _. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @ex (group_type gT) (fun K : group_type gT => is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@pred_Nirr gT (@gval gT H)))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (index_enum (ordinal_finType (S (@pred_Nirr gT (@gval gT H))))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT H))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@pred_Nirr gT (@gval gT H)))) i (@setI (FinGroup.arg_finType (FinGroup.base gT))) true (@cfker gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) (@s2val (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @prop_in1 (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 x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => 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)) K1)) (@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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) (extG 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 H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) *) apply/subsetP=> x /setIP[Hx /bigcapP/(_ i isT)/=]; rewrite !cfkerEirr !inE. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @ex (group_type gT) (fun K : group_type gT => is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G))) *) (* Goal: forall _ : is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) (@s2val (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @prop_in1 (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 x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => 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)) K1)) (@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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) (extG i))) x) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) (@s2val (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @prop_in1 (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 x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => 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)) K1)) (@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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) (extG i))) (oneg (FinGroup.base gT)))), is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) (oneg (FinGroup.base gT)))) *) by case: (extG i) => /= j def_j _; rewrite !def_j. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @ex (group_type gT) (fun K : group_type gT => is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G))) *) exists K; rewrite sdprodE // eqEcard TI_cardMg // mul_subG //=; last first. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* 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 G)))) (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)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@pred_Nirr gT (@gval gT H)))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (index_enum (ordinal_finType (S (@pred_Nirr gT (@gval gT H))))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT H))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@pred_Nirr gT (@gval gT H)))) i (@setI (FinGroup.arg_finType (FinGroup.base gT))) true (@cfker gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) (@s2val (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @prop_in1 (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 x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => 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)) K1)) (@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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) (extG i))))))))) (@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)))))) *) (* 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)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@pred_Nirr gT (@gval gT H)))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (index_enum (ordinal_finType (S (@pred_Nirr gT (@gval gT H))))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT H))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@pred_Nirr gT (@gval gT H)))) i (@setI (FinGroup.arg_finType (FinGroup.base gT))) true (@cfker gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) (@s2val (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @prop_in1 (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 x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => 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)) K1)) (@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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) (extG 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)))) *) by rewrite (bigcap_min (0 : Iirr H)) ?cfker_sub. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* 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 G)))) (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)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@pred_Nirr gT (@gval gT H)))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (index_enum (ordinal_finType (S (@pred_Nirr gT (@gval gT H))))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT H))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@pred_Nirr gT (@gval gT H)))) i (@setI (FinGroup.arg_finType (FinGroup.base gT))) true (@cfker gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) (@s2val (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @prop_in1 (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 x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => 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)) K1)) (@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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) (extG i))))))))) (@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)))))) *) rewrite -(Lagrange sHG) mulnC leq_pmul2r // -oK1 subset_leq_card //. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* 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)) K1)) (@mem (Finite.sort (FinGroup.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 (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@pred_Nirr gT (@gval gT H)))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (index_enum (ordinal_finType (S (@pred_Nirr gT (@gval gT H))))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT H))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@pred_Nirr gT (@gval gT H)))) i (@setI (FinGroup.arg_finType (FinGroup.base gT))) true (@cfker gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) (@s2val (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @prop_in1 (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 x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => 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)) K1)) (@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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) (extG i))))))))) *) by apply/bigcapsP=> i _; case: (extG i). (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) case i0: (i == 0). (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) exists 0 => [x Hx|]; last by rewrite irr0 cfker_cfun1 subsetDl. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) (GRing.zero (Zp_zmodType (@pred_Nirr gT (@gval gT G))))) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x) *) by rewrite (eqP i0) !irr0 !cfun1E // (subsetP sHG) ?Hx. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) have ochi1: '['chi_i, 1] = 0 by rewrite -irr0 cfdot_irr i0. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) pose a := 'chi_i 1%g; have Za: a \in Cint by rewrite CintE Cnat_irr1. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) pose theta := 'chi_i - a%:A; pose phi := 'Ind[G] theta + a%:A. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) have /cfun_onP theta0: theta \in 'CF(H, H^#). (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: is_true (@in_mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT H))) theta (@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) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))))))) *) by rewrite cfunD1E !cfunE cfun11 mulr1 subrr. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) have RItheta: 'Res ('Ind[G] theta) = theta. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @eq (@classfun gT (@gval gT H)) (@cfRes gT (@gval gT H) (@gval gT G) (@cfInd gT (@gval gT G) (@gval gT H) theta)) theta *) apply/cfun_inP=> x Hx; rewrite cfResE ?cfIndE // (big_setID H) /= addrC. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* 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 H)))))) (@GRing.add Algebraics.Implementation.zmodType (@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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) (@fun_of_cfun gT (@gval gT H) theta (@conjg gT x i)))) (@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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) (@fun_of_cfun gT (@gval gT H) theta (@conjg gT x i)))))) (@fun_of_cfun gT (@gval gT H) theta x) *) apply: canLR (mulKf (neq0CG H)) _; rewrite (setIidPr sHG) mulr_natl. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @eq (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@GRing.add Algebraics.Implementation.zmodType (@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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) (@fun_of_cfun gT (@gval gT H) theta (@conjg gT x i)))) (@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)))) (@fun_of_cfun gT (@gval gT H) theta (@conjg gT x i))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@fun_of_cfun gT (@gval gT H) theta 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 big1 ?add0r => [|y /setDP[/regGH tiHy H'y]]; last first. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @eq (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@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)))) (@fun_of_cfun gT (@gval gT H) theta (@conjg gT x i)))) (@GRing.natmul (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@fun_of_cfun gT (@gval gT H) theta 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))))) *) (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT H) theta (@conjg gT x y)) (GRing.zero Algebraics.Implementation.zmodType) *) have [-> | ntx] := eqVneq x 1%g; first by rewrite conj1g theta0 ?inE ?eqxx. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @eq (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@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)))) (@fun_of_cfun gT (@gval gT H) theta (@conjg gT x i)))) (@GRing.natmul (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@fun_of_cfun gT (@gval gT H) theta 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))))) *) (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT H) theta (@conjg gT x y)) (GRing.zero Algebraics.Implementation.zmodType) *) by rewrite theta0 ?tiHy // !inE ntx. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @eq (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@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)))) (@fun_of_cfun gT (@gval gT H) theta (@conjg gT x i)))) (@GRing.natmul (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@fun_of_cfun gT (@gval gT H) theta 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))))) *) by rewrite -sumr_const; apply: eq_bigr => y Hy; rewrite cfunJ. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) have ophi1: '[phi, 1] = 0. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi (GRing.one (@cfun_ringType gT (@gval gT G)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) rewrite cfdotDl -cfdot_Res_r cfRes_cfun1 // cfdotBl !cfdotZl !cfnorm1. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* 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)) (@cfdot gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) (GRing.one (@cfun_ringType gT (@gval gT H)))) (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul Algebraics.Implementation.ringType a (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))) (@GRing.mul Algebraics.Implementation.ringType a (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) by rewrite ochi1 add0r addNr. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) have{ochi1} n1phi: '[phi] = 1. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @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)) *) have: '[phi - a%:A] = '[theta] by rewrite addrK -cfdot_Res_l RItheta. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: forall _ : @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 (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@GRing.Lalgebra.lmod_ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT G)))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@GRing.Lalgebra.lmod_ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT G)))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@GRing.Lalgebra.lmod_ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT G)))))) (@GRing.scale Algebraics.Implementation.ringType (@GRing.Lalgebra.lmod_ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT G))) a (GRing.one (@GRing.Lalgebra.ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT G))))))) (@GRing.add (@cfun_zmodType gT (@gval gT G)) phi (@GRing.opp (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@GRing.Lalgebra.lmod_ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT G)))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@GRing.Lalgebra.lmod_ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT G)))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@GRing.Lalgebra.lmod_ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT G)))))) (@GRing.scale Algebraics.Implementation.ringType (@GRing.Lalgebra.lmod_ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT G))) a (GRing.one (@GRing.Lalgebra.ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT G)))))))) (@cfdot gT (@gval gT H) theta theta), @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)) *) rewrite !cfnormBd ?cfnormZ ?cfdotZr ?ophi1 ?ochi1 ?mulr0 //. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: forall _ : @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi 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) (GRing.one (@GRing.Lalgebra.ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT G)))) (GRing.one (@GRing.Lalgebra.ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT G))))))) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i)) (@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 H) (GRing.one (@GRing.Lalgebra.ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT H)))) (GRing.one (@GRing.Lalgebra.ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT H))))))), @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)) *) by rewrite !cfnorm1 cfnorm_irr => /addIr. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) have Zphi: phi \in 'Z[irr G]. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: is_true (@in_mem (GRing.Zmodule.sort (@cfun_zmodType 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) by rewrite rpredD ?cfInd_vchar ?rpredB ?irr_vchar // scale_zchar ?rpred1. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) have def_phi: {in H, phi =1 'chi_i}. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* 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) phi x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) 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 H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i)))) *) move=> x Hx /=; rewrite !cfunE -[_ x](cfResE _ sHG) ?RItheta //. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @eq Algebraics.Implementation.type (@GRing.add Algebraics.Implementation.zmodType (@fun_of_cfun gT (@gval gT H) theta x) (@GRing.mul Algebraics.Implementation.ringType a (@fun_of_cfun gT (@gval gT G) (GRing.one (@GRing.Lalgebra.ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT G)))) x))) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x) *) by rewrite !cfunE !cfun1E ?(subsetP sHG) ?Hx ?subrK. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) have [j def_chi_j]: {j | 'chi_j = phi}. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: @sig (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @eq (@classfun gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) phi) *) apply/sig_eqW; have [[] [j]] := vchar_norm1P Zphi n1phi; last first. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: forall _ : @eq (@classfun gT (@gval gT G)) 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)) (nat_of_bool true)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)), @ex (Choice.sort (ordinal_choiceType (S (@pred_Nirr gT (@gval gT G))))) (fun x : Choice.sort (ordinal_choiceType (S (@pred_Nirr gT (@gval gT G)))) => @eq (Equality.sort (@cfun_eqType gT (@gval gT G))) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) x) phi) *) (* Goal: forall _ : @eq (@classfun gT (@gval gT G)) 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)) (nat_of_bool false)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)), @ex (Choice.sort (ordinal_choiceType (S (@pred_Nirr gT (@gval gT G))))) (fun x : Choice.sort (ordinal_choiceType (S (@pred_Nirr gT (@gval gT G)))) => @eq (Equality.sort (@cfun_eqType gT (@gval gT G))) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) x) phi) *) by rewrite scale1r; exists j. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: forall _ : @eq (@classfun gT (@gval gT G)) 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)) (nat_of_bool true)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)), @ex (Choice.sort (ordinal_choiceType (S (@pred_Nirr gT (@gval gT G))))) (fun x : Choice.sort (ordinal_choiceType (S (@pred_Nirr gT (@gval gT G)))) => @eq (Equality.sort (@cfun_eqType gT (@gval gT G))) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) x) phi) *) move/cfunP/(_ 1%g)/eqP; rewrite scaleN1r def_phi // cfunE -addr_eq0 eqr_le. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) (* Goal: forall _ : is_true (andb (@Num.Def.ler Algebraics.Implementation.numDomainType (@GRing.add Algebraics.Implementation.zmodType (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) (oneg (FinGroup.base gT))) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) (oneg (FinGroup.base gT)))) (GRing.zero Algebraics.Implementation.zmodType)) (@Num.Def.ler Algebraics.Implementation.numDomainType (GRing.zero Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) (oneg (FinGroup.base gT))) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) (oneg (FinGroup.base gT)))))), @ex (Choice.sort (ordinal_choiceType (S (@pred_Nirr gT (@gval gT G))))) (fun x : Choice.sort (ordinal_choiceType (S (@pred_Nirr gT (@gval gT G)))) => @eq (Equality.sort (@cfun_eqType gT (@gval gT G))) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) x) phi) *) by rewrite ltr_geF // ltr_paddl ?ltrW ?irr1_gt0. (* Goal: @sig2 (ordinal (S (@pred_Nirr gT (@gval gT G)))) (fun j : ordinal (S (@pred_Nirr 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 H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j) x) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@fun_of_cfun gT (@gval gT H) (@tnth (S (@pred_Nirr gT (@gval gT H))) (@classfun gT (@gval gT H)) (@irr gT (@gval gT H)) i))))) (fun j : ordinal (S (@pred_Nirr 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)) K1)) (@mem (Finite.sort (FinGroup.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) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)))))) *) exists j; rewrite ?cfkerEirr def_chi_j //; apply/subsetP => x /setDP[Gx notHx]. (* 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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) phi x) (@fun_of_cfun gT (@gval gT G) phi (oneg (FinGroup.base gT)))))))) *) rewrite inE cfunE def_phi // cfunE -/a cfun1E // Gx mulr1 cfIndE //. (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@GRing.add Algebraics.Implementation.zmodType (@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) theta (@conjg gT x y))))) a) a) *) rewrite big1 ?mulr0 ?add0r // => y Gy; apply/theta0/(contra _ notHx) => Hxy. (* 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)) (@cover (FinGroup.finType (FinGroup.base gT)) (@conjugates gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))) (@gval gT G)))))) *) by rewrite -(conjgK y x) cover_imset -class_supportEr mem_imset2 ?groupV. Qed. End MoreVchar. Definition dirr (gT : finGroupType) (B : {set gT}) : pred_class := [pred f : 'CF(B) | (f \in irr B) || (- f \in irr B)]. Canonical dirr_keyed := KeyedPred dirr_key. Fact dirr_oppr_closed : oppr_closed (dirr G). Proof. (* Goal: @GRing.oppr_closed (@cfun_zmodType gT (@gval gT G)) (@dirr gT (@gval gT G)) *) by move=> xi; rewrite !inE opprK orbC. Qed. Lemma dirr_sign n v : ((-1)^+ n *: v \in dirr G) = (v \in dirr G). Proof. (* Goal: @eq bool (@in_mem (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.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) v) (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@dirr gT (@gval gT G)))) (@in_mem (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)))))) v (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@dirr gT (@gval gT G)))) *) exact: rpredZsign. Qed. Lemma irr_dirr i : 'chi_i \in dirr G. Proof. (* Goal: is_true (@in_mem (@classfun gT (@gval gT G)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@dirr gT (@gval gT G)))) *) by rewrite !inE mem_irr. Qed. Lemma dirrP f : reflect (exists b : bool, exists i, f = (-1) ^+ b *: 'chi_i) (f \in dirr G). Lemma dirrE phi : phi \in dirr G = (phi \in 'Z[irr G]) && ('[phi] == 1). Proof. (* Goal: @eq bool (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@dirr gT (@gval gT G)))) (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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (@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)))) *) apply/dirrP/andP=> [[b [i ->]] | [Zphi /eqP/vchar_norm1P]]; last exact. (* Goal: and (is_true (@in_mem (@classfun 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)) (nat_of_bool b)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))))) (is_true (@eq_op (GRing.Ring.eqType (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)) (nat_of_bool b)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@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)) (nat_of_bool b)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i))) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) *) by rewrite rpredZsign irr_vchar cfnorm_sign cfnorm_irr. Qed. Lemma cfdot_dirr f g : f \in dirr G -> g \in dirr G -> '[f, g] = (if f == - g then -1 else (f == g)%:R). Proof. (* Goal: forall (_ : is_true (@in_mem (@classfun gT (@gval gT G)) f (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@dirr gT (@gval gT G))))) (_ : is_true (@in_mem (@classfun gT (@gval gT G)) g (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@dirr gT (@gval gT G))))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) f g) (if @eq_op (@cfun_eqType gT (@gval gT G)) f (@GRing.opp (@cfun_zmodType gT (@gval gT G)) g) then @GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) else @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)) f g))) *) case/dirrP=> [b1 [i1 ->]] /dirrP[b2 [i2 ->]]. (* 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)) (nat_of_bool b1)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i1)) (@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)) (nat_of_bool b2)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i2))) (if @eq_op (@cfun_eqType 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)) (nat_of_bool b1)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i1)) (@GRing.opp (@cfun_zmodType 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)) (nat_of_bool b2)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i2))) then @GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) else @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)) (@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)) (nat_of_bool b1)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i1)) (@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)) (nat_of_bool b2)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i2))))) *) rewrite cfdotZl cfdotZr rmorph_sign mulrA -signr_addb cfdot_irr. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul Algebraics.Implementation.ringType (@GRing.exp Algebraics.Implementation.ringType (@GRing.opp (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType)) (nat_of_bool (addb b1 b2))) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i1 i2)))) (if @eq_op (@cfun_eqType 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)) (nat_of_bool b1)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i1)) (@GRing.opp (@cfun_zmodType 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)) (nat_of_bool b2)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i2))) then @GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) else @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)) (@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)) (nat_of_bool b1)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i1)) (@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)) (nat_of_bool b2)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i2))))) *) rewrite -scaleNr -signrN !eq_scaled_irr signr_eq0 !(inj_eq signr_inj) /=. (* Goal: @eq Algebraics.Implementation.type (@GRing.mul Algebraics.Implementation.ringType (@GRing.exp Algebraics.Implementation.ringType (@GRing.opp (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType)) (nat_of_bool (addb b1 b2))) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i1 i2)))) (if andb (@eq_op bool_eqType b1 (negb b2)) (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i1 i2) then @GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) else @GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (andb (@eq_op bool_eqType b1 b2) (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i1 i2)))) *) by rewrite -!negb_add addbN mulr_sign -mulNrn mulrb; case: ifP. Qed. Lemma dirr_norm1 phi : phi \in 'Z[irr G] -> '[phi] = 1 -> phi \in dirr G. 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))))) (_ : @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))), 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 (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@dirr gT (@gval gT G)))) *) by rewrite dirrE => -> -> /=. Qed. Lemma dirr_aut u phi : (cfAut u phi \in dirr G) = (phi \in dirr G). Proof. (* Goal: @eq bool (@in_mem (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u phi) (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@dirr gT (@gval gT G)))) (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@dirr gT (@gval gT G)))) *) rewrite !dirrE vchar_aut; apply: andb_id2l => /cfdot_aut_vchar->. (* Goal: @eq bool (@eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) u (@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) phi phi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) exact: fmorph_eq1. Qed. Definition dIirr (B : {set gT}) := (bool * (Iirr B))%type. Definition dirr1 (B : {set gT}) : dIirr B := (false, 0). Definition ndirr (B : {set gT}) (i : dIirr B) : dIirr B := (~~ i.1, i.2). Lemma ndirr_diff (i : dIirr G) : ndirr i != i. Proof. (* Goal: is_true (negb (@eq_op (prod_eqType bool_eqType (ordinal_eqType (S (@pred_Nirr gT (@gval gT G))))) (@ndirr (@gval gT G) i) i)) *) by case: i => [] [|] i. Qed. Lemma ndirrK : involutive (@ndirr G). Proof. (* Goal: @involutive (dIirr (@gval gT G)) (@ndirr (@gval gT G)) *) by move=> [b i]; rewrite /ndirr /= negbK. Qed. Lemma ndirr_inj : injective (@ndirr G). Proof. (* Goal: @injective (dIirr (@gval gT G)) (dIirr (@gval gT G)) (@ndirr (@gval gT G)) *) exact: (inv_inj ndirrK). Qed. Definition dchi (B : {set gT}) (i : dIirr B) : 'CF(B) := (-1)^+ i.1 *: 'chi_i.2. Lemma dchi1 : dchi (dirr1 G) = 1. Proof. (* Goal: @eq (@classfun gT (@gval gT G)) (@dchi (@gval gT G) (dirr1 (@gval gT G))) (GRing.one (@cfun_ringType gT (@gval gT G))) *) by rewrite /dchi scale1r irr0. Qed. Lemma dirr_dchi i : dchi i \in dirr G. Proof. (* Goal: is_true (@in_mem (@classfun gT (@gval gT G)) (@dchi (@gval gT G) i) (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@dirr gT (@gval gT G)))) *) by apply/dirrP; exists i.1; exists i.2. Qed. Lemma dIrrP phi : reflect (exists i, phi = dchi i) (phi \in dirr G). Proof. (* Goal: Bool.reflect (@ex (dIirr (@gval gT G)) (fun i : dIirr (@gval gT G) => @eq (@classfun gT (@gval gT G)) phi (@dchi (@gval gT G) i))) (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@dirr gT (@gval gT G)))) *) by apply: (iffP idP)=> [/dirrP[b]|] [i ->]; [exists (b, i) | apply: dirr_dchi]. Qed. Lemma dchi_ndirrE (i : dIirr G) : dchi (ndirr i) = - dchi i. Proof. (* Goal: @eq (@classfun gT (@gval gT G)) (@dchi (@gval gT G) (@ndirr (@gval gT G) i)) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@dchi (@gval gT G) i)) *) by case: i => [b i]; rewrite /ndirr /dchi signrN scaleNr. Qed. Lemma cfdot_dchi (i j : dIirr G) : '[dchi i, dchi j] = (i == j)%:R - (i == ndirr j)%:R. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@dchi (@gval gT G) i) (@dchi (@gval gT G) j)) (@GRing.add (GRing.Ring.zmodType (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)) (nat_of_bool (@eq_op (prod_eqType bool_eqType (ordinal_eqType (S (@pred_Nirr gT (@gval gT G))))) i j))) (@GRing.opp (GRing.Ring.zmodType (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)) (nat_of_bool (@eq_op (prod_eqType bool_eqType (ordinal_eqType (S (@pred_Nirr gT (@gval gT G))))) i (@ndirr (@gval gT G) j)))))) *) case: i => bi i; case: j => bj j; rewrite cfdot_dirr ?dirr_dchi // !xpair_eqE. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (if @eq_op (@cfun_eqType gT (@gval gT G)) (@dchi (@gval gT G) (@pair bool (ordinal (S (@pred_Nirr gT (@gval gT G)))) bi i)) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) (@dchi (@gval gT G) (@pair bool (ordinal (S (@pred_Nirr gT (@gval gT G)))) bj j))) then @GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) else @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)) (@dchi (@gval gT G) (@pair bool (ordinal (S (@pred_Nirr gT (@gval gT G)))) bi i)) (@dchi (@gval gT G) (@pair bool (ordinal (S (@pred_Nirr gT (@gval gT G)))) bj j))))) (@GRing.add (GRing.Ring.zmodType (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)) (nat_of_bool (andb (@eq_op bool_eqType bi bj) (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i j)))) (@GRing.opp (GRing.Ring.zmodType (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)) (nat_of_bool (andb (@eq_op bool_eqType bi (negb (@fst bool (ordinal (S (@pred_Nirr gT (@gval gT G)))) (@pair bool (ordinal (S (@pred_Nirr gT (@gval gT G)))) bj j)))) (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i (@snd bool (ordinal (S (@pred_Nirr gT (@gval gT G)))) (@pair bool (ordinal (S (@pred_Nirr gT (@gval gT G)))) bj j)))))))) *) rewrite -dchi_ndirrE !eq_scaled_irr signr_eq0 !(inj_eq signr_inj) /=. (* Goal: @eq Algebraics.Implementation.type (if andb (@eq_op bool_eqType bi (negb bj)) (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i j) then @GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) else @GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (andb (@eq_op bool_eqType bi bj) (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i j)))) (@GRing.add (GRing.Ring.zmodType (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)) (nat_of_bool (andb (@eq_op bool_eqType bi bj) (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i j)))) (@GRing.opp (GRing.Ring.zmodType (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)) (nat_of_bool (andb (@eq_op bool_eqType bi (negb bj)) (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i j)))))) *) by rewrite -!negb_add addbN negbK; case: andP => [[->]|]; rewrite ?subr0 ?add0r. Qed. Lemma dchi_vchar i : dchi i \in 'Z[irr G]. Proof. (* Goal: is_true (@in_mem (@classfun gT (@gval gT G)) (@dchi (@gval gT G) i) (@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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) *) by case: i => b i; rewrite rpredZsign irr_vchar. Qed. Lemma cfnorm_dchi (i : dIirr G) : '[dchi i] = 1. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@dchi (@gval gT G) i) (@dchi (@gval gT G) i)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) *) by case: i => b i; rewrite cfnorm_sign cfnorm_irr. Qed. Lemma dirr_inj : injective (@dchi G). Proof. (* Goal: @injective (@classfun gT (@gval gT G)) (dIirr (@gval gT G)) (@dchi (@gval gT G)) *) case=> b1 i1 [b2 i2] /eqP; rewrite eq_scaled_irr (inj_eq signr_inj) /=. (* Goal: forall _ : is_true (andb (@eq_op bool_eqType b1 b2) (orb (@eq_op (GRing.Ring.eqType Algebraics.Implementation.ringType) (@GRing.exp Algebraics.Implementation.ringType (@GRing.opp (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType)) (nat_of_bool b1)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i1 i2))), @eq (dIirr (@gval gT G)) (@pair bool (ordinal (S (@pred_Nirr gT (@gval gT G)))) b1 i1) (@pair bool (ordinal (S (@pred_Nirr gT (@gval gT G)))) b2 i2) *) by rewrite signr_eq0 -xpair_eqE => /eqP. Qed. Definition dirr_dIirr (B : {set gT}) J (f : J -> 'CF(B)) j : dIirr B := odflt (dirr1 B) [pick i | dchi i == f j]. Lemma dirr_dIirrPE J (f : J -> 'CF(G)) (P : pred J) : (forall j, P j -> f j \in dirr G) -> forall j, P j -> dchi (dirr_dIirr f j) = f j. Proof. (* Goal: forall (_ : forall (j : J) (_ : is_true (P j)), is_true (@in_mem (@classfun gT (@gval gT G)) (f j) (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@dirr gT (@gval gT G))))) (j : J) (_ : is_true (P j)), @eq (@classfun gT (@gval gT G)) (@dchi (@gval gT G) (@dirr_dIirr (@gval gT G) J f j)) (f j) *) rewrite /dirr_dIirr => dirrGf j Pj; case: pickP => [i /eqP //|]. (* Goal: forall _ : @eqfun bool (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @eq_op (@cfun_eqType gT (@gval gT G)) (@dchi (@gval gT G) i) (f j)) (fun _ : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => false), @eq (@classfun gT (@gval gT G)) (@dchi (@gval gT G) (@Option.default (dIirr (@gval gT G)) (dirr1 (@gval gT G)) (@None (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))))) (f j) *) by have /dIrrP[i-> /(_ i)/eqP] := dirrGf j Pj. Qed. Lemma dirr_dIirrE J (f : J -> 'CF(G)) : (forall j, f j \in dirr G) -> forall j, dchi (dirr_dIirr f j) = f j. Proof. (* Goal: forall (_ : forall j : J, is_true (@in_mem (@classfun gT (@gval gT G)) (f j) (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@dirr gT (@gval gT G))))) (j : J), @eq (@classfun gT (@gval gT G)) (@dchi (@gval gT G) (@dirr_dIirr (@gval gT G) J f j)) (f j) *) by move=> dirrGf j; apply: (@dirr_dIirrPE _ _ xpredT). Qed. Definition dirr_constt (B : {set gT}) (phi: 'CF(B)) : {set (dIirr B)} := [set i | 0 < '[phi, dchi i]]. Lemma dirr_consttE (phi : 'CF(G)) (i : dIirr G) : (i \in dirr_constt phi) = (0 < '[phi, dchi i]). Proof. (* Goal: @eq bool (@in_mem (dIirr (@gval gT G)) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@Num.Def.ltr Algebraics.Implementation.numDomainType (GRing.zero (Num.NumDomain.zmodType Algebraics.Implementation.numDomainType)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i))) *) by rewrite inE. Qed. Lemma Cnat_dirr (phi : 'CF(G)) i : phi \in 'Z[irr G] -> i \in dirr_constt phi -> '[phi, dchi i] \in Cnat. 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))))) (_ : is_true (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi))))), is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cnat)) *) move=> PiZ; rewrite CnatEint dirr_consttE andbC => /ltrW -> /=. (* Goal: is_true (@in_mem Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint)) *) by case: i => b i; rewrite cfdotZr rmorph_sign rpredMsign Cint_cfdot_vchar_irr. Qed. Lemma dirr_constt_oppr (i : dIirr G) (phi : 'CF(G)) : (i \in dirr_constt (-phi)) = (ndirr i \in dirr_constt phi). Proof. (* Goal: @eq bool (@in_mem (dIirr (@gval gT G)) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) phi))))) (@in_mem (dIirr (@gval gT G)) (@ndirr (@gval gT G) i) (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) *) by rewrite !dirr_consttE dchi_ndirrE cfdotNl cfdotNr. Qed. Lemma dirr_constt_oppI (phi: 'CF(G)) : dirr_constt phi :&: dirr_constt (-phi) = set0. Proof. (* Goal: @eq (@set_of (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (Phant (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))))) (@setI (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi) (@dirr_constt (@gval gT G) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) phi))) (@set0 (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) *) apply/setP=> i; rewrite inE !dirr_consttE cfdotNl inE. (* Goal: @eq bool (andb (@Num.Def.ltr Algebraics.Implementation.numDomainType (GRing.zero (Num.NumDomain.zmodType Algebraics.Implementation.numDomainType)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i))) (@Num.Def.ltr Algebraics.Implementation.numDomainType (GRing.zero (Num.NumDomain.zmodType Algebraics.Implementation.numDomainType)) (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i))))) false *) apply/idP=> /andP [L1 L2]; have := ltr_paddl (ltrW L1) L2. (* Goal: forall _ : is_true (@Num.Def.ltr Algebraics.Implementation.numDomainType (GRing.zero (Num.NumDomain.zmodType Algebraics.Implementation.numDomainType)) (@GRing.add (Num.NumDomain.zmodType Algebraics.Implementation.numDomainType) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i))))), False *) by rewrite subrr ltr_def eqxx. Qed. Lemma dirr_constt_oppl (phi: 'CF(G)) i : i \in dirr_constt phi -> (ndirr i) \notin dirr_constt phi. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))), is_true (negb (@in_mem (dIirr (@gval gT G)) (@ndirr (@gval gT G) i) (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi))))) *) rewrite !dirr_consttE dchi_ndirrE cfdotNr oppr_gt0. (* Goal: forall _ : is_true (@Num.Def.ltr Algebraics.Implementation.numDomainType (GRing.zero (Num.NumDomain.zmodType Algebraics.Implementation.numDomainType)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i))), is_true (negb (@Num.Def.ltr Algebraics.Implementation.numDomainType (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (GRing.zero (Num.NumDomain.zmodType Algebraics.Implementation.numDomainType)))) *) by move/ltrW=> /ler_gtF ->. Qed. Definition to_dirr (B : {set gT}) (phi : 'CF(B)) (i : Iirr B) : dIirr B := ('[phi, 'chi_i] < 0, i). Definition of_irr (B : {set gT}) (i : dIirr B) : Iirr B := i.2. Lemma irr_constt_to_dirr (phi: 'CF(G)) i : phi \in 'Z[irr G] -> (i \in irr_constt phi) = (to_dirr phi i \in dirr_constt phi). 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), @eq bool (@in_mem (ordinal (S (@pred_Nirr gT (@gval gT G)))) i (@mem (ordinal (S (@pred_Nirr gT (@gval gT G)))) (simplPredType (ordinal (S (@pred_Nirr gT (@gval gT G))))) (@irr_constt gT (@gval gT G) phi))) (@in_mem (dIirr (@gval gT G)) (@to_dirr (@gval gT G) phi i) (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) *) move=> Zphi; rewrite irr_consttE dirr_consttE cfdotZr rmorph_sign /=. (* Goal: @eq bool (negb (@eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))) (@Num.Def.ltr Algebraics.Implementation.numDomainType (GRing.zero (Num.NumDomain.zmodType Algebraics.Implementation.numDomainType)) (@GRing.mul (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (@GRing.exp (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (@GRing.opp (GRing.Ring.zmodType (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType)) (GRing.one (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType))) (nat_of_bool (@Num.Def.ltr Algebraics.Implementation.numDomainType (@cfdot gT (@gval gT G) phi (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (GRing.zero (Num.NumDomain.zmodType Algebraics.Implementation.numDomainType))))) (@cfdot gT (@gval gT G) phi (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)))) *) by rewrite -real_normrEsign ?normr_gt0 ?Creal_Cint // Cint_cfdot_vchar_irr. Qed. Lemma to_dirrK (phi: 'CF(G)) : cancel (to_dirr phi) (@of_irr G). Proof. (* Goal: @cancel (dIirr (@gval gT G)) (ordinal (S (@pred_Nirr gT (@gval gT G)))) (@to_dirr (@gval gT G) phi) (@of_irr (@gval gT G)) *) by []. Qed. Lemma of_irrK (phi: 'CF(G)) : {in dirr_constt phi, cancel (@of_irr G) (to_dirr phi)}. Proof. (* Goal: @prop_in1 (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi))) (fun x : dIirr (@gval gT G) => @eq (dIirr (@gval gT G)) (@to_dirr (@gval gT G) phi (@of_irr (@gval gT G) x)) x) (inPhantom (@cancel (ordinal (S (@pred_Nirr gT (@gval gT G)))) (dIirr (@gval gT G)) (@of_irr (@gval gT G)) (@to_dirr (@gval gT G) phi))) *) case=> b i; rewrite dirr_consttE cfdotZr rmorph_sign /= /to_dirr mulr_sign. (* Goal: forall _ : is_true (@Num.Def.ltr Algebraics.Implementation.numDomainType (GRing.zero (Num.NumDomain.zmodType Algebraics.Implementation.numDomainType)) (if b then @GRing.opp (GRing.Ring.zmodType (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType)) (@cfdot gT (@gval gT G) phi (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) else @cfdot gT (@gval gT G) phi (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i))), @eq (dIirr (@gval gT G)) (@pair bool (ordinal (S (@pred_Nirr gT (@gval gT G)))) (@Num.Def.ltr Algebraics.Implementation.numDomainType (@cfdot gT (@gval gT G) phi (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (GRing.zero (Num.NumDomain.zmodType Algebraics.Implementation.numDomainType))) i) (@pair bool (ordinal (S (@pred_Nirr gT (@gval gT G)))) b i) *) by rewrite fun_if oppr_gt0; case: b => [|/ltrW/ler_gtF] ->. Qed. Lemma cfdot_todirrE (phi: 'CF(G)) i (phi_i := dchi (to_dirr phi i)) : '[phi, phi_i] *: phi_i = '[phi, 'chi_i] *: 'chi_i. Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi phi_i) phi_i) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) *) by rewrite cfdotZr rmorph_sign mulrC -scalerA signrZK. Qed. Lemma cfun_sum_dconstt (phi : 'CF(G)) : phi \in 'Z[irr G] -> phi = \sum_(i in dirr_constt phi) '[phi, dchi i] *: dchi i. 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), @eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (@dchi (@gval gT G) i)))) *) move=> PiZ; rewrite [LHS]cfun_sum_constt. (* Goal: @eq (@classfun gT (@gval gT G)) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (Finite.sort (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (index_enum (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (fun i : Finite.sort (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (Finite.sort (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@in_mem (Finite.sort (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) i (@mem (ordinal (S (@pred_Nirr gT (@gval gT G)))) (simplPredType (ordinal (S (@pred_Nirr gT (@gval gT G))))) (@irr_constt gT (@gval gT G) phi))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)))) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (@dchi (@gval gT G) i)))) *) rewrite (reindex (to_dirr phi))=> [/= |]; last first. (* Goal: @eq (@classfun gT (@gval gT G)) (@BigOp.bigop (@classfun gT (@gval gT G)) (ordinal (S (@pred_Nirr 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))))) (index_enum (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @BigBody (@classfun gT (@gval gT G)) (ordinal (S (@pred_Nirr gT (@gval gT G)))) i (@GRing.add (@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))))) (@in_mem (ordinal (S (@pred_Nirr gT (@gval gT G)))) i (@mem (ordinal (S (@pred_Nirr gT (@gval gT G)))) (simplPredType (ordinal (S (@pred_Nirr gT (@gval gT G))))) (@irr_constt gT (@gval gT G) phi))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)))) (@BigOp.bigop (@classfun gT (@gval gT G)) (ordinal (S (@pred_Nirr 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))))) (index_enum (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @BigBody (@classfun gT (@gval gT G)) (ordinal (S (@pred_Nirr gT (@gval gT G)))) j (@GRing.add (@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))))) (@in_mem (prod bool (ordinal (S (@pred_Nirr gT (@gval gT G))))) (@to_dirr (@gval gT G) phi j) (@mem (prod bool (ordinal (S (@pred_Nirr gT (@gval gT G))))) (predPredType (prod bool (ordinal (S (@pred_Nirr gT (@gval gT G)))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) (@to_dirr (@gval gT G) phi j))) (@dchi (@gval gT G) (@to_dirr (@gval gT G) phi j))))) *) (* Goal: @bijective_on (Finite.sort (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (simplPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SimplPred (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))))) (@to_dirr (@gval gT G) phi) *) by exists (@of_irr _)=> //; apply: of_irrK . (* Goal: @eq (@classfun gT (@gval gT G)) (@BigOp.bigop (@classfun gT (@gval gT G)) (ordinal (S (@pred_Nirr 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))))) (index_enum (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (fun i : ordinal (S (@pred_Nirr gT (@gval gT G))) => @BigBody (@classfun gT (@gval gT G)) (ordinal (S (@pred_Nirr gT (@gval gT G)))) i (@GRing.add (@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))))) (@in_mem (ordinal (S (@pred_Nirr gT (@gval gT G)))) i (@mem (ordinal (S (@pred_Nirr gT (@gval gT G)))) (simplPredType (ordinal (S (@pred_Nirr gT (@gval gT G))))) (@irr_constt gT (@gval gT G) phi))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i)))) (@BigOp.bigop (@classfun gT (@gval gT G)) (ordinal (S (@pred_Nirr 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))))) (index_enum (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (fun j : ordinal (S (@pred_Nirr gT (@gval gT G))) => @BigBody (@classfun gT (@gval gT G)) (ordinal (S (@pred_Nirr gT (@gval gT G)))) j (@GRing.add (@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))))) (@in_mem (prod bool (ordinal (S (@pred_Nirr gT (@gval gT G))))) (@to_dirr (@gval gT G) phi j) (@mem (prod bool (ordinal (S (@pred_Nirr gT (@gval gT G))))) (predPredType (prod bool (ordinal (S (@pred_Nirr gT (@gval gT G)))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) (@to_dirr (@gval gT G) phi j))) (@dchi (@gval gT G) (@to_dirr (@gval gT G) phi j))))) *) by apply: eq_big => i; rewrite ?irr_constt_to_dirr // cfdot_todirrE. Qed. Lemma cnorm_dconstt (phi : 'CF(G)) : phi \in 'Z[irr G] -> '[phi] = \sum_(i in dirr_constt phi) '[phi, dchi i] ^+ 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@GRing.exp (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (S (S O))))) *) move=> PiZ; rewrite {1 2}(cfun_sum_dconstt PiZ). (* 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.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (@dchi (@gval gT G) i)))) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (@dchi (@gval gT G) i))))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@GRing.exp (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (S (S O))))) *) rewrite cfdot_suml; apply: eq_bigr=> i IiD. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (@dchi (@gval gT G) i)) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (@dchi (@gval gT G) i))))) (@GRing.exp (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (S (S O))) *) rewrite cfdot_sumr (bigD1 i) //= big1 ?addr0 => [|j /andP [JiD IdJ]]. (* Goal: @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (@dchi (@gval gT G) i)) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) j)) (@dchi (@gval gT G) j))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) (* Goal: @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (@dchi (@gval gT G) i)) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (@dchi (@gval gT G) i))) (@GRing.exp (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (S (S O))) *) rewrite cfdotZr cfdotZl cfdot_dchi eqxx eq_sym (negPf (ndirr_diff i)). (* Goal: @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (@dchi (@gval gT G) i)) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) j)) (@dchi (@gval gT G) j))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) (* Goal: @eq Algebraics.Implementation.type (@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) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i))) (@GRing.mul Algebraics.Implementation.ringType (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (@GRing.add (GRing.Ring.zmodType (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)) (nat_of_bool true)) (@GRing.opp (GRing.Ring.zmodType (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)) (nat_of_bool false)))))) (@GRing.exp (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (S (S O))) *) by rewrite subr0 mulr1 aut_Cnat ?Cnat_dirr. (* Goal: @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (@dchi (@gval gT G) i)) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) j)) (@dchi (@gval gT G) j))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) rewrite cfdotZr cfdotZl cfdot_dchi eq_sym (negPf IdJ) -natrB ?mulr0 //. (* Goal: is_true (leq (nat_of_bool (@eq_op (prod_eqType bool_eqType (ordinal_eqType (S (@pred_Nirr gT (@gval gT G))))) i (@ndirr (@gval gT G) j))) (nat_of_bool false)) *) by rewrite (negPf (contraNneq _ (dirr_constt_oppl JiD))) => // <-. Qed. Lemma dirr_small_norm (phi : 'CF(G)) n : phi \in 'Z[irr G] -> '[phi] = n%:R -> (n < 4)%N -> [/\ #|dirr_constt phi| = n, dirr_constt phi :&: dirr_constt (- phi) = set0 & phi = \sum_(i in dirr_constt phi) dchi i]. 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)))) (@Zchar gT (@gval gT G) (@tval (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))))) (_ : @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) n)) (_ : is_true (leq (S n) (S (S (S (S O)))))), and3 (@eq nat (@card (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) n) (@eq (@set_of (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (Phant (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))))) (@setI (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi) (@dirr_constt (@gval gT G) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) phi))) (@set0 (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (@cfun_zmodType gT (@gval gT G))) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@dchi (@gval gT G) i)))) *) move=> PiZ Pln; rewrite ltnNge -leC_nat => Nl4. (* Goal: and3 (@eq nat (@card (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) n) (@eq (@set_of (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (Phant (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))))) (@setI (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi) (@dirr_constt (@gval gT G) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) phi))) (@set0 (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (@cfun_zmodType gT (@gval gT G))) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@dchi (@gval gT G) i)))) *) suffices Fd i: i \in dirr_constt phi -> '[phi, dchi i] = 1. (* Goal: forall _ : is_true (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) *) (* Goal: and3 (@eq nat (@card (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) n) (@eq (@set_of (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (Phant (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))))) (@setI (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi) (@dirr_constt (@gval gT G) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) phi))) (@set0 (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (@cfun_zmodType gT (@gval gT G))) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@dchi (@gval gT G) i)))) *) split; last 2 [by apply/setP=> u; rewrite !inE cfdotNl oppr_gt0 ltr_asym]. (* Goal: forall _ : is_true (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) *) (* Goal: @eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (@cfun_zmodType gT (@gval gT G))) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@dchi (@gval gT G) i))) *) (* Goal: @eq nat (@card (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) n *) apply/eqP; rewrite -eqC_nat -sumr_const -Pln (cnorm_dconstt PiZ). (* Goal: forall _ : is_true (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) *) (* Goal: @eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (@cfun_zmodType gT (@gval gT G))) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@dchi (@gval gT G) i))) *) (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (GRing.one Algebraics.Implementation.ringType))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@GRing.exp (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (S (S O)))))) *) by apply/eqP/eq_bigr=> i Hi; rewrite Fd // expr1n. (* Goal: forall _ : is_true (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) *) (* Goal: @eq (@classfun gT (@gval gT G)) phi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (@cfun_zmodType gT (@gval gT G))) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@dchi (@gval gT G) i))) *) rewrite {1}[phi]cfun_sum_dconstt //. (* Goal: forall _ : is_true (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) *) (* Goal: @eq (@classfun gT (@gval gT G)) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType 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))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_lmodType gT (@gval gT G)))))) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (@dchi (@gval gT G) i)))) (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (index_enum (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (fun i : Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@GRing.add (@cfun_zmodType gT (@gval gT G))) (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (@dchi (@gval gT G) i))) *) by apply: eq_bigr => i /Fd->; rewrite scale1r. (* Goal: forall _ : is_true (@in_mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i (@mem (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) (predPredType (Finite.sort (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) *) move=> IiD; apply: contraNeq Nl4 => phi_i_neq1. (* Goal: is_true (@Num.Def.ler Algebraics.Implementation.numDomainType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (S (S (S (S O))))) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) n)) *) rewrite -Pln cnorm_dconstt // (bigD1 i) ?ler_paddr ?sumr_ge0 //=. (* Goal: is_true (@Num.Def.ler Algebraics.Implementation.numDomainType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (S (S (S (S O))))) (@GRing.exp (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (S (S O)))) *) (* Goal: forall (i0 : prod bool (ordinal (S (@pred_Nirr gT (@gval gT G))))) (_ : is_true (andb (@in_mem (prod bool (ordinal (S (@pred_Nirr gT (@gval gT G))))) i0 (@mem (prod bool (ordinal (S (@pred_Nirr gT (@gval gT G))))) (predPredType (prod bool (ordinal (S (@pred_Nirr gT (@gval gT G)))))) (@SetDef.pred_of_set (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G))))) (@dirr_constt (@gval gT G) phi)))) (negb (@eq_op (Finite.eqType (prod_finType bool_finType (ordinal_finType (S (@pred_Nirr gT (@gval gT G)))))) i0 i)))), is_true (@Num.Def.ler Algebraics.Implementation.numDomainType (GRing.zero (Num.NumDomain.zmodType Algebraics.Implementation.numDomainType)) (@GRing.exp (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i0)) (S (S O)))) *) by move=> j /andP[JiD _]; rewrite exprn_ge0 ?Cnat_ge0 ?Cnat_dirr. (* Goal: is_true (@Num.Def.ler Algebraics.Implementation.numDomainType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (S (S (S (S O))))) (@GRing.exp (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) phi (@dchi (@gval gT G) i)) (S (S O)))) *) have /CnatP[m Dm] := Cnat_dirr PiZ IiD; rewrite Dm -natrX ler_nat (leq_sqr 2). (* Goal: is_true (leq (S (S O)) m) *) by rewrite ltn_neqAle eq_sym -eqC_nat -ltC_nat -Dm phi_i_neq1 -dirr_consttE. Qed. Lemma cfdot_sum_dchi (phi1 phi2 : 'CF(G)) : '[\sum_(i in dirr_constt phi1) dchi i, \sum_(i in dirr_constt phi2) dchi i] = #|dirr_constt phi1 :&: dirr_constt phi2|%:R - #|dirr_constt phi1 :&: dirr_constt (- phi2)|%:R. Lemma cfdot_dirr_eq1 : {in dirr G &, forall phi psi, ('[phi, psi] == 1) = (phi == psi)}. Proof. (* Goal: @prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@dirr gT (@gval gT G))) (fun phi psi : @classfun gT (@gval gT G) => @eq bool (@eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)) (inPhantom (forall phi psi : @classfun gT (@gval gT G), @eq bool (@eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))) *) move=> _ _ /dirrP[b1 [i1 ->]] /dirrP[b2 [i2 ->]]. (* Goal: @eq bool (@eq_op (GRing.Ring.eqType (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)) (nat_of_bool b1)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i1)) (@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)) (nat_of_bool b2)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i2))) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@eq_op (@cfun_eqType 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)) (nat_of_bool b1)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i1)) (@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)) (nat_of_bool b2)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i2))) *) rewrite eq_signed_irr cfdotZl cfdotZr rmorph_sign cfdot_irr mulrA -signr_addb. (* Goal: @eq bool (@eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul Algebraics.Implementation.ringType (@GRing.exp Algebraics.Implementation.ringType (@GRing.opp (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType)) (nat_of_bool (addb b1 b2))) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i1 i2)))) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (andb (@eq_op bool_eqType b1 b2) (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i1 i2)) *) rewrite pmulrn -rmorphMsign (eqr_int _ _ 1) -negb_add. (* Goal: @eq bool (@eq_op int_eqType (@GRing.mul int_Ring (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (addb b1 b2))) (Posz (nat_of_bool (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i1 i2)))) (GRing.one int_Ring)) (andb (negb (addb b1 b2)) (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i1 i2)) *) by case: (b1 (+) b2) (i1 == i2) => [] []. Qed. Lemma cfdot_add_dirr_eq1 : {in dirr G & &, forall phi1 phi2 psi, '[phi1 + phi2, psi] = 1 -> psi = phi1 \/ psi = phi2}. Proof. (* Goal: @prop_in3 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) (@dirr gT (@gval gT G))) (fun (phi1 phi2 : GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (psi : @classfun gT (@gval gT G)) => forall _ : @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.add (@cfun_zmodType gT (@gval gT G)) phi1 phi2) psi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)), or (@eq (@classfun gT (@gval gT G)) psi phi1) (@eq (@classfun gT (@gval gT G)) psi phi2)) (inPhantom (forall (phi1 phi2 : GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (psi : @classfun gT (@gval gT G)) (_ : @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.add (@cfun_zmodType gT (@gval gT G)) phi1 phi2) psi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))), or (@eq (@classfun gT (@gval gT G)) psi phi1) (@eq (@classfun gT (@gval gT G)) psi phi2))) *) move=> _ _ _ /dirrP[b1 [i1 ->]] /dirrP[b2 [i2 ->]] /dirrP[c [j ->]] /eqP. (* Goal: forall _ : is_true (@eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.add (@cfun_zmodType 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)) (nat_of_bool b1)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i1)) (@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)) (nat_of_bool b2)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i2))) (@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)) (nat_of_bool c)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j))) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))), or (@eq (@classfun 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)) (nat_of_bool c)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@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)) (nat_of_bool b1)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i1))) (@eq (@classfun 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)) (nat_of_bool c)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@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)) (nat_of_bool b2)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i2))) *) rewrite cfdotDl !cfdotZl !cfdotZr !rmorph_sign !cfdot_irr !mulrA -!signr_addb. (* Goal: forall _ : is_true (@eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul Algebraics.Implementation.ringType (@GRing.exp Algebraics.Implementation.ringType (@GRing.opp (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType)) (nat_of_bool (addb b1 c))) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i1 j)))) (@GRing.mul Algebraics.Implementation.ringType (@GRing.exp Algebraics.Implementation.ringType (@GRing.opp (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType)) (nat_of_bool (addb b2 c))) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i2 j))))) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))), or (@eq (@classfun 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)) (nat_of_bool c)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@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)) (nat_of_bool b1)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i1))) (@eq (@classfun 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)) (nat_of_bool c)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@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)) (nat_of_bool b2)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i2))) *) rewrite 2!{1}signrE !mulrBl !mul1r -!natrM addrCA -subr_eq0 -!addrA. (* Goal: forall _ : is_true (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@GRing.add (GRing.Ring.zmodType (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)) (nat_of_bool (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i2 j))) (@GRing.add (GRing.Ring.zmodType (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)) (nat_of_bool (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i1 j))) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.opp (GRing.Ring.zmodType Algebraics.Implementation.ringType) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (muln (double (nat_of_bool (addb b1 c))) (nat_of_bool (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i1 j))))) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.opp (GRing.Ring.zmodType Algebraics.Implementation.ringType) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (muln (double (nat_of_bool (addb b2 c))) (nat_of_bool (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i2 j))))) (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))), or (@eq (@classfun 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)) (nat_of_bool c)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@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)) (nat_of_bool b1)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i1))) (@eq (@classfun 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)) (nat_of_bool c)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@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)) (nat_of_bool b2)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i2))) *) rewrite -!opprD addrA subr_eq0 -mulrSr -!natrD eqr_nat => eq_phi_psi. (* Goal: or (@eq (@classfun 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)) (nat_of_bool c)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@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)) (nat_of_bool b1)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i1))) (@eq (@classfun 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)) (nat_of_bool c)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) j)) (@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)) (nat_of_bool b2)) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i2))) *) apply/pred2P; rewrite /= !eq_signed_irr -!negb_add !(eq_sym j) !(addbC c). (* Goal: is_true (orb (andb (negb (addb b1 c)) (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i1 j)) (andb (negb (addb b2 c)) (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i2 j))) *) by case: (i1 == j) eq_phi_psi; case: (i2 == j); do 2!case: (_ (+) c). Qed. End Norm1vchar. Prenex Implicits ndirr ndirrK to_dirr to_dirrK of_irr. Arguments of_irrK {gT G phi} [i] phi_i : rename.
Definition identity (A:Set) := fun a:A=> a. Definition compose (A B C:Set) (g:B->C) (f:A->B) := fun a:A=>g(f a). Section Denumerability. Definition same_cardinality (A:Set) (B:Set) := {f:A->B & { g:B->A | (forall b,(compose _ _ _ f g) b= (identity B) b) /\ forall a,(compose _ _ _ g f) a = (identity A) a}}. Definition is_denumerable A := same_cardinality A nat. Lemma same_cardinality_transitive:forall A B C, same_cardinality A B -> same_cardinality B C -> same_cardinality A C. Lemma is_denumerable_transitive:forall A B, is_denumerable A -> same_cardinality B A -> is_denumerable B. End Denumerability. Require Div2. Require Import ZArith. Definition Z_to_nat_i (z:Z) :nat := match z with | Z0 => O | Zpos p => Div2.double (nat_of_P p) | Zneg p => pred (Div2.double (nat_of_P p)) end. Lemma odd_pred2n: forall n : nat, Even.odd n -> {p : nat | n = pred (Div2.double p)}. Proof. (* Goal: forall (n : nat) (_ : Even.odd n), @sig nat (fun p : nat => @eq nat n (Init.Nat.pred (Nat.double p))) *) intros n H_odd; rewrite (Div2.odd_double _ H_odd); exists (S (Div2.div2 n)); generalize (Div2.div2 n); clear n H_odd; intros n; rewrite Div2.double_S; reflexivity. Qed. Lemma even_odd_exists_dec:forall n, {p : nat | n = Div2.double p} + {p : nat | n = pred (Div2.double p)}. Definition nat_to_Z_i (n:nat) := match even_odd_exists_dec n with | inl s => let (k, _) := s in Z_of_nat k | inr s => let (k, _) := s in Z.opp (Z_of_nat k) end. Lemma double_eq_half_eq:forall m n, Div2.double m = Div2.double n -> m =n. Lemma parity_mismatch_not_eq:forall m n, Even.even m -> Even.odd n -> ~m=n. Lemma even_double:forall n, Even.even (Div2.double n). Lemma double_S_neq_pred:forall m n, ~Div2.double (S m) = pred (Div2.double n). Lemma eq_add_pred : forall n m : nat, pred n = pred m -> {n = m} + {n<2/\m<2}. Proof. (* Goal: forall (n m : nat) (_ : @eq nat (Init.Nat.pred n) (Init.Nat.pred m)), sumbool (@eq nat n m) (and (lt n (S (S O))) (lt m (S (S O)))) *) intros [|[|n]] m; simpl; intros H; try (right; omega); left; rewrite (f_equal S H); symmetry; apply S_pred with 0; omega. Qed. Lemma nat_to_Z_to_nat_i : forall (z:Z), nat_to_Z_i (Z_to_nat_i z) = z. Proof. (* Goal: forall z : Z, @eq Z (nat_to_Z_i (Z_to_nat_i z)) z *) intros [|p|p]; unfold nat_to_Z_i. (* Goal: @eq Z match even_odd_exists_dec (Z_to_nat_i (Zneg p)) with | inl (exist _ k x as s) => Z.of_nat k | inr (exist _ k x as s) => Z.opp (Z.of_nat k) end (Zneg p) *) (* Goal: @eq Z match even_odd_exists_dec (Z_to_nat_i (Zpos p)) with | inl (exist _ k x as s) => Z.of_nat k | inr (exist _ k x as s) => Z.opp (Z.of_nat k) end (Zpos p) *) (* Goal: @eq Z match even_odd_exists_dec (Z_to_nat_i Z0) with | inl (exist _ k x as s) => Z.of_nat k | inr (exist _ k x as s) => Z.opp (Z.of_nat k) end Z0 *) simpl; case (even_odd_exists_dec 0); intros [k Hk]; [transitivity (Z_of_nat 0) |transitivity (Z.opp (Z_of_nat 0)) ]; trivial; try apply (f_equal Z.opp); apply (f_equal Z_of_nat); unfold Div2.double in Hk; omega. (* Goal: @eq Z match even_odd_exists_dec (Z_to_nat_i (Zneg p)) with | inl (exist _ k x as s) => Z.of_nat k | inr (exist _ k x as s) => Z.opp (Z.of_nat k) end (Zneg p) *) (* Goal: @eq Z match even_odd_exists_dec (Z_to_nat_i (Zpos p)) with | inl (exist _ k x as s) => Z.of_nat k | inr (exist _ k x as s) => Z.opp (Z.of_nat k) end (Zpos p) *) case (even_odd_exists_dec (Z_to_nat_i (Zpos p)) ); intros [k Hk]. (* Goal: @eq Z match even_odd_exists_dec (Z_to_nat_i (Zneg p)) with | inl (exist _ k x as s) => Z.of_nat k | inr (exist _ k x as s) => Z.opp (Z.of_nat k) end (Zneg p) *) (* Goal: @eq Z (Z.opp (Z.of_nat k)) (Zpos p) *) (* Goal: @eq Z (Z.of_nat k) (Zpos p) *) unfold Z_to_nat_i in Hk; rewrite <- (double_eq_half_eq _ _ Hk); symmetry; apply Zpos_eq_Z_of_nat_o_nat_of_P. (* Goal: @eq Z match even_odd_exists_dec (Z_to_nat_i (Zneg p)) with | inl (exist _ k x as s) => Z.of_nat k | inr (exist _ k x as s) => Z.opp (Z.of_nat k) end (Zneg p) *) (* Goal: @eq Z (Z.opp (Z.of_nat k)) (Zpos p) *) apply False_ind; unfold Z_to_nat_i in Hk; destruct (ZL4 p) as [m Hm]; rewrite Hm in Hk; apply (double_S_neq_pred m k); assumption. (* Goal: @eq Z match even_odd_exists_dec (Z_to_nat_i (Zneg p)) with | inl (exist _ k x as s) => Z.of_nat k | inr (exist _ k x as s) => Z.opp (Z.of_nat k) end (Zneg p) *) case (even_odd_exists_dec (Z_to_nat_i (Zneg p)) ); intros [k Hk]. (* Goal: @eq Z (Z.opp (Z.of_nat k)) (Zneg p) *) (* Goal: @eq Z (Z.of_nat k) (Zneg p) *) unfold Z_to_nat_i in Hk; unfold Div2.double in Hk; destruct (ZL4 p) as [m Hm]; omega. (* Goal: @eq Z (Z.opp (Z.of_nat k)) (Zneg p) *) unfold Z_to_nat_i in Hk; case (eq_add_pred _ _ Hk). (* Goal: forall _ : and (lt (Nat.double (Pos.to_nat p)) (S (S O))) (lt (Nat.double k) (S (S O))), @eq Z (Z.opp (Z.of_nat k)) (Zneg p) *) (* Goal: forall _ : @eq nat (Nat.double (Pos.to_nat p)) (Nat.double k), @eq Z (Z.opp (Z.of_nat k)) (Zneg p) *) intro Hk'; rewrite <- (double_eq_half_eq _ _ Hk'); symmetry; apply Z.opp_inj; rewrite Zopp_neg; rewrite Z.opp_involutive; apply Zpos_eq_Z_of_nat_o_nat_of_P. (* Goal: forall _ : and (lt (Nat.double (Pos.to_nat p)) (S (S O))) (lt (Nat.double k) (S (S O))), @eq Z (Z.opp (Z.of_nat k)) (Zneg p) *) intros [H_nat_p_lt_2 _]; apply False_ind; destruct (ZL4 p) as [m Hm]; rewrite Hm in H_nat_p_lt_2; rewrite Div2.double_S in H_nat_p_lt_2; omega. Qed. Lemma Z_to_nat_to_Z_i : forall (n:nat), Z_to_nat_i (nat_to_Z_i n) = n. Proof. (* Goal: forall n : nat, @eq nat (Z_to_nat_i (nat_to_Z_i n)) n *) intros [|n]; unfold nat_to_Z_i. (* Goal: @eq nat (Z_to_nat_i match even_odd_exists_dec (S n) with | inl (exist _ k x as s) => Z.of_nat k | inr (exist _ k x as s) => Z.opp (Z.of_nat k) end) (S n) *) (* Goal: @eq nat (Z_to_nat_i match even_odd_exists_dec O with | inl (exist _ k x as s) => Z.of_nat k | inr (exist _ k x as s) => Z.opp (Z.of_nat k) end) O *) case (even_odd_exists_dec 0); intros [k Hk]; transitivity (Z_to_nat_i (Z_of_nat 0)); trivial; apply (f_equal Z_to_nat_i); simpl; unfold Div2.double in Hk; omega. (* Goal: @eq nat (Z_to_nat_i match even_odd_exists_dec (S n) with | inl (exist _ k x as s) => Z.of_nat k | inr (exist _ k x as s) => Z.opp (Z.of_nat k) end) (S n) *) case (even_odd_exists_dec (S n)); intros [[|k] Hk]; rewrite Hk; trivial; simpl; [apply (f_equal Div2.double); apply nat_of_P_o_P_of_succ_nat_eq_succ |transitivity (pred (Div2.double (S k))); trivial; apply (f_equal pred); apply (f_equal Div2.double); apply nat_of_P_o_P_of_succ_nat_eq_succ ]. Qed. Theorem Z_is_denumerable:is_denumerable Z. Require Import Q_field. Fixpoint positive_to_Qpositive_i (p:positive) : Qpositive := match p with | xI p => nR (positive_to_Qpositive_i p) | xO p => dL (positive_to_Qpositive_i p) | xH => One end. Definition Z_to_Q_i (z:Z) := match z with | Z0 => Zero | Zpos p => Qpos (positive_to_Qpositive_i p) | Zneg p => Qneg (positive_to_Qpositive_i p) end. Fixpoint Qpositive_to_positive_i (qp:Qpositive) : positive := match qp with | nR qp => xI (Qpositive_to_positive_i qp) | dL qp => xO (Qpositive_to_positive_i qp) | One => xH end. Definition Q_to_Z_i (q:Q) := match q with | Zero => Z0 | Qpos qp => Zpos (Qpositive_to_positive_i qp) | Qneg qp => Zneg (Qpositive_to_positive_i qp) end. Lemma Qpositive_to_positive_to_Qpositive_i : forall (p:positive), Qpositive_to_positive_i (positive_to_Qpositive_i p) = p. Proof. (* Goal: forall p : positive, @eq positive (Qpositive_to_positive_i (positive_to_Qpositive_i p)) p *) intros p; induction p as [p|p|]; trivial; simpl; rewrite IHp; trivial. Qed. Lemma positive_to_Qpositive_to_positive_i : forall qp, positive_to_Qpositive_i (Qpositive_to_positive_i qp) = qp. Proof. (* Goal: forall qp : Qpositive, @eq Qpositive (positive_to_Qpositive_i (Qpositive_to_positive_i qp)) qp *) intros p; induction p as [p|p|]; trivial; simpl; rewrite IHp; trivial. Qed. Lemma Q_to_Z_to_Q_i : forall (z:Z), Q_to_Z_i (Z_to_Q_i z) = z. Proof. (* Goal: forall z : Z, @eq Z (Q_to_Z_i (Z_to_Q_i z)) z *) intros [|p|p]; trivial; simpl; rewrite Qpositive_to_positive_to_Qpositive_i; trivial. Qed. Lemma Z_to_Q_to_Z_i : forall (q:Q), Z_to_Q_i (Q_to_Z_i q) = q. Proof. (* Goal: forall q : Q, @eq Q (Z_to_Q_i (Q_to_Z_i q)) q *) intros [|qp|qp]; trivial; simpl; rewrite positive_to_Qpositive_to_positive_i; trivial. Qed. Theorem Q_is_denumerable: is_denumerable Q. Proof. (* Goal: is_denumerable Q *) apply is_denumerable_transitive with Z. (* Goal: same_cardinality Q Z *) (* Goal: is_denumerable Z *) apply Z_is_denumerable. (* Goal: same_cardinality Q Z *) exists Q_to_Z_i; exists Z_to_Q_i; split; [ apply Q_to_Z_to_Q_i | apply Z_to_Q_to_Z_i ]. Qed.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrbool ssrfun eqtype ssrnat seq path fintype div. From mathcomp Require Import bigop prime finset fingroup morphism automorphism quotient. From mathcomp Require Import commutator gproduct gfunctor center gseries cyclic. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Import GroupScope. Section SeriesDefs. Variables (n : nat) (gT : finGroupType) (A : {set gT}). Definition lower_central_at_rec := iter n (fun B => [~: B, A]) A. Definition upper_central_at_rec := iter n (fun B => coset B @*^-1 'Z(A / B)) 1. End SeriesDefs. Definition lower_central_at n := lower_central_at_rec n.-1. Definition upper_central_at := nosimpl upper_central_at_rec. Arguments lower_central_at n%N {gT} A%g. Arguments upper_central_at n%N {gT} A%g. Notation "''L_' n ( G )" := (lower_central_at n G) (at level 8, n at level 2, format "''L_' n ( G )") : group_scope. Notation "''Z_' n ( G )" := (upper_central_at n G) (at level 8, n at level 2, format "''Z_' n ( G )") : group_scope. Section PropertiesDefs. Variables (gT : finGroupType) (A : {set gT}). Definition nilpotent := [forall (G : {group gT} | G \subset A :&: [~: G, A]), G :==: 1]. Definition nil_class := index 1 (mkseq (fun n => 'L_n.+1(A)) #|A|). Definition solvable := [forall (G : {group gT} | G \subset A :&: [~: G, G]), G :==: 1]. End PropertiesDefs. Arguments nilpotent {gT} A%g. Arguments nil_class {gT} A%g. Arguments solvable {gT} A%g. Section NilpotentProps. Variable gT: finGroupType. Implicit Types (A B : {set gT}) (G H : {group gT}). Lemma nilpotent1 : nilpotent [1 gT]. Proof. (* Goal: is_true (@nilpotent gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) *) by apply/forall_inP=> H; rewrite commG1 setIid -subG1. Qed. Lemma nilpotentS A B : B \subset A -> nilpotent A -> nilpotent 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)))) (_ : is_true (@nilpotent gT A)), is_true (@nilpotent gT B) *) move=> sBA nilA; apply/forall_inP=> H sHR. (* Goal: is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) have:= forallP nilA H; rewrite (subset_trans sHR) //. (* 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)) B (@commutator gT (@gval gT H) 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (@commutator gT (@gval gT H) A))))) *) by apply: subset_trans (setIS _ _) (setSI _ _); rewrite ?commgS. Qed. Lemma nil_comm_properl G H A : nilpotent G -> H \subset G -> H :!=: 1 -> A \subset 'N_G(H) -> [~: H, A] \proper H. Proof. (* Goal: forall (_ : is_true (@nilpotent 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 G))))) (_ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H : @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)))))))) (_ : 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@gval gT H))))))), is_true (@proper (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@commutator gT (@gval gT H) 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)))) *) move=> nilG sHG ntH; rewrite subsetI properE; case/andP=> sAG nHA. (* 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)) (@commutator gT (@gval gT H) 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)))) (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)) (@commutator gT (@gval gT H) A)))))) *) rewrite (subset_trans (commgS H (subset_gen A))) ?commg_subl ?gen_subG //. (* Goal: is_true (andb 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)) (@commutator gT (@gval gT H) A)))))) *) apply: contra ntH => sHR; have:= forallP nilG H; rewrite subsetI sHG. (* Goal: forall _ : is_true (implb (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)) (@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)) (@commutator gT (@gval gT H) (@gval gT G)))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))), is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) by rewrite (subset_trans sHR) ?commgS. Qed. Lemma nil_comm_properr G A H : nilpotent G -> H \subset G -> H :!=: 1 -> A \subset 'N_G(H) -> [~: A, H] \proper H. Proof. (* Goal: forall (_ : is_true (@nilpotent 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 G))))) (_ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H : @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)))))))) (_ : 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@gval gT H))))))), is_true (@proper (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@commutator gT A (@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 commGC; apply: nil_comm_properl. Qed. Lemma centrals_nil (s : seq {group gT}) G : G.-central.-series 1%G s -> last 1%G s = G -> nilpotent G. Proof. (* Goal: forall (_ : 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)))) (@group_rel_of gT (@central_factor gT (@gval gT G)))) (one_group gT) s)) (_ : @eq (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@last (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (one_group gT) s) G), is_true (@nilpotent gT (@gval gT G)) *) move=> cGs defG; apply/forall_inP=> H /subsetIP[sHG sHR]. (* Goal: is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) move: sHG; rewrite -{}defG -subG1 -[1]/(gval 1%G). (* 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 (@last (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (one_group gT) s))))), 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.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@gval gT (one_group gT))))) *) elim: s 1%G cGs => //= L s IHs K /andP[/and3P[sRK sKL sLG] /IHs sHL] sHs. (* 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.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@gval gT K)))) *) exact: subset_trans sHR (subset_trans (commSg _ (sHL sHs)) sRK). Qed. Lemma lcn1 A : 'L_1(A) = A. Proof. by []. Qed. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@lower_central_at (S O) gT A) A *) by []. Qed. Lemma lcnSnS n G : [~: 'L_n(G), G] \subset 'L_n.+1(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)) (@commutator gT (@lower_central_at n gT (@gval gT G)) (@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)) (@lower_central_at (S n) gT (@gval gT G))))) *) by case: n => //; apply: der1_subG. Qed. Lemma lcnE n A : 'L_n.+1(A) = lower_central_at_rec n A. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@lower_central_at (S n) gT A) (@lower_central_at_rec n gT A) *) by []. Qed. Lemma lcn_group_set n G : group_set 'L_n(G). Proof. (* Goal: is_true (@group_set gT (@lower_central_at n gT (@gval gT G))) *) by case: n => [|[|n]]; apply: groupP. Qed. Canonical lower_central_at_group n G := Group (lcn_group_set n G). Lemma lcn_char n G : 'L_n(G) \char G. Proof. (* Goal: is_true (@characteristic gT (@lower_central_at n gT (@gval gT G)) (@gval gT G)) *) by case: n; last elim=> [|n IHn]; rewrite ?char_refl ?lcnSn ?charR. Qed. Lemma lcn_normal n G : 'L_n(G) <| G. Proof. (* Goal: is_true (@normal gT (@lower_central_at n gT (@gval gT G)) (@gval gT G)) *) exact/char_normal/lcn_char. Qed. Lemma lcn_sub n G : 'L_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)) (@lower_central_at 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)))) *) exact/char_sub/lcn_char. Qed. Lemma lcn_norm n G : G \subset 'N('L_n(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)) (@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 (@lower_central_at n gT (@gval gT G)))))) *) exact/char_norm/lcn_char. Qed. Lemma lcn_subS n G : 'L_n.+1(G) \subset 'L_n(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)) (@lower_central_at (S 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)) (@lower_central_at n gT (@gval gT G))))) *) case: n => // n; rewrite lcnSn commGC commg_subr. (* 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 (@gval gT (lower_central_at_group (S n) G)))))) *) by case/andP: (lcn_normal n.+1 G). Qed. Lemma lcn_normalS n G : 'L_n.+1(G) <| 'L_n(G). Proof. (* Goal: is_true (@normal gT (@lower_central_at (S n) gT (@gval gT G)) (@lower_central_at n gT (@gval gT G))) *) by apply: normalS (lcn_normal _ _); rewrite (lcn_subS, lcn_sub). Qed. Lemma lcn_central n G : 'L_n(G) / 'L_n.+1(G) \subset 'Z(G / 'L_n.+1(G)). Proof. (* Goal: is_true (@subset (@coset_finType gT (@lower_central_at (S n) gT (@gval gT G))) (@mem (Finite.sort (@coset_finType gT (@lower_central_at (S n) gT (@gval gT G)))) (predPredType (Finite.sort (@coset_finType gT (@lower_central_at (S n) gT (@gval gT G))))) (@SetDef.pred_of_set (@coset_finType gT (@lower_central_at (S n) gT (@gval gT G))) (@quotient gT (@lower_central_at n gT (@gval gT G)) (@lower_central_at (S n) gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@lower_central_at (S n) gT (@gval gT G)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@lower_central_at (S n) gT (@gval gT G))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@lower_central_at (S n) gT (@gval gT G))))) (@center (@coset_groupType gT (@lower_central_at (S n) gT (@gval gT G))) (@quotient gT (@gval gT G) (@lower_central_at (S n) gT (@gval gT G))))))) *) case: n => [|n]; first by rewrite trivg_quotient sub1G. (* Goal: is_true (@subset (@coset_finType gT (@lower_central_at (S (S n)) gT (@gval gT G))) (@mem (Finite.sort (@coset_finType gT (@lower_central_at (S (S n)) gT (@gval gT G)))) (predPredType (Finite.sort (@coset_finType gT (@lower_central_at (S (S n)) gT (@gval gT G))))) (@SetDef.pred_of_set (@coset_finType gT (@lower_central_at (S (S n)) gT (@gval gT G))) (@quotient gT (@lower_central_at (S n) gT (@gval gT G)) (@lower_central_at (S (S n)) gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@lower_central_at (S (S n)) gT (@gval gT G)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@lower_central_at (S (S n)) gT (@gval gT G))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@lower_central_at (S (S n)) gT (@gval gT G))))) (@center (@coset_groupType gT (@lower_central_at (S (S n)) gT (@gval gT G))) (@quotient gT (@gval gT G) (@lower_central_at (S (S n)) gT (@gval gT G))))))) *) by rewrite subsetI quotientS ?lcn_sub ?quotient_cents2r. Qed. Lemma lcn_sub_leq m n G : n <= m -> 'L_m(G) \subset 'L_n(G). Proof. (* Goal: forall _ : is_true (leq n 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)) (@lower_central_at 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)) (@lower_central_at n gT (@gval gT G))))) *) by move/subnK <-; elim: {m}(m - n) => // m; apply: subset_trans (lcn_subS _ _). Qed. Lemma lcnS n A B : A \subset B -> 'L_n(A) \subset 'L_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 (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@lower_central_at n 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)) (@lower_central_at n gT B)))) *) by case: n => // n sAB; elim: n => // n IHn; rewrite !lcnSn genS ?imset2S. Qed. Lemma lcn_cprod n A B G : A \* B = G -> 'L_n(A) \* 'L_n(B) = 'L_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 (@lower_central_at n gT A) (@lower_central_at n gT B)) (@lower_central_at n gT (@gval gT G)) *) case: n => // n /cprodP[[H K -> ->{A B}] defG cHK]. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@lower_central_at (S n) gT (@gval gT H)) (@lower_central_at (S n) gT (@gval gT K))) (@lower_central_at (S n) gT (@gval gT G)) *) have sL := subset_trans (lcn_sub _ _); rewrite cprodE ?(centSS _ _ cHK) ?sL //. (* 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 (lower_central_at_group (S n) H)) (@gval gT (lower_central_at_group (S n) K))) (@lower_central_at (S n) gT (@gval gT G)) *) symmetry; elim: n => // n; rewrite lcnSn => ->; rewrite commMG /=; last first. (* 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)) (@commutator gT (@lower_central_at (S n) gT (@gval gT H)) (@gval gT G)) (@commutator gT (@lower_central_at (S n) gT (@gval gT K)) (@gval gT G))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@lower_central_at (S (S n)) gT (@gval gT H)) (@lower_central_at (S (S n)) gT (@gval gT K))) *) (* 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)) (@lower_central_at (S 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)) (@normaliser gT (@commutator gT (@lower_central_at (S n) gT (@gval gT H)) (@gval gT G)))))) *) by apply: subset_trans (commg_normr _ _); rewrite sL // -defG mulG_subr. (* 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)) (@commutator gT (@lower_central_at (S n) gT (@gval gT H)) (@gval gT G)) (@commutator gT (@lower_central_at (S n) gT (@gval gT K)) (@gval gT G))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@lower_central_at (S (S n)) gT (@gval gT H)) (@lower_central_at (S (S n)) gT (@gval gT K))) *) rewrite -!(commGC G) -defG -{1}(centC cHK). (* 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)) (@commutator gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H)) (@lower_central_at (S n) gT (@gval gT H))) (@commutator gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)) (@lower_central_at (S n) gT (@gval gT K)))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@lower_central_at (S (S n)) gT (@gval gT H)) (@lower_central_at (S (S n)) gT (@gval gT K))) *) rewrite !commMG ?normsR ?lcn_norm ?cents_norm // 1?centsC //. (* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@commutator gT (@gval gT K) (@gval gT (lower_central_at_group (S n) H))) (@commutator gT (@gval gT H) (@gval gT (lower_central_at_group (S n) H)))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@commutator gT (@gval gT H) (@gval gT (lower_central_at_group (S n) K))) (@commutator gT (@gval gT K) (@gval gT (lower_central_at_group (S n) K))))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@lower_central_at (S (S n)) gT (@gval gT H)) (@lower_central_at (S (S n)) gT (@gval gT K))) *) by rewrite -!(commGC 'L__(_)) -!lcnSn !(commG1P _) ?mul1g ?sL // centsC. Qed. Lemma lcn_dprod n A B G : A \x B = G -> 'L_n(A) \x 'L_n(B) = 'L_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 (@lower_central_at n gT A) (@lower_central_at n gT B)) (@lower_central_at n gT (@gval gT G)) *) move=> defG; have [[K H defA defB] _ _ tiAB] := dprodP defG. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@lower_central_at n gT A) (@lower_central_at n gT B)) (@lower_central_at n gT (@gval gT G)) *) rewrite !dprodEcp // in defG *; first exact: lcn_cprod. (* 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)) (@lower_central_at n gT A) (@lower_central_at n gT B)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) by rewrite defA defB; apply/trivgP; rewrite -tiAB defA defB setISS ?lcn_sub. Qed. Lemma der_cprod n A B G : A \* B = G -> A^`(n) \* B^`(n) = G^`(n). 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 (@derived_at n gT A) (@derived_at n gT B)) (@derived_at n gT (@gval gT G)) *) by move=> defG; elim: n => {defG}// n; apply: (lcn_cprod 2). Qed. Lemma der_dprod n A B G : A \x B = G -> A^`(n) \x B^`(n) = G^`(n). 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 (@derived_at n gT A) (@derived_at n gT B)) (@derived_at n gT (@gval gT G)) *) by move=> defG; elim: n => {defG}// n; apply: (lcn_dprod 2). Qed. Lemma lcn_bigcprod n I r P (F : I -> {set gT}) G : \big[cprod/1]_(i <- r | P i) F i = G -> \big[cprod/1]_(i <- r | P i) 'L_n(F i) = 'L_n(G). Proof. (* Goal: forall _ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I i (central_product gT) (P i) (F i))) (@gval gT G), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I i (central_product gT) (P i) (@lower_central_at n gT (F i)))) (@lower_central_at n gT (@gval gT G)) *) elim/big_rec2: _ G => [_ <- | i A Z _ IH G dG]; first exact/esym/trivgP/lcn_sub. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (central_product gT (@lower_central_at n gT (F i)) A) (@lower_central_at n gT (@gval gT G)) *) by rewrite -(lcn_cprod n dG); have [[_ H _ dH]] := cprodP dG; rewrite dH (IH H). Qed. Lemma lcn_bigdprod n I r P (F : I -> {set gT}) G : \big[dprod/1]_(i <- r | P i) F i = G -> \big[dprod/1]_(i <- r | P i) 'L_n(F i) = 'L_n(G). Proof. (* Goal: forall _ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I i (direct_product gT) (P i) (F i))) (@gval gT G), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I i (direct_product gT) (P i) (@lower_central_at n gT (F i)))) (@lower_central_at n gT (@gval gT G)) *) elim/big_rec2: _ G => [_ <- | i A Z _ IH G dG]; first exact/esym/trivgP/lcn_sub. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (direct_product gT (@lower_central_at n gT (F i)) A) (@lower_central_at n gT (@gval gT G)) *) by rewrite -(lcn_dprod n dG); have [[_ H _ dH]] := dprodP dG; rewrite dH (IH H). Qed. Lemma der_bigcprod n I r P (F : I -> {set gT}) G : \big[cprod/1]_(i <- r | P i) F i = G -> \big[cprod/1]_(i <- r | P i) (F i)^`(n) = G^`(n). Proof. (* Goal: forall _ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I i (central_product gT) (P i) (F i))) (@gval gT G), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I i (central_product gT) (P i) (@derived_at n gT (F i)))) (@derived_at n gT (@gval gT G)) *) elim/big_rec2: _ G => [_ <- | i A Z _ IH G dG]; first by rewrite gF1. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (central_product gT (@derived_at n gT (F i)) A) (@derived_at n gT (@gval gT G)) *) by rewrite -(der_cprod n dG); have [[_ H _ dH]] := cprodP dG; rewrite dH (IH H). Qed. Lemma der_bigdprod n I r P (F : I -> {set gT}) G : \big[dprod/1]_(i <- r | P i) F i = G -> \big[dprod/1]_(i <- r | P i) (F i)^`(n) = G^`(n). Proof. (* Goal: forall _ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I i (direct_product gT) (P i) (F i))) (@gval gT G), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I i (direct_product gT) (P i) (@derived_at n gT (F i)))) (@derived_at n gT (@gval gT G)) *) elim/big_rec2: _ G => [_ <- | i A Z _ IH G dG]; first by rewrite gF1. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (direct_product gT (@derived_at n gT (F i)) A) (@derived_at n gT (@gval gT G)) *) by rewrite -(der_dprod n dG); have [[_ H _ dH]] := dprodP dG; rewrite dH (IH H). Qed. Lemma nilpotent_class G : nilpotent G = (nil_class G < #|G|). Proof. (* Goal: @eq bool (@nilpotent gT (@gval gT G)) (leq (S (@nil_class 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 /nil_class; set s := mkseq _ _. (* Goal: @eq bool (@nilpotent gT (@gval gT G)) (leq (S (@index (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) 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))))) *) transitivity (1 \in s); last by rewrite -index_mem size_mkseq. (* Goal: @eq bool (@nilpotent gT (@gval gT G)) (@in_mem (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@mem (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT)))) (seq_predType (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT)))) s)) *) apply/idP/mapP=> {s}/= [nilG | [n _ Ln1]]; last first. (* Goal: @ex2 nat (fun x : nat => is_true (@in_mem nat x (@mem nat (seq_predType nat_eqType) (iota O (@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)))))))) (fun x : nat => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@lower_central_at (S x) gT (@gval gT G))) *) (* Goal: is_true (@nilpotent gT (@gval gT G)) *) apply/forall_inP=> H /subsetIP[sHG sHR]. (* Goal: @ex2 nat (fun x : nat => is_true (@in_mem nat x (@mem nat (seq_predType nat_eqType) (iota O (@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)))))))) (fun x : nat => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@lower_central_at (S x) gT (@gval gT G))) *) (* Goal: is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) rewrite -subG1 {}Ln1; elim: n => // n IHn. (* Goal: @ex2 nat (fun x : nat => is_true (@in_mem nat x (@mem nat (seq_predType nat_eqType) (iota O (@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)))))))) (fun x : nat => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@lower_central_at (S x) gT (@gval gT 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)) (@gval 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)) (@lower_central_at (S (S n)) gT (@gval gT G))))) *) by rewrite (subset_trans sHR) ?commSg. (* Goal: @ex2 nat (fun x : nat => is_true (@in_mem nat x (@mem nat (seq_predType nat_eqType) (iota O (@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)))))))) (fun x : nat => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@lower_central_at (S x) gT (@gval gT G))) *) pose m := #|G|.-1; exists m; first by rewrite mem_iota /= prednK. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@lower_central_at (S m) gT (@gval gT G)) *) rewrite ['L__(G)]card_le1_trivg //= -(subnn m). (* 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)) (@lower_central_at (S m) gT (@gval gT G))))) (S (subn m m))) *) elim: {-2}m => [|n]; [by rewrite subn0 prednK | rewrite lcnSn subnS]. (* Goal: forall _ : 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)) (@lower_central_at (S n) gT (@gval gT G))))) (S (subn m n))), 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)) (@commutator gT (@lower_central_at (S n) gT (@gval gT G)) (@gval gT G))))) (S (Nat.pred (subn m n)))) *) case: (eqsVneq 'L_n.+1(G) 1) => [-> | ntLn]; first by rewrite comm1G cards1. (* Goal: forall _ : 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)) (@lower_central_at (S n) gT (@gval gT G))))) (S (subn m n))), 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)) (@commutator gT (@lower_central_at (S n) gT (@gval gT G)) (@gval gT G))))) (S (Nat.pred (subn m n)))) *) case: (m - n) => [|m' /= IHn]; first by rewrite leqNgt cardG_gt1 ntLn. (* 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)) (@commutator gT (@lower_central_at (S n) gT (@gval gT G)) (@gval gT G))))) (S m')) *) rewrite -ltnS (leq_trans (proper_card _) IHn) //. (* Goal: is_true (@proper (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@commutator gT (@lower_central_at (S n) gT (@gval gT G)) (@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)) (@lower_central_at (S n) gT (@gval gT G))))) *) by rewrite (nil_comm_properl nilG) ?lcn_sub // subsetI subxx lcn_norm. Qed. Lemma lcn_nil_classP n G : nilpotent G -> reflect ('L_n.+1(G) = 1) (nil_class G <= n). Proof. (* Goal: forall _ : is_true (@nilpotent gT (@gval gT G)), Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@lower_central_at (S n) gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (leq (@nil_class gT (@gval gT G)) n) *) rewrite nilpotent_class /nil_class; set s := mkseq _ _. (* Goal: forall _ : is_true (leq (S (@index (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) 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))))), Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@lower_central_at (S n) gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (leq (@index (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) s) n) *) set c := index 1 s => lt_c_G; case: leqP => [le_c_n | lt_n_c]. (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@lower_central_at (S n) gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) false *) (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@lower_central_at (S n) gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) true *) have Lc1: nth 1 s c = 1 by rewrite nth_index // -index_mem size_mkseq. (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@lower_central_at (S n) gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) false *) (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@lower_central_at (S n) gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) true *) by left; apply/trivgP; rewrite -Lc1 nth_mkseq ?lcn_sub_leq. (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@lower_central_at (S n) gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) false *) right; apply/eqP/negPf; rewrite -(before_find 1 lt_n_c) nth_mkseq //. (* Goal: is_true (leq (S n) (@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: ltn_trans lt_n_c lt_c_G. Qed. Lemma lcnP G : reflect (exists n, 'L_n.+1(G) = 1) (nilpotent G). Proof. (* Goal: Bool.reflect (@ex nat (fun n : nat => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@lower_central_at (S n) gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@nilpotent gT (@gval gT G)) *) apply: (iffP idP) => [nilG | [n Ln1]]. (* Goal: is_true (@nilpotent gT (@gval gT G)) *) (* Goal: @ex nat (fun n : nat => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@lower_central_at (S n) gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) by exists (nil_class G); apply/lcn_nil_classP. (* Goal: is_true (@nilpotent gT (@gval gT G)) *) apply/forall_inP=> H /subsetIP[sHG sHR]; rewrite -subG1 -{}Ln1. (* 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.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@lower_central_at (S n) gT (@gval gT G))))) *) by elim: n => // n IHn; rewrite (subset_trans sHR) ?commSg. Qed. Lemma abelian_nil G : abelian G -> nilpotent G. Proof. (* Goal: forall _ : is_true (@abelian gT (@gval gT G)), is_true (@nilpotent gT (@gval gT G)) *) by move=> abG; apply/lcnP; exists 1%N; apply/commG1P. Qed. Lemma nil_class0 G : (nil_class G == 0) = (G :==: 1). Proof. (* Goal: @eq bool (@eq_op nat_eqType (@nil_class gT (@gval gT G)) O) (@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/eqP=> [nilG | ->]. (* Goal: is_true (@eq_op nat_eqType (@nil_class gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) O) *) (* 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 apply/(lcn_nil_classP 0); rewrite ?nilpotent_class (eqP nilG) ?cardG_gt0. (* Goal: is_true (@eq_op nat_eqType (@nil_class gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) O) *) by rewrite -leqn0; apply/(lcn_nil_classP 0); rewrite ?nilpotent1. Qed. Lemma nil_class1 G : (nil_class G <= 1) = abelian G. Proof. (* Goal: @eq bool (leq (@nil_class gT (@gval gT G)) (S O)) (@abelian gT (@gval gT G)) *) have [-> | ntG] := eqsVneq G 1. (* Goal: @eq bool (leq (@nil_class gT (@gval gT G)) (S O)) (@abelian gT (@gval gT G)) *) (* Goal: @eq bool (leq (@nil_class gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (S O)) (@abelian gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) by rewrite abelian1 leq_eqVlt ltnS leqn0 nil_class0 eqxx orbT. (* Goal: @eq bool (leq (@nil_class gT (@gval gT G)) (S O)) (@abelian gT (@gval gT G)) *) apply/idP/idP=> cGG. (* Goal: is_true (leq (@nil_class gT (@gval gT G)) (S O)) *) (* Goal: is_true (@abelian gT (@gval gT G)) *) apply/commG1P; apply/(lcn_nil_classP 1); rewrite // nilpotent_class. (* Goal: is_true (leq (@nil_class gT (@gval gT G)) (S O)) *) (* Goal: is_true (leq (S (@nil_class 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 rewrite (leq_ltn_trans cGG) // cardG_gt1. (* Goal: is_true (leq (@nil_class gT (@gval gT G)) (S O)) *) by apply/(lcn_nil_classP 1); rewrite ?abelian_nil //; apply/commG1P. Qed. Lemma cprod_nil A B G : A \* B = G -> nilpotent G = nilpotent A && nilpotent B. Lemma mulg_nil G H : H \subset 'C(G) -> nilpotent (G * H) = nilpotent G && nilpotent 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)) (@centraliser gT (@gval gT G))))), @eq bool (@nilpotent gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))) (andb (@nilpotent gT (@gval gT G)) (@nilpotent gT (@gval gT H))) *) by move=> cGH; rewrite -(cprod_nil (cprodEY cGH)) /= cent_joinEr. Qed. Lemma dprod_nil A B G : A \x B = G -> nilpotent G = nilpotent A && nilpotent 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 (@nilpotent gT (@gval gT G)) (andb (@nilpotent gT A) (@nilpotent gT B)) *) by case/dprodP=> [[H K -> ->] <- cHK _]; rewrite mulg_nil. Qed. Lemma bigdprod_nil I r (P : pred I) (A_ : I -> {set gT}) G : \big[dprod/1]_(i <- r | P i) A_ i = G -> (forall i, P i -> nilpotent (A_ i)) -> nilpotent G. Proof. (* Goal: forall (_ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I i (direct_product gT) (P i) (A_ i))) (@gval gT G)) (_ : forall (i : I) (_ : is_true (P i)), is_true (@nilpotent gT (A_ i))), is_true (@nilpotent gT (@gval gT G)) *) move=> defG nilA; elim/big_rec: _ => [|i B Pi nilB] in G defG *. by rewrite -defG nilpotent1. have [[_ H _ defB] _ _ _] := dprodP defG. by rewrite (dprod_nil defG) nilA //= defB nilB. Qed. Qed. End LowerCentral. Notation "''L_' n ( G )" := (lower_central_at_group n G) : Group_scope. Lemma lcn_cont n : GFunctor.continuous (@lower_central_at n). Proof. (* Goal: GFunctor.continuous (@lower_central_at n) *) case: n => //; elim=> // n IHn g0T h0T H phi. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base h0T)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base h0T))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base h0T)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base h0T)) (@morphim g0T h0T (@gval g0T H) phi (@MorPhantom g0T h0T (@mfun g0T h0T (@gval g0T H) phi)) (@lower_central_at (S (S n)) g0T (@gval g0T H))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base h0T))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base h0T)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base h0T)) (@lower_central_at (S (S n)) h0T (@morphim g0T h0T (@gval g0T H) phi (@MorPhantom g0T h0T (@mfun g0T h0T (@gval g0T H) phi)) (@gval g0T H)))))) *) by rewrite !lcnSn morphimR ?lcn_sub // commSg ?IHn. Qed. Canonical lcn_igFun n := [igFun by lcn_sub^~ n & lcn_cont n]. Canonical lcn_gFun n := [gFun by lcn_cont n]. Canonical lcn_mgFun n := [mgFun by fun _ G H => @lcnS _ n G H]. Section UpperCentralFunctor. Variable n : nat. Implicit Type gT : finGroupType. Lemma ucn_pmap : exists hZ : GFunctor.pmap, @upper_central_at n = hZ. Proof. (* Goal: @ex GFunctor.pmap (fun hZ : GFunctor.pmap => @eq (forall (gT : FinGroup.type) (_ : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))), @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@upper_central_at n) (@GFunctor.apply (GFunctor.iso_of_map (GFunctor.map_of_pmap hZ)))) *) elim: n => [|n' [hZ defZ]]; first by exists trivGfun_pgFun. (* Goal: @ex GFunctor.pmap (fun hZ : GFunctor.pmap => @eq (forall (gT : FinGroup.type) (_ : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))), @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@upper_central_at (S n')) (@GFunctor.apply (GFunctor.iso_of_map (GFunctor.map_of_pmap hZ)))) *) by exists [pgFun of @center %% hZ]; rewrite /= -defZ. Qed. Lemma ucn_group_set gT (G : {group gT}) : group_set 'Z_n(G). Proof. (* Goal: is_true (@group_set gT (@upper_central_at n gT (@gval gT G))) *) by have [hZ ->] := ucn_pmap; apply: groupP. Qed. Canonical upper_central_at_group gT G := Group (@ucn_group_set gT G). Lemma ucn_sub gT (G : {group gT}) : 'Z_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)) (@upper_central_at 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 have [hZ ->] := ucn_pmap; apply: gFsub. Qed. Lemma morphim_ucn : GFunctor.pcontinuous (@upper_central_at n). Proof. (* Goal: GFunctor.pcontinuous (@upper_central_at n) *) by have [hZ ->] := ucn_pmap; apply: pmorphimF. Qed. Lemma ucn_norm : G \subset 'N('Z_n(G)). Proof. exact: gFnorm. 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 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 (@upper_central_at n gT (@gval gT G)))))) *) exact: gFnorm. Qed. End UpperCentralFunctor. Notation "''Z_' n ( G )" := (upper_central_at_group n G) : Group_scope. Section UpperCentral. Variable gT : finGroupType. Implicit Types (A B : {set gT}) (G H : {group gT}). Lemma ucn0 A : 'Z_0(A) = 1. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@upper_central_at O gT A) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) by []. Qed. Lemma ucnSn n A : 'Z_n.+1(A) = coset 'Z_n(A) @*^-1 'Z(A / 'Z_n(A)). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@upper_central_at (S n) gT A) (@morphpre gT (@coset_groupType gT (@upper_central_at n gT A)) (@normaliser gT (@upper_central_at n gT A)) (@coset_morphism gT (@upper_central_at n gT A)) (@MorPhantom gT (@coset_groupType gT (@upper_central_at n gT A)) (@coset gT (@upper_central_at n gT A))) (@center (@coset_groupType gT (@upper_central_at n gT A)) (@quotient gT A (@upper_central_at n gT A)))) *) by []. Qed. Lemma ucnE n A : 'Z_n(A) = upper_central_at_rec n A. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@upper_central_at n gT A) (@upper_central_at_rec n gT A) *) by []. Qed. Lemma ucn_subS n G : 'Z_n(G) \subset 'Z_n.+1(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)) (@upper_central_at 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)) (@upper_central_at (S n) gT (@gval gT G))))) *) by rewrite -{1}['Z_n(G)]ker_coset morphpreS ?sub1G. Qed. Lemma ucn_sub_geq m n G : n >= m -> 'Z_m(G) \subset 'Z_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)) (@upper_central_at 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)) (@upper_central_at n gT (@gval gT G))))) *) move/subnK <-; elim: {n}(n - m) => // n IHn. (* 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)) (@upper_central_at 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)) (@upper_central_at (addn (S n) m) gT (@gval gT G))))) *) exact: subset_trans (ucn_subS _ _). Qed. Lemma ucn_central n G : 'Z_n.+1(G) / 'Z_n(G) = 'Z(G / 'Z_n(G)). Proof. (* Goal: @eq (@set_of (@coset_finType gT (@upper_central_at n gT (@gval gT G))) (Phant (@coset_of gT (@upper_central_at n gT (@gval gT G))))) (@quotient gT (@upper_central_at (S n) gT (@gval gT G)) (@upper_central_at n gT (@gval gT G))) (@center (@coset_groupType gT (@upper_central_at n gT (@gval gT G))) (@quotient gT (@gval gT G) (@upper_central_at n gT (@gval gT G)))) *) by rewrite ucnSn cosetpreK. Qed. Lemma ucn_normalS n G : 'Z_n(G) <| 'Z_n.+1(G). Proof. (* Goal: is_true (@normal gT (@upper_central_at n gT (@gval gT G)) (@upper_central_at (S n) gT (@gval gT G))) *) by rewrite (normalS _ _ (ucn_normal n G)) ?ucn_subS ?ucn_sub. Qed. Lemma ucn_comm n G : [~: 'Z_n.+1(G), G] \subset 'Z_n(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)) (@commutator gT (@upper_central_at (S n) gT (@gval gT G)) (@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)) (@upper_central_at n gT (@gval gT G))))) *) rewrite -quotient_cents2 ?normal_norm ?ucn_normal ?ucn_normalS //. (* Goal: is_true (@subset (@coset_finType gT (@gval gT (@upper_central_at_group n gT G))) (@mem (Finite.sort (@coset_finType gT (@gval gT (@upper_central_at_group n gT G)))) (predPredType (Finite.sort (@coset_finType gT (@gval gT (@upper_central_at_group n gT G))))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT (@upper_central_at_group n gT G))) (@quotient gT (@upper_central_at (S n) gT (@gval gT G)) (@gval gT (@upper_central_at_group n gT G))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT (@upper_central_at_group n gT G)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT (@upper_central_at_group n gT G))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT (@upper_central_at_group n gT G))))) (@centraliser (@coset_groupType gT (@gval gT (@upper_central_at_group n gT G))) (@quotient gT (@gval gT G) (@gval gT (@upper_central_at_group n gT G))))))) *) by rewrite ucn_central subsetIr. Qed. Lemma ucn1 G : 'Z_1(G) = 'Z(G). Lemma ucnSnR n G : 'Z_n.+1(G) = [set x in G | [~: [set x], G] \subset 'Z_n(G)]. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@upper_central_at (S n) gT (@gval gT G)) (@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)))) (@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)) (@commutator gT (@set1 (FinGroup.arg_finType (FinGroup.base 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)) (@upper_central_at n gT (@gval gT G))))))) *) apply/setP=> x; rewrite inE -(setIidPr (ucn_sub n.+1 G)) inE ucnSn. (* Goal: @eq 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)))) (@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 (@coset_groupType gT (@upper_central_at n gT (@gval gT G))) (@normaliser gT (@upper_central_at n gT (@gval gT G))) (@coset_morphism gT (@upper_central_at n gT (@gval gT G))) (@MorPhantom gT (@coset_groupType gT (@upper_central_at n gT (@gval gT G))) (@coset gT (@upper_central_at n gT (@gval gT G)))) (@center (@coset_groupType gT (@upper_central_at n gT (@gval gT G))) (@quotient gT (@gval gT G) (@upper_central_at n gT (@gval gT G))))))))) (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.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@commutator gT (@set1 (FinGroup.arg_finType (FinGroup.base 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)) (@upper_central_at n gT (@gval gT G)))))) *) case Gx: (x \in G) => //=; have nZG := ucn_norm n G. (* Goal: @eq bool (@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)) (@morphpre gT (@coset_groupType gT (@upper_central_at n gT (@gval gT G))) (@normaliser gT (@upper_central_at n gT (@gval gT G))) (@coset_morphism gT (@upper_central_at n gT (@gval gT G))) (@MorPhantom gT (@coset_groupType gT (@upper_central_at n gT (@gval gT G))) (@coset gT (@upper_central_at n gT (@gval gT G)))) (@center (@coset_groupType gT (@upper_central_at n gT (@gval gT G))) (@quotient gT (@gval gT G) (@upper_central_at n 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)) (@commutator gT (@set1 (FinGroup.arg_finType (FinGroup.base 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)) (@upper_central_at n gT (@gval gT G))))) *) rewrite -sub1set -sub_quotient_pre -?quotient_cents2 ?sub1set ?(subsetP nZG) //. (* Goal: @eq bool (@subset (@coset_finType gT (@gval gT (@upper_central_at_group n gT G))) (@mem (Finite.sort (@coset_finType gT (@gval gT (@upper_central_at_group n gT G)))) (predPredType (Finite.sort (@coset_finType gT (@gval gT (@upper_central_at_group n gT G))))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT (@upper_central_at_group n gT G))) (@quotient gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@gval gT (@upper_central_at_group n gT G))))) (@mem (Finite.sort (@coset_finType gT (@gval gT (@upper_central_at_group n gT G)))) (predPredType (Finite.sort (@coset_finType gT (@gval gT (@upper_central_at_group n gT G))))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT (@upper_central_at_group n gT G))) (@center (@coset_groupType gT (@upper_central_at n gT (@gval gT G))) (@quotient gT (@gval gT G) (@upper_central_at n gT (@gval gT G))))))) (@subset (@coset_finType gT (@gval gT (@upper_central_at_group n gT G))) (@mem (Finite.sort (@coset_finType gT (@gval gT (@upper_central_at_group n gT G)))) (predPredType (Finite.sort (@coset_finType gT (@gval gT (@upper_central_at_group n gT G))))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT (@upper_central_at_group n gT G))) (@quotient gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@gval gT (@upper_central_at_group n gT G))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT (@upper_central_at_group n gT G)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT (@upper_central_at_group n gT G))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT (@upper_central_at_group n gT G))))) (@centraliser (@coset_groupType gT (@gval gT (@upper_central_at_group n gT G))) (@quotient gT (@gval gT G) (@gval gT (@upper_central_at_group n gT G))))))) *) by rewrite subsetI quotientS ?sub1set. Qed. Lemma ucn_cprod n A B G : A \* B = G -> 'Z_n(A) \* 'Z_n(B) = 'Z_n(G). Lemma ucn_dprod n A B G : A \x B = G -> 'Z_n(A) \x 'Z_n(B) = 'Z_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 (@upper_central_at n gT A) (@upper_central_at n gT B)) (@upper_central_at n gT (@gval gT G)) *) move=> defG; have [[K H defA defB] _ _ tiAB] := dprodP defG. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@upper_central_at n gT A) (@upper_central_at n gT B)) (@upper_central_at n gT (@gval gT G)) *) rewrite !dprodEcp // in defG *; first exact: ucn_cprod. (* 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)) (@upper_central_at n gT A) (@upper_central_at n gT B)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) by rewrite defA defB; apply/trivgP; rewrite -tiAB defA defB setISS ?ucn_sub. Qed. Lemma ucn_bigcprod n I r P (F : I -> {set gT}) G : \big[cprod/1]_(i <- r | P i) F i = G -> \big[cprod/1]_(i <- r | P i) 'Z_n(F i) = 'Z_n(G). Proof. (* Goal: forall _ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I i (central_product gT) (P i) (F i))) (@gval gT G), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I i (central_product gT) (P i) (@upper_central_at n gT (F i)))) (@upper_central_at n gT (@gval gT G)) *) elim/big_rec2: _ G => [_ <- | i A Z _ IH G dG]; first by rewrite gF1. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (central_product gT (@upper_central_at n gT (F i)) A) (@upper_central_at n gT (@gval gT G)) *) by rewrite -(ucn_cprod n dG); have [[_ H _ dH]] := cprodP dG; rewrite dH (IH H). Qed. Lemma ucn_bigdprod n I r P (F : I -> {set gT}) G : \big[dprod/1]_(i <- r | P i) F i = G -> \big[dprod/1]_(i <- r | P i) 'Z_n(F i) = 'Z_n(G). Proof. (* Goal: forall _ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I i (direct_product gT) (P i) (F i))) (@gval gT G), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I i (direct_product gT) (P i) (@upper_central_at n gT (F i)))) (@upper_central_at n gT (@gval gT G)) *) elim/big_rec2: _ G => [_ <- | i A Z _ IH G dG]; first by rewrite gF1. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (direct_product gT (@upper_central_at n gT (F i)) A) (@upper_central_at n gT (@gval gT G)) *) by rewrite -(ucn_dprod n dG); have [[_ H _ dH]] := dprodP dG; rewrite dH (IH H). Qed. Lemma ucn_lcnP n G : ('L_n.+1(G) == 1) = ('Z_n(G) == G). Proof. (* Goal: @eq bool (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@lower_central_at (S n) gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@upper_central_at n gT (@gval gT G)) (@gval gT G)) *) rewrite !eqEsubset sub1G ucn_sub /= andbT -(ucn0 G). (* Goal: @eq bool (@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)) (@lower_central_at (S n) 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)) (@upper_central_at O 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)) (@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)) (@upper_central_at n gT (@gval gT G))))) *) elim: {1 3}n 0 (addn0 n) => [j <- //|i IHi j]. (* Goal: forall _ : @eq nat (addn (S i) j) n, @eq bool (@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)) (@lower_central_at (S (S i)) 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)) (@upper_central_at j 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)) (@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)) (@upper_central_at n gT (@gval gT G))))) *) rewrite addSnnS => /IHi <- {IHi}; rewrite ucnSn lcnSn. (* Goal: @eq bool (@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)) (@commutator gT (@lower_central_at (S i) gT (@gval gT G)) (@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)) (@upper_central_at j 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)) (@lower_central_at (S i) 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)) (@morphpre gT (@coset_groupType gT (@upper_central_at j gT (@gval gT G))) (@normaliser gT (@upper_central_at j gT (@gval gT G))) (@coset_morphism gT (@upper_central_at j gT (@gval gT G))) (@MorPhantom gT (@coset_groupType gT (@upper_central_at j gT (@gval gT G))) (@coset gT (@upper_central_at j gT (@gval gT G)))) (@center (@coset_groupType gT (@upper_central_at j gT (@gval gT G))) (@quotient gT (@gval gT G) (@upper_central_at j gT (@gval gT G)))))))) *) rewrite -sub_morphim_pre ?gFsub_trans ?gFnorm_trans // subsetI. (* Goal: @eq bool (@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)) (@commutator gT (@lower_central_at (S i) gT (@gval gT G)) (@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)) (@upper_central_at j gT (@gval gT G))))) (andb (@subset (FinGroup.finType (FinGroup.base (@coset_groupType gT (@upper_central_at j gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@upper_central_at j gT (@gval gT G)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@upper_central_at j gT (@gval gT G))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@coset_groupType gT (@upper_central_at j gT (@gval gT G))))) (@morphim gT (@coset_groupType gT (@upper_central_at j gT (@gval gT G))) (@gval gT (@normaliser_group gT (@upper_central_at j gT (@gval gT G)))) (@coset_morphism gT (@upper_central_at j gT (@gval gT G))) (@MorPhantom gT (@coset_groupType gT (@upper_central_at j gT (@gval gT G))) (@mfun gT (@coset_groupType gT (@upper_central_at j gT (@gval gT G))) (@gval gT (@normaliser_group gT (@upper_central_at j gT (@gval gT G)))) (@coset_morphism gT (@upper_central_at j gT (@gval gT G))))) (@lower_central_at (S i) gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@upper_central_at j gT (@gval gT G)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@upper_central_at j gT (@gval gT G))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@coset_groupType gT (@upper_central_at j gT (@gval gT G))))) (@quotient gT (@gval gT G) (@upper_central_at j gT (@gval gT G)))))) (@subset (FinGroup.finType (FinGroup.base (@coset_groupType gT (@upper_central_at j gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@upper_central_at j gT (@gval gT G)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@upper_central_at j gT (@gval gT G))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@coset_groupType gT (@upper_central_at j gT (@gval gT G))))) (@morphim gT (@coset_groupType gT (@upper_central_at j gT (@gval gT G))) (@gval gT (@normaliser_group gT (@upper_central_at j gT (@gval gT G)))) (@coset_morphism gT (@upper_central_at j gT (@gval gT G))) (@MorPhantom gT (@coset_groupType gT (@upper_central_at j gT (@gval gT G))) (@mfun gT (@coset_groupType gT (@upper_central_at j gT (@gval gT G))) (@gval gT (@normaliser_group gT (@upper_central_at j gT (@gval gT G)))) (@coset_morphism gT (@upper_central_at j gT (@gval gT G))))) (@lower_central_at (S i) gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@upper_central_at j gT (@gval gT G)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@upper_central_at j gT (@gval gT G))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@coset_groupType gT (@upper_central_at j gT (@gval gT G))))) (@centraliser (@coset_groupType gT (@upper_central_at j gT (@gval gT G))) (@quotient gT (@gval gT G) (@upper_central_at j gT (@gval gT G)))))))) *) by rewrite morphimS ?gFsub // quotient_cents2 ?gFsub_trans ?gFnorm_trans. Qed. Lemma ucnP G : reflect (exists n, 'Z_n(G) = G) (nilpotent G). Proof. (* Goal: Bool.reflect (@ex nat (fun n : nat => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@upper_central_at n gT (@gval gT G)) (@gval gT G))) (@nilpotent gT (@gval gT G)) *) apply: (iffP (lcnP G)) => -[n /eqP-clGn]; by exists n; apply/eqP; rewrite ucn_lcnP in clGn *. Qed. Qed. Lemma ucn_nil_classP n G : nilpotent G -> reflect ('Z_n(G) = G) (nil_class G <= n). Proof. (* Goal: forall _ : is_true (@nilpotent gT (@gval gT G)), Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@upper_central_at n gT (@gval gT G)) (@gval gT G)) (leq (@nil_class gT (@gval gT G)) n) *) move=> nilG; rewrite (sameP (lcn_nil_classP n nilG) eqP) ucn_lcnP; apply: eqP. Qed. Lemma ucn_id n G : 'Z_n('Z_n(G)) = 'Z_n(G). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@upper_central_at n gT (@upper_central_at n gT (@gval gT G))) (@upper_central_at n gT (@gval gT G)) *) exact: gFid. Qed. Lemma ucn_nilpotent n G : nilpotent 'Z_n(G). Proof. (* Goal: is_true (@nilpotent gT (@upper_central_at n gT (@gval gT G))) *) by apply/ucnP; exists n; rewrite ucn_id. Qed. Lemma nil_class_ucn n G : nil_class 'Z_n(G) <= n. Proof. (* Goal: is_true (leq (@nil_class gT (@upper_central_at n gT (@gval gT G))) n) *) by apply/ucn_nil_classP; rewrite ?ucn_nilpotent ?ucn_id. Qed. End UpperCentral. Section MorphNil. Variables (aT rT : finGroupType) (D : {group aT}) (f : {morphism D >-> rT}). Implicit Type G : {group aT}. Lemma morphim_lcn n G : G \subset D -> f @* 'L_n(G) = 'L_n(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)))), @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)) (@lower_central_at n aT (@gval aT G))) (@lower_central_at n rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) *) move=> sHG; case: n => //; elim=> // n IHn. (* 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)) (@lower_central_at (S (S n)) aT (@gval aT G))) (@lower_central_at (S (S n)) rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) *) by rewrite !lcnSn -IHn morphimR // (subset_trans _ sHG) // lcn_sub. Qed. Lemma injm_ucn n G : 'injm f -> G \subset D -> f @* 'Z_n(G) = 'Z_n(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)) (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)) (@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)) (@upper_central_at n aT (@gval aT G))) (@upper_central_at n rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) *) exact: injmF. Qed. Lemma morphim_nil G : nilpotent G -> nilpotent (f @* G). Lemma injm_nil G : 'injm f -> G \subset D -> nilpotent (f @* G) = nilpotent G. Lemma nil_class_morphim G : nilpotent G -> nil_class (f @* G) <= nil_class G. Proof. (* Goal: forall _ : is_true (@nilpotent aT (@gval aT G)), is_true (leq (@nil_class rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@nil_class aT (@gval aT G))) *) move=> nilG; rewrite (sameP (ucn_nil_classP _ (morphim_nil nilG)) eqP) /=. (* Goal: is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base rT))) (@upper_central_at (@nil_class aT (@gval aT G)) 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 G))) *) by rewrite eqEsubset ucn_sub -{1}(ucn_nil_classP _ nilG (leqnn _)) morphim_ucn. Qed. Lemma nil_class_injm G : 'injm f -> G \subset D -> nil_class (f @* G) = nil_class 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)) (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)) (@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 nat (@nil_class rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@nil_class aT (@gval aT G)) *) move=> injf sGD; case nilG: (nilpotent G). (* Goal: @eq nat (@nil_class rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@nil_class aT (@gval aT G)) *) (* Goal: @eq nat (@nil_class rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@nil_class aT (@gval aT G)) *) apply/eqP; rewrite eqn_leq nil_class_morphim //. (* Goal: @eq nat (@nil_class rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@nil_class aT (@gval aT G)) *) (* Goal: is_true (andb true (leq (@nil_class aT (@gval aT G)) (@nil_class rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) *) rewrite (sameP (lcn_nil_classP _ nilG) eqP) -subG1. (* Goal: @eq nat (@nil_class rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@nil_class aT (@gval aT G)) *) (* Goal: is_true (andb 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 (@lower_central_at_group aT (S (@nil_class rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))) G)))) (@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))))))) *) rewrite -(injmSK injf) ?gFsub_trans // morphim1. (* Goal: @eq nat (@nil_class rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@nil_class aT (@gval aT G)) *) (* 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)) (@gval aT (@lower_central_at_group aT (S (@nil_class rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))) 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)) (oneg (group_set_of_baseGroupType (FinGroup.base rT))))))) *) by rewrite morphim_lcn // (lcn_nil_classP _ _ (leqnn _)) //= injm_nil. (* Goal: @eq nat (@nil_class rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@nil_class aT (@gval aT G)) *) transitivity #|G|; apply/eqP; rewrite eqn_leq. (* Goal: is_true (andb (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 G)))) (@nil_class aT (@gval aT G))) (leq (@nil_class aT (@gval aT G)) (@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)))))) *) (* Goal: is_true (andb (leq (@nil_class rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@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))))) (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 G)))) (@nil_class rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) *) rewrite -(card_injm injf sGD) (leq_trans (index_size _ _)) ?size_mkseq //. (* Goal: is_true (andb (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 G)))) (@nil_class aT (@gval aT G))) (leq (@nil_class aT (@gval aT G)) (@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)))))) *) (* Goal: is_true (andb 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)) (@gval aT G))))) (@nil_class rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) *) by rewrite leqNgt -nilpotent_class injm_nil ?nilG. (* Goal: is_true (andb (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 G)))) (@nil_class aT (@gval aT G))) (leq (@nil_class aT (@gval aT G)) (@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)))))) *) rewrite (leq_trans (index_size _ _)) ?size_mkseq // leqNgt -nilpotent_class. (* Goal: is_true (andb (negb (@nilpotent aT (@gval aT G))) true) *) by rewrite nilG. Qed. End MorphNil. Section QuotientNil. Variables gT : finGroupType. Implicit Types (rT : finGroupType) (G H : {group gT}). Lemma quotient_ucn_add m n G : 'Z_(m + n)(G) / 'Z_n(G) = 'Z_m(G / 'Z_n(G)). Proof. (* Goal: @eq (@set_of (@coset_finType gT (@upper_central_at n gT (@gval gT G))) (Phant (@coset_of gT (@upper_central_at n gT (@gval gT G))))) (@quotient gT (@upper_central_at (addn m n) gT (@gval gT G)) (@upper_central_at n gT (@gval gT G))) (@upper_central_at m (@coset_groupType gT (@upper_central_at n gT (@gval gT G))) (@quotient gT (@gval gT G) (@upper_central_at n gT (@gval gT G)))) *) elim: m => [|m IHm]; first exact: trivg_quotient. (* Goal: @eq (@set_of (@coset_finType gT (@upper_central_at n gT (@gval gT G))) (Phant (@coset_of gT (@upper_central_at n gT (@gval gT G))))) (@quotient gT (@upper_central_at (addn (S m) n) gT (@gval gT G)) (@upper_central_at n gT (@gval gT G))) (@upper_central_at (S m) (@coset_groupType gT (@upper_central_at n gT (@gval gT G))) (@quotient gT (@gval gT G) (@upper_central_at n gT (@gval gT G)))) *) apply/setP=> Zx; have [x Nx ->{Zx}] := cosetP Zx. (* Goal: @eq bool (@in_mem (Finite.sort (@coset_finType gT (@upper_central_at n gT (@gval gT G)))) (@coset gT (@upper_central_at n gT (@gval gT G)) x) (@mem (Finite.sort (@coset_finType gT (@upper_central_at n gT (@gval gT G)))) (predPredType (Finite.sort (@coset_finType gT (@upper_central_at n gT (@gval gT G))))) (@SetDef.pred_of_set (@coset_finType gT (@upper_central_at n gT (@gval gT G))) (@quotient gT (@upper_central_at (addn (S m) n) gT (@gval gT G)) (@upper_central_at n gT (@gval gT G)))))) (@in_mem (Finite.sort (@coset_finType gT (@upper_central_at n gT (@gval gT G)))) (@coset gT (@upper_central_at n gT (@gval gT G)) x) (@mem (Finite.sort (@coset_finType gT (@upper_central_at n gT (@gval gT G)))) (predPredType (Finite.sort (@coset_finType gT (@upper_central_at n gT (@gval gT G))))) (@SetDef.pred_of_set (@coset_finType gT (@upper_central_at n gT (@gval gT G))) (@upper_central_at (S m) (@coset_groupType gT (@upper_central_at n gT (@gval gT G))) (@quotient gT (@gval gT G) (@upper_central_at n gT (@gval gT G))))))) *) have [sZG nZG] := andP (ucn_normal n G). (* Goal: @eq bool (@in_mem (Finite.sort (@coset_finType gT (@upper_central_at n gT (@gval gT G)))) (@coset gT (@upper_central_at n gT (@gval gT G)) x) (@mem (Finite.sort (@coset_finType gT (@upper_central_at n gT (@gval gT G)))) (predPredType (Finite.sort (@coset_finType gT (@upper_central_at n gT (@gval gT G))))) (@SetDef.pred_of_set (@coset_finType gT (@upper_central_at n gT (@gval gT G))) (@quotient gT (@upper_central_at (addn (S m) n) gT (@gval gT G)) (@upper_central_at n gT (@gval gT G)))))) (@in_mem (Finite.sort (@coset_finType gT (@upper_central_at n gT (@gval gT G)))) (@coset gT (@upper_central_at n gT (@gval gT G)) x) (@mem (Finite.sort (@coset_finType gT (@upper_central_at n gT (@gval gT G)))) (predPredType (Finite.sort (@coset_finType gT (@upper_central_at n gT (@gval gT G))))) (@SetDef.pred_of_set (@coset_finType gT (@upper_central_at n gT (@gval gT G))) (@upper_central_at (S m) (@coset_groupType gT (@upper_central_at n gT (@gval gT G))) (@quotient gT (@gval gT G) (@upper_central_at n gT (@gval gT G))))))) *) rewrite (ucnSnR m) inE -!sub1set -morphim_set1 //= -quotientR ?sub1set // -IHm. (* Goal: @eq bool (@subset (@coset_finType gT (@upper_central_at n gT (@gval gT G))) (@mem (@coset_of gT (@upper_central_at n gT (@gval gT G))) (predPredType (@coset_of gT (@upper_central_at n gT (@gval gT G)))) (@SetDef.pred_of_set (@coset_finType gT (@upper_central_at n gT (@gval gT G))) (@morphim gT (@coset_groupType gT (@upper_central_at n gT (@gval gT G))) (@normaliser gT (@upper_central_at n gT (@gval gT G))) (@coset_morphism gT (@upper_central_at n gT (@gval gT G))) (@MorPhantom gT (@coset_groupType gT (@upper_central_at n gT (@gval gT G))) (@coset gT (@upper_central_at n gT (@gval gT G)))) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) (@mem (@coset_of gT (@upper_central_at n gT (@gval gT G))) (predPredType (@coset_of gT (@upper_central_at n gT (@gval gT G)))) (@SetDef.pred_of_set (@coset_finType gT (@upper_central_at n gT (@gval gT G))) (@quotient gT (@upper_central_at (addn (S m) n) gT (@gval gT G)) (@upper_central_at n gT (@gval gT G)))))) (andb (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@upper_central_at n gT (@gval gT G)))) (@mem (@coset_of gT (@upper_central_at n gT (@gval gT G))) (predPredType (@coset_of gT (@upper_central_at n gT (@gval gT G)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@upper_central_at n gT (@gval gT G)))) (@morphim gT (@coset_groupType gT (@upper_central_at n gT (@gval gT G))) (@normaliser gT (@upper_central_at n gT (@gval gT G))) (@coset_morphism gT (@upper_central_at n gT (@gval gT G))) (@MorPhantom gT (@coset_groupType gT (@upper_central_at n gT (@gval gT G))) (@coset gT (@upper_central_at n gT (@gval gT G)))) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) (@mem (@coset_of gT (@upper_central_at n gT (@gval gT G))) (predPredType (@coset_of gT (@upper_central_at n gT (@gval gT G)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@upper_central_at n gT (@gval gT G)))) (@quotient gT (@gval gT G) (@upper_central_at n gT (@gval gT G)))))) (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@upper_central_at n gT (@gval gT G)))) (@mem (@coset_of gT (@upper_central_at n gT (@gval gT G))) (predPredType (@coset_of gT (@upper_central_at n gT (@gval gT G)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@upper_central_at n gT (@gval gT G)))) (@quotient gT (@commutator gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@gval gT G)) (@gval gT (@upper_central_at_group n gT G))))) (@mem (@coset_of gT (@upper_central_at n gT (@gval gT G))) (predPredType (@coset_of gT (@upper_central_at n gT (@gval gT G)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@upper_central_at n gT (@gval gT G)))) (@quotient gT (@upper_central_at (addn m n) gT (@gval gT G)) (@upper_central_at n gT (@gval gT G))))))) *) rewrite !quotientSGK ?(ucn_sub_geq, leq_addl, comm_subG _ nZG, sub1set) //=. (* Goal: @eq bool (@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)) (@upper_central_at (addn (S m) n) gT (@gval gT G))))) (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)))) (@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)) (@commutator gT (@set1 (FinGroup.arg_finType (FinGroup.base 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)) (@upper_central_at (addn m n) gT (@gval gT G)))))) *) by rewrite addSn /= ucnSnR inE. Qed. Lemma isog_nil rT G (L : {group rT}) : G \isog L -> nilpotent G = nilpotent L. Proof. (* Goal: forall _ : is_true (@isog gT rT (@gval gT G) (@gval rT L)), @eq bool (@nilpotent gT (@gval gT G)) (@nilpotent rT (@gval rT L)) *) by case/isogP=> f injf <-; rewrite injm_nil. Qed. Lemma isog_nil_class rT G (L : {group rT}) : G \isog L -> nil_class G = nil_class L. Proof. (* Goal: forall _ : is_true (@isog gT rT (@gval gT G) (@gval rT L)), @eq nat (@nil_class gT (@gval gT G)) (@nil_class rT (@gval rT L)) *) by case/isogP=> f injf <-; rewrite nil_class_injm. Qed. Lemma quotient_nil G H : nilpotent G -> nilpotent (G / H). Proof. (* Goal: forall _ : is_true (@nilpotent gT (@gval gT G)), is_true (@nilpotent (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H))) *) exact: morphim_nil. Qed. Lemma quotient_center_nil G : nilpotent (G / 'Z(G)) = nilpotent G. Lemma nil_class_quotient_center G : nilpotent (G) -> nil_class (G / 'Z(G)) = (nil_class G).-1. Lemma nilpotent_sub_norm G H : nilpotent G -> H \subset G -> 'N_G(H) \subset H -> G :=: H. Proof. (* Goal: forall (_ : is_true (@nilpotent 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 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser 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))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT G) (@gval gT H) *) move=> nilG sHG sNH; apply/eqP; rewrite eqEsubset sHG andbT; apply/negP=> nsGH. (* Goal: False *) have{nsGH} [i sZH []]: exists2 i, 'Z_i(G) \subset H & ~ 'Z_i.+1(G) \subset 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)) (@upper_central_at (S i) 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)))) *) (* Goal: @ex2 nat (fun i : nat => 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)) (@upper_central_at i 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))))) (fun i : nat => not (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)) (@upper_central_at (S i) 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)))))) *) case/ucnP: nilG => n ZnG; rewrite -{}ZnG in nsGH. (* 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)) (@upper_central_at (S i) 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)))) *) (* Goal: @ex2 nat (fun i : nat => 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)) (@upper_central_at i 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))))) (fun i : nat => not (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)) (@upper_central_at (S i) 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)))))) *) elim: n => [|i IHi] in nsGH *; first by rewrite sub1G in nsGH. (* 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)) (@upper_central_at (S i) 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)))) *) (* Goal: @ex2 nat (fun i : nat => 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)) (@upper_central_at i 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))))) (fun i : nat => not (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)) (@upper_central_at (S i) 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)))))) *) by case sZH: ('Z_i(G) \subset H); [exists i | apply: IHi; rewrite sZH]. (* 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)) (@upper_central_at (S i) 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)))) *) apply: subset_trans sNH; rewrite subsetI ucn_sub -commg_subr. (* 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)) (@commutator gT (@gval gT (@upper_central_at_group (S i) gT G)) (@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 apply: subset_trans sZH; apply: subset_trans (ucn_comm i G); apply: commgS. Qed. Lemma nilpotent_proper_norm G H : nilpotent G -> H \proper G -> H \proper 'N_G(H). Proof. (* Goal: forall (_ : is_true (@nilpotent gT (@gval gT G))) (_ : is_true (@proper (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (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 (@proper (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@gval gT H)))))) *) move=> nilG; rewrite properEneq properE subsetI normG => /andP[neHG sHG]. (* 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 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)))) 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser 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)))))) *) by rewrite sHG; apply: contra neHG => /(nilpotent_sub_norm nilG)->. Qed. Lemma nilpotent_subnormal G H : nilpotent G -> H \subset G -> H <|<| G. Proof. (* Goal: forall (_ : is_true (@nilpotent 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 G))))), is_true (@subnormal gT (@gval gT H) (@gval gT G)) *) move=> nilG; elim: {H}_.+1 {-2}H (ltnSn (#|G| - #|H|)) => // m IHm H. (* Goal: forall (_ : is_true (leq (S (subn (@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 gT)) (@mem (Finite.sort (FinGroup.arg_finType (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)))))) (S 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)) (@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 (@subnormal gT (@gval gT H) (@gval gT G)) *) rewrite ltnS => leGHm sHG. (* Goal: is_true (@subnormal gT (@gval gT H) (@gval gT G)) *) have [->|] := eqVproper sHG; first exact: subnormal_refl. (* Goal: forall _ : is_true (@proper (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (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 (@subnormal gT (@gval gT H) (@gval gT G)) *) move/(nilpotent_proper_norm nilG); set K := 'N_G(H) => prHK. (* Goal: is_true (@subnormal gT (@gval gT H) (@gval gT G)) *) have snHK: H <|<| K by rewrite normal_subnormal ?normalSG. (* Goal: is_true (@subnormal gT (@gval gT H) (@gval gT G)) *) have sKG: K \subset G by rewrite subsetIl. (* Goal: is_true (@subnormal gT (@gval gT H) (@gval gT G)) *) apply: subnormal_trans snHK (IHm _ (leq_trans _ leGHm) sKG). (* Goal: is_true (leq (S (subn (@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 gT)) (@mem (Finite.sort (FinGroup.arg_finType (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 H))))))))) (subn (@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 gT)) (@mem (Finite.sort (FinGroup.arg_finType (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 ltn_sub2l ?proper_card ?(proper_sub_trans prHK). Qed. Lemma TI_center_nil G H : nilpotent G -> H <| G -> H :&: 'Z(G) = 1 -> H :=: 1. Proof. (* Goal: forall (_ : is_true (@nilpotent gT (@gval gT G))) (_ : is_true (@normal gT (@gval gT H) (@gval gT 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) (@center 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))))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) move=> nilG /andP[sHG nHG] tiHZ. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) rewrite -{1}(setIidPl sHG); have{nilG} /ucnP[n <-] := nilG. (* 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) (@upper_central_at n gT (@gval gT G))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) elim: n => [|n IHn]; apply/trivgP; rewrite ?subsetIr // -tiHZ. (* 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 (@setI_group gT H (@upper_central_at_group (S n) 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@center gT (@gval gT G)))))) *) rewrite [H :&: 'Z(G)]setIA subsetI setIS ?ucn_sub //= (sameP commG1P trivgP). (* 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 (@commutator_group gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@upper_central_at (S n) gT (@gval gT G))) (@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)))))) *) rewrite -commg_subr commGC in nHG. (* 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 (@commutator_group gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@upper_central_at (S n) gT (@gval gT G))) (@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)))))) *) rewrite -IHn subsetI (subset_trans _ nHG) ?commSg ?subsetIl //=. (* 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)) (@commutator gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@upper_central_at (S n) gT (@gval gT G))) (@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)) (@upper_central_at n gT (@gval gT G))))) *) by rewrite (subset_trans _ (ucn_comm n G)) ?commSg ?subsetIr. Qed. Lemma meet_center_nil G H : nilpotent G -> H <| G -> H :!=: 1 -> H :&: 'Z(G) != 1. Proof. (* Goal: forall (_ : is_true (@nilpotent gT (@gval gT G))) (_ : is_true (@normal gT (@gval gT H) (@gval gT G))) (_ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H : @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)))))))), is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@center gT (@gval gT G))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) *) by move=> nilG nsHG; apply: contraNneq => /TI_center_nil->. Qed. Lemma center_nil_eq1 G : nilpotent G -> ('Z(G) == 1) = (G :==: 1). Proof. (* Goal: forall _ : is_true (@nilpotent gT (@gval gT G)), @eq bool (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center 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)))))) *) move=> nilG; apply/eqP/eqP=> [Z1 | ->]; last exact: center1. (* 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 (TI_center_nil nilG) // (setIidPr (center_sub G)). Qed. Lemma cyclic_nilpotent_quo_der1_cyclic G : nilpotent G -> cyclic (G / G^`(1)) -> cyclic G. End QuotientNil. Section Solvable. Variable gT : finGroupType. Implicit Types G H : {group gT}. Lemma nilpotent_sol G : nilpotent G -> solvable G. Proof. (* Goal: forall _ : is_true (@nilpotent gT (@gval gT G)), is_true (@solvable gT (@gval gT G)) *) move=> nilG; apply/forall_inP=> H /subsetIP[sHG sHH']. (* Goal: is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) by rewrite (forall_inP nilG) // subsetI sHG (subset_trans sHH') ?commgS. Qed. Lemma abelian_sol G : abelian G -> solvable G. Proof. (* Goal: forall _ : is_true (@abelian gT (@gval gT G)), is_true (@solvable gT (@gval gT G)) *) by move/abelian_nil/nilpotent_sol. Qed. Lemma solvableS G H : H \subset G -> solvable G -> solvable 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 (@solvable gT (@gval gT G))), is_true (@solvable gT (@gval gT H)) *) move=> sHG solG; apply/forall_inP=> K /subsetIP[sKH sKK']. (* Goal: is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) by rewrite (forall_inP solG) // subsetI (subset_trans sKH). Qed. Lemma sol_der1_proper G H : solvable G -> H \subset G -> H :!=: 1 -> H^`(1) \proper H. Proof. (* Goal: forall (_ : is_true (@solvable 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 G))))) (_ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H : @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)))))))), is_true (@proper (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@derived_at (S O) 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)))) *) move=> solG sHG ntH; rewrite properE comm_subG //; apply: implyP ntH. (* Goal: is_true (implb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (andb 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)) (@derived_at (S O) gT (@gval gT H)))))))) *) by have:= forallP solG H; rewrite subsetI sHG implybNN. Qed. Lemma derivedP G : reflect (exists n, G^`(n) = 1) (solvable G). Proof. (* Goal: Bool.reflect (@ex nat (fun n : nat => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@derived_at n gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@solvable gT (@gval gT G)) *) apply: (iffP idP) => [solG | [n solGn]]; last first. (* Goal: @ex nat (fun n : nat => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@derived_at n gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) (* Goal: is_true (@solvable gT (@gval gT G)) *) apply/forall_inP=> H /subsetIP[sHG sHH']. (* Goal: @ex nat (fun n : nat => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@derived_at n gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) (* Goal: is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) rewrite -subG1 -{}solGn; elim: n => // n IHn. (* Goal: @ex nat (fun n : nat => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@derived_at n gT (@gval gT G)) (oneg (group_set_of_baseGroupType (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)) (@gval 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)) (@derived_at (S n) gT (@gval gT G))))) *) exact: subset_trans sHH' (commgSS _ _). (* Goal: @ex nat (fun n : nat => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@derived_at n gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) suffices IHn n: #|G^`(n)| <= (#|G|.-1 - n).+1. (* 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)) (@derived_at n gT (@gval gT G))))) (S (subn (Nat.pred (@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))))) n))) *) (* Goal: @ex nat (fun n : nat => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@derived_at n gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) by exists #|G|.-1; rewrite [G^`(_)]card_le1_trivg ?(leq_trans (IHn _)) ?subnn. (* 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)) (@derived_at n gT (@gval gT G))))) (S (subn (Nat.pred (@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))))) n))) *) elim: n => [|n IHn]; first by rewrite subn0 prednK. (* 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)) (@derived_at (S n) gT (@gval gT G))))) (S (subn (Nat.pred (@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 n)))) *) rewrite dergSn subnS -ltnS. (* 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)) (@commutator gT (@derived_at n gT (@gval gT G)) (@derived_at n gT (@gval gT G))))))) (S (S (Nat.pred (subn (Nat.pred (@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))))) n))))) *) have [-> | ntGn] := eqVneq G^`(n) 1; first by rewrite commG1 cards1. (* 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)) (@commutator gT (@derived_at n gT (@gval gT G)) (@derived_at n gT (@gval gT G))))))) (S (S (Nat.pred (subn (Nat.pred (@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))))) n))))) *) case: (_ - _) IHn => [|n']; first by rewrite leqNgt cardG_gt1 ntGn. (* 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)) (@derived_at n gT (@gval gT G))))) (S (S n'))), 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)) (@commutator gT (@derived_at n gT (@gval gT G)) (@derived_at n gT (@gval gT G))))))) (S (S (Nat.pred (S n'))))) *) by apply: leq_trans (proper_card _); apply: sol_der1_proper (der_sub _ _) _. Qed. End Solvable. Section MorphSol. Variables (gT rT : finGroupType) (D : {group gT}) (f : {morphism D >-> rT}). Variable G : {group gT}. Lemma morphim_sol : solvable G -> solvable (f @* G). Lemma injm_sol : 'injm f -> G \subset D -> solvable (f @* G) = solvable G. End MorphSol. Section QuotientSol. Variables gT rT : finGroupType. Implicit Types G H K : {group gT}. Lemma isog_sol G (L : {group rT}) : G \isog L -> solvable G = solvable L. Proof. (* Goal: forall _ : is_true (@isog gT rT (@gval gT G) (@gval rT L)), @eq bool (@solvable gT (@gval gT G)) (@solvable rT (@gval rT L)) *) by case/isogP=> f injf <-; rewrite injm_sol. Qed. Lemma quotient_sol G H : solvable G -> solvable (G / H). Proof. (* Goal: forall _ : is_true (@solvable gT (@gval gT G)), is_true (@solvable (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H))) *) exact: morphim_sol. Qed. Lemma series_sol G H : H <| G -> solvable G = solvable H && solvable (G / H). Proof. (* Goal: forall _ : is_true (@normal gT (@gval gT H) (@gval gT G)), @eq bool (@solvable gT (@gval gT G)) (andb (@solvable gT (@gval gT H)) (@solvable (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)))) *) case/andP=> sHG nHG; apply/idP/andP=> [solG | [solH solGH]]. (* Goal: is_true (@solvable gT (@gval gT G)) *) (* Goal: and (is_true (@solvable gT (@gval gT H))) (is_true (@solvable (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)))) *) by rewrite quotient_sol // (solvableS sHG). (* Goal: is_true (@solvable gT (@gval gT G)) *) apply/forall_inP=> K /subsetIP[sKG sK'K]. (* Goal: is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) suffices sKH: K \subset H by rewrite (forall_inP solH) // subsetI sKH. (* 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 H)))) *) have nHK := subset_trans sKG nHG. (* 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 H)))) *) rewrite -quotient_sub1 // subG1 (forall_inP solGH) //. (* Goal: is_true (@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 K (@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)))) (@setI (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H)))) (@quotient gT (@gval gT G) (@gval gT H)) (@commutator (@coset_groupType gT (@gval gT H)) (@gval (@coset_groupType gT (@gval gT H)) (@quotient_group gT K (@gval gT H))) (@gval (@coset_groupType gT (@gval gT H)) (@quotient_group gT K (@gval gT H)))))))) *) by rewrite subsetI -morphimR ?morphimS. Qed. Lemma metacyclic_sol G : metacyclic G -> solvable G. Proof. (* Goal: forall _ : is_true (@metacyclic gT (@gval gT G)), is_true (@solvable gT (@gval gT G)) *) case/metacyclicP=> K [cycK nsKG cycGq]. (* Goal: is_true (@solvable gT (@gval gT G)) *) by rewrite (series_sol nsKG) !abelian_sol ?cyclic_abelian. Qed. End QuotientSol.
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 CoqV6Beta. 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_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 _) e t u & head_normal _ (beta _) e u}. Proof beta_whnf srt_v6. Lemma beta_conv_hnf : forall (e : env_v6) (x y : trm_v6), v6_sn e x -> v6_sn e y -> decide (conv_hn_inv _ (beta_rule _) e x y). Proof CR_WHNF_convert_hn srt_v6 v6_sort_dec (beta_rule srt_v6) (church_rosser_red 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_red 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 (beta_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 (beta_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 beta_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. Axiom v6_normalise : forall (e : env_v6) (t T : trm_v6), typ_v6 e t T -> v6_sn e t. Lemma sound_v6_beta : rule_sound _ v6_pts (beta _). Proof. (* Goal: rule_sound srt_v6 v6_pts (beta srt_v6) *) simpl in |- *. (* Goal: rule_sound srt_v6 v6_pts (beta srt_v6) *) apply beta_sound; auto with arith pts. (* Goal: product_inversion srt_v6 (Rule srt_v6 (Le_type srt_v6 (pts_le_type srt_v6 v6_pts))) *) simpl in |- *. (* Goal: product_inversion srt_v6 (R_rt srt_v6 (cumul srt_v6 v6)) *) apply cumul_inv_prod. (* Goal: subtype_dec_CTS srt_v6 v6 *) exact v6_is_subtype_dec. Qed. 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_beta 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 CoqV6Beta.
Require Import Bool. Require Import Omega. Section registers. Inductive register : nat -> Set := | regO : register 0 | regS : forall m : nat, bool -> register m -> register (S m). Definition register_zero := nat_rec register regO (fun m : nat => regS m false). Definition register_max := nat_rec register regO (fun m : nat => regS m true). Fixpoint is_register_zero (n : nat) (x : register n) {struct x} : bool := match x with | regO => true | regS m b y => if b then false else is_register_zero m y end. Definition is_register_max (n : nat) (x : register n) := match x with | regO => true | regS m b y => if b then is_register_zero m y else false end. Fixpoint entier_of_register (n : nat) (x : register n) {struct x} : N := match x with | regO => 0%N | regS m b y => if b then Ndouble_plus_one (entier_of_register m y) else Ndouble (entier_of_register m y) end. Definition Z_of_register (n : nat) (x : register n) := BinInt.Z_of_N (entier_of_register n x). Definition sign_of (b : bool) := if b then 1%Z else (-1)%Z. Fixpoint register_of_pos (n : nat) (x : positive) {struct x} : register n := match n as x return (register x) with | O => regO | S m => match x with | xH => regS m true (register_zero m) | xI y => regS m true (register_of_pos m y) | xO y => regS m false (register_of_pos m y) end end. Definition register_of_entier (n : nat) (x : N) := match x return (register n) with | N0 => register_zero n | Npos p => register_of_pos n p end. Definition register_of_Z (n : nat) (z : Z) : register n := register_of_entier n (BinInt.Zabs_N z). Lemma register_of_entier_bij2 : forall (n : nat) (x : register n), register_of_entier n (entier_of_register n x) = x. Proof. (* Goal: forall (n : nat) (x : register n), @eq (register n) (register_of_entier n (entier_of_register n x)) x *) simple induction x; [ reflexivity | intros m b r; elim b; [ simpl in |- *; unfold Ndouble_plus_one in |- *; elim (entier_of_register m r); intros; rewrite <- H; reflexivity | simpl in |- *; unfold Ndouble in |- *; elim (entier_of_register m r); intros; rewrite <- H; reflexivity ] ]. Qed. Fixpoint register_compare (n : nat) (x : register n) (m : nat) (y : register m) {struct y} : Datatypes.comparison := match x with | regO => if is_register_zero m y then Datatypes.Eq else Datatypes.Lt | regS n' b_x x' => match y with | regO => if is_register_zero n x then Datatypes.Eq else Datatypes.Gt | regS m' b_y y' => match register_compare n' x' m' y' with | Datatypes.Eq => if b_x then if b_y then Datatypes.Eq else Datatypes.Gt else if b_y then Datatypes.Lt else Datatypes.Eq | Datatypes.Gt => Datatypes.Gt | Datatypes.Lt => Datatypes.Lt end end end. Definition reg_compare (n : nat) (x y : register n) := register_compare n x n y. End registers.
Require Export GeoCoq.Elements.OriginalProofs.lemma_TCreflexive. Section Euclid. Context `{Ax:area}. Lemma lemma_ETreflexive : forall A B C, Triangle A B C -> ET A B C A B C. Proof. (* Goal: forall (A B C : @Point Ax0) (_ : @Triangle Ax0 A B C), @ET Ax0 Ax1 Ax2 Ax A B C A B C *) intros. (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C A B C *) assert (nCol A B C) by (conclude_def Triangle ). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C A B C *) assert (Cong_3 A B C A B C) by (conclude lemma_TCreflexive). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C A B C *) assert (ET A B C A B C) by (conclude axiom_congruentequal). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C A B C *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.lemma_lessthancongruence2. Require Export GeoCoq.Elements.OriginalProofs.lemma_lessthancongruence. Section Euclid. Context `{Ax1:euclidean_neutral_ruler_compass}. Lemma lemma_together : forall A B C D F G P Q a b c, TG A a B b C c -> Cong D F A a -> Cong F G B b -> BetS D F G -> Cong P Q C c -> Lt P Q D G /\ neq A a /\ neq B b /\ neq C c. Proof. (* Goal: forall (A B C D F G P Q a b c : @Point Ax) (_ : @TG Ax A a B b C c) (_ : @Cong Ax D F A a) (_ : @Cong Ax F G B b) (_ : @BetS Ax D F G) (_ : @Cong Ax P Q C c), and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) intros. (* Goal: and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) let Tf:=fresh in assert (Tf:exists R, (BetS A a R /\ Cong a R B b /\ Lt C c A R)) by (conclude_def TG );destruct Tf as [R];spliter. (* Goal: and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) assert (Cong A a A a) by (conclude cn_congruencereflexive). (* Goal: and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) assert (Cong B b a R) by (conclude lemma_congruencesymmetric). (* Goal: and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) assert (Cong F G a R) by (conclude lemma_congruencetransitive). (* Goal: and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) assert (Cong D G A R) by (conclude cn_sumofparts). (* Goal: and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) assert (Cong A R D G) by (conclude lemma_congruencesymmetric). (* Goal: and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) assert (Cong C c P Q) by (conclude lemma_congruencesymmetric). (* Goal: and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) assert (Lt P Q A R) by (conclude lemma_lessthancongruence2). (* Goal: and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) assert (Lt P Q D G) by (conclude lemma_lessthancongruence). (* Goal: and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) assert (neq A a) by (forward_using lemma_betweennotequal). (* Goal: and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) assert (neq a R) by (forward_using lemma_betweennotequal). (* Goal: and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) assert (neq B b) by (conclude axiom_nocollapse). (* Goal: and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) let Tf:=fresh in assert (Tf:exists S, (BetS A S R /\ Cong A S C c)) by (conclude_def Lt );destruct Tf as [S];spliter. (* Goal: and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) assert (neq A S) by (forward_using lemma_betweennotequal). (* Goal: and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) assert (neq C c) by (conclude axiom_nocollapse). (* Goal: and (@Lt Ax P Q D G) (and (@neq Ax A a) (and (@neq Ax B b) (@neq Ax C c))) *) close. Qed. End Euclid.
Require Export Numerals. Require Export Compare_Nat. Section compare_num. Variable BASE : BT. Let Digit := digit BASE. Let valB := val BASE. Let ValB := Val BASE. Let Num := num BASE. Let Val_bound := val_bound BASE. Let Cons := cons Digit. Let Nil := nil Digit. Lemma Comp_dif : forall (n : nat) (x y : Digit) (X Y : Num n), valB x < valB y -> Compare_Nat.comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y)) = Proof. (* Goal: forall (n : nat) (x y : Digit) (X Y : Num n) (_ : lt (valB x) (valB y)), @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) L *) intros n x y X Y l. (* Goal: @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) L *) apply comparisonL. (* Goal: lt (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y)) *) unfold ValB in |- *. (* Goal: lt (Val BASE (S n) (Cons n x X)) (Val BASE (S n) (Cons n y Y)) *) unfold Cons in |- *. (* Goal: lt (Val BASE (S n) (cons Digit n x X)) (Val BASE (S n) (cons Digit n y Y)) *) unfold Digit in |- *. (* Goal: lt (Val BASE (S n) (cons (digit BASE) n x X)) (Val BASE (S n) (cons (digit BASE) n y Y)) *) apply comp_dif. (* Goal: lt (val BASE x) (val BASE y) *) auto. Qed. Hint Resolve Comp_dif. Lemma Comp_eq : forall (n : nat) (x y : Digit) (X Y : Num n), valB x = valB y -> Compare_Nat.comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y)) = Proof. (* Goal: forall (n : nat) (x y : Digit) (X Y : Num n) (_ : @eq nat (valB x) (valB y)), @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) (comparison (ValB n X) (ValB n Y)) *) intros n x y X Y e. (* Goal: @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) (comparison (ValB n X) (ValB n Y)) *) cut (Compare_Nat.comparison (ValB n X) (ValB n Y) = Compare_Nat.comparison (ValB n X) (ValB n Y)); auto. (* Goal: forall _ : @eq order (comparison (ValB n X) (ValB n Y)) (comparison (ValB n X) (ValB n Y)), @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) (comparison (ValB n X) (ValB n Y)) *) pattern (Compare_Nat.comparison (ValB n X) (ValB n Y)) at 2 3 in |- *. (* Goal: (fun o : order => forall _ : @eq order (comparison (ValB n X) (ValB n Y)) o, @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) o) (comparison (ValB n X) (ValB n Y)) *) case (Compare_Nat.comparison (ValB n X) (ValB n Y)); intros c. (* Goal: @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) G *) (* Goal: @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) E *) (* Goal: @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) L *) unfold ValB in |- *; unfold Cons in |- *; unfold Digit in |- *. (* Goal: @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) G *) (* Goal: @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) E *) (* Goal: @eq order (comparison (Val BASE (S n) (cons (digit BASE) n x X)) (Val BASE (S n) (cons (digit BASE) n y Y))) L *) apply comparisonL. (* Goal: @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) G *) (* Goal: @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) E *) (* Goal: lt (Val BASE (S n) (cons (digit BASE) n x X)) (Val BASE (S n) (cons (digit BASE) n y Y)) *) apply comp_eq_most; auto. (* Goal: @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) G *) (* Goal: @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) E *) simpl in |- *. (* Goal: @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) G *) (* Goal: @eq order (comparison (Init.Nat.add (Init.Nat.mul (val BASE x) (exp (base BASE) n)) (ValB n X)) (Init.Nat.add (Init.Nat.mul (val BASE y) (exp (base BASE) n)) (ValB n Y))) E *) unfold valB in e. (* Goal: @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) G *) (* Goal: @eq order (comparison (Init.Nat.add (Init.Nat.mul (val BASE x) (exp (base BASE) n)) (ValB n X)) (Init.Nat.add (Init.Nat.mul (val BASE y) (exp (base BASE) n)) (ValB n Y))) E *) rewrite e. (* Goal: @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) G *) (* Goal: @eq order (comparison (Init.Nat.add (Init.Nat.mul (val BASE y) (exp (base BASE) n)) (ValB n X)) (Init.Nat.add (Init.Nat.mul (val BASE y) (exp (base BASE) n)) (ValB n Y))) E *) rewrite (inv_comparisonE (ValB n X) (ValB n Y) c). (* Goal: @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) G *) (* Goal: @eq order (comparison (Init.Nat.add (Init.Nat.mul (val BASE y) (exp (base BASE) n)) (ValB n Y)) (Init.Nat.add (Init.Nat.mul (val BASE y) (exp (base BASE) n)) (ValB n Y))) E *) apply comparisonE; auto. (* Goal: @eq order (comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y))) G *) apply comparisonG. (* Goal: gt (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y)) *) unfold gt in |- *. (* Goal: lt (ValB (S n) (Cons n y Y)) (ValB (S n) (Cons n x X)) *) unfold ValB in |- *; unfold Cons in |- *; unfold Digit in |- *. (* Goal: lt (Val BASE (S n) (cons (digit BASE) n y Y)) (Val BASE (S n) (cons (digit BASE) n x X)) *) apply comp_eq_most. (* Goal: lt (Val BASE n Y) (Val BASE n X) *) (* Goal: @eq nat (val BASE y) (val BASE x) *) auto. (* Goal: lt (Val BASE n Y) (Val BASE n X) *) cut (Val BASE n X > Val BASE n Y); auto. Qed. End compare_num. Hint Resolve Comp_eq. Hint Resolve Comp_dif.
Require Export GeoCoq.Tarski_dev.Ch13_5_Pappus_Pascal. Section Desargues_Hessenberg. Context `{T2D:Tarski_2D}. Context `{TE:@Tarski_euclidean Tn TnEQD}. Lemma l13_15_1 : forall A B C A' B' C' O , ~ Col A B C -> ~ Par O B A C -> Par_strict A B A' B' -> Par_strict A C A' C'-> Col O A A' -> Col O B B' -> Col O C C' -> Par B C B' C'. Proof. (* Goal: forall (A B C A' B' C' O : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : not (@Par Tn O B A C)) (_ : @Par_strict Tn A B A' B') (_ : @Par_strict Tn A C A' C') (_ : @Col Tn O A A') (_ : @Col Tn O B B') (_ : @Col Tn O C C'), @Par Tn B C B' C' *) intros. (* Goal: @Par Tn B C B' C' *) assert(~Col B A' B'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Col Tn B A' B') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H1. (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A' B')) *) exists B. (* Goal: @Par Tn B C B' C' *) (* Goal: and (@Col Tn B A B) (@Col Tn B A' B') *) split; Col. (* Goal: @Par Tn B C B' C' *) assert(~Col A A' B'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Col Tn A A' B') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H1. (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A' B')) *) exists A. (* Goal: @Par Tn B C B' C' *) (* Goal: and (@Col Tn A A B) (@Col Tn A A' B') *) split; Col. (* Goal: @Par Tn B C B' C' *) assert(B <> O). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B O) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst B. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H1. (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A O) (@Col Tn X A' B')) *) exists A'. (* Goal: @Par Tn B C B' C' *) (* Goal: and (@Col Tn A' A O) (@Col Tn A' A' B') *) split; Col. (* Goal: @Par Tn B C B' C' *) assert(A <> O). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) A O) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst A. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H1. (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O B) (@Col Tn X A' B')) *) exists B'. (* Goal: @Par Tn B C B' C' *) (* Goal: and (@Col Tn B' O B) (@Col Tn B' A' B') *) split; Col. (* Goal: @Par Tn B C B' C' *) assert(~ Col A' A C). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Col Tn A' A C) *) eapply (par_not_col A' C'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A' A' C' *) (* Goal: @Par_strict Tn A' C' A C *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A' A' C' *) Col. (* Goal: @Par Tn B C B' C' *) assert(C <> O). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) C O) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst C. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H10. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A' A O *) Col. (* Goal: @Par Tn B C B' C' *) assert(~Col O A B). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Col Tn O A B) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H1. (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A' B')) *) exists O. (* Goal: @Par Tn B C B' C' *) (* Goal: and (@Col Tn O A B) (@Col Tn O A' B') *) split. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A' B' *) (* Goal: @Col Tn O A B *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A' B' *) assert(Col O A B'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A' B' *) (* Goal: @Col Tn O A B' *) apply (col_transitivity_1 _ B); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A' B' *) apply (col_transitivity_1 _ A); Col. (* Goal: @Par Tn B C B' C' *) assert(~Col O A C). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Col Tn O A C) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H2. (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A C) (@Col Tn X A' C')) *) exists O. (* Goal: @Par Tn B C B' C' *) (* Goal: and (@Col Tn O A C) (@Col Tn O A' C') *) split. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A' C' *) (* Goal: @Col Tn O A C *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A' C' *) assert(Col O A C'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A' C' *) (* Goal: @Col Tn O A C' *) apply (col_transitivity_1 _ C); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A' C' *) apply (col_transitivity_1 _ A); Col. (* Goal: @Par Tn B C B' C' *) assert(~ Col A' B' C'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Col Tn A' B' C') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) assert(Par A' C' A B). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn A' C' A B *) apply(par_col_par_2 A' B' A B C'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn A' B' A B *) (* Goal: @Col Tn A' B' C' *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn A' B' A B *) (* Goal: @Col Tn A' B' C' *) (* Goal: False *) subst C'. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn A' B' A B *) (* Goal: @Col Tn A' B' C' *) (* Goal: False *) unfold Par_strict in H2. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn A' B' A B *) (* Goal: @Col Tn A' B' C' *) (* Goal: False *) tauto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn A' B' A B *) (* Goal: @Col Tn A' B' C' *) auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn A' B' A B *) left. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) (* Goal: @Par_strict Tn A' B' A B *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) assert(Par A C A B). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn A C A B *) apply(par_trans A C A' C'); Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) induction H16. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) (* Goal: @Col Tn A B C *) apply False_ind. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) (* Goal: False *) apply H16. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A C) (@Col Tn X A B)) *) exists A. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) (* Goal: and (@Col Tn A A C) (@Col Tn A A B) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) spliter; Col. (* Goal: @Par Tn B C B' C' *) induction(col_dec O B C). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) right. (* Goal: @Par Tn B C B' C' *) (* Goal: and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) B' C')) (and (@Col Tn B B' C') (@Col Tn C B' C'))) *) repeat split. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn C B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) (* Goal: not (@eq (@Tpoint Tn) B C) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn C B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) (* Goal: False *) subst C. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn C B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) (* Goal: False *) apply H. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn C B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) (* Goal: @Col Tn A B B *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn C B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn C B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: False *) subst C'. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn C B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: False *) apply H14. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn C B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: @Col Tn A' B' B' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn C B' C' *) (* Goal: @Col Tn B B' C' *) assert(Col O B C'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn C B' C' *) (* Goal: @Col Tn B B' C' *) (* Goal: @Col Tn O B C' *) apply (col_transitivity_1 _ C); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn C B' C' *) (* Goal: @Col Tn B B' C' *) apply (col_transitivity_1 _ O); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn C B' C' *) assert(Col O C B'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn C B' C' *) (* Goal: @Col Tn O C B' *) apply (col_transitivity_1 _ B); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn C B' C' *) apply (col_transitivity_1 _ O); Col. (* Goal: @Par Tn B C B' C' *) assert(B' <> O). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst B'. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H7. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A A' O *) Col. (* Goal: @Par Tn B C B' C' *) assert(B' <> O). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst B'. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H7. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A A' O *) Col. (* Goal: @Par Tn B C B' C' *) assert(A' <> O). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst A'. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H6. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn B O B' *) Col. (* Goal: @Par Tn B C B' C' *) assert(~ Col A A' C'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Col Tn A A' C') *) eapply (par_not_col A C). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A A C *) (* Goal: @Par_strict Tn A C A' C' *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A A C *) Col. (* Goal: @Par Tn B C B' C' *) assert(C' <> O). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) C' O) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst C'. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H19. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A A' O *) Col. (* Goal: @Par Tn B C B' C' *) assert(~Col O A' B'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Col Tn O A' B') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H1. (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A' B')) *) exists O. (* Goal: @Par Tn B C B' C' *) (* Goal: and (@Col Tn O A B) (@Col Tn O A' B') *) split. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A' B' *) (* Goal: @Col Tn O A B *) assert(Col O A' B). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A' B' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A' B *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A' B' *) (* Goal: @Col Tn O A B *) apply (col_transitivity_1 _ A'); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A' B' *) Col. (* Goal: @Par Tn B C B' C' *) assert(~Col O A' C'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Col Tn O A' C') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H2. (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A C) (@Col Tn X A' C')) *) exists O. (* Goal: @Par Tn B C B' C' *) (* Goal: and (@Col Tn O A C) (@Col Tn O A' C') *) split. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A' C' *) (* Goal: @Col Tn O A C *) ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A' C' *) Col. (* Goal: @Par Tn B C B' C' *) assert(~Col B' A B). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Col Tn B' A B) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H1. (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A' B')) *) exists B'. (* Goal: @Par Tn B C B' C' *) (* Goal: and (@Col Tn B' A B) (@Col Tn B' A' B') *) Col. (* Goal: @Par Tn B C B' C' *) assert(~Col A' A B). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Col Tn A' A B) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H1. (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A' B')) *) exists A'. (* Goal: @Par Tn B C B' C' *) (* Goal: and (@Col Tn A' A B) (@Col Tn A' A' B') *) split; Col. (* Goal: @Par Tn B C B' C' *) assert(exists C : Tpoint, exists D : Tpoint, C <> D /\ Par O B C D /\ Col A C D). (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (not (@eq (@Tpoint Tn) C D)) (and (@Par Tn O B C D) (@Col Tn A C D)))) *) apply(parallel_existence O B A). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) O B) *) auto. (* Goal: @Par Tn B C B' C' *) ex_and H25 X. (* Goal: @Par Tn B C B' C' *) ex_and H26 Y. (* Goal: @Par Tn B C B' C' *) assert(exists L : Tpoint, Col L X Y /\ Col L A' C'). (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun L : @Tpoint Tn => and (@Col Tn L X Y) (@Col Tn L A' C')) *) apply(not_par_inter_exists X Y A' C'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Par Tn X Y A' C') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H0. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O B A C *) eapply (par_trans O B X Y). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn X Y A C *) (* Goal: @Par Tn O B X Y *) auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn X Y A C *) apply par_symmetry. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A C X Y *) apply (par_trans A C A' C'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A' C' X Y *) (* Goal: @Par Tn A C A' C' *) left. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A' C' X Y *) (* Goal: @Par_strict Tn A C A' C' *) auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A' C' X Y *) Par. (* Goal: @Par Tn B C B' C' *) ex_and H28 L. (* Goal: @Par Tn B C B' C' *) assert(A <> L). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) A L) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst L. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) contradiction. (* Goal: @Par Tn B C B' C' *) assert(Par A L O B'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A L O B' *) apply par_symmetry. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O B' A L *) apply(par_col_par_2 _ B); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O B A L *) apply par_symmetry. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A L O B *) apply par_left_comm. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn L A O B *) induction(eq_dec_points X L). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn L A O B *) (* Goal: @Par Tn L A O B *) subst X. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn L A O B *) (* Goal: @Par Tn L A O B *) apply (par_col_par_2 _ Y); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn L A O B *) (* Goal: @Par Tn L Y O B *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn L A O B *) apply (par_col_par_2 _ X); try auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn L X O B *) (* Goal: @Col Tn L X A *) ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn L X O B *) apply par_left_comm. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn X L O B *) apply (par_col_par_2 _ Y); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn X Y O B *) Par. (* Goal: @Par Tn B C B' C' *) assert(~ Par X Y O C). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Par Tn X Y O C) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) assert(Par O B O C). (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Par Tn O B O C *) apply (par_trans O B X Y); Par. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) induction H33. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) apply H33. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O B) (@Col Tn X O C)) *) exists O. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: and (@Col Tn O O B) (@Col Tn O O C) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H15. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O B C *) Col. (* Goal: @Par Tn B C B' C' *) assert(HH:=not_par_inter_exists X Y O C H32). (* Goal: @Par Tn B C B' C' *) ex_and HH M. (* Goal: @Par Tn B C B' C' *) assert(A <> M). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) A M) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst M. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H13. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A C *) Col. (* Goal: @Par Tn B C B' C' *) assert(Par O B A M). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O B A M *) apply (par_col_par_2 _ B'); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O B' A M *) apply par_symmetry. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A M O B' *) apply (par_col_par_2 _ L); try auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A L M *) ColR. (* Goal: @Par Tn B C B' C' *) assert(L <> A'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) L A') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst L. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) clean_trivial_hyps. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H12. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) induction(eq_dec_points A' X). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A B *) subst X. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A B *) assert(Par A' A O B). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A B *) (* Goal: @Par Tn A' A O B *) apply (par_col_par_2 _ Y); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A B *) (* Goal: @Par Tn A' Y O B *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A B *) induction H29. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A B *) apply False_ind. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A B *) (* Goal: False *) apply H29. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A B *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A' A) (@Col Tn X O B)) *) exists O. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A B *) (* Goal: and (@Col Tn O A' A) (@Col Tn O O B) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A B *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A B *) ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) assert(Par X A' O B). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Par Tn X A' O B *) apply (par_col_par_2 _ Y); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Par Tn X Y O B *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) assert(Par A' A O B). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Par Tn A' A O B *) apply (par_col_par_2 _ X); try auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Par Tn A' X O B *) (* Goal: @Col Tn A' X A *) ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Par Tn A' X O B *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) induction H38. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A B *) apply False_ind. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: False *) apply H38. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A' A) (@Col Tn X O B)) *) exists O. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) (* Goal: and (@Col Tn O A' A) (@Col Tn O O B) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) Col. (* Goal: @Par Tn B C B' C' *) assert(~ Par L B' A' B'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Par Tn L B' A' B') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) induction H38. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) apply H38. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X L B') (@Col Tn X A' B')) *) exists B'. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: and (@Col Tn B' L B') (@Col Tn B' A' B') *) split;Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H14. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A' B' C' *) eapply (col_transitivity_1 _ L); Col. (* Goal: @Par Tn B C B' C' *) assert(~ Par A B L B'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Par Tn A B L B') *) apply(par_not_par A' B' A B L B'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Par Tn A' B' L B') *) (* Goal: @Par Tn A' B' A B *) left. (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Par Tn A' B' L B') *) (* Goal: @Par_strict Tn A' B' A B *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Par Tn A' B' L B') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H38. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn L B' A' B' *) Par. (* Goal: @Par Tn B C B' C' *) assert(HH:=not_par_inter_exists A B L B' H39 ). (* Goal: @Par Tn B C B' C' *) ex_and HH N. (* Goal: @Par Tn B C B' C' *) assert(Par_strict A L O B'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par_strict Tn A L O B' *) induction H31. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par_strict Tn A L O B' *) (* Goal: @Par_strict Tn A L O B' *) auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par_strict Tn A L O B' *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par_strict Tn A L O B' *) apply False_ind. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H12. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Par Tn B C B' C' *) assert(A <> N). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) A N) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst N. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H42. (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A L) (@Col Tn X O B')) *) exists B'; Col. (* Goal: @Par Tn B C B' C' *) assert(Par A N A' B'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A N A' B' *) apply (par_col_par_2 _ B); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A B A' B' *) left. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par_strict Tn A B A' B' *) Par. (* Goal: @Par Tn B C B' C' *) clean_duplicated_hyps. (* Goal: @Par Tn B C B' C' *) assert(Par O N L A'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) induction(par_dec A O N L). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par Tn O N L A' *) assert(Par_strict A O N L). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par_strict Tn A O N L *) induction H17. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par_strict Tn A O N L *) (* Goal: @Par_strict Tn A O N L *) auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par_strict Tn A O N L *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par_strict Tn A O N L *) apply False_ind. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par Tn O N L A' *) (* Goal: False *) apply H23. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Col Tn B' A B *) assert(Col N A B'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Col Tn B' A B *) (* Goal: @Col Tn N A B' *) eapply (col_transitivity_1 _ L); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Col Tn B' A B *) apply col_permutation_2. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Col Tn A B B' *) eapply (col_transitivity_1 _ N); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par Tn O N L A' *) apply(l13_14 A O A' A N L N B'); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par Tn A' B' N A *) (* Goal: @Par Tn O B' L A *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: @Par Tn A' B' N A *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) assert(N <> L). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: not (@eq (@Tpoint Tn) N L) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: False *) subst L. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: False *) apply H42. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A N) (@Col Tn X O B')) *) exists B. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) (* Goal: and (@Col Tn B A N) (@Col Tn B O B') *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) assert(HH:=not_par_inter_exists A O N L H17). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) ex_and HH P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N L A' *) apply par_right_comm. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) assert(P <> L). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: not (@eq (@Tpoint Tn) P L) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) subst P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) apply H42. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A L) (@Col Tn X O B')) *) exists O. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: and (@Col Tn O A L) (@Col Tn O O B') *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) assert(P <> O). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: not (@eq (@Tpoint Tn) P O) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) subst P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) apply H42. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A L) (@Col Tn X O B')) *) exists L. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: and (@Col Tn L A L) (@Col Tn L O B') *) split. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn L O B' *) (* Goal: @Col Tn L A L *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn L O B' *) apply (col_transitivity_1 _ N); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) assert(L <> B'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: not (@eq (@Tpoint Tn) L B') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) subst L. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) apply H42. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B') (@Col Tn X O B')) *) exists B'. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: and (@Col Tn B' A B') (@Col Tn B' O B') *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) assert(A <> P). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: not (@eq (@Tpoint Tn) A P) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) subst P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) assert(Col A B L). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) (* Goal: @Col Tn A B L *) apply (col_transitivity_1 _ N); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) assert(Col L A B'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) (* Goal: @Col Tn L A B' *) apply (col_transitivity_1 _ N); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) apply H39. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Par Tn A B L B' *) apply par_symmetry. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Par Tn L B' A B *) right. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: and (not (@eq (@Tpoint Tn) L B')) (and (not (@eq (@Tpoint Tn) A B)) (and (@Col Tn L A B) (@Col Tn B' A B))) *) repeat split. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn B' A B *) (* Goal: @Col Tn L A B *) (* Goal: not (@eq (@Tpoint Tn) A B) *) (* Goal: not (@eq (@Tpoint Tn) L B') *) assumption. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn B' A B *) (* Goal: @Col Tn L A B *) (* Goal: not (@eq (@Tpoint Tn) A B) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn B' A B *) (* Goal: @Col Tn L A B *) (* Goal: False *) subst B. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn B' A B *) (* Goal: @Col Tn L A B *) (* Goal: False *) apply H23. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn B' A B *) (* Goal: @Col Tn L A B *) (* Goal: @Col Tn B' A A *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn B' A B *) (* Goal: @Col Tn L A B *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn B' A B *) ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) assert(P <> N). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: not (@eq (@Tpoint Tn) P N) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) subst P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) apply H12. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn O A B *) apply col_permutation_2. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn A B O *) apply (col_transitivity_1 _ N); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) assert(A' <> P). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: not (@eq (@Tpoint Tn) A' P) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) subst P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) apply H38. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Par Tn L B' A' B' *) right. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: and (not (@eq (@Tpoint Tn) L B')) (and (not (@eq (@Tpoint Tn) A' B')) (and (@Col Tn L A' B') (@Col Tn B' A' B'))) *) repeat split; try assumption. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn B' A' B' *) (* Goal: @Col Tn L A' B' *) (* Goal: not (@eq (@Tpoint Tn) A' B') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn B' A' B' *) (* Goal: @Col Tn L A' B' *) (* Goal: False *) subst B'. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn B' A' B' *) (* Goal: @Col Tn L A' B' *) (* Goal: False *) apply H21. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn B' A' B' *) (* Goal: @Col Tn L A' B' *) (* Goal: @Col Tn O A' A' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn B' A' B' *) (* Goal: @Col Tn L A' B' *) ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn B' A' B' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) assert(B' <> P). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: not (@eq (@Tpoint Tn) B' P) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) subst P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: False *) apply H21. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) (* Goal: @Col Tn O A' B' *) apply (col_transitivity_1 _ A); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A' L *) apply(l13_11 O A' A L N B' P); Par; try ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Col Tn P O L) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H42. (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A L) (@Col Tn X O B')) *) exists L. (* Goal: @Par Tn B C B' C' *) (* Goal: and (@Col Tn L A L) (@Col Tn L O B') *) split. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn L O B' *) (* Goal: @Col Tn L A L *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn L O B' *) assert(Col L O N). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn L O B' *) (* Goal: @Col Tn L O N *) apply (col_transitivity_1 _ P); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn L O B' *) apply (col_transitivity_1 _ N); Col. (* Goal: @Par Tn B C B' C' *) assert(Par A' C' O N). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A' C' O N *) apply (par_col_par_2 _ L). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A' L O N *) (* Goal: @Col Tn A' L C' *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A' L O N *) (* Goal: @Col Tn A' L C' *) (* Goal: False *) subst C'. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A' L O N *) (* Goal: @Col Tn A' L C' *) (* Goal: False *) apply H22. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A' L O N *) (* Goal: @Col Tn A' L C' *) (* Goal: @Col Tn O A' A' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A' L O N *) (* Goal: @Col Tn A' L C' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A' L O N *) Par. (* Goal: @Par Tn B C B' C' *) assert(Par O N A C). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn O N A C *) apply (par_trans _ _ A' C'); Par. (* Goal: @Par Tn B C B' C' *) assert(Par N M B C). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) induction(par_dec A N O C). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: @Par Tn N M B C *) assert(Par_strict A N O C). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: @Par Tn N M B C *) (* Goal: @Par_strict Tn A N O C *) induction H47. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: @Par Tn N M B C *) (* Goal: @Par_strict Tn A N O C *) (* Goal: @Par_strict Tn A N O C *) auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: @Par Tn N M B C *) (* Goal: @Par_strict Tn A N O C *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: @Par Tn N M B C *) (* Goal: @Par_strict Tn A N O C *) apply False_ind. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: @Par Tn N M B C *) (* Goal: False *) apply H13. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: @Par Tn N M B C *) (* Goal: @Col Tn O A C *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: @Par Tn N M B C *) apply par_right_comm. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: @Par Tn N M C B *) apply(l13_14 A N B A O C M O ); Par; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) assert(HH:= not_par_inter_exists A N O C H47). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) ex_and HH P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) assert(B <> P). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: not (@eq (@Tpoint Tn) B P) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) subst P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) apply H15. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: @Col Tn O B C *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) assert(A <> P). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: not (@eq (@Tpoint Tn) A P) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) subst P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) apply H13. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: @Col Tn O A C *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) assert(M <> P). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: not (@eq (@Tpoint Tn) M P) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) subst P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) induction H36. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) (* Goal: False *) apply H36. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O B) (@Col Tn X A M)) *) exists B. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) (* Goal: and (@Col Tn B O B) (@Col Tn B A M) *) split. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) (* Goal: @Col Tn B A M *) (* Goal: @Col Tn B O B *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) (* Goal: @Col Tn B A M *) apply col_permutation_2. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) (* Goal: @Col Tn A M B *) apply (col_transitivity_1 _ N); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) apply H12. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: @Col Tn O A B *) apply col_permutation_2. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: @Col Tn A B O *) apply (col_transitivity_1 _ M); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) assert(O <> P). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: not (@eq (@Tpoint Tn) O P) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) subst P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) induction H46. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) (* Goal: False *) apply H46. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O N) (@Col Tn X A C)) *) exists A. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) (* Goal: and (@Col Tn A O N) (@Col Tn A A C) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) apply H13. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: @Col Tn O A C *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) assert(P <> N). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: not (@eq (@Tpoint Tn) P N) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) subst P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) induction H46. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) (* Goal: False *) apply H46. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O N) (@Col Tn X A C)) *) exists C. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) (* Goal: and (@Col Tn C O N) (@Col Tn C A C) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: False *) apply H13. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) (* Goal: @Col Tn O A C *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B C *) apply(l13_11 N B A C M O P); Par; try ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Col Tn P N C) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) assert(Col N A C) by ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) ColR. (* Goal: @Par Tn B C B' C' *) assert(Par N M B' C'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) induction(par_dec N B' O C'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) assert(Par_strict N B' O C'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par_strict Tn N B' O C' *) induction H48. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par_strict Tn N B' O C' *) (* Goal: @Par_strict Tn N B' O C' *) auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par_strict Tn N B' O C' *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par_strict Tn N B' O C' *) apply False_ind. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) induction H46. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) (* Goal: False *) apply H46. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O N) (@Col Tn X A C)) *) exists C. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) (* Goal: and (@Col Tn C O N) (@Col Tn C A C) *) split. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) (* Goal: @Col Tn C A C *) (* Goal: @Col Tn C O N *) ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) (* Goal: @Col Tn C A C *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) contradiction. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) assert(M <> L). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: not (@eq (@Tpoint Tn) M L) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) subst M. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) apply H49. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X N B') (@Col Tn X O C')) *) exists L. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: and (@Col Tn L N B') (@Col Tn L O C') *) split. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Col Tn L O C' *) (* Goal: @Col Tn L N B' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Col Tn L O C' *) apply col_permutation_2. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Col Tn O C' L *) apply(col_transitivity_1 _ C); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) assert(L <> C'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: not (@eq (@Tpoint Tn) L C') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) subst C'. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) apply H49. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X N B') (@Col Tn X O L)) *) exists L. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: and (@Col Tn L N B') (@Col Tn L O L) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) assert(Par L M O B'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn L M O B' *) apply (par_col_par_2 _ A); try assumption. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn L A O B' *) (* Goal: @Col Tn L A M *) (* Goal: not (@eq (@Tpoint Tn) L M) *) auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn L A O B' *) (* Goal: @Col Tn L A M *) ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn L A O B' *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) assert(Par L C' O N). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn L C' O N *) apply (par_col_par_2 _ A'); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn L A' O N *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) apply par_right_comm. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M C' B' *) apply(l13_14 B' N B' L O C' M O);sfinish. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) assert(HH:= not_par_inter_exists N B' O C' H48). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) ex_and HH P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) assert(B' <> P). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' P) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) subst P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) apply H15. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Col Tn O B C *) ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) induction(eq_dec_points C' L). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) subst L. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) assert(C' = M). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) induction (col_dec O X C). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) (* Goal: @eq (@Tpoint Tn) C' M *) apply (l6_21 O C Y X). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) (* Goal: @Col Tn Y X M *) (* Goal: @Col Tn Y X C' *) (* Goal: @Col Tn O C M *) (* Goal: @Col Tn O C C' *) (* Goal: not (@eq (@Tpoint Tn) Y X) *) (* Goal: not (@Col Tn O C Y) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) (* Goal: @Col Tn Y X M *) (* Goal: @Col Tn Y X C' *) (* Goal: @Col Tn O C M *) (* Goal: @Col Tn O C C' *) (* Goal: not (@eq (@Tpoint Tn) Y X) *) (* Goal: False *) assert(Col O X Y) by ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) (* Goal: @Col Tn Y X M *) (* Goal: @Col Tn Y X C' *) (* Goal: @Col Tn O C M *) (* Goal: @Col Tn O C C' *) (* Goal: not (@eq (@Tpoint Tn) Y X) *) (* Goal: False *) induction H26. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) (* Goal: @Col Tn Y X M *) (* Goal: @Col Tn Y X C' *) (* Goal: @Col Tn O C M *) (* Goal: @Col Tn O C C' *) (* Goal: not (@eq (@Tpoint Tn) Y X) *) (* Goal: False *) (* Goal: False *) apply H26. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) (* Goal: @Col Tn Y X M *) (* Goal: @Col Tn Y X C' *) (* Goal: @Col Tn O C M *) (* Goal: @Col Tn O C C' *) (* Goal: not (@eq (@Tpoint Tn) Y X) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 O B) (@Col Tn X0 X Y)) *) exists O. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) (* Goal: @Col Tn Y X M *) (* Goal: @Col Tn Y X C' *) (* Goal: @Col Tn O C M *) (* Goal: @Col Tn O C C' *) (* Goal: not (@eq (@Tpoint Tn) Y X) *) (* Goal: False *) (* Goal: and (@Col Tn O O B) (@Col Tn O X Y) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) (* Goal: @Col Tn Y X M *) (* Goal: @Col Tn Y X C' *) (* Goal: @Col Tn O C M *) (* Goal: @Col Tn O C C' *) (* Goal: not (@eq (@Tpoint Tn) Y X) *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) (* Goal: @Col Tn Y X M *) (* Goal: @Col Tn Y X C' *) (* Goal: @Col Tn O C M *) (* Goal: @Col Tn O C C' *) (* Goal: not (@eq (@Tpoint Tn) Y X) *) (* Goal: False *) apply H12. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) (* Goal: @Col Tn Y X M *) (* Goal: @Col Tn Y X C' *) (* Goal: @Col Tn O C M *) (* Goal: @Col Tn O C C' *) (* Goal: not (@eq (@Tpoint Tn) Y X) *) (* Goal: @Col Tn O A B *) apply(col3 X Y); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) (* Goal: @Col Tn Y X M *) (* Goal: @Col Tn Y X C' *) (* Goal: @Col Tn O C M *) (* Goal: @Col Tn O C C' *) (* Goal: not (@eq (@Tpoint Tn) Y X) *) auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) (* Goal: @Col Tn Y X M *) (* Goal: @Col Tn Y X C' *) (* Goal: @Col Tn O C M *) (* Goal: @Col Tn O C C' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) (* Goal: @Col Tn Y X M *) (* Goal: @Col Tn Y X C' *) (* Goal: @Col Tn O C M *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) (* Goal: @Col Tn Y X M *) (* Goal: @Col Tn Y X C' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) (* Goal: @Col Tn Y X M *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) apply (l6_21 O C X Y); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) subst M. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N C' B' C' *) right. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: and (not (@eq (@Tpoint Tn) N C')) (and (not (@eq (@Tpoint Tn) B' C')) (and (@Col Tn N B' C') (@Col Tn C' B' C'))) *) repeat split; try auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Col Tn C' B' C' *) (* Goal: @Col Tn N B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) (* Goal: not (@eq (@Tpoint Tn) N C') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Col Tn C' B' C' *) (* Goal: @Col Tn N B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) (* Goal: False *) subst N. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Col Tn C' B' C' *) (* Goal: @Col Tn N B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) (* Goal: False *) apply par_distincts in H47; spliter; auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Col Tn C' B' C' *) (* Goal: @Col Tn N B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) intro; subst; apply H14; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Col Tn C' B' C' *) (* Goal: @Col Tn N B' C' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Col Tn C' B' C' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) assert(L <> P). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: not (@eq (@Tpoint Tn) L P) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) subst P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) apply H22. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Col Tn O A' C' *) apply col_permutation_1. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Col Tn C' O A' *) apply (col_transitivity_1 _ L); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) induction (eq_dec_points L M). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) subst L. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) assert(C' = M). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @eq (@Tpoint Tn) C' M *) apply (l6_21 O C A' C'); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: not (@Col Tn O C A') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: False *) apply H22. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn O A' C' *) ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) subst C'. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) apply H22. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Col Tn O A' A' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N M B' C' *) subst M. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn N C' B' C' *) right. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: and (not (@eq (@Tpoint Tn) N C')) (and (not (@eq (@Tpoint Tn) B' C')) (and (@Col Tn N B' C') (@Col Tn C' B' C'))) *) repeat split; try auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Col Tn C' B' C' *) (* Goal: @Col Tn N B' C' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Col Tn C' B' C' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) assert(Par L M O B'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn L M O B' *) apply (par_col_par_2 _ A); try assumption. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn L A O B' *) (* Goal: @Col Tn L A M *) ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn L A O B' *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) assert(Par L C' N O). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn L C' N O *) apply (par_col_par_2 _ A'); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: @Par Tn L A' N O *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) assert(B' <> N). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' N) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) subst N. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) (* Goal: False *) contradiction. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn N M B' C' *) apply(l13_11 N B' L C' M O P); Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: not (@Col Tn P N C') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) assert(Col P B' C'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn P B' C' *) apply (col_transitivity_1 _ N). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn P N C' *) (* Goal: @Col Tn P N B' *) (* Goal: not (@eq (@Tpoint Tn) P N) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn P N C' *) (* Goal: @Col Tn P N B' *) (* Goal: False *) subst N. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn P N C' *) (* Goal: @Col Tn P N B' *) (* Goal: False *) induction H45. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn P N C' *) (* Goal: @Col Tn P N B' *) (* Goal: False *) (* Goal: False *) apply H45. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn P N C' *) (* Goal: @Col Tn P N B' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A' C') (@Col Tn X O P)) *) exists C'. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn P N C' *) (* Goal: @Col Tn P N B' *) (* Goal: False *) (* Goal: and (@Col Tn C' A' C') (@Col Tn C' O P) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn P N C' *) (* Goal: @Col Tn P N B' *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn P N C' *) (* Goal: @Col Tn P N B' *) (* Goal: False *) apply H22. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn P N C' *) (* Goal: @Col Tn P N B' *) (* Goal: @Col Tn O A' C' *) ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn P N C' *) (* Goal: @Col Tn P N B' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn P N C' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) assert(Col C' O B' ). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn C' O B' *) apply (col_transitivity_1 _ P). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn C' P B' *) (* Goal: @Col Tn C' P O *) (* Goal: not (@eq (@Tpoint Tn) C' P) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn C' P B' *) (* Goal: @Col Tn C' P O *) (* Goal: False *) subst P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn C' P B' *) (* Goal: @Col Tn C' P O *) (* Goal: False *) clean_trivial_hyps. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn C' P B' *) (* Goal: @Col Tn C' P O *) (* Goal: False *) assert(Col B' C' L). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn C' P B' *) (* Goal: @Col Tn C' P O *) (* Goal: False *) (* Goal: @Col Tn B' C' L *) apply (col_transitivity_1 _ N); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn C' P B' *) (* Goal: @Col Tn C' P O *) (* Goal: False *) apply H14. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn C' P B' *) (* Goal: @Col Tn C' P O *) (* Goal: @Col Tn A' B' C' *) ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn C' P B' *) (* Goal: @Col Tn C' P O *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn C' P B' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) assert(Col O B C'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) (* Goal: @Col Tn O B C' *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: False *) apply H15. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) (* Goal: @Col Tn O B C *) ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) (* Goal: @Col Tn P B' L *) ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: not (@eq (@Tpoint Tn) M P) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: False *) subst M. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: False *) assert(Col B' P L). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: False *) (* Goal: @Col Tn B' P L *) apply (col_transitivity_1 _ N); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: False *) assert(Col L A B'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: False *) (* Goal: @Col Tn L A B' *) assert(Col P A L). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: False *) (* Goal: @Col Tn L A B' *) (* Goal: @Col Tn P A L *) apply (col3 X Y); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: False *) (* Goal: @Col Tn L A B' *) apply (col_transitivity_1 _ P); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: False *) apply H42. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A L) (@Col Tn X O B')) *) exists B'. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: and (@Col Tn B' A L) (@Col Tn B' O B') *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: not (@eq (@Tpoint Tn) O P) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) subst P. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) assert(N = B). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) (* Goal: @eq (@Tpoint Tn) N B *) apply (l6_21 A B O B'); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) subst N. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) induction H47. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) (* Goal: False *) apply H47. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B M) (@Col Tn X B C)) *) exists B. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) (* Goal: and (@Col Tn B B M) (@Col Tn B B C) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) assert(B = O). (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) (* Goal: @eq (@Tpoint Tn) B O *) apply (l6_21 O B' M C); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) subst B. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) induction H56. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) (* Goal: False *) apply H56. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X L C') (@Col Tn X O O)) *) exists L. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) (* Goal: and (@Col Tn L L C') (@Col Tn L O O) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) (* Goal: False *) tauto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) (* Goal: @Col Tn P C' M *) ColR. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn P M O *) ColR. (* Goal: @Par Tn B C B' C' *) apply (par_trans _ _ N M); Par. Qed. Lemma l13_15_2_aux : forall A B C A' B' C' O , ~Col A B C -> ~Par O A B C -> Par O B A C -> Par_strict A B A' B' -> Par_strict A C A' C' -> Col O A A' -> Col O B B' -> Col O C C' -> Par B C B' C'. Proof. (* Goal: forall (A B C A' B' C' O : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : not (@Par Tn O A B C)) (_ : @Par Tn O B A C) (_ : @Par_strict Tn A B A' B') (_ : @Par_strict Tn A C A' C') (_ : @Col Tn O A A') (_ : @Col Tn O B B') (_ : @Col Tn O C C'), @Par Tn B C B' C' *) intros. (* Goal: @Par Tn B C B' C' *) assert(~Col O A B /\ ~Col O B C /\ ~Col O A C). (* Goal: @Par Tn B C B' C' *) (* Goal: and (not (@Col Tn O A B)) (and (not (@Col Tn O B C)) (not (@Col Tn O A C))) *) induction H1; repeat split; intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H1. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O B) (@Col Tn X A C)) *) exists A. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn A O B) (@Col Tn A A C) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H1. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O B) (@Col Tn X A C)) *) exists C. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn C O B) (@Col Tn C A C) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H1. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O B) (@Col Tn X A C)) *) exists O. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn O O B) (@Col Tn O A C) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) apply H; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H; Col. (* Goal: @Par Tn B C B' C' *) spliter. (* Goal: @Par Tn B C B' C' *) assert( A <> O /\ B <> O /\ C <> O). (* Goal: @Par Tn B C B' C' *) (* Goal: and (not (@eq (@Tpoint Tn) A O)) (and (not (@eq (@Tpoint Tn) B O)) (not (@eq (@Tpoint Tn) C O))) *) repeat split; intro; subst O. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H9. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: @Col Tn A A C *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) apply H8. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Col Tn B B C *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H9. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn C A C *) Col. (* Goal: @Par Tn B C B' C' *) spliter. (* Goal: @Par Tn B C B' C' *) assert( A' <> O). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst A'. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) assert(Par O B A B). (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Par Tn O B A B *) apply (par_col_par_2 _ B'); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Par Tn O B' A B *) left. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Par_strict Tn O B' A B *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) induction H13. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) apply H13. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O B) (@Col Tn X A B)) *) exists B. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: and (@Col Tn B O B) (@Col Tn B A B) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) contradiction. (* Goal: @Par Tn B C B' C' *) assert(B' <> O). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst B'. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) assert(Par O A B A). (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Par Tn O A B A *) apply(par_col_par_2 _ A'); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Par Tn O A' B A *) apply par_comm. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Par Tn A' O A B *) apply par_symmetry. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Par Tn A B A' O *) left. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Par_strict Tn A B A' O *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) induction H14. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) apply H14. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O A) (@Col Tn X B A)) *) exists A. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: and (@Col Tn A O A) (@Col Tn A B A) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H7. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) Col. (* Goal: @Par Tn B C B' C' *) assert(C' <> O). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) C' O) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst C'. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) assert(Par O A C A). (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Par Tn O A C A *) apply (par_col_par_2 _ A'); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Par Tn O A' C A *) apply par_comm. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Par Tn A' O A C *) apply par_symmetry. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Par Tn A C A' O *) left. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Par_strict Tn A C A' O *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) induction H15. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) apply H15. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O A) (@Col Tn X C A)) *) exists A. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: and (@Col Tn A O A) (@Col Tn A C A) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H9. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A C *) Col. (* Goal: @Par Tn B C B' C' *) assert(~Col O A' B'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Col Tn O A' B') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) assert(Col O A B'). (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Col Tn O A B' *) apply (col_transitivity_1 _ A'); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H7. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A B *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Par Tn B C B' C' *) assert(~Col O B' C'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Col Tn O B' C') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) assert(Col O B C'). (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Col Tn O B C' *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H8. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O B C *) apply (col_transitivity_1 _ C'); Col. (* Goal: @Par Tn B C B' C' *) assert(~Col O A' C'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Col Tn O A' C') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) assert(Col O A C'). (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Col Tn O A C' *) apply (col_transitivity_1 _ A'); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H9. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O A C *) apply (col_transitivity_1 _ C'); Col. (* Goal: @Par Tn B C B' C' *) assert(A <> A'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) A A') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst A'. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H3. (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A C) (@Col Tn X A C')) *) exists A. (* Goal: @Par Tn B C B' C' *) (* Goal: and (@Col Tn A A C) (@Col Tn A A C') *) split; Col. (* Goal: @Par Tn B C B' C' *) assert(B <> B'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B B') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst B'. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H2. (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A' B)) *) exists B. (* Goal: @Par Tn B C B' C' *) (* Goal: and (@Col Tn B A B) (@Col Tn B A' B) *) split; Col. (* Goal: @Par Tn B C B' C' *) assert(C <> C'). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) C C') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst C'. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H3. (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A C) (@Col Tn X A' C)) *) exists C. (* Goal: @Par Tn B C B' C' *) (* Goal: and (@Col Tn C A C) (@Col Tn C A' C) *) split; Col. (* Goal: @Par Tn B C B' C' *) induction(par_dec B C B' C'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) auto. (* Goal: @Par Tn B C B' C' *) assert(B <> C). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B C) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst C. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B B *) Col. (* Goal: @Par Tn B C B' C' *) assert(HP:=parallel_existence B C B' H23). (* Goal: @Par Tn B C B' C' *) ex_and HP X. (* Goal: @Par Tn B C B' C' *) ex_and H24 Y. (* Goal: @Par Tn B C B' C' *) assert(~Par X Y O C). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Par Tn X Y O C) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) assert(Par O C B C). (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Par Tn O C B C *) apply (par_trans _ _ X Y); Par. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) induction H28. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) apply H28. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O C) (@Col Tn X B C)) *) exists C. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: and (@Col Tn C O C) (@Col Tn C B C) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) contradiction. (* Goal: @Par Tn B C B' C' *) assert(HH:=not_par_inter_exists X Y O C H27). (* Goal: @Par Tn B C B' C' *) ex_and HH C''. (* Goal: @Par Tn B C B' C' *) assert(B' <> C''). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C'') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst C''. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) assert(Col O B C). (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Col Tn O B C *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) contradiction. (* Goal: @Par Tn B C B' C' *) assert(Par B' C'' B C ). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B' C'' B C *) induction(eq_dec_points B' X). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B' C'' B C *) (* Goal: @Par Tn B' C'' B C *) subst X. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B' C'' B C *) (* Goal: @Par Tn B' C'' B C *) apply (par_col_par_2 _ Y). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B' C'' B C *) (* Goal: @Par Tn B' Y B C *) (* Goal: @Col Tn B' Y C'' *) (* Goal: not (@eq (@Tpoint Tn) B' C'') *) auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B' C'' B C *) (* Goal: @Par Tn B' Y B C *) (* Goal: @Col Tn B' Y C'' *) Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B' C'' B C *) (* Goal: @Par Tn B' Y B C *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B' C'' B C *) apply (par_col_par_2 _ X). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B' X B C *) (* Goal: @Col Tn B' X C'' *) (* Goal: not (@eq (@Tpoint Tn) B' C'') *) auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B' X B C *) (* Goal: @Col Tn B' X C'' *) apply col_permutation_2. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B' X B C *) (* Goal: @Col Tn X C'' B' *) apply(col_transitivity_1 _ Y); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B' X B C *) apply par_left_comm. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn X B' B C *) apply (par_col_par_2 _ Y); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn X Y B C *) Par. (* Goal: @Par Tn B C B' C' *) assert(Par A C A' C''). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A C A' C'' *) eapply(l13_15_1 B A C B' A' C'' O); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par_strict Tn B C B' C'' *) (* Goal: @Par_strict Tn B A B' A' *) apply par_strict_comm. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par_strict Tn B C B' C'' *) (* Goal: @Par_strict Tn A B A' B' *) auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par_strict Tn B C B' C'' *) induction H31. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par_strict Tn B C B' C'' *) (* Goal: @Par_strict Tn B C B' C'' *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par_strict Tn B C B' C'' *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par_strict Tn B C B' C'' *) apply False_ind. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H8. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn O B C *) apply col_permutation_2. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn B C O *) apply(col_transitivity_1 _ B'); Col. (* Goal: @Par Tn B C B' C' *) assert(C' <> C''). (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) C' C'') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst C''. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H22. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) Par. (* Goal: @Par Tn B C B' C' *) assert(Par A' C' A' C''). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A' C' A' C'' *) apply (par_trans _ _ A C). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A C A' C'' *) (* Goal: @Par Tn A' C' A C *) left. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A C A' C'' *) (* Goal: @Par_strict Tn A' C' A C *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A C A' C'' *) Par. (* Goal: @Par Tn B C B' C' *) assert(C' = C''). (* Goal: @Par Tn B C B' C' *) (* Goal: @eq (@Tpoint Tn) C' C'' *) apply (l6_21 A' C' O C); Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A' C' C'' *) induction H34. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A' C' C'' *) (* Goal: @Col Tn A' C' C'' *) apply False_ind. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A' C' C'' *) (* Goal: False *) apply H34. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A' C' C'' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A' C') (@Col Tn X A' C'')) *) exists A'. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A' C' C'' *) (* Goal: and (@Col Tn A' A' C') (@Col Tn A' A' C'') *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A' C' C'' *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A' C' C'' *) Col. (* Goal: @Par Tn B C B' C' *) contradiction. Qed. Lemma l13_15_2 : forall A B C A' B' C' O , ~Col A B C -> Par O B A C -> Par_strict A B A' B' -> Par_strict A C A' C' -> Col O A A' -> Col O B B' -> Col O C C' -> Par B C B' C'. Proof. (* Goal: forall (A B C A' B' C' O : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @Par Tn O B A C) (_ : @Par_strict Tn A B A' B') (_ : @Par_strict Tn A C A' C') (_ : @Col Tn O A A') (_ : @Col Tn O B B') (_ : @Col Tn O C C'), @Par Tn B C B' C' *) intros. (* Goal: @Par Tn B C B' C' *) induction(par_dec B C B' C'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) auto. (* Goal: @Par Tn B C B' C' *) assert(HH:=not_par_one_not_par B C B' C' O A H6). (* Goal: @Par Tn B C B' C' *) induction HH. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) apply (l13_15_2_aux A B C A' B' C' O); auto. (* Goal: @Par Tn B C B' C' *) (* Goal: not (@Par Tn O A B C) *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H7. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C O A *) Par. (* Goal: @Par Tn B C B' C' *) apply par_symmetry. (* Goal: @Par Tn B' C' B C *) assert(~ Col A' B' C'). (* Goal: @Par Tn B' C' B C *) (* Goal: not (@Col Tn A' B' C') *) intro. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) apply H. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) assert(Par A' B' A' C'). (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn A' B' A' C' *) right. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: and (not (@eq (@Tpoint Tn) A' B')) (and (not (@eq (@Tpoint Tn) A' C')) (and (@Col Tn A' A' C') (@Col Tn B' A' C'))) *) repeat split; Col. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: not (@eq (@Tpoint Tn) A' B') *) intro. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: False *) subst B'. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: False *) apply H1. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A' A')) *) exists A. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: and (@Col Tn A A B) (@Col Tn A A' A') *) split; Col. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) intro. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: False *) subst C'. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: False *) apply H2. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A C) (@Col Tn X A' A')) *) exists A. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: and (@Col Tn A A C) (@Col Tn A A' A') *) split; Col. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) assert(Par A B A C). (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn A B A C *) apply(par_trans _ _ A' B'). (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn A' B' A C *) (* Goal: @Par Tn A B A' B' *) left. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn A' B' A C *) (* Goal: @Par_strict Tn A B A' B' *) auto. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn A' B' A C *) apply(par_trans _ _ A' C'). (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn A' C' A C *) (* Goal: @Par Tn A' B' A' C' *) Par. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn A' C' A C *) left. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: @Par_strict Tn A' C' A C *) Par. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) induction H10. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: @Col Tn A B C *) apply False_ind. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: False *) apply H10. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A C)) *) exists A. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) (* Goal: and (@Col Tn A A B) (@Col Tn A A C) *) split; Col. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) spliter. (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn A B C *) Col. (* Goal: @Par Tn B' C' B C *) assert(B' <> O). (* Goal: @Par Tn B' C' B C *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) subst B'. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) assert(Par O A B A). (* Goal: @Par Tn B' C' B C *) (* Goal: False *) (* Goal: @Par Tn O A B A *) apply (par_col_par_2 _ A'); Col. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) (* Goal: @Par Tn O A' B A *) (* Goal: not (@eq (@Tpoint Tn) O A) *) intro. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) (* Goal: @Par Tn O A' B A *) (* Goal: False *) subst A. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) (* Goal: @Par Tn O A' B A *) (* Goal: False *) apply H1. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) (* Goal: @Par Tn O A' B A *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O B) (@Col Tn X A' O)) *) exists O. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) (* Goal: @Par Tn O A' B A *) (* Goal: and (@Col Tn O O B) (@Col Tn O A' O) *) split; Col. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) (* Goal: @Par Tn O A' B A *) apply par_comm. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) (* Goal: @Par Tn A' O A B *) left. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) (* Goal: @Par_strict Tn A' O A B *) Par. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) induction H9. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) (* Goal: False *) apply H9. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O A) (@Col Tn X B A)) *) exists A. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) (* Goal: and (@Col Tn A O A) (@Col Tn A B A) *) split; Col. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) spliter. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) apply H1. (* Goal: @Par Tn B' C' B C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A' O)) *) exists O. (* Goal: @Par Tn B' C' B C *) (* Goal: and (@Col Tn O A B) (@Col Tn O A' O) *) split; Col. (* Goal: @Par Tn B' C' B C *) assert(Par O B O B'). (* Goal: @Par Tn B' C' B C *) (* Goal: @Par Tn O B O B' *) right. (* Goal: @Par Tn B' C' B C *) (* Goal: and (not (@eq (@Tpoint Tn) O B)) (and (not (@eq (@Tpoint Tn) O B')) (and (@Col Tn O O B') (@Col Tn B O B'))) *) repeat split; Col. (* Goal: @Par Tn B' C' B C *) (* Goal: not (@eq (@Tpoint Tn) O B) *) intro. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) subst B. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) apply par_distincts in H0. (* Goal: @Par Tn B' C' B C *) (* Goal: False *) tauto. (* Goal: @Par Tn B' C' B C *) apply (l13_15_2_aux A' B' C' A B C O); Col; Par. (* Goal: @Par Tn O B' A' C' *) (* Goal: not (@Par Tn O A' B' C') *) intro. (* Goal: @Par Tn O B' A' C' *) (* Goal: False *) apply H7. (* Goal: @Par Tn O B' A' C' *) (* Goal: @Par Tn B' C' O A *) apply par_symmetry. (* Goal: @Par Tn O B' A' C' *) (* Goal: @Par Tn O A B' C' *) apply (par_col_par_2 _ A'). (* Goal: @Par Tn O B' A' C' *) (* Goal: @Par Tn O A' B' C' *) (* Goal: @Col Tn O A' A *) (* Goal: not (@eq (@Tpoint Tn) O A) *) intro. (* Goal: @Par Tn O B' A' C' *) (* Goal: @Par Tn O A' B' C' *) (* Goal: @Col Tn O A' A *) (* Goal: False *) subst A. (* Goal: @Par Tn O B' A' C' *) (* Goal: @Par Tn O A' B' C' *) (* Goal: @Col Tn O A' A *) (* Goal: False *) induction H0. (* Goal: @Par Tn O B' A' C' *) (* Goal: @Par Tn O A' B' C' *) (* Goal: @Col Tn O A' A *) (* Goal: False *) (* Goal: False *) apply H0. (* Goal: @Par Tn O B' A' C' *) (* Goal: @Par Tn O A' B' C' *) (* Goal: @Col Tn O A' A *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O B) (@Col Tn X O C)) *) exists O. (* Goal: @Par Tn O B' A' C' *) (* Goal: @Par Tn O A' B' C' *) (* Goal: @Col Tn O A' A *) (* Goal: False *) (* Goal: and (@Col Tn O O B) (@Col Tn O O C) *) split; Col. (* Goal: @Par Tn O B' A' C' *) (* Goal: @Par Tn O A' B' C' *) (* Goal: @Col Tn O A' A *) (* Goal: False *) spliter. (* Goal: @Par Tn O B' A' C' *) (* Goal: @Par Tn O A' B' C' *) (* Goal: @Col Tn O A' A *) (* Goal: False *) apply H. (* Goal: @Par Tn O B' A' C' *) (* Goal: @Par Tn O A' B' C' *) (* Goal: @Col Tn O A' A *) (* Goal: @Col Tn O B C *) Col. (* Goal: @Par Tn O B' A' C' *) (* Goal: @Par Tn O A' B' C' *) (* Goal: @Col Tn O A' A *) Col. (* Goal: @Par Tn O B' A' C' *) (* Goal: @Par Tn O A' B' C' *) Par. (* Goal: @Par Tn O B' A' C' *) apply (par_trans _ _ O B). (* Goal: @Par Tn O B A' C' *) (* Goal: @Par Tn O B' O B *) Par. (* Goal: @Par Tn O B A' C' *) apply (par_trans _ _ A C). (* Goal: @Par Tn A C A' C' *) (* Goal: @Par Tn O B A C *) Par. (* Goal: @Par Tn A C A' C' *) left. (* Goal: @Par_strict Tn A C A' C' *) Par. Qed. Lemma l13_15 : forall A B C A' B' C' O , ~Col A B C -> Par_strict A B A' B' -> Par_strict A C A' C' -> Col O A A' -> Col O B B' -> Col O C C' -> Par B C B' C'. Proof. (* Goal: forall (A B C A' B' C' O : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @Par_strict Tn A B A' B') (_ : @Par_strict Tn A C A' C') (_ : @Col Tn O A A') (_ : @Col Tn O B B') (_ : @Col Tn O C C'), @Par Tn B C B' C' *) intros. (* Goal: @Par Tn B C B' C' *) induction(par_dec O B A C). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) apply (l13_15_2 A B C A' B' C' O); Col; Par. (* Goal: @Par Tn B C B' C' *) apply (l13_15_1 A B C A' B' C' O); Col; Par. Qed. Lemma l13_15_par : forall A B C A' B' C', ~Col A B C -> Par_strict A B A' B' -> Par_strict A C A' C' -> Par A A' B B' -> Par A A' C C' -> Par B C B' C'. Proof. (* Goal: forall (A B C A' B' C' : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @Par_strict Tn A B A' B') (_ : @Par_strict Tn A C A' C') (_ : @Par Tn A A' B B') (_ : @Par Tn A A' C C'), @Par Tn B C B' C' *) intros. (* Goal: @Par Tn B C B' C' *) assert(Plg B' A' A B). (* Goal: @Par Tn B C B' C' *) (* Goal: @Plg Tn B' A' A B *) apply(pars_par_plg B' A' A B). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B' B A' A *) (* Goal: @Par_strict Tn B' A' A B *) apply par_strict_left_comm. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B' B A' A *) (* Goal: @Par_strict Tn A' B' A B *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B' B A' A *) Par. (* Goal: @Par Tn B C B' C' *) apply plg_to_parallelogram in H4. (* Goal: @Par Tn B C B' C' *) apply plg_permut in H4. (* Goal: @Par Tn B C B' C' *) assert(Plg A' C' C A). (* Goal: @Par Tn B C B' C' *) (* Goal: @Plg Tn A' C' C A *) apply(pars_par_plg A' C' C A). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A' A C' C *) (* Goal: @Par_strict Tn A' C' C A *) apply par_strict_right_comm. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A' A C' C *) (* Goal: @Par_strict Tn A' C' A C *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn A' A C' C *) Par. (* Goal: @Par Tn B C B' C' *) apply plg_to_parallelogram in H5. (* Goal: @Par Tn B C B' C' *) apply plg_permut in H5. (* Goal: @Par Tn B C B' C' *) assert(Parallelogram B B' C' C \/ B = B' /\ A' = A /\ C = C' /\ B = C). (* Goal: @Par Tn B C B' C' *) (* Goal: or (@Parallelogram Tn B B' C' C) (and (@eq (@Tpoint Tn) B B') (and (@eq (@Tpoint Tn) A' A) (and (@eq (@Tpoint Tn) C C') (@eq (@Tpoint Tn) B C)))) *) apply(plg_pseudo_trans B B' A' A C C'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Parallelogram Tn A' A C C' *) (* Goal: @Parallelogram Tn B B' A' A *) apply plg_sym. (* Goal: @Par Tn B C B' C' *) (* Goal: @Parallelogram Tn A' A C C' *) (* Goal: @Parallelogram Tn A' A B B' *) auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Parallelogram Tn A' A C C' *) apply plg_comm2. (* Goal: @Par Tn B C B' C' *) (* Goal: @Parallelogram Tn A A' C' C *) apply plg_permut. (* Goal: @Par Tn B C B' C' *) (* Goal: @Parallelogram Tn C A A' C' *) apply plg_permut. (* Goal: @Par Tn B C B' C' *) (* Goal: @Parallelogram Tn C' C A A' *) auto. (* Goal: @Par Tn B C B' C' *) assert(Par B B' C C'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B B' C C' *) apply (par_trans _ _ A A'); Par. (* Goal: @Par Tn B C B' C' *) induction H7. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) induction H6. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) assert(B <> B'). (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B B') *) apply par_distincts in H2. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B B') *) tauto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) apply plg_par in H6. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) (* Goal: not (@eq (@Tpoint Tn) B B') *) (* Goal: @Par Tn B C B' C' *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) (* Goal: not (@eq (@Tpoint Tn) B B') *) (* Goal: @Par Tn B C B' C' *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) (* Goal: not (@eq (@Tpoint Tn) B B') *) auto. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst C'. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H7. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X C B')) *) exists B'. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) (* Goal: and (@Col Tn B' B B') (@Col Tn B' C B') *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) subst C. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C' B' C' *) subst C'. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B B B' B *) apply False_ind. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H7. (* Goal: @Par Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X B B)) *) exists B. (* Goal: @Par Tn B C B' C' *) (* Goal: and (@Col Tn B B B') (@Col Tn B B B) *) split; Col. (* Goal: @Par Tn B C B' C' *) induction H6. (* Goal: @Par Tn B C B' C' *) (* Goal: @Par Tn B C B' C' *) apply plg_par in H6. (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) (* Goal: not (@eq (@Tpoint Tn) B B') *) (* Goal: @Par Tn B C B' C' *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) (* Goal: not (@eq (@Tpoint Tn) B B') *) (* Goal: @Par Tn B C B' C' *) Par. (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) (* Goal: not (@eq (@Tpoint Tn) B B') *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) (* Goal: not (@eq (@Tpoint Tn) B B') *) auto. (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) intro. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) subst C'. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) assert(Par A B A C). (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @Par Tn A B A C *) apply (par_trans _ _ A' B'); left; Par. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) induction H11. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: False *) apply H11. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A C)) *) exists A. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) (* Goal: and (@Col Tn A A B) (@Col Tn A A C) *) split; Col. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) spliter. (* Goal: @Par Tn B C B' C' *) (* Goal: False *) apply H. (* Goal: @Par Tn B C B' C' *) (* Goal: @Col Tn A B C *) Col. (* Goal: @Par Tn B C B' C' *) spliter. (* Goal: @Par Tn B C B' C' *) subst B'. (* Goal: @Par Tn B C B C' *) subst A'. (* Goal: @Par Tn B C B C' *) subst C'. (* Goal: @Par Tn B C B C *) subst C. (* Goal: @Par Tn B B B B *) apply False_ind. (* Goal: False *) apply H1. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A B)) *) exists A. (* Goal: and (@Col Tn A A B) (@Col Tn A A B) *) split; Col. Qed. Lemma l13_18_2 : forall A B C A' B' C' O, ~Col A B C -> Par_strict A B A' B' -> Par_strict A C A' C' -> (Par_strict B C B' C' /\ Col O A A' /\ Col O B B' -> Col O C C'). Proof. (* Goal: forall (A B C A' B' C' O : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @Par_strict Tn A B A' B') (_ : @Par_strict Tn A C A' C') (_ : and (@Par_strict Tn B C B' C') (and (@Col Tn O A A') (@Col Tn O B B'))), @Col Tn O C C' *) intros. (* Goal: @Col Tn O C C' *) spliter. (* Goal: @Col Tn O C C' *) assert(~ Col O A B). (* Goal: @Col Tn O C C' *) (* Goal: not (@Col Tn O A B) *) intro. (* Goal: @Col Tn O C C' *) (* Goal: False *) apply H0. (* Goal: @Col Tn O C C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A' B')) *) exists O. (* Goal: @Col Tn O C C' *) (* Goal: and (@Col Tn O A B) (@Col Tn O A' B') *) split. (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn O A' B' *) (* Goal: @Col Tn O A B *) Col. (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn O A' B' *) apply(col_transitivity_1 _ A); Col. (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn O A B' *) (* Goal: not (@eq (@Tpoint Tn) O A) *) intro. (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn O A B' *) (* Goal: False *) subst A. (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn O A B' *) (* Goal: False *) apply H0. (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn O A B' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O B) (@Col Tn X A' B')) *) exists B'. (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn O A B' *) (* Goal: and (@Col Tn B' O B) (@Col Tn B' A' B') *) split; Col. (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn O A B' *) apply(col_transitivity_1 _ B); Col. (* Goal: @Col Tn O C C' *) (* Goal: not (@eq (@Tpoint Tn) O B) *) intro. (* Goal: @Col Tn O C C' *) (* Goal: False *) subst B. (* Goal: @Col Tn O C C' *) (* Goal: False *) apply H0. (* Goal: @Col Tn O C C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A O) (@Col Tn X A' B')) *) exists A'. (* Goal: @Col Tn O C C' *) (* Goal: and (@Col Tn A' A O) (@Col Tn A' A' B') *) split; Col. (* Goal: @Col Tn O C C' *) assert(exists X : Tpoint, Col X B' C' /\ Col X O C). (* Goal: @Col Tn O C C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B' C') (@Col Tn X O C)) *) apply not_par_inter_exists, par_not_par with B C; Par. (* Goal: @Col Tn O C C' *) (* Goal: not (@Par Tn B C O C) *) intro. (* Goal: @Col Tn O C C' *) (* Goal: False *) induction H6. (* Goal: @Col Tn O C C' *) (* Goal: False *) (* Goal: False *) apply H6. (* Goal: @Col Tn O C C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C) (@Col Tn X O C)) *) exists C. (* Goal: @Col Tn O C C' *) (* Goal: False *) (* Goal: and (@Col Tn C B C) (@Col Tn C O C) *) split; Col. (* Goal: @Col Tn O C C' *) (* Goal: False *) spliter. (* Goal: @Col Tn O C C' *) (* Goal: False *) apply H2. (* Goal: @Col Tn O C C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C) (@Col Tn X B' C')) *) exists B'. (* Goal: @Col Tn O C C' *) (* Goal: and (@Col Tn B' B C) (@Col Tn B' B' C') *) split;Col. (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn B' B C *) apply col_permutation_2. (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn B C B' *) apply (col_transitivity_1 _ O); Col. (* Goal: @Col Tn O C C' *) (* Goal: not (@eq (@Tpoint Tn) B O) *) intro. (* Goal: @Col Tn O C C' *) (* Goal: False *) subst O. (* Goal: @Col Tn O C C' *) (* Goal: False *) apply H0. (* Goal: @Col Tn O C C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A' B')) *) exists A'. (* Goal: @Col Tn O C C' *) (* Goal: and (@Col Tn A' A B) (@Col Tn A' A' B') *) split; Col. (* Goal: @Col Tn O C C' *) ex_and H6 C''. (* Goal: @Col Tn O C C' *) induction(col_dec O C C'). (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn O C C' *) auto. (* Goal: @Col Tn O C C' *) apply False_ind. (* Goal: False *) assert(Par C' C'' B C ). (* Goal: False *) (* Goal: @Par Tn C' C'' B C *) apply (par_col_par_2 _ B'). (* Goal: False *) (* Goal: @Par Tn C' B' B C *) (* Goal: @Col Tn C' B' C'' *) (* Goal: not (@eq (@Tpoint Tn) C' C'') *) intro. (* Goal: False *) (* Goal: @Par Tn C' B' B C *) (* Goal: @Col Tn C' B' C'' *) (* Goal: False *) subst C''. (* Goal: False *) (* Goal: @Par Tn C' B' B C *) (* Goal: @Col Tn C' B' C'' *) (* Goal: False *) Col. (* Goal: False *) (* Goal: @Par Tn C' B' B C *) (* Goal: @Col Tn C' B' C'' *) Col. (* Goal: False *) (* Goal: @Par Tn C' B' B C *) apply par_left_comm. (* Goal: False *) (* Goal: @Par Tn B' C' B C *) left. (* Goal: False *) (* Goal: @Par_strict Tn B' C' B C *) Par. (* Goal: False *) assert(Par_strict C' C'' B C). (* Goal: False *) (* Goal: @Par_strict Tn C' C'' B C *) induction H9. (* Goal: False *) (* Goal: @Par_strict Tn C' C'' B C *) (* Goal: @Par_strict Tn C' C'' B C *) auto. (* Goal: False *) (* Goal: @Par_strict Tn C' C'' B C *) spliter. (* Goal: False *) (* Goal: @Par_strict Tn C' C'' B C *) apply False_ind. (* Goal: False *) (* Goal: False *) apply H8. (* Goal: False *) (* Goal: @Col Tn O C C' *) apply col_permutation_2. (* Goal: False *) (* Goal: @Col Tn C C' O *) apply (col_transitivity_1 _ C''). (* Goal: False *) (* Goal: @Col Tn C C'' O *) (* Goal: @Col Tn C C'' C' *) (* Goal: not (@eq (@Tpoint Tn) C C'') *) intro. (* Goal: False *) (* Goal: @Col Tn C C'' O *) (* Goal: @Col Tn C C'' C' *) (* Goal: False *) subst C''. (* Goal: False *) (* Goal: @Col Tn C C'' O *) (* Goal: @Col Tn C C'' C' *) (* Goal: False *) apply H2. (* Goal: False *) (* Goal: @Col Tn C C'' O *) (* Goal: @Col Tn C C'' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C) (@Col Tn X B' C')) *) exists C. (* Goal: False *) (* Goal: @Col Tn C C'' O *) (* Goal: @Col Tn C C'' C' *) (* Goal: and (@Col Tn C B C) (@Col Tn C B' C') *) split; Col. (* Goal: False *) (* Goal: @Col Tn C C'' O *) (* Goal: @Col Tn C C'' C' *) apply (col_transitivity_1 _ B); Col. (* Goal: False *) (* Goal: @Col Tn C C'' O *) Col. (* Goal: False *) assert(~Col O B C). (* Goal: False *) (* Goal: not (@Col Tn O B C) *) intro. (* Goal: False *) (* Goal: False *) apply H10. (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X C' C'') (@Col Tn X B C)) *) exists B'. (* Goal: False *) (* Goal: and (@Col Tn B' C' C'') (@Col Tn B' B C) *) split; Col. (* Goal: False *) (* Goal: @Col Tn B' B C *) apply col_permutation_2. (* Goal: False *) (* Goal: @Col Tn B C B' *) apply (col_transitivity_1 _ O); Col. (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) B O) *) intro. (* Goal: False *) (* Goal: False *) subst B. (* Goal: False *) (* Goal: False *) apply H5. (* Goal: False *) (* Goal: @Col Tn O A O *) Col. (* Goal: False *) assert(Par B' C'' B C). (* Goal: False *) (* Goal: @Par Tn B' C'' B C *) apply (par_col_par_2 _ C') ; Col. (* Goal: False *) (* Goal: @Par Tn B' C' B C *) (* Goal: not (@eq (@Tpoint Tn) B' C'') *) intro. (* Goal: False *) (* Goal: @Par Tn B' C' B C *) (* Goal: False *) subst B'. (* Goal: False *) (* Goal: @Par Tn B' C' B C *) (* Goal: False *) apply H11. (* Goal: False *) (* Goal: @Par Tn B' C' B C *) (* Goal: @Col Tn O B C *) apply(col_transitivity_1 _ C''); Col. (* Goal: False *) (* Goal: @Par Tn B' C' B C *) (* Goal: not (@eq (@Tpoint Tn) O C'') *) intro. (* Goal: False *) (* Goal: @Par Tn B' C' B C *) (* Goal: False *) subst C''. (* Goal: False *) (* Goal: @Par Tn B' C' B C *) (* Goal: False *) apply H0. (* Goal: False *) (* Goal: @Par Tn B' C' B C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A' O)) *) exists A. (* Goal: False *) (* Goal: @Par Tn B' C' B C *) (* Goal: and (@Col Tn A A B) (@Col Tn A A' O) *) split; Col. (* Goal: False *) (* Goal: @Par Tn B' C' B C *) left. (* Goal: False *) (* Goal: @Par_strict Tn B' C' B C *) Par. (* Goal: False *) assert(Par_strict B' C'' B C). (* Goal: False *) (* Goal: @Par_strict Tn B' C'' B C *) induction H12. (* Goal: False *) (* Goal: @Par_strict Tn B' C'' B C *) (* Goal: @Par_strict Tn B' C'' B C *) auto. (* Goal: False *) (* Goal: @Par_strict Tn B' C'' B C *) spliter. (* Goal: False *) (* Goal: @Par_strict Tn B' C'' B C *) apply False_ind. (* Goal: False *) (* Goal: False *) apply H11. (* Goal: False *) (* Goal: @Col Tn O B C *) apply col_permutation_2. (* Goal: False *) (* Goal: @Col Tn B C O *) apply (col_transitivity_1 _ B'); Col. (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) B B') *) intro. (* Goal: False *) (* Goal: False *) subst B'. (* Goal: False *) (* Goal: False *) apply H2. (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C) (@Col Tn X B C')) *) exists B. (* Goal: False *) (* Goal: and (@Col Tn B B C) (@Col Tn B B C') *) split; Col. (* Goal: False *) assert(Par A C A' C''). (* Goal: False *) (* Goal: @Par Tn A C A' C'' *) apply(l13_15 B A C B' A' C'' O); Par; Col. (* Goal: False *) assert(Par A' C' A' C''). (* Goal: False *) (* Goal: @Par Tn A' C' A' C'' *) apply (par_trans _ _ A C). (* Goal: False *) (* Goal: @Par Tn A C A' C'' *) (* Goal: @Par Tn A' C' A C *) left. (* Goal: False *) (* Goal: @Par Tn A C A' C'' *) (* Goal: @Par_strict Tn A' C' A C *) Par. (* Goal: False *) (* Goal: @Par Tn A C A' C'' *) Par. (* Goal: False *) induction H15. (* Goal: False *) (* Goal: False *) apply H15. (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A' C') (@Col Tn X A' C'')) *) exists A'. (* Goal: False *) (* Goal: and (@Col Tn A' A' C') (@Col Tn A' A' C'') *) split; Col. (* Goal: False *) spliter. (* Goal: False *) assert(~ Col A' B' C'). (* Goal: False *) (* Goal: not (@Col Tn A' B' C') *) intro. (* Goal: False *) (* Goal: False *) apply H. (* Goal: False *) (* Goal: @Col Tn A B C *) apply(col_par_par_col A' B' C' A B C H19); left; Par. (* Goal: False *) assert( C' = C''). (* Goal: False *) (* Goal: @eq (@Tpoint Tn) C' C'' *) apply(l6_21 A' C' B' C'); Col. (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) intro. (* Goal: False *) (* Goal: False *) subst C'. (* Goal: False *) (* Goal: False *) apply H19. (* Goal: False *) (* Goal: @Col Tn A' B' B' *) Col. (* Goal: False *) subst C''. (* Goal: False *) Col. Qed. Lemma l13_18_3 : forall A B C A' B' C', ~Col A B C -> Par_strict A B A' B' -> Par_strict A C A' C' -> (Par_strict B C B' C' /\ Par A A' B B') -> (Par C C' A A' /\ Par C C' B B'). Proof. (* Goal: forall (A B C A' B' C' : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @Par_strict Tn A B A' B') (_ : @Par_strict Tn A C A' C') (_ : and (@Par_strict Tn B C B' C') (@Par Tn A A' B B')), and (@Par Tn C C' A A') (@Par Tn C C' B B') *) intros. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) spliter. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) assert(Par C C' A A'). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) apply par_distincts in H3. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) spliter. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) assert(HH:= parallel_existence1 B B' C H5). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) ex_and HH P. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) induction(par_dec C P B C). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) induction H7. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) apply False_ind. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) (* Goal: False *) apply H7. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X C P) (@Col Tn X B C)) *) exists C. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) (* Goal: and (@Col Tn C C P) (@Col Tn C B C) *) split; Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) spliter. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) assert(Col P B' C). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn P B' C *) induction H6. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn P B' C *) (* Goal: @Col Tn P B' C *) apply False_ind. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn P B' C *) (* Goal: False *) apply H6. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn P B' C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X C P)) *) exists B. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn P B' C *) (* Goal: and (@Col Tn B B B') (@Col Tn B C P) *) split; Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn P B' C *) spliter. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn P B' C *) Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) assert(Col C B B'). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn C B B' *) apply (col_transitivity_1 _ P); Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) apply False_ind. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: False *) apply H2. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C) (@Col Tn X B' C')) *) exists B'. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: and (@Col Tn B' B C) (@Col Tn B' B' C') *) split; Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) assert(~ Par C P B' C'). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: not (@Par Tn C P B' C') *) intro. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: False *) apply H7. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C P B C *) apply(par_trans _ _ B' C'); Par. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) assert(HH:=not_par_inter_exists C P B' C' H8). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) ex_and HH C''. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) induction(eq_dec_points B' C''). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) subst C''. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C' A A' *) apply False_ind. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: False *) induction H6. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: False *) (* Goal: False *) apply H6. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X C P)) *) exists B'. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: False *) (* Goal: and (@Col Tn B' B B') (@Col Tn B' C P) *) split; Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: False *) spliter; apply H2. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C) (@Col Tn X B' C')) *) exists B'. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: and (@Col Tn B' B C) (@Col Tn B' B' C') *) split; Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn B' B C *) apply col_permutation_1. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn C B' B *) apply(col_transitivity_1 _ P); Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) assert(Par C C'' B B' ). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C C'' B B' *) apply (par_col_par_2 _ P); Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C P B B' *) (* Goal: not (@eq (@Tpoint Tn) C C'') *) intro. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C P B B' *) (* Goal: False *) subst C''. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C P B B' *) (* Goal: False *) apply H2. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C P B B' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C) (@Col Tn X B' C')) *) exists C. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C P B B' *) (* Goal: and (@Col Tn C B C) (@Col Tn C B' C') *) split; Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C P B B' *) Par. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) assert(Par B' C'' B C). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn B' C'' B C *) apply (par_col_par_2 _ C'); Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn B' C' B C *) left. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par_strict Tn B' C' B C *) Par. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) assert(~ Col A' B' C'). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: not (@Col Tn A' B' C') *) intro. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: False *) apply H. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) assert(Par C' A' B C). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn C' A' B C *) apply (par_col_par_2 _ B'). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn C' B' B C *) (* Goal: @Col Tn C' B' A' *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) intro. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn C' B' B C *) (* Goal: @Col Tn C' B' A' *) (* Goal: False *) subst C'. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn C' B' B C *) (* Goal: @Col Tn C' B' A' *) (* Goal: False *) unfold Par_strict in H1. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn C' B' B C *) (* Goal: @Col Tn C' B' A' *) (* Goal: False *) tauto. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn C' B' B C *) (* Goal: @Col Tn C' B' A' *) Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn C' B' B C *) apply par_left_comm. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn B' C' B C *) left. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) (* Goal: @Par_strict Tn B' C' B C *) Par. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) assert(Par B C A C). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) (* Goal: @Par Tn B C A C *) apply (par_trans _ _ A' C'); Par. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) induction H16. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) (* Goal: @Col Tn A B C *) apply False_ind. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) (* Goal: False *) apply H16. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C) (@Col Tn X A C)) *) exists C. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) (* Goal: and (@Col Tn C B C) (@Col Tn C A C) *) split; Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn A B C *) spliter; Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) assert(Par A C A' C''). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn A C A' C'' *) apply(l13_15_par B A C B' A' C''). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn B B' C C'' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Par_strict Tn B C B' C'' *) (* Goal: @Par_strict Tn B A B' A' *) (* Goal: not (@Col Tn B A C) *) intro. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn B B' C C'' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Par_strict Tn B C B' C'' *) (* Goal: @Par_strict Tn B A B' A' *) (* Goal: False *) apply H. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn B B' C C'' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Par_strict Tn B C B' C'' *) (* Goal: @Par_strict Tn B A B' A' *) (* Goal: @Col Tn A B C *) Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn B B' C C'' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Par_strict Tn B C B' C'' *) (* Goal: @Par_strict Tn B A B' A' *) apply par_strict_comm. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn B B' C C'' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Par_strict Tn B C B' C'' *) (* Goal: @Par_strict Tn A B A' B' *) Par. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn B B' C C'' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Par_strict Tn B C B' C'' *) induction H13. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn B B' C C'' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Par_strict Tn B C B' C'' *) (* Goal: @Par_strict Tn B C B' C'' *) Par. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn B B' C C'' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Par_strict Tn B C B' C'' *) spliter. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn B B' C C'' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Par_strict Tn B C B' C'' *) apply False_ind. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn B B' C C'' *) (* Goal: @Par Tn B B' A A' *) (* Goal: False *) apply H2. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn B B' C C'' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C) (@Col Tn X B' C')) *) exists B'. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn B B' C C'' *) (* Goal: @Par Tn B B' A A' *) (* Goal: and (@Col Tn B' B C) (@Col Tn B' B' C') *) split; Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn B B' C C'' *) (* Goal: @Par Tn B B' A A' *) Par. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn B B' C C'' *) Par. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) assert(C' = C''). (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @eq (@Tpoint Tn) C' C'' *) apply (l6_21 C' A' B' C'); Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn C' A' C'' *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) intro. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn C' A' C'' *) (* Goal: False *) subst C'. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn C' A' C'' *) (* Goal: False *) apply H14. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn C' A' C'' *) (* Goal: @Col Tn A' B' B' *) Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Col Tn C' A' C'' *) eapply (col_par_par_col A C A); Col. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C A A' C'' *) (* Goal: @Par Tn A C C' A' *) apply par_right_comm. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C A A' C'' *) (* Goal: @Par Tn A C A' C' *) left. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C A A' C'' *) (* Goal: @Par_strict Tn A C A' C' *) Par. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) (* Goal: @Par Tn C A A' C'' *) Par. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) subst C''. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) (* Goal: @Par Tn C C' A A' *) apply (par_trans _ _ B B'); Par. (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) split. (* Goal: @Par Tn C C' B B' *) (* Goal: @Par Tn C C' A A' *) Par. (* Goal: @Par Tn C C' B B' *) apply (par_trans _ _ A A'); Par. Qed. Lemma l13_18 : forall A B C A' B' C' O, ~Col A B C /\ Par_strict A B A' B' /\ Par_strict A C A' C' ->(Par_strict B C B' C' /\ Col O A A' /\ Col O B B' -> Col O C C') /\ ((Par_strict B C B' C' /\ Par A A' B B') -> (Par C C' A A' /\ Par C C' B B')) /\ (Par A A' B B' /\ Par A A' C C' -> Par B C B' C'). Proof. (* Goal: forall (A B C A' B' C' O : @Tpoint Tn) (_ : and (not (@Col Tn A B C)) (and (@Par_strict Tn A B A' B') (@Par_strict Tn A C A' C'))), and (forall _ : and (@Par_strict Tn B C B' C') (and (@Col Tn O A A') (@Col Tn O B B')), @Col Tn O C C') (and (forall _ : and (@Par_strict Tn B C B' C') (@Par Tn A A' B B'), and (@Par Tn C C' A A') (@Par Tn C C' B B')) (forall _ : and (@Par Tn A A' B B') (@Par Tn A A' C C'), @Par Tn B C B' C')) *) intros. (* Goal: and (forall _ : and (@Par_strict Tn B C B' C') (and (@Col Tn O A A') (@Col Tn O B B')), @Col Tn O C C') (and (forall _ : and (@Par_strict Tn B C B' C') (@Par Tn A A' B B'), and (@Par Tn C C' A A') (@Par Tn C C' B B')) (forall _ : and (@Par Tn A A' B B') (@Par Tn A A' C C'), @Par Tn B C B' C')) *) spliter. (* Goal: and (forall _ : and (@Par_strict Tn B C B' C') (and (@Col Tn O A A') (@Col Tn O B B')), @Col Tn O C C') (and (forall _ : and (@Par_strict Tn B C B' C') (@Par Tn A A' B B'), and (@Par Tn C C' A A') (@Par Tn C C' B B')) (forall _ : and (@Par Tn A A' B B') (@Par Tn A A' C C'), @Par Tn B C B' C')) *) split. (* Goal: and (forall _ : and (@Par_strict Tn B C B' C') (@Par Tn A A' B B'), and (@Par Tn C C' A A') (@Par Tn C C' B B')) (forall _ : and (@Par Tn A A' B B') (@Par Tn A A' C C'), @Par Tn B C B' C') *) (* Goal: forall _ : and (@Par_strict Tn B C B' C') (and (@Col Tn O A A') (@Col Tn O B B')), @Col Tn O C C' *) intros. (* Goal: and (forall _ : and (@Par_strict Tn B C B' C') (@Par Tn A A' B B'), and (@Par Tn C C' A A') (@Par Tn C C' B B')) (forall _ : and (@Par Tn A A' B B') (@Par Tn A A' C C'), @Par Tn B C B' C') *) (* Goal: @Col Tn O C C' *) apply (l13_18_2 A B C A' B' C' O); auto. (* Goal: and (forall _ : and (@Par_strict Tn B C B' C') (@Par Tn A A' B B'), and (@Par Tn C C' A A') (@Par Tn C C' B B')) (forall _ : and (@Par Tn A A' B B') (@Par Tn A A' C C'), @Par Tn B C B' C') *) split. (* Goal: forall _ : and (@Par Tn A A' B B') (@Par Tn A A' C C'), @Par Tn B C B' C' *) (* Goal: forall _ : and (@Par_strict Tn B C B' C') (@Par Tn A A' B B'), and (@Par Tn C C' A A') (@Par Tn C C' B B') *) intros. (* Goal: forall _ : and (@Par Tn A A' B B') (@Par Tn A A' C C'), @Par Tn B C B' C' *) (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) spliter. (* Goal: forall _ : and (@Par Tn A A' B B') (@Par Tn A A' C C'), @Par Tn B C B' C' *) (* Goal: and (@Par Tn C C' A A') (@Par Tn C C' B B') *) apply l13_18_3; auto. (* Goal: forall _ : and (@Par Tn A A' B B') (@Par Tn A A' C C'), @Par Tn B C B' C' *) intros. (* Goal: @Par Tn B C B' C' *) spliter. (* Goal: @Par Tn B C B' C' *) apply (l13_15_par A B C A' B' C'); auto. Qed. Lemma l13_19_aux : forall A B C D A' B' C' D' O, ~Col O A B -> A <> A' -> A <> C -> O <> A -> O <> A' -> O <> C -> O <> C' -> O <> B -> O <> B' -> O <> D -> O <> D' -> Col O A C -> Col O A A' -> Col O A C' -> Col O B D -> Col O B B' -> Col O B D' -> ~Par A B C D -> Par A B A' B' -> Par A D A' D' -> Par B C B' C' -> Par C D C' D'. Proof. (* Goal: forall (A B C D A' B' C' D' O : @Tpoint Tn) (_ : not (@Col Tn O A B)) (_ : not (@eq (@Tpoint Tn) A A')) (_ : not (@eq (@Tpoint Tn) A C)) (_ : not (@eq (@Tpoint Tn) O A)) (_ : not (@eq (@Tpoint Tn) O A')) (_ : not (@eq (@Tpoint Tn) O C)) (_ : not (@eq (@Tpoint Tn) O C')) (_ : not (@eq (@Tpoint Tn) O B)) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O D)) (_ : not (@eq (@Tpoint Tn) O D')) (_ : @Col Tn O A C) (_ : @Col Tn O A A') (_ : @Col Tn O A C') (_ : @Col Tn O B D) (_ : @Col Tn O B B') (_ : @Col Tn O B D') (_ : not (@Par Tn A B C D)) (_ : @Par Tn A B A' B') (_ : @Par Tn A D A' D') (_ : @Par Tn B C B' C'), @Par Tn C D C' D' *) intros. (* Goal: @Par Tn C D C' D' *) assert(HH:= not_par_inter_exists A B C D H16). (* Goal: @Par Tn C D C' D' *) ex_and HH E. (* Goal: @Par Tn C D C' D' *) assert(~Par A' B' O E). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@Par Tn A' B' O E) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) assert(Par A B O E). (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: @Par Tn A B O E *) apply (par_trans _ _ A' B'); Par. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) induction H23. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: False *) apply H23. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X O E)) *) exists E. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: and (@Col Tn E A B) (@Col Tn E O E) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O A B *) apply (col_transitivity_1 _ E); Col. (* Goal: @Par Tn C D C' D' *) assert(HH:= not_par_inter_exists A' B' O E H22). (* Goal: @Par Tn C D C' D' *) ex_and HH E'. (* Goal: @Par Tn C D C' D' *) assert(C <> E). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@eq (@Tpoint Tn) C E) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) subst E. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O A B *) apply col_permutation_2. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A B O *) apply (col_transitivity_1 _ C); Col. (* Goal: @Par Tn C D C' D' *) induction(col_dec A D E). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) assert(B = D). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @eq (@Tpoint Tn) B D *) apply(l6_21 O B A E); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: not (@eq (@Tpoint Tn) A E) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: False *) subst E. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O A B *) assert(Col A O D). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn A O D *) apply (col_transitivity_1 _ C); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O A B *) apply (col_transitivity_1 _ D); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) subst D. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) assert(Par A' B' A' D'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: @Par Tn A' B' A' D' *) apply (par_trans _ _ A B); Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) induction H27. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: @Par Tn C B C' D' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: False *) apply H27. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A' B') (@Col Tn X A' D')) *) exists A'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: and (@Col Tn A' A' B') (@Col Tn A' A' D') *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) assert(B' = D'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: @eq (@Tpoint Tn) B' D' *) eapply(l6_21 A' B' O B'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: @Col Tn O B' D' *) (* Goal: not (@Col Tn A' B' O) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: @Col Tn O B' D' *) (* Goal: False *) apply H. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: @Col Tn O B' D' *) (* Goal: @Col Tn O A B *) apply (col_transitivity_1 _ A'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: @Col Tn O B' D' *) (* Goal: @Col Tn O A' B *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: @Col Tn O B' D' *) apply (col_transitivity_1 _ B); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) subst D'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' B' *) Par. (* Goal: @Par Tn C D C' D' *) assert(B <> B'). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@eq (@Tpoint Tn) B B') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) subst B'. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) induction H17. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: False *) apply H17. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A' B)) *) exists B. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: and (@Col Tn B A B) (@Col Tn B A' B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O A B *) apply col_permutation_2. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A B O *) apply (col_transitivity_1 _ A'); Col. (* Goal: @Par Tn C D C' D' *) assert(Par D E D' E'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn D E D' E' *) eapply (l13_15 A _ _ A' _ _ O); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par_strict Tn A D A' D' *) induction H18. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par_strict Tn A D A' D' *) (* Goal: @Par_strict Tn A D A' D' *) auto. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par_strict Tn A D A' D' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par_strict Tn A D A' D' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: False *) assert(Col A' A D). (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: False *) (* Goal: @Col Tn A' A D *) apply (col_transitivity_1 _ D'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: False *) assert(Col A O D). (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: False *) (* Goal: @Col Tn A O D *) apply (col_transitivity_1 _ A'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: False *) apply H. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Col Tn O A B *) apply (col_transitivity_1 _ D); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) assert(Par A E A' E'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A E A' E' *) apply(par_col_par_2 _ B); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A B A' E' *) (* Goal: not (@eq (@Tpoint Tn) A E) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A B A' E' *) (* Goal: False *) subst E. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A B A' E' *) (* Goal: False *) apply H26. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A B A' E' *) (* Goal: @Col Tn A D A *) Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A B A' E' *) apply par_symmetry. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A' E' A B *) apply(par_col_par_2 _ B'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A' B' A B *) (* Goal: not (@eq (@Tpoint Tn) A' E') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A' B' A B *) (* Goal: False *) subst E'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A' B' A B *) (* Goal: False *) assert(Col O A E). (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A' B' A B *) (* Goal: False *) (* Goal: @Col Tn O A E *) apply(col_transitivity_1 _ A'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A' B' A B *) (* Goal: False *) apply H. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A' B' A B *) (* Goal: @Col Tn O A B *) apply col_permutation_2. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A' B' A B *) (* Goal: @Col Tn A B O *) apply(col_transitivity_1 _ E); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A' B' A B *) (* Goal: not (@eq (@Tpoint Tn) A E) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A' B' A B *) (* Goal: False *) subst E. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A' B' A B *) (* Goal: False *) apply H26. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A' B' A B *) (* Goal: @Col Tn A D A *) Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par Tn A' B' A B *) Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) induction H28. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par_strict Tn A E A' E' *) auto. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Par_strict Tn A E A' E' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: False *) assert(Col A' A E). (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: False *) (* Goal: @Col Tn A' A E *) apply(col_transitivity_1 _ E'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: False *) assert(Col A O E). (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: False *) (* Goal: @Col Tn A O E *) apply(col_transitivity_1 _ A'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: False *) apply H. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Col Tn O A B *) apply col_permutation_2. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) (* Goal: @Col Tn A B O *) apply(col_transitivity_1 _ E); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O D D' *) apply(col_transitivity_1 _ B); Col. (* Goal: @Par Tn C D C' D' *) apply par_comm. (* Goal: @Par Tn D C D' C' *) induction(col_dec B C E). (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn D C D' C' *) assert(B = D). (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn D C D' C' *) (* Goal: @eq (@Tpoint Tn) B D *) apply(l6_21 O B C E); Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn D C D' C' *) (* Goal: not (@Col Tn O B C) *) intro. (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn D C D' C' *) (* Goal: False *) apply H. (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O A B *) apply (col_transitivity_1 _ C); Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn D C D' C' *) subst D. (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn B C D' C' *) assert(Par A' B' A' D'). (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn B C D' C' *) (* Goal: @Par Tn A' B' A' D' *) apply (par_trans _ _ A B); Par. (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn B C D' C' *) induction H30. (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn B C D' C' *) (* Goal: @Par Tn B C D' C' *) apply False_ind. (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn B C D' C' *) (* Goal: False *) apply H30. (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn B C D' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A' B') (@Col Tn X A' D')) *) exists A'. (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn B C D' C' *) (* Goal: and (@Col Tn A' A' B') (@Col Tn A' A' D') *) split; Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn B C D' C' *) spliter. (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn B C D' C' *) assert(B' = D'). (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn B C D' C' *) (* Goal: @eq (@Tpoint Tn) B' D' *) eapply(l6_21 A' B' O B'); Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn B C D' C' *) (* Goal: @Col Tn O B' D' *) (* Goal: not (@Col Tn A' B' O) *) Col5. (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn B C D' C' *) (* Goal: @Col Tn O B' D' *) ColR. (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn B C D' C' *) subst D'. (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn B C B' C' *) Par. (* Goal: @Par Tn D C D' C' *) assert(Par C E C' E'). (* Goal: @Par Tn D C D' C' *) (* Goal: @Par Tn C E C' E' *) eapply (l13_15 B _ _ B' _ _ O); Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par_strict Tn B C B' C' *) induction H19. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par_strict Tn B C B' C' *) (* Goal: @Par_strict Tn B C B' C' *) auto. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par_strict Tn B C B' C' *) spliter. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par_strict Tn B C B' C' *) apply False_ind. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: False *) apply H. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Col Tn O A B *) assert(Col B O C'). (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn B O C' *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Col Tn O A B *) apply (col_transitivity_1 _ C'); Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) assert(Par B E B' E'). (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B E B' E' *) apply (par_col_par_2 _ A); Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B A B' E' *) (* Goal: not (@eq (@Tpoint Tn) B E) *) intro. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B A B' E' *) (* Goal: False *) subst E. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B A B' E' *) (* Goal: False *) apply H29. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B A B' E' *) (* Goal: @Col Tn B C B *) Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B A B' E' *) apply par_symmetry. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B' E' B A *) apply (par_col_par_2 _ A'); Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B' A' B A *) (* Goal: not (@eq (@Tpoint Tn) B' E') *) intro. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B' A' B A *) (* Goal: False *) subst E'. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B' A' B A *) (* Goal: False *) assert(Col O B E). (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B' A' B A *) (* Goal: False *) (* Goal: @Col Tn O B E *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B' A' B A *) (* Goal: False *) apply H. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B' A' B A *) (* Goal: @Col Tn O A B *) apply col_permutation_1. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B' A' B A *) (* Goal: @Col Tn B O A *) apply (col_transitivity_1 _ E); Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B' A' B A *) (* Goal: not (@eq (@Tpoint Tn) B E) *) intro. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B' A' B A *) (* Goal: False *) subst E. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B' A' B A *) (* Goal: False *) apply H29. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B' A' B A *) (* Goal: @Col Tn B C B *) Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B' A' B A *) Par. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) induction H30. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par_strict Tn B E B' E' *) auto. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) spliter. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Par_strict Tn B E B' E' *) apply False_ind. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: False *) apply H. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn O A B *) assert(Col O B' E'). (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O B' E' *) apply col_permutation_2. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn B' E' O *) apply (col_transitivity_1 _ B); Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn O A B *) assert(Col B' A' O). (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn B' A' O *) apply (col_transitivity_1 _ E'); Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn O A B *) apply (col_transitivity_1 _ A'); Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) (* Goal: @Col Tn O A' B *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Par Tn D C D' C' *) (* Goal: @Col Tn O C C' *) apply (col_transitivity_1 _ A); Col. (* Goal: @Par Tn D C D' C' *) apply(par_col_par_2 _ E); Col. (* Goal: @Par Tn D E D' C' *) (* Goal: not (@eq (@Tpoint Tn) D C) *) intro. (* Goal: @Par Tn D E D' C' *) (* Goal: False *) subst D. (* Goal: @Par Tn D E D' C' *) (* Goal: False *) apply H. (* Goal: @Par Tn D E D' C' *) (* Goal: @Col Tn O A B *) apply(col_transitivity_1 _ C); Col. (* Goal: @Par Tn D E D' C' *) apply par_symmetry. (* Goal: @Par Tn D' C' D E *) apply(par_col_par_2 _ E'); Col. (* Goal: @Par Tn D' E' D E *) (* Goal: @Col Tn D' E' C' *) (* Goal: not (@eq (@Tpoint Tn) D' C') *) intro. (* Goal: @Par Tn D' E' D E *) (* Goal: @Col Tn D' E' C' *) (* Goal: False *) subst D'. (* Goal: @Par Tn D' E' D E *) (* Goal: @Col Tn D' E' C' *) (* Goal: False *) apply H. (* Goal: @Par Tn D' E' D E *) (* Goal: @Col Tn D' E' C' *) (* Goal: @Col Tn O A B *) apply(col_transitivity_1 _ C'); Col. (* Goal: @Par Tn D' E' D E *) (* Goal: @Col Tn D' E' C' *) apply (col_par_par_col D E C); Par. (* Goal: @Par Tn D' E' D E *) (* Goal: @Col Tn D E C *) Col. (* Goal: @Par Tn D' E' D E *) Par. Qed. Lemma l13_19 : forall A B C D A' B' C' D' O, ~Col O A B -> O <> A -> O <> A' -> O <> C -> O <> C' -> O <> B -> O <> B' -> O <> D -> O <> D' -> Col O A C -> Col O A A' -> Col O A C' -> Col O B D -> Col O B B' -> Col O B D' -> Par A B A' B' -> Par A D A' D' -> Par B C B' C' -> Par C D C' D'. Proof. (* Goal: forall (A B C D A' B' C' D' O : @Tpoint Tn) (_ : not (@Col Tn O A B)) (_ : not (@eq (@Tpoint Tn) O A)) (_ : not (@eq (@Tpoint Tn) O A')) (_ : not (@eq (@Tpoint Tn) O C)) (_ : not (@eq (@Tpoint Tn) O C')) (_ : not (@eq (@Tpoint Tn) O B)) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O D)) (_ : not (@eq (@Tpoint Tn) O D')) (_ : @Col Tn O A C) (_ : @Col Tn O A A') (_ : @Col Tn O A C') (_ : @Col Tn O B D) (_ : @Col Tn O B B') (_ : @Col Tn O B D') (_ : @Par Tn A B A' B') (_ : @Par Tn A D A' D') (_ : @Par Tn B C B' C'), @Par Tn C D C' D' *) intros. (* Goal: @Par Tn C D C' D' *) induction (eq_dec_points A A'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) subst A'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) assert(B = B'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @eq (@Tpoint Tn) B B' *) apply(l6_21 A B O B); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A B B' *) induction H14. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A B B' *) (* Goal: @Col Tn A B B' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A B B' *) (* Goal: False *) apply H14. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A B B' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A B')) *) exists A. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A B B' *) (* Goal: and (@Col Tn A A B) (@Col Tn A A B') *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A B B' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A B B' *) Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) subst B'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) assert(D = D'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @eq (@Tpoint Tn) D D' *) apply(l6_21 A D O B); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A D D' *) (* Goal: not (@Col Tn A D O) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A D D' *) (* Goal: False *) apply H. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A D D' *) (* Goal: @Col Tn O A B *) apply (col_transitivity_1 _ D); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A D D' *) induction H15. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A D D' *) (* Goal: @Col Tn A D D' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A D D' *) (* Goal: False *) apply H15. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A D D' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A D) (@Col Tn X A D')) *) exists A. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A D D' *) (* Goal: and (@Col Tn A A D) (@Col Tn A A D') *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A D D' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A D D' *) Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) subst D'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D *) assert(C = C'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D *) (* Goal: @eq (@Tpoint Tn) C C' *) apply(l6_21 B C O A); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D *) (* Goal: @Col Tn B C C' *) (* Goal: not (@Col Tn B C O) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D *) (* Goal: @Col Tn B C C' *) (* Goal: False *) apply H. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D *) (* Goal: @Col Tn B C C' *) (* Goal: @Col Tn O A B *) apply (col_transitivity_1 _ C); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D *) (* Goal: @Col Tn B C C' *) induction H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D *) (* Goal: @Col Tn B C C' *) (* Goal: @Col Tn B C C' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D *) (* Goal: @Col Tn B C C' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D *) (* Goal: @Col Tn B C C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C) (@Col Tn X B C')) *) exists B. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D *) (* Goal: @Col Tn B C C' *) (* Goal: and (@Col Tn B B C) (@Col Tn B B C') *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D *) (* Goal: @Col Tn B C C' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D *) (* Goal: @Col Tn B C C' *) Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D *) subst C'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C D *) apply par_reflexivity. (* Goal: @Par Tn C D C' D' *) (* Goal: not (@eq (@Tpoint Tn) C D) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) subst D. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn O A B *) apply (col_transitivity_1 _ C); Col. (* Goal: @Par Tn C D C' D' *) induction(eq_dec_points A C). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) subst C. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) assert(A' = C'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: @eq (@Tpoint Tn) A' C' *) assert(Par A' B' B' C'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: @eq (@Tpoint Tn) A' C' *) (* Goal: @Par Tn A' B' B' C' *) apply (par_trans _ _ A B); Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: @eq (@Tpoint Tn) A' C' *) induction H18. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: @eq (@Tpoint Tn) A' C' *) (* Goal: @eq (@Tpoint Tn) A' C' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: @eq (@Tpoint Tn) A' C' *) (* Goal: False *) apply H18. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: @eq (@Tpoint Tn) A' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A' B') (@Col Tn X B' C')) *) exists B'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: @eq (@Tpoint Tn) A' C' *) (* Goal: and (@Col Tn B' A' B') (@Col Tn B' B' C') *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: @eq (@Tpoint Tn) A' C' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: @eq (@Tpoint Tn) A' C' *) eapply (l6_21 B' C' O A); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: not (@Col Tn B' C' O) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: False *) apply H. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: @Col Tn O A B *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: @Col Tn O B' A *) apply (col_transitivity_1 _ C'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) subst C'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D A' D' *) auto. (* Goal: @Par Tn C D C' D' *) induction(eq_dec_points A' C'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) subst C'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' D' *) assert(A = C). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' D' *) (* Goal: @eq (@Tpoint Tn) A C *) assert(Par A B B C). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' D' *) (* Goal: @eq (@Tpoint Tn) A C *) (* Goal: @Par Tn A B B C *) apply (par_trans _ _ A' B'); Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' D' *) (* Goal: @eq (@Tpoint Tn) A C *) induction H19. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' D' *) (* Goal: @eq (@Tpoint Tn) A C *) (* Goal: @eq (@Tpoint Tn) A C *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' D' *) (* Goal: @eq (@Tpoint Tn) A C *) (* Goal: False *) apply H19. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' D' *) (* Goal: @eq (@Tpoint Tn) A C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X B C)) *) exists B. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' D' *) (* Goal: @eq (@Tpoint Tn) A C *) (* Goal: and (@Col Tn B A B) (@Col Tn B B C) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' D' *) (* Goal: @eq (@Tpoint Tn) A C *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' D' *) (* Goal: @eq (@Tpoint Tn) A C *) eapply (l6_21 B C O A'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' D' *) (* Goal: @Col Tn O A' C *) (* Goal: not (@Col Tn B C O) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' D' *) (* Goal: @Col Tn O A' C *) (* Goal: False *) apply H. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' D' *) (* Goal: @Col Tn O A' C *) (* Goal: @Col Tn O A B *) apply (col_transitivity_1 _ C); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' D' *) (* Goal: @Col Tn O A' C *) apply (col_transitivity_1 _ A); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' D' *) contradiction. (* Goal: @Par Tn C D C' D' *) induction(par_dec C D C' D'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) auto. (* Goal: @Par Tn C D C' D' *) assert(HH:=not_par_one_not_par C D C' D' A' B' H20). (* Goal: @Par Tn C D C' D' *) induction HH. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) assert(~ Par C D A B). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: not (@Par Tn C D A B) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H21. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' B' *) apply (par_trans _ _ A B); Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) apply (l13_19_aux A B C D A' B' C' D' O); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: not (@Par Tn A B C D) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H21. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A' B' *) apply (par_trans _ _ A B); Par. (* Goal: @Par Tn C D C' D' *) apply par_symmetry. (* Goal: @Par Tn C' D' C D *) apply (l13_19_aux A' B' C' D' A B C D O); Par. (* Goal: @Col Tn O B' D *) (* Goal: @Col Tn O B' B *) (* Goal: @Col Tn O B' D' *) (* Goal: @Col Tn O A' C *) (* Goal: @Col Tn O A' A *) (* Goal: @Col Tn O A' C' *) (* Goal: not (@Col Tn O A' B') *) intro. (* Goal: @Col Tn O B' D *) (* Goal: @Col Tn O B' B *) (* Goal: @Col Tn O B' D' *) (* Goal: @Col Tn O A' C *) (* Goal: @Col Tn O A' A *) (* Goal: @Col Tn O A' C' *) (* Goal: False *) apply H. (* Goal: @Col Tn O B' D *) (* Goal: @Col Tn O B' B *) (* Goal: @Col Tn O B' D' *) (* Goal: @Col Tn O A' C *) (* Goal: @Col Tn O A' A *) (* Goal: @Col Tn O A' C' *) (* Goal: @Col Tn O A B *) apply (col_transitivity_1 _ A'); Col. (* Goal: @Col Tn O B' D *) (* Goal: @Col Tn O B' B *) (* Goal: @Col Tn O B' D' *) (* Goal: @Col Tn O A' C *) (* Goal: @Col Tn O A' A *) (* Goal: @Col Tn O A' C' *) (* Goal: @Col Tn O A' B *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Col Tn O B' D *) (* Goal: @Col Tn O B' B *) (* Goal: @Col Tn O B' D' *) (* Goal: @Col Tn O A' C *) (* Goal: @Col Tn O A' A *) (* Goal: @Col Tn O A' C' *) apply (col_transitivity_1 _ A); Col. (* Goal: @Col Tn O B' D *) (* Goal: @Col Tn O B' B *) (* Goal: @Col Tn O B' D' *) (* Goal: @Col Tn O A' C *) (* Goal: @Col Tn O A' A *) Col. (* Goal: @Col Tn O B' D *) (* Goal: @Col Tn O B' B *) (* Goal: @Col Tn O B' D' *) (* Goal: @Col Tn O A' C *) apply (col_transitivity_1 _ A); Col. (* Goal: @Col Tn O B' D *) (* Goal: @Col Tn O B' B *) (* Goal: @Col Tn O B' D' *) apply (col_transitivity_1 _ B); Col. (* Goal: @Col Tn O B' D *) (* Goal: @Col Tn O B' B *) Col. (* Goal: @Col Tn O B' D *) apply (col_transitivity_1 _ B); Col. Qed. Lemma l13_19_par_aux : forall A B C D A' B' C' D' X Y, X <> A -> X <> A' -> X <> C -> X <> C' -> Y <> B -> Y <> B' -> Y <> D -> Y <> D' -> Col X A C -> Col X A A' -> Col X A C' -> Col Y B D -> Col Y B B' -> Col Y B D' -> A <> C -> B <> D -> A <> A' -> Par_strict X A Y B -> ~Par A B C D -> Par A B A' B' -> Par A D A' D' -> Par B C B' C' -> Par C D C' D'. Proof. (* Goal: forall (A B C D A' B' C' D' X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) X A)) (_ : not (@eq (@Tpoint Tn) X A')) (_ : not (@eq (@Tpoint Tn) X C)) (_ : not (@eq (@Tpoint Tn) X C')) (_ : not (@eq (@Tpoint Tn) Y B)) (_ : not (@eq (@Tpoint Tn) Y B')) (_ : not (@eq (@Tpoint Tn) Y D)) (_ : not (@eq (@Tpoint Tn) Y D')) (_ : @Col Tn X A C) (_ : @Col Tn X A A') (_ : @Col Tn X A C') (_ : @Col Tn Y B D) (_ : @Col Tn Y B B') (_ : @Col Tn Y B D') (_ : not (@eq (@Tpoint Tn) A C)) (_ : not (@eq (@Tpoint Tn) B D)) (_ : not (@eq (@Tpoint Tn) A A')) (_ : @Par_strict Tn X A Y B) (_ : not (@Par Tn A B C D)) (_ : @Par Tn A B A' B') (_ : @Par Tn A D A' D') (_ : @Par Tn B C B' C'), @Par Tn C D C' D' *) intros. (* Goal: @Par Tn C D C' D' *) assert(HH := not_par_inter_exists A B C D H17). (* Goal: @Par Tn C D C' D' *) ex_and HH E. (* Goal: @Par Tn C D C' D' *) assert(HH:= parallel_existence1 X A E H). (* Goal: @Par Tn C D C' D' *) ex_and HH Z. (* Goal: @Par Tn C D C' D' *) assert(~Par A B E Z). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@Par Tn A B E Z) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) assert(Par Y B E Z). (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: @Par Tn Y B E Z *) apply (par_trans _ _ X A); Par. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) induction H24. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: False *) apply H24. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X E Z)) *) exists E. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: and (@Col Tn E A B) (@Col Tn E E Z) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) induction H23. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: False *) apply H23. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 E Z)) *) exists A. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: and (@Col Tn A X A) (@Col Tn A E Z) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) induction H25. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: False *) apply H25. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X Y B) (@Col Tn X E Z)) *) exists B. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: and (@Col Tn B Y B) (@Col Tn B E Z) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists E. (* Goal: @Par Tn C D C' D' *) (* Goal: and (@Col Tn E X A) (@Col Tn E Y B) *) split;ColR. (* Goal: @Par Tn C D C' D' *) assert(~Par A' B' E Z). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@Par Tn A' B' E Z) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H24. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A B E Z *) apply (par_trans _ _ A' B'); Par. (* Goal: @Par Tn C D C' D' *) assert(HH:= not_par_inter_exists A' B' E Z H25). (* Goal: @Par Tn C D C' D' *) ex_and HH E'. (* Goal: @Par Tn C D C' D' *) assert(~Col A D E). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@Col Tn A D E) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) induction (eq_dec_points A E). (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: False *) subst E. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: False *) apply H13. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: @eq (@Tpoint Tn) A C *) apply (l6_21 X A D A); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) D A) *) (* Goal: not (@Col Tn X A D) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) D A) *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) D A) *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists D. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) D A) *) (* Goal: and (@Col Tn D X A) (@Col Tn D Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) D A) *) apply par_distincts in H19. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) D A) *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) D A) *) auto. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) assert(Col A B D) by ColR. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists A. (* Goal: @Par Tn C D C' D' *) (* Goal: and (@Col Tn A X A) (@Col Tn A Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A Y B *) ColR. (* Goal: @Par Tn C D C' D' *) assert(Par_strict X A E Z). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par_strict Tn X A E Z *) induction H23. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par_strict Tn X A E Z *) (* Goal: @Par_strict Tn X A E Z *) Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par_strict Tn X A E Z *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par_strict Tn X A E Z *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) assert(Col E X A) by ColR. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) assert(Col A C E) by ColR. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H13. (* Goal: @Par Tn C D C' D' *) (* Goal: @eq (@Tpoint Tn) A C *) apply (l6_21 A E D C); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn D C A *) (* Goal: not (@eq (@Tpoint Tn) D C) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn D C A *) (* Goal: False *) subst D. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn D C A *) (* Goal: False *) contradiction. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn D C A *) apply col_permutation_2. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C A D *) apply (col_transitivity_1 _ E); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: not (@eq (@Tpoint Tn) C E) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) subst E. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) clean_trivial_hyps. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists B. (* Goal: @Par Tn C D C' D' *) (* Goal: and (@Col Tn B X A) (@Col Tn B Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn B X A *) apply col_permutation_1. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A B X *) apply (col_transitivity_1 _ C); Col. (* Goal: @Par Tn C D C' D' *) assert(Par Y B E Z). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn Y B E Z *) apply (par_trans _ _ X A); Par. (* Goal: @Par Tn C D C' D' *) assert(Par_strict Y B E Z). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par_strict Tn Y B E Z *) induction H30. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par_strict Tn Y B E Z *) (* Goal: @Par_strict Tn Y B E Z *) Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par_strict Tn Y B E Z *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par_strict Tn Y B E Z *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) assert(Col E Y B) by ColR. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) assert(Col B D E) by ColR. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H14. (* Goal: @Par Tn C D C' D' *) (* Goal: @eq (@Tpoint Tn) B D *) apply (l6_21 B E C D); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: not (@eq (@Tpoint Tn) C D) *) (* Goal: not (@Col Tn B E C) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: not (@eq (@Tpoint Tn) C D) *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: not (@eq (@Tpoint Tn) C D) *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists C. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: not (@eq (@Tpoint Tn) C D) *) (* Goal: and (@Col Tn C X A) (@Col Tn C Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: not (@eq (@Tpoint Tn) C D) *) (* Goal: @Col Tn C Y B *) apply col_permutation_1. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: not (@eq (@Tpoint Tn) C D) *) (* Goal: @Col Tn B C Y *) apply (col_transitivity_1 _ E); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: not (@eq (@Tpoint Tn) C D) *) (* Goal: not (@eq (@Tpoint Tn) B E) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: not (@eq (@Tpoint Tn) C D) *) (* Goal: False *) subst E. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: not (@eq (@Tpoint Tn) C D) *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: not (@eq (@Tpoint Tn) C D) *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists C. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: not (@eq (@Tpoint Tn) C D) *) (* Goal: and (@Col Tn C X A) (@Col Tn C Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: not (@eq (@Tpoint Tn) C D) *) (* Goal: @Col Tn C Y B *) clean_trivial_hyps. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: not (@eq (@Tpoint Tn) C D) *) (* Goal: @Col Tn C Y B *) apply col_permutation_1. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: not (@eq (@Tpoint Tn) C D) *) (* Goal: @Col Tn B C Y *) apply (col_transitivity_1 _ D); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: not (@eq (@Tpoint Tn) C D) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: False *) subst D. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists C. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) (* Goal: and (@Col Tn C X A) (@Col Tn C Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C D B *) assert_diffs; ColR. (* Goal: @Par Tn C D C' D' *) assert(~Col A' D' E'). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@Col Tn A' D' E') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) assert(Col A' B' D'). (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: @Col Tn A' B' D' *) apply (col_transitivity_1 _ E'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) A' E') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: False *) subst E'. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: False *) apply H29. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 E Z)) *) exists A'. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: and (@Col Tn A' X A) (@Col Tn A' E Z) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists A'. (* Goal: @Par Tn C D C' D' *) (* Goal: and (@Col Tn A' X A) (@Col Tn A' Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) assert(Col Y B' D'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) (* Goal: @Col Tn Y B' D' *) apply (col_transitivity_1 _ B); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) assert(Col B' A' Y). (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) (* Goal: @Col Tn B' A' Y *) apply (col_transitivity_1 _ D'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) (* Goal: False *) subst D'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) (* Goal: False *) assert(Par A D A B). (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) (* Goal: False *) (* Goal: @Par Tn A D A B *) apply(par_trans _ _ A' B'); Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) (* Goal: False *) induction H35. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) (* Goal: False *) (* Goal: False *) apply H35. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A D) (@Col Tn X A B)) *) exists A. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) (* Goal: False *) (* Goal: and (@Col Tn A A D) (@Col Tn A A B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) (* Goal: False *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists A. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) (* Goal: and (@Col Tn A X A) (@Col Tn A Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) (* Goal: @Col Tn A Y B *) apply col_permutation_1. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) (* Goal: @Col Tn B A Y *) apply (col_transitivity_1 _ D); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' Y B *) apply col_permutation_2. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn Y B A' *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Par Tn C D C' D' *) assert(~ Col X A B). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@Col Tn X A B) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists B. (* Goal: @Par Tn C D C' D' *) (* Goal: and (@Col Tn B X A) (@Col Tn B Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) assert(~ Col Y A B). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@Col Tn Y A B) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists A. (* Goal: @Par Tn C D C' D' *) (* Goal: and (@Col Tn A X A) (@Col Tn A Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) assert(B <> B'). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@eq (@Tpoint Tn) B B') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) subst B'. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H15. (* Goal: @Par Tn C D C' D' *) (* Goal: @eq (@Tpoint Tn) A A' *) apply(l6_21 X A B A); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn B A A' *) (* Goal: not (@eq (@Tpoint Tn) B A) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn B A A' *) (* Goal: False *) subst B. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn B A A' *) (* Goal: False *) apply H33. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn B A A' *) (* Goal: @Col Tn X A A *) Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn B A A' *) induction H18. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn B A A' *) (* Goal: @Col Tn B A A' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn B A A' *) (* Goal: False *) apply H18. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn B A A' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A' B)) *) exists B. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn B A A' *) (* Goal: and (@Col Tn B A B) (@Col Tn B A' B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn B A A' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn B A A' *) Col. (* Goal: @Par Tn C D C' D' *) assert(C <> C'). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@eq (@Tpoint Tn) C C') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) subst C'. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) induction H20. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: False *) apply H20. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C) (@Col Tn X B' C)) *) exists C. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: and (@Col Tn C B C) (@Col Tn C B' C) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists C. (* Goal: @Par Tn C D C' D' *) (* Goal: and (@Col Tn C X A) (@Col Tn C Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn C Y B *) apply col_permutation_1. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn B C Y *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Par Tn C D C' D' *) assert(D <> D'). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@eq (@Tpoint Tn) D D') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) subst D'. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) induction H19. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: False *) apply H19. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A D) (@Col Tn X A' D)) *) exists D. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: and (@Col Tn D A D) (@Col Tn D A' D) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists D. (* Goal: @Par Tn C D C' D' *) (* Goal: and (@Col Tn D X A) (@Col Tn D Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn D X A *) apply col_permutation_1. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A D X *) apply (col_transitivity_1 _ A'); Col. (* Goal: @Par Tn C D C' D' *) assert(A' <> C'). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) subst C'. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) assert(Par B C A B). (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: @Par Tn B C A B *) apply (par_trans _ _ A' B'); Par. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) induction H38. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: False *) apply H38. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C) (@Col Tn X A B)) *) exists B. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: and (@Col Tn B B C) (@Col Tn B A B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists B. (* Goal: @Par Tn C D C' D' *) (* Goal: and (@Col Tn B X A) (@Col Tn B Y B) *) split; ColR. (* Goal: @Par Tn C D C' D' *) assert(B' <> D'). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) subst D'. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) assert(Par A D A B). (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: @Par Tn A D A B *) apply (par_trans _ _ A' B'); Par. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) induction H39. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: False *) apply H39. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A D) (@Col Tn X A B)) *) exists A. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) (* Goal: and (@Col Tn A A D) (@Col Tn A A B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists A. (* Goal: @Par Tn C D C' D' *) (* Goal: and (@Col Tn A X A) (@Col Tn A Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A Y B *) apply col_permutation_1. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn B A Y *) apply (col_transitivity_1 _ D); Col. (* Goal: @Par Tn C D C' D' *) assert(A <> E). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@eq (@Tpoint Tn) A E) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) subst E. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H28. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A D A *) Col. (* Goal: @Par Tn C D C' D' *) assert(A' <> E'). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@eq (@Tpoint Tn) A' E') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) subst E'. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H32. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' D' A' *) Col. (* Goal: @Par Tn C D C' D' *) assert(B <> E). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@eq (@Tpoint Tn) B E) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) subst E. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H31. (* Goal: @Par Tn C D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X Y B) (@Col Tn X B Z)) *) exists B. (* Goal: @Par Tn C D C' D' *) (* Goal: and (@Col Tn B Y B) (@Col Tn B B Z) *) split; Col. (* Goal: @Par Tn C D C' D' *) assert(B' <> E'). (* Goal: @Par Tn C D C' D' *) (* Goal: not (@eq (@Tpoint Tn) B' E') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) subst E'. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H31. (* Goal: @Par Tn C D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X Y B) (@Col Tn X E Z)) *) exists B'. (* Goal: @Par Tn C D C' D' *) (* Goal: and (@Col Tn B' Y B) (@Col Tn B' E Z) *) split; Col. (* Goal: @Par Tn C D C' D' *) assert(Par A E A' E'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A E A' E' *) apply (par_col_par_2 _ B); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A B A' E' *) apply par_symmetry. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A' E' A B *) apply (par_col_par_2 _ B'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A' B' A B *) Par. (* Goal: @Par Tn C D C' D' *) assert(Par_strict A E A' E'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par_strict Tn A E A' E' *) induction H44. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par_strict Tn A E A' E' *) (* Goal: @Par_strict Tn A E A' E' *) Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par_strict Tn A E A' E' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par_strict Tn A E A' E' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H45. (* Goal: @Par Tn C D C' D' *) (* Goal: @eq (@Tpoint Tn) A' E' *) apply (l6_21 X A' B' E'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn X A' E' *) (* Goal: not (@Col Tn X A' B') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn X A' E' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn X A' E' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists B'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn X A' E' *) (* Goal: and (@Col Tn B' X A) (@Col Tn B' Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn X A' E' *) (* Goal: @Col Tn B' X A *) apply col_permutation_2. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn X A' E' *) (* Goal: @Col Tn X A B' *) apply (col_transitivity_1 _ A'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn X A' E' *) apply col_permutation_2. (* Goal: @Par Tn C D C' D' *) (* Goal: @Col Tn A' E' X *) apply (col_transitivity_1 _ A); Col. (* Goal: @Par Tn C D C' D' *) assert(Par D E D' E'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn D E D' E' *) apply(l13_15_par A D E A' D' E'); Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn A A' D D' *) (* Goal: @Par_strict Tn A D A' D' *) induction H19. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn A A' D D' *) (* Goal: @Par_strict Tn A D A' D' *) (* Goal: @Par_strict Tn A D A' D' *) Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn A A' D D' *) (* Goal: @Par_strict Tn A D A' D' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn A A' D D' *) (* Goal: @Par_strict Tn A D A' D' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn A A' D D' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn A A' D D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists D. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn A A' D D' *) (* Goal: and (@Col Tn D X A) (@Col Tn D Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn A A' D D' *) (* Goal: @Col Tn D X A *) apply col_permutation_1. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn A A' D D' *) (* Goal: @Col Tn A D X *) apply (col_transitivity_1 _ A'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn A A' D D' *) (* Goal: @Col Tn A A' D *) apply col_permutation_2. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn A A' D D' *) (* Goal: @Col Tn A' D A *) apply (col_transitivity_1 _ D'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn A A' D D' *) apply (par_col_par_2 _ X); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn A X D D' *) apply par_symmetry. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn D D' A X *) apply (par_col_par_2 _ Y); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn D Y A X *) (* Goal: @Col Tn D Y D' *) apply col_permutation_2. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn D Y A X *) (* Goal: @Col Tn Y D' D *) apply (col_transitivity_1 _ B); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn D Y A X *) apply par_comm. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn Y D X A *) apply (par_col_par_2 _ B); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn Y B X A *) apply (par_trans _ _ E Z); Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A A' E E' *) apply (par_col_par_2 _ X); Par; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A X E E' *) apply par_symmetry. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn E E' A X *) apply (par_col_par_2 _ Z); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn E Z A X *) (* Goal: not (@eq (@Tpoint Tn) E E') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn E Z A X *) (* Goal: False *) subst E'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn E Z A X *) (* Goal: False *) apply H45. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn E Z A X *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A E) (@Col Tn X A' E)) *) exists E. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn E Z A X *) (* Goal: and (@Col Tn E A E) (@Col Tn E A' E) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn E Z A X *) Par. (* Goal: @Par Tn C D C' D' *) assert(Par C E C' E'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C E C' E' *) eapply(l13_15_par B C E B' C' E'); Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par_strict Tn B C B' C' *) (* Goal: not (@Col Tn B C E) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par_strict Tn B C B' C' *) (* Goal: False *) assert(Col B A C) by ColR. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par_strict Tn B C B' C' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par_strict Tn B C B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists B. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par_strict Tn B C B' C' *) (* Goal: and (@Col Tn B X A) (@Col Tn B Y B) *) split; ColR. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par_strict Tn B C B' C' *) induction H20. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par_strict Tn B C B' C' *) (* Goal: @Par_strict Tn B C B' C' *) Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par_strict Tn B C B' C' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par_strict Tn B C B' C' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists B'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: and (@Col Tn B' X A) (@Col Tn B' Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Col Tn B' X A *) assert(Col X C C'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Col Tn B' X A *) (* Goal: @Col Tn X C C' *) apply (col_transitivity_1 _ A); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Col Tn B' X A *) assert(Col C B' X). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Col Tn B' X A *) (* Goal: @Col Tn C B' X *) apply (col_transitivity_1 _ C'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Col Tn B' X A *) apply col_permutation_2. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Col Tn X A B' *) apply (col_transitivity_1 _ C); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) assert(Par B E B' E'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B E B' E' *) apply (par_col_par_2 _ A); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B A B' E' *) apply par_symmetry. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B' E' B A *) apply (par_col_par_2 _ A'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par Tn B' A' B A *) Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) induction H47. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) (* Goal: @Par_strict Tn B E B' E' *) Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @Par_strict Tn B E B' E' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: False *) assert(Col B' A' B) by ColR. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists A'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) (* Goal: and (@Col Tn A' X A) (@Col Tn A' Y B) *) split; sfinish. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' C C' *) apply (par_col_par_2 _ Y); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B Y C C' *) apply par_symmetry. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C C' B Y *) apply (par_col_par_2 _ X); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C X B Y *) (* Goal: @Col Tn C X C' *) apply col_permutation_2. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C X B Y *) (* Goal: @Col Tn X C' C *) apply (col_transitivity_1 _ A); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C X B Y *) apply par_left_comm. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn X C B Y *) apply (par_col_par_2 _ A); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn X A B Y *) apply (par_trans _ _ E Z); Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B B' E E' *) apply (par_col_par_2 _ Y); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn B Y E E' *) apply par_symmetry. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn E E' B Y *) apply (par_col_par_2 _ Z); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn E Z B Y *) (* Goal: not (@eq (@Tpoint Tn) E E') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn E Z B Y *) (* Goal: False *) subst E'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn E Z B Y *) (* Goal: False *) apply H45. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn E Z B Y *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A E) (@Col Tn X A' E)) *) exists E. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn E Z B Y *) (* Goal: and (@Col Tn E A E) (@Col Tn E A' E) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn E Z B Y *) Par. (* Goal: @Par Tn C D C' D' *) apply (par_col_par_2 _ E); Col. (* Goal: @Par Tn C E C' D' *) (* Goal: not (@eq (@Tpoint Tn) C D) *) intro. (* Goal: @Par Tn C E C' D' *) (* Goal: False *) subst D. (* Goal: @Par Tn C E C' D' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C E C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists C. (* Goal: @Par Tn C E C' D' *) (* Goal: and (@Col Tn C X A) (@Col Tn C Y B) *) split; Col. (* Goal: @Par Tn C E C' D' *) apply par_symmetry. (* Goal: @Par Tn C' D' C E *) apply (par_col_par_2 _ E'); Col. (* Goal: @Par Tn C' E' C E *) (* Goal: @Col Tn C' E' D' *) (* Goal: not (@eq (@Tpoint Tn) C' D') *) intro. (* Goal: @Par Tn C' E' C E *) (* Goal: @Col Tn C' E' D' *) (* Goal: False *) subst D'. (* Goal: @Par Tn C' E' C E *) (* Goal: @Col Tn C' E' D' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C' E' C E *) (* Goal: @Col Tn C' E' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists C'. (* Goal: @Par Tn C' E' C E *) (* Goal: @Col Tn C' E' D' *) (* Goal: and (@Col Tn C' X A) (@Col Tn C' Y B) *) split; Col. (* Goal: @Par Tn C' E' C E *) (* Goal: @Col Tn C' E' D' *) apply (col_par_par_col C E D); Col ; Par. (* Goal: @Par Tn C' E' C E *) Par. Qed. Lemma l13_19_par : forall A B C D A' B' C' D' X Y, X <> A -> X <> A' -> X <> C -> X <> C'-> Y <> B -> Y <> B' -> Y <> D -> Y <> D' -> Col X A C -> Col X A A' -> Col X A C' -> Col Y B D -> Col Y B B' -> Col Y B D' -> Par_strict X A Y B -> Par A B A' B' -> Par A D A' D' -> Par B C B' C' -> Par C D C' D'. Proof. (* Goal: forall (A B C D A' B' C' D' X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) X A)) (_ : not (@eq (@Tpoint Tn) X A')) (_ : not (@eq (@Tpoint Tn) X C)) (_ : not (@eq (@Tpoint Tn) X C')) (_ : not (@eq (@Tpoint Tn) Y B)) (_ : not (@eq (@Tpoint Tn) Y B')) (_ : not (@eq (@Tpoint Tn) Y D)) (_ : not (@eq (@Tpoint Tn) Y D')) (_ : @Col Tn X A C) (_ : @Col Tn X A A') (_ : @Col Tn X A C') (_ : @Col Tn Y B D) (_ : @Col Tn Y B B') (_ : @Col Tn Y B D') (_ : @Par_strict Tn X A Y B) (_ : @Par Tn A B A' B') (_ : @Par Tn A D A' D') (_ : @Par Tn B C B' C'), @Par Tn C D C' D' *) intros. (* Goal: @Par Tn C D C' D' *) induction(eq_dec_points A C). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) subst C. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) assert(Par A' B' B' C'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: @Par Tn A' B' B' C' *) apply(par_trans _ _ A B); Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) induction H17. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: @Par Tn A D C' D' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: False *) apply H17. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A' B') (@Col Tn X B' C')) *) exists B'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: and (@Col Tn B' A' B') (@Col Tn B' B' C') *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) assert(A' = C'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: @eq (@Tpoint Tn) A' C' *) apply (l6_21 X A B' A'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: not (@Col Tn X A B') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: False *) apply H13. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists B'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) (* Goal: and (@Col Tn B' X A) (@Col Tn B' Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D C' D' *) subst C'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn A D A' D' *) Par. (* Goal: @Par Tn C D C' D' *) induction(eq_dec_points B D). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) subst D. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) assert(Par A' B' A' D'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: @Par Tn A' B' A' D' *) apply(par_trans _ _ A B); Par. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) induction H18. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: @Par Tn C B C' D' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: False *) apply H18. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A' B') (@Col Tn X A' D')) *) exists A'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: and (@Col Tn A' A' B') (@Col Tn A' A' D') *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) assert(B' = D'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: @eq (@Tpoint Tn) B' D' *) apply (l6_21 Y B A' B'); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: not (@Col Tn Y B A') *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: False *) apply H13. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists A'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) (* Goal: and (@Col Tn A' X A) (@Col Tn A' Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' D' *) subst D'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C B C' B' *) Par. (* Goal: @Par Tn C D C' D' *) induction(eq_dec_points A A'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) subst A'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) induction H14. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H14. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A B')) *) exists A. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: and (@Col Tn A A B) (@Col Tn A A B') *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) assert(B = B'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @eq (@Tpoint Tn) B B' *) apply (l6_21 Y B A B); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: not (@Col Tn Y B A) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H13. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists A. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: and (@Col Tn A X A) (@Col Tn A Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) subst B'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) assert(C = C'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @eq (@Tpoint Tn) C C' *) induction H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @eq (@Tpoint Tn) C C' *) (* Goal: @eq (@Tpoint Tn) C C' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @eq (@Tpoint Tn) C C' *) (* Goal: False *) apply H16. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @eq (@Tpoint Tn) C C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C) (@Col Tn X B C')) *) exists B. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @eq (@Tpoint Tn) C C' *) (* Goal: and (@Col Tn B B C) (@Col Tn B B C') *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @eq (@Tpoint Tn) C C' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @eq (@Tpoint Tn) C C' *) apply (l6_21 X A B C); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: not (@Col Tn X A B) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H13. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists B. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) (* Goal: and (@Col Tn B X A) (@Col Tn B Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) subst C'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C D' *) assert(D = D'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C D' *) (* Goal: @eq (@Tpoint Tn) D D' *) induction H15. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C D' *) (* Goal: @eq (@Tpoint Tn) D D' *) (* Goal: @eq (@Tpoint Tn) D D' *) apply False_ind. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C D' *) (* Goal: @eq (@Tpoint Tn) D D' *) (* Goal: False *) apply H15. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C D' *) (* Goal: @eq (@Tpoint Tn) D D' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A D) (@Col Tn X A D')) *) exists A. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C D' *) (* Goal: @eq (@Tpoint Tn) D D' *) (* Goal: and (@Col Tn A A D) (@Col Tn A A D') *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C D' *) (* Goal: @eq (@Tpoint Tn) D D' *) spliter. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C D' *) (* Goal: @eq (@Tpoint Tn) D D' *) apply (l6_21 Y B A D); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C D' *) (* Goal: not (@Col Tn Y B A) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C D' *) (* Goal: False *) apply H13. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists A. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C D' *) (* Goal: and (@Col Tn A X A) (@Col Tn A Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C D' *) subst D'. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C D *) auto. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C D *) apply par_reflexivity. (* Goal: @Par Tn C D C' D' *) (* Goal: not (@eq (@Tpoint Tn) C D) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) subst D. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) clean_trivial_hyps. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H13. (* Goal: @Par Tn C D C' D' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists C. (* Goal: @Par Tn C D C' D' *) (* Goal: and (@Col Tn C X A) (@Col Tn C Y B) *) split; Col. (* Goal: @Par Tn C D C' D' *) induction(par_dec C D C' D'). (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) auto. (* Goal: @Par Tn C D C' D' *) assert(HH:=not_par_one_not_par C D C' D' A B H20). (* Goal: @Par Tn C D C' D' *) induction HH. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D C' D' *) eapply (l13_19_par_aux A B C D A' B' C' D' X Y); Col. (* Goal: @Par Tn C D C' D' *) (* Goal: not (@Par Tn A B C D) *) intro. (* Goal: @Par Tn C D C' D' *) (* Goal: False *) apply H21. (* Goal: @Par Tn C D C' D' *) (* Goal: @Par Tn C D A B *) Par. (* Goal: @Par Tn C D C' D' *) apply par_distincts in H14. (* Goal: @Par Tn C D C' D' *) spliter. (* Goal: @Par Tn C D C' D' *) apply par_symmetry. (* Goal: @Par Tn C' D' C D *) eapply (l13_19_par_aux A' B' C' D' A B C D X Y); sfinish. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) intro. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: False *) subst C'. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: False *) apply H17. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: @eq (@Tpoint Tn) A C *) apply (l6_21 X A B A); finish. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: @Col Tn B A C *) (* Goal: not (@Col Tn X A B) *) intro. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: @Col Tn B A C *) (* Goal: False *) apply H13. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: @Col Tn B A C *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists B. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: @Col Tn B A C *) (* Goal: and (@Col Tn B X A) (@Col Tn B Y B) *) split; Col. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: @Col Tn B A C *) assert(Par B C B A). (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: @Col Tn B A C *) (* Goal: @Par Tn B C B A *) apply(par_trans _ _ A' B');finish. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: @Col Tn B A C *) induction H24. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: @Col Tn B A C *) (* Goal: @Col Tn B A C *) apply False_ind. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: @Col Tn B A C *) (* Goal: False *) apply H24. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: @Col Tn B A C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C) (@Col Tn X B A)) *) exists B. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: @Col Tn B A C *) (* Goal: and (@Col Tn B B C) (@Col Tn B B A) *) split; Col. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: @Col Tn B A C *) spliter. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) (* Goal: @Col Tn B A C *) Col. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: not (@eq (@Tpoint Tn) B' D') *) intro. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: False *) apply H18. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: @eq (@Tpoint Tn) B D *) subst D'. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: @eq (@Tpoint Tn) B D *) assert(Par A D A B). (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: @eq (@Tpoint Tn) B D *) (* Goal: @Par Tn A D A B *) apply(par_trans _ _ A' B'); Par. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: @eq (@Tpoint Tn) B D *) apply (l6_21 Y B A B); Col. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: @Col Tn A B D *) (* Goal: not (@Col Tn Y B A) *) intro. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: @Col Tn A B D *) (* Goal: False *) apply H13. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: @Col Tn A B D *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists A. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: @Col Tn A B D *) (* Goal: and (@Col Tn A X A) (@Col Tn A Y B) *) split; Col. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: @Col Tn A B D *) induction H24. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: @Col Tn A B D *) (* Goal: @Col Tn A B D *) apply False_ind. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: @Col Tn A B D *) (* Goal: False *) apply H24. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: @Col Tn A B D *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A D) (@Col Tn X A B)) *) exists A. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: @Col Tn A B D *) (* Goal: and (@Col Tn A A D) (@Col Tn A A B) *) split; Col. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: @Col Tn A B D *) spliter. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) (* Goal: @Col Tn A B D *) Col. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) unfold Par_strict in H13. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) spliter. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Par_strict Tn X A' Y B' *) unfold Par_strict. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: and (not (@eq (@Tpoint Tn) X A')) (and (not (@eq (@Tpoint Tn) Y B')) (and (@Coplanar Tn X A' Y B') (not (@ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A') (@Col Tn X0 Y B')))))) *) repeat split; auto; try apply all_coplanar. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: not (@ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A') (@Col Tn X0 Y B'))) *) intro. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: False *) apply H26. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) ex_and H27 P. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X A) (@Col Tn X0 Y B)) *) exists P. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: and (@Col Tn P X A) (@Col Tn P Y B) *) split. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Col Tn P Y B *) (* Goal: @Col Tn P X A *) ColR. (* Goal: not (@Par Tn A' B' C' D') *) (* Goal: @Col Tn P Y B *) ColR. (* Goal: not (@Par Tn A' B' C' D') *) intro. (* Goal: False *) apply H21. (* Goal: @Par Tn C' D' A B *) apply (par_trans _ _ A' B'); Par. Qed. End Desargues_Hessenberg.
From Coq Require Import ssreflect ssrbool ssrfun. From mathcomp Require Import ssrnat eqtype seq path. From fcsl Require Import ordtype finmap pcm. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Module UM. Section UM. Variables (K : ordType) (V : Type) (p : pred K). Inductive base := Undef | Def (f : {finMap K -> V}) of all p (supp f). Section FormationLemmas. Variable (f g : {finMap K -> V}). Lemma all_supp_insP k v : p k -> all p (supp f) -> all p (supp (ins k v f)). Proof. (* Goal: forall (_ : is_true (p k)) (_ : is_true (@all (Ordered.sort K) p (@supp K V f))), is_true (@all (Ordered.sort K) p (@supp K V (@ins K V k v f))) *) move=>H1 H2; apply/allP=>x; rewrite supp_ins inE /=. (* Goal: forall _ : is_true (orb (@eq_op (Ordered.eqType K) x k) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f)))), is_true (p x) *) by case: eqP=>[->|_] //=; move/(allP H2). Qed. Lemma all_supp_remP k : all p (supp f) -> all p (supp (rem k f)). Proof. (* Goal: forall _ : is_true (@all (Ordered.sort K) p (@supp K V f)), is_true (@all (Ordered.sort K) p (@supp K V (@rem K V k f))) *) move=>H; apply/allP=>x; rewrite supp_rem inE /=. (* Goal: forall _ : is_true (andb (negb (@eq_op (Ordered.eqType K) x k)) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f)))), is_true (p x) *) by case: eqP=>[->|_] //=; move/(allP H). Qed. Lemma all_supp_fcatP : all p (supp f) -> all p (supp g) -> all p (supp (fcat f g)). Proof. (* Goal: forall (_ : is_true (@all (Ordered.sort K) p (@supp K V f))) (_ : is_true (@all (Ordered.sort K) p (@supp K V g))), is_true (@all (Ordered.sort K) p (@supp K V (@fcat K V f g))) *) move=>H1 H2; apply/allP=>x; rewrite supp_fcat inE /=. (* Goal: forall _ : is_true (orb (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f))) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V g)))), is_true (p x) *) by case/orP; [move/(allP H1) | move/(allP H2)]. Qed. Lemma all_supp_kfilterP q : all p (supp f) -> all p (supp (kfilter q f)). Proof. (* Goal: forall _ : is_true (@all (Ordered.sort K) p (@supp K V f)), is_true (@all (Ordered.sort K) p (@supp K V (@kfilter K V q f))) *) move=>H; apply/allP=>x; rewrite supp_kfilt mem_filter. (* Goal: forall _ : is_true (andb (q x) (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f)))), is_true (p x) *) by case/andP=>_ /(allP H). Qed. End FormationLemmas. Implicit Types (k : K) (v : V) (f g : base). Lemma umapE (f g : base) : f = g <-> match f, g with Def f' pf, Def g' pg => f' = g' | Undef, Undef => true | _, _ => false end. Proof. (* Goal: iff (@eq base f g) match f with | Undef => match g with | Undef => is_true true | @Def f i => is_true false end | @Def f' pf => match g with | Undef => is_true false | @Def g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) split; first by move=>->; case: g. (* Goal: forall _ : match f with | Undef => match g with | Undef => is_true true | @Def f i => is_true false end | @Def f' pf => match g with | Undef => is_true false | @Def g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end, @eq base f g *) case: f; case: g=>// f pf g pg E; rewrite {g}E in pg *. by congr Def; apply: bool_irrelevance. Qed. Qed. Definition valid f := if f is Def _ _ then true else false. Definition empty := @Def (finmap.nil K V) is_true_true. Definition upd k v f := if f is Def fs fpf then if decP (@idP (p k)) is left pf then Def (all_supp_insP v pf fpf) else Undef else Undef. Definition dom f : seq K := if f is Def fs _ then supp fs else [::]. Definition dom_eq f1 f2 := match f1, f2 with Def fs1 _, Def fs2 _ => supp fs1 == supp fs2 | Undef, Undef => true | _, _ => false end. Definition free k f := if f is Def fs pf then Def (all_supp_remP k pf) else Undef. Definition find k f := if f is Def fs _ then fnd k fs else None. Definition union f1 f2 := if (f1, f2) is (Def fs1 pf1, Def fs2 pf2) then if disj fs1 fs2 then Def (all_supp_fcatP pf1 pf2) else Undef else Undef. Definition um_filter q f := if f is Def fs pf then Def (all_supp_kfilterP q pf) else Undef. Definition empb f := if f is Def fs _ then supp fs == [::] else false. Definition undefb f := if f is Undef then true else false. Definition pts k v := upd k v empty. Lemma base_indf (P : base -> Prop) : P Undef -> P empty -> (forall k v f, P f -> valid (union (pts k v) f) -> path ord k (dom f) -> P (union (pts k v) f)) -> forall f, P f. Lemma base_indb (P : base -> Prop) : P Undef -> P empty -> (forall k v f, P f -> valid (union (pts k v) f) -> (forall x, x \in dom f -> ord x k) -> P (union (pts k v) f)) -> forall f, P f. End UM. End UM. Module UMC. Section MixinDef. Variables (K : ordType) (V : Type) (p : pred K). Structure mixin_of (T : Type) := Mixin { defined_op : T -> bool; empty_op : T; undef_op : T; upd_op : K -> V -> T -> T; dom_op : T -> seq K; dom_eq_op : T -> T -> bool; free_op : K -> T -> T; find_op : K -> T -> option V; union_op : T -> T -> T; um_filter_op : pred K -> T -> T; empb_op : T -> bool; undefb_op : T -> bool; pts_op : K -> V -> T; from_op : T -> UM.base V p; to_op : UM.base V p -> T; _ : forall b, from_op (to_op b) = b; _ : forall f, to_op (from_op f) = f; _ : forall f, defined_op f = UM.valid (from_op f); _ : undef_op = to_op (UM.Undef V p); _ : empty_op = to_op (UM.empty V p); _ : forall k v f, upd_op k v f = to_op (UM.upd k v (from_op f)); _ : forall f, dom_op f = UM.dom (from_op f); _ : forall f1 f2, dom_eq_op f1 f2 = UM.dom_eq (from_op f1) (from_op f2); _ : forall k f, free_op k f = to_op (UM.free k (from_op f)); _ : forall k f, find_op k f = UM.find k (from_op f); _ : forall f1 f2, union_op f1 f2 = to_op (UM.union (from_op f1) (from_op f2)); _ : forall q f, um_filter_op q f = to_op (UM.um_filter q (from_op f)); _ : forall f, empb_op f = UM.empb (from_op f); _ : forall f, undefb_op f = UM.undefb (from_op f); _ : forall k v, pts_op k v = to_op (UM.pts p k v)}. End MixinDef. Section ClassDef. Variables (K : ordType) (V : Type). Structure class_of (T : Type) := Class { p : pred K; mixin : mixin_of V p T}. Structure type : Type := Pack {sort : Type; _ : 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. Definition pack p (m : @mixin_of K V p T) := @Pack T (@Class T p m). Definition cond := [pred x : K | @p _ class x]. Definition from := from_op (mixin class). Definition to := to_op (mixin class). Definition defined := defined_op (mixin class). Definition um_undef := undef_op (mixin class). Definition empty := empty_op (mixin class). Definition upd : K -> V -> cT -> cT := upd_op (mixin class). Definition dom : cT -> seq K := dom_op (mixin class). Definition dom_eq := dom_eq_op (mixin class). Definition free : K -> cT -> cT := free_op (mixin class). Definition find : K -> cT -> option V := find_op (mixin class). Definition union := union_op (mixin class). Definition um_filter : pred K -> cT -> cT := um_filter_op (mixin class). Definition empb := empb_op (mixin class). Definition undefb := undefb_op (mixin class). Definition pts : K -> V -> cT := pts_op (mixin class). End ClassDef. Arguments um_undef [K V cT]. Arguments empty [K V cT]. Arguments pts [K V cT] _ _. Prenex Implicits to um_undef empty pts. Section Lemmas. Variables (K : ordType) (V : Type) (U : type K V). Local Coercion sort : type >-> Sortclass. Implicit Type f : U. Lemma ftE (b : UM.base V (cond U)) : from (to b) = b. Proof. (* Goal: @eq (@UM.base K V (@p K V (@sort K V U) (@class K V U))) (@from K V U (@to K V U b)) b *) by case: U b=>x [p][*]. Qed. Lemma tfE f : to (from f) = f. Proof. (* Goal: @eq (@sort K V U) (@to K V U (@from K V U f)) f *) by case: U f=>x [p][*]. Qed. Lemma eqE (b1 b2 : UM.base V (cond U)) : Proof. (* Goal: iff (@eq (@sort K V U) (@to K V U b1) (@to K V U b2)) (@eq (@UM.base K V (@pred_of_simpl (Ordered.sort K) (@cond K V U))) b1 b2) *) by split=>[E|-> //]; rewrite -[b1]ftE -[b2]ftE E. Qed. Lemma defE f : defined f = UM.valid (from f). Proof. (* Goal: @eq bool (@defined K V U f) (@UM.valid K V (@p K V (@sort K V U) (@class K V U)) (@from K V U f)) *) by case: U f=>x [p][*]. Qed. Lemma undefE : um_undef = to (UM.Undef V (cond U)). Proof. (* Goal: @eq (@sort K V U) (@um_undef K V U) (@to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@cond K V U)))) *) by case: U=>x [p][*]. Qed. Lemma emptyE : empty = to (UM.empty V (cond U)). Proof. (* Goal: @eq (@sort K V U) (@empty K V U) (@to K V U (@UM.empty K V (@pred_of_simpl (Ordered.sort K) (@cond K V U)))) *) by case: U=>x [p][*]. Qed. Lemma updE k v f : upd k v f = to (UM.upd k v (from f)). Proof. (* Goal: @eq (@sort K V U) (@upd K V U k v f) (@to K V U (@UM.upd K V (@p K V (@sort K V U) (@class K V U)) k v (@from K V U f))) *) by case: U k v f=>x [p][*]. Qed. Lemma domE f : dom f = UM.dom (from f). Proof. (* Goal: @eq (list (Ordered.sort K)) (@dom K V U f) (@UM.dom K V (@p K V (@sort K V U) (@class K V U)) (@from K V U f)) *) by case: U f=>x [p][*]. Qed. Lemma dom_eqE f1 f2 : dom_eq f1 f2 = UM.dom_eq (from f1) (from f2). Proof. (* Goal: @eq bool (@dom_eq K V U f1 f2) (@UM.dom_eq K V (@p K V (@sort K V U) (@class K V U)) (@from K V U f1) (@from K V U f2)) *) by case: U f1 f2=>x [p][*]. Qed. Lemma freeE k f : free k f = to (UM.free k (from f)). Proof. (* Goal: @eq (@sort K V U) (@free K V U k f) (@to K V U (@UM.free K V (@p K V (@sort K V U) (@class K V U)) k (@from K V U f))) *) by case: U k f=>x [p][*]. Qed. Lemma findE k f : find k f = UM.find k (from f). Proof. (* Goal: @eq (option V) (@find K V U k f) (@UM.find K V (@p K V (@sort K V U) (@class K V U)) k (@from K V U f)) *) by case: U k f=>x [p][*]. Qed. Lemma unionE f1 f2 : union f1 f2 = to (UM.union (from f1) (from f2)). Proof. (* Goal: @eq (@sort K V U) (@union K V U f1 f2) (@to K V U (@UM.union K V (@p K V (@sort K V U) (@class K V U)) (@from K V U f1) (@from K V U f2))) *) by case: U f1 f2=>x [p][*]. Qed. Lemma um_filterE q f : um_filter q f = to (UM.um_filter q (from f)). Proof. (* Goal: @eq (@sort K V U) (@um_filter K V U q f) (@to K V U (@UM.um_filter K V (@p K V (@sort K V U) (@class K V U)) q (@from K V U f))) *) by case: U q f=>x [p][*]. Qed. Lemma empbE f : empb f = UM.empb (from f). Proof. (* Goal: @eq bool (@empb K V U f) (@UM.empb K V (@p K V (@sort K V U) (@class K V U)) (@from K V U f)) *) by case: U f=>x [p][*]. Qed. Lemma undefbE f : undefb f = UM.undefb (from f). Proof. (* Goal: @eq bool (@undefb K V U f) (@UM.undefb K V (@p K V (@sort K V U) (@class K V U)) (@from K V U f)) *) by case: U f=>x [p][*]. Qed. Lemma ptsE k v : pts k v = to (UM.pts (cond U) k v). Proof. (* Goal: @eq (@sort K V U) (@pts K V U k v) (@to K V U (@UM.pts K V (@pred_of_simpl (Ordered.sort K) (@cond K V U)) k v)) *) by case: U k v=>x [p][*]. Qed. End Lemmas. Module Exports. Coercion sort : type >-> Sortclass. Notation union_map_class := type. Notation UMCMixin := Mixin. Notation UMC T m := (@pack _ _ T _ m). Notation "[ 'umcMixin' 'of' T ]" := (mixin (class _ _ _ : class_of T)) (at level 0, format "[ 'umcMixin' 'of' T ]") : form_scope. Notation "[ 'um_class' 'of' T 'for' C ]" := (@clone _ _ T C _ id) (at level 0, format "[ 'um_class' 'of' T 'for' C ]") : form_scope. Notation "[ 'um_class' 'of' T ]" := (@clone _ _ T _ _ id) (at level 0, format "[ 'um_class' 'of' T ]") : form_scope. Notation cond := cond. Notation um_undef := um_undef. Notation upd := upd. Notation dom := dom. Notation dom_eq := dom_eq. Notation free := free. Notation find := find. Notation um_filter := um_filter. Notation empb := empb. Notation undefb := undefb. Notation pts := pts. Definition umEX := (ftE, tfE, eqE, undefE, defE, emptyE, updE, domE, dom_eqE, freeE, findE, unionE, um_filterE, empbE, undefbE, ptsE, UM.umapE). End Exports. End UMC. Export UMC.Exports. Module UnionMapClassPCM. Section UnionMapClassPCM. Variables (K : ordType) (V : Type) (U : union_map_class K V). Implicit Type f : U. Local Notation "f1 \+ f2" := (@UMC.union _ _ _ f1 f2) (at level 43, left associativity). Local Notation valid := (@UMC.defined _ _ U). Local Notation unit := (@UMC.empty _ _ U). Lemma joinC f1 f2 : f1 \+ f2 = f2 \+ f1. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.union K V U f1 f2) (@UMC.union K V U f2 f1) *) rewrite !umEX /UM.union. (* Goal: match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => match match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) case: (UMC.from f1)=>[|f1' H1]; case: (UMC.from f2)=>[|f2' H2] //. (* Goal: match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' H1 H2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => match (if @disj K V f2' f1' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' f1') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' f1' H2 H1) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match (if @disj K V f2' f1' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' f1') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' f1' H2 H1) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) by case: ifP=>E; rewrite disjC E // fcatC. Qed. Lemma joinCA f1 f2 f3 : f1 \+ (f2 \+ f3) = f2 \+ (f1 \+ f3). Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.union K V U f1 (@UMC.union K V U f2 f3)) (@UMC.union K V U f2 (@UMC.union K V U f1 f3)) *) rewrite !umEX /UM.union /=. (* Goal: match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => match @UMC.from K V U f3 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs3 pf3 => if @disj K V fs2 fs3 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs2 fs3) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs2 fs3 pf2 pf3) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => match match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => match @UMC.from K V U f3 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs3 pf3 => if @disj K V fs2 fs3 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs2 fs3) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs2 fs3 pf2 pf3) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => match @UMC.from K V U f3 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs3 pf3 => if @disj K V fs2 fs3 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs2 fs3) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs2 fs3 pf2 pf3) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) case: (UMC.from f1) (UMC.from f2) (UMC.from f3)=>[|f1' H1][|f2' H2][|f3' H3] //. (* Goal: match match (if @disj K V f2' f3' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' f3') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' f3' H2 H3) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V f1' fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' fs2 H1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => match match (if @disj K V f1' f3' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f3') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f3' H1 H3) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V f2' fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' fs2 H2 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match match (if @disj K V f1' f3' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f3') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f3' H1 H3) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V f2' fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' fs2 H2 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) case E1: (disj f2' f3'); last first. (* Goal: match (if @disj K V f1' (@fcat K V f2' f3') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@fcat K V f2' f3')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@fcat K V f2' f3') H1 (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' f3' H2 H3)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => match match (if @disj K V f1' f3' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f3') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f3' H1 H3) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V f2' fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' fs2 H2 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match match (if @disj K V f1' f3' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f3') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f3' H1 H3) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V f2' fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' fs2 H2 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) (* Goal: match match (if @disj K V f1' f3' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f3') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f3' H1 H3) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V f2' fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' fs2 H2 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end *) - (* Goal: match (if @disj K V f1' (@fcat K V f2' f3') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@fcat K V f2' f3')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@fcat K V f2' f3') H1 (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' f3' H2 H3)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => match match (if @disj K V f1' f3' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f3') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f3' H1 H3) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V f2' fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' fs2 H2 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match match (if @disj K V f1' f3' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f3') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f3' H1 H3) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V f2' fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' fs2 H2 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) (* Goal: match match (if @disj K V f1' f3' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f3') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f3' H1 H3) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V f2' fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' fs2 H2 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end *) by case E2: (disj f1' f3')=>//; rewrite disj_fcat E1 andbF. (* Goal: match (if @disj K V f1' (@fcat K V f2' f3') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@fcat K V f2' f3')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@fcat K V f2' f3') H1 (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' f3' H2 H3)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => match match (if @disj K V f1' f3' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f3') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f3' H1 H3) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V f2' fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' fs2 H2 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match match (if @disj K V f1' f3' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f3') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f3' H1 H3) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V f2' fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' fs2 H2 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) rewrite disj_fcat andbC. (* Goal: match (if andb (@disj K V f1' f3') (@disj K V f1' f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@fcat K V f2' f3')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@fcat K V f2' f3') H1 (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' f3' H2 H3)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => match match (if @disj K V f1' f3' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f3') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f3' H1 H3) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V f2' fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' fs2 H2 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match match (if @disj K V f1' f3' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f3') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f3' H1 H3) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V f2' fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' fs2 H2 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) case E2: (disj f1' f3')=>//; rewrite disj_fcat (disjC f2') E1 /= andbT. (* Goal: match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@fcat K V f2' f3')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@fcat K V f2' f3') H1 (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' f3' H2 H3)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' (@fcat K V f1' f3')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' (@fcat K V f1' f3') H2 (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f3' H1 H3)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' (@fcat K V f1' f3')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' (@fcat K V f1' f3') H2 (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f3' H1 H3)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) by case E3: (disj f1' f2')=>//; rewrite fcatAC // E1 E2 E3. Qed. Lemma joinA f1 f2 f3 : f1 \+ (f2 \+ f3) = (f1 \+ f2) \+ f3. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.union K V U f1 (@UMC.union K V U f2 f3)) (@UMC.union K V U (@UMC.union K V U f1 f2) f3) *) by rewrite (joinC f2) joinCA joinC. Qed. Lemma validL f1 f2 : valid (f1 \+ f2) -> valid f1. Proof. (* Goal: forall _ : is_true (@UMC.defined K V U (@UMC.union K V U f1 f2)), is_true (@UMC.defined K V U f1) *) by rewrite !umEX; case: (UMC.from f1). Qed. Lemma unitL f : unit \+ f = f. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.union K V U (@UMC.empty K V U) f) f *) rewrite -[f]UMC.tfE !umEX /UM.union /UM.empty. (* Goal: match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V (nil K V) fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (nil K V) fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (nil K V) fs2 is_true_true pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => match @UMC.from K V U f with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match @UMC.from K V U f with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) by case: (UMC.from f)=>[//|f' H]; rewrite disjC disj_nil fcat0s. Qed. Lemma validU : valid unit. Proof. (* Goal: is_true (@UMC.defined K V U (@UMC.empty K V U)) *) by rewrite !umEX. Qed. End UnionMapClassPCM. Module Exports. Section Exports. Variables (K : ordType) (V : Type) (U : union_map_class K V). Definition union_map_classPCMMix := PCMMixin (@joinC K V U) (@joinA K V U) (@unitL K V U) (@validL K V U) (validU U). Canonical union_map_classPCM := Eval hnf in PCM U union_map_classPCMMix. End Exports. End Exports. End UnionMapClassPCM. Export UnionMapClassPCM.Exports. Module UnionMapClassCPCM. Section Cancelativity. Variables (K : ordType) (V : Type) (U : union_map_class K V). Implicit Type f : U. Lemma joinKf f1 f2 f : valid (f1 \+ f) -> f1 \+ f = f2 \+ f -> f1 = f2. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f))) (_ : @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) f1 f) (@PCM.join (@union_map_classPCM K V U) f2 f)), @eq (@UMC.sort K V U) f1 f2 *) rewrite -{3}[f1]UMC.tfE -{2}[f2]UMC.tfE !pcmE /= !umEX /UM.valid /UM.union. (* Goal: forall (_ : is_true match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end) (_ : match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => match match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end), match @UMC.from K V U f1 with | @UM.Undef _ _ _ => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) case: (UMC.from f) (UMC.from f1) (UMC.from f2)=> [|f' H]; case=>[|f1' H1]; case=>[|f2' H2] //; case: ifP=>//; case: ifP=>// D1 D2 _ E. (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f1' f2' *) by apply: fcatsK E; rewrite D1 D2. Qed. End Cancelativity. Module Exports. Section Exports. Variables (K : ordType) (V : Type) (U : union_map_class K V). Definition union_map_classCPCMMix := CPCMMixin (@joinKf K V U). Canonical union_map_classCPCM := Eval hnf in CPCM U union_map_classCPCMMix. End Exports. End Exports. End UnionMapClassCPCM. Export UnionMapClassCPCM.Exports. Module UnionMapEq. Section UnionMapEq. Variables (K : ordType) (V : eqType) (p : pred K). Variables (T : Type) (m : @UMC.mixin_of K V p T). Definition unionmap_eq (f1 f2 : UMC T m) := match (UMC.from f1), (UMC.from f2) with | UM.Undef, UM.Undef => true | UM.Def f1' pf1, UM.Def f2' pf2 => f1' == f2' | _, _ => false end. Lemma unionmap_eqP : Equality.axiom unionmap_eq. Proof. (* Goal: @Equality.axiom (@UMC.sort K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m)) unionmap_eq *) move=>x y; rewrite -{1}[x]UMC.tfE -{1}[y]UMC.tfE /unionmap_eq. (* Goal: Bool.reflect (@eq (@UMC.sort K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UMC.from K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) x)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UMC.from K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) y))) match @UMC.from K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) x with | @UM.Undef _ _ _ => match @UMC.from K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) y with | @UM.Undef _ _ _ => true | @UM.Def _ _ _ f i => false end | @UM.Def _ _ _ f1' pf1 => match @UMC.from K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) y with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f2' pf2 => @eq_op (fmap_eqType K V) f1' f2' end end *) case: (UMC.from x)=>[|f1 H1]; case: (UMC.from y)=>[|f2 H2] /=. (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f1 H1)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f2 H2))) (@eq_op (fmap_eqType K V) f1 f2) *) (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f1 H1)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Undef K (Equality.sort V) p))) false *) (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Undef K (Equality.sort V) p)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f2 H2))) false *) (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Undef K (Equality.sort V) p)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Undef K (Equality.sort V) p))) true *) - (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f1 H1)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f2 H2))) (@eq_op (fmap_eqType K V) f1 f2) *) (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f1 H1)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Undef K (Equality.sort V) p))) false *) (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Undef K (Equality.sort V) p)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f2 H2))) false *) (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Undef K (Equality.sort V) p)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Undef K (Equality.sort V) p))) true *) by constructor. (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f1 H1)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f2 H2))) (@eq_op (fmap_eqType K V) f1 f2) *) (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f1 H1)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Undef K (Equality.sort V) p))) false *) (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Undef K (Equality.sort V) p)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f2 H2))) false *) - (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f1 H1)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f2 H2))) (@eq_op (fmap_eqType K V) f1 f2) *) (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f1 H1)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Undef K (Equality.sort V) p))) false *) (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Undef K (Equality.sort V) p)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f2 H2))) false *) by constructor; move/(@UMC.eqE _ _ (UMC T m)). (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f1 H1)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f2 H2))) (@eq_op (fmap_eqType K V) f1 f2) *) (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f1 H1)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Undef K (Equality.sort V) p))) false *) - (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f1 H1)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f2 H2))) (@eq_op (fmap_eqType K V) f1 f2) *) (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f1 H1)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Undef K (Equality.sort V) p))) false *) by constructor; move/(@UMC.eqE _ _ (UMC T m)). (* Goal: Bool.reflect (@eq T (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f1 H1)) (@UMC.to K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m) (@UM.Def K (Equality.sort V) p f2 H2))) (@eq_op (fmap_eqType K V) f1 f2) *) case: eqP=>E; constructor; rewrite (@UMC.eqE _ _ (UMC T m)). (* Goal: not (@eq (@UM.base K (Equality.sort V) (@pred_of_simpl (Ordered.sort K) (@UMC.cond K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m)))) (@UM.Def K (Equality.sort V) p f1 H1) (@UM.Def K (Equality.sort V) p f2 H2)) *) (* Goal: @eq (@UM.base K (Equality.sort V) (@pred_of_simpl (Ordered.sort K) (@UMC.cond K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m)))) (@UM.Def K (Equality.sort V) p f1 H1) (@UM.Def K (Equality.sort V) p f2 H2) *) - (* Goal: not (@eq (@UM.base K (Equality.sort V) (@pred_of_simpl (Ordered.sort K) (@UMC.cond K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m)))) (@UM.Def K (Equality.sort V) p f1 H1) (@UM.Def K (Equality.sort V) p f2 H2)) *) (* Goal: @eq (@UM.base K (Equality.sort V) (@pred_of_simpl (Ordered.sort K) (@UMC.cond K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m)))) (@UM.Def K (Equality.sort V) p f1 H1) (@UM.Def K (Equality.sort V) p f2 H2) *) by rewrite UM.umapE. (* Goal: not (@eq (@UM.base K (Equality.sort V) (@pred_of_simpl (Ordered.sort K) (@UMC.cond K (Equality.sort V) (@UMC.pack K (Equality.sort V) T p m)))) (@UM.Def K (Equality.sort V) p f1 H1) (@UM.Def K (Equality.sort V) p f2 H2)) *) by case. Qed. End UnionMapEq. Module Exports. Section Exports. Variables (K : ordType) (V : eqType) (p : pred K). Variables (T : Type) (m : @UMC.mixin_of K V p T). Definition union_map_class_eqMix := EqMixin (@unionmap_eqP K V p T m). End Exports. End Exports. End UnionMapEq. Export UnionMapEq.Exports. Section DomLemmas. Variables (K : ordType) (V : Type) (U : union_map_class K V). Implicit Types (k : K) (v : V) (f g : U). Lemma dom_undef : dom (um_undef : U) = [::]. Proof. (* Goal: @eq (list (Ordered.sort K)) (@UMC.dom K V U (@UMC.um_undef K V U : @UMC.sort K V U)) (@Datatypes.nil (Ordered.sort K)) *) by rewrite !umEX. Qed. Lemma dom0 : dom (Unit : U) = [::]. Proof. (* Goal: @eq (list (Ordered.sort K)) (@UMC.dom K V U (@PCM.unit (@union_map_classPCM K V U) : @UMC.sort K V U)) (@Datatypes.nil (Ordered.sort K)) *) by rewrite pcmE /= !umEX. Qed. Lemma dom0E f : valid f -> dom f =i pred0 -> f = Unit. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f)) (_ : @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)) (@mem (Equality.sort (Ordered.eqType K)) (simplPredType (Equality.sort (Ordered.eqType K))) (@pred0 (Equality.sort (Ordered.eqType K))))), @eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)) *) rewrite !pcmE /= !umEX /UM.valid /UM.dom /UM.empty -{3}[f]UMC.tfE. (* Goal: forall (_ : is_true match @UMC.from K V U f with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end) (_ : @eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end) (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@pred0 (Ordered.sort K)))), @eq (@UMC.sort K V U) (@UMC.to K V U (@UMC.from K V U f)) (@UMC.to K V U (@UM.Def K V (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U)) (nil K V) is_true_true)) *) case: (UMC.from f)=>[|f' S] //= _; rewrite !umEX fmapE /= {S}. (* Goal: forall _ : @eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f')) (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@pred0 (Ordered.sort K))), @eq (list (prod (Ordered.sort K) V)) (@seq_of K V f') (@Datatypes.nil (prod (Ordered.sort K) V)) *) by case: f'; case=>[|kv s] //= P /= /(_ kv.1); rewrite inE eq_refl. Qed. Lemma domU k v f : dom (upd k v f) =i [pred x | cond U k & if x == k then valid f else x \in dom f]. Proof. (* Goal: @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.upd K V U k v f))) (@mem (Equality.sort (Ordered.eqType K)) (simplPredType (Equality.sort (Ordered.eqType K))) (@SimplPred (Equality.sort (Ordered.eqType K)) (fun x : Equality.sort (Ordered.eqType K) => andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (if @eq_op (Ordered.eqType K) x k then @PCM.valid (@union_map_classPCM K V U) f else @in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) rewrite pcmE /= !umEX /UM.dom /UM.upd /UM.valid /= /cond. (* Goal: @eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k v pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end) (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => andb (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (if @eq_op (Ordered.eqType K) x k then match @UMC.from K V U f with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end else @in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end))))) *) case: (UMC.from f)=>[|f' H] /= x. (* Goal: @eq bool (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f') (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k v pf H) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end)) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => andb (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (if @eq_op (Ordered.eqType K) x k then true else @in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f'))))))) *) (* Goal: @eq bool (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K)))) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => andb (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (if @eq_op (Ordered.eqType K) x k then false else @in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K)))))))) *) - (* Goal: @eq bool (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f') (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k v pf H) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end)) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => andb (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (if @eq_op (Ordered.eqType K) x k then true else @in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f'))))))) *) (* Goal: @eq bool (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K)))) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => andb (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (if @eq_op (Ordered.eqType K) x k then false else @in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K)))))))) *) by rewrite !inE /= andbC; case: ifP. (* Goal: @eq bool (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f') (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k v pf H) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end)) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => andb (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (if @eq_op (Ordered.eqType K) x k then true else @in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f'))))))) *) case: decP; first by move=>->; rewrite supp_ins. (* Goal: forall _ : not (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)), @eq bool (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K)))) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => andb (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (if @eq_op (Ordered.eqType K) x k then true else @in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f'))))))) *) by move/(introF idP)=>->. Qed. Lemma domF k f : dom (free k f) =i [pred x | if k == x then false else x \in dom f]. Proof. (* Goal: @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.free K V U k f))) (@mem (Equality.sort (Ordered.eqType K)) (simplPredType (Equality.sort (Ordered.eqType K))) (@SimplPred (Equality.sort (Ordered.eqType K)) (fun x : Equality.sort (Ordered.eqType K) => if @eq_op (Ordered.eqType K) k x then false else @in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f))))) *) rewrite !umEX; case: (UMC.from f)=>[|f' H] x; rewrite inE /=; by case: ifP=>// E; rewrite supp_rem inE /= eq_sym E. Qed. Lemma domUn f1 f2 : dom (f1 \+ f2) =i [pred x | valid (f1 \+ f2) & (x \in dom f1) || (x \in dom f2)]. Proof. (* Goal: @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@PCM.join (@union_map_classPCM K V U) f1 f2))) (@mem (Equality.sort (Ordered.eqType K)) (simplPredType (Equality.sort (Ordered.eqType K))) (@SimplPred (Equality.sort (Ordered.eqType K)) (fun x : Equality.sort (Ordered.eqType K) => andb (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2)) (orb (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1))) (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))))))) *) rewrite !pcmE /= !umEX /UM.dom /UM.valid /UM.union. (* Goal: @eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end) (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => andb match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end (orb (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end)) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end)))))) *) case: (UMC.from f1) (UMC.from f2)=>[|f1' H1] // [|f2' H2] // x. (* Goal: @eq bool (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' H1 H2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end)) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => andb match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' H1 H2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end (orb (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1'))) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f2')))))))) *) by case: ifP=>E //; rewrite supp_fcat. Qed. Lemma dom_valid k f : k \in dom f -> valid f. Proof. (* Goal: forall _ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f))), is_true (@PCM.valid (@union_map_classPCM K V U) f) *) by rewrite pcmE /= !umEX; case: (UMC.from f). Qed. Lemma dom_cond k f : k \in dom f -> cond U k. Proof. (* Goal: forall _ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f))), is_true (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) *) by rewrite !umEX; case: (UMC.from f)=>[|f' F] // /(allP F). Qed. Lemma dom_inIL k f1 f2 : valid (f1 \+ f2) -> k \in dom f1 -> k \in dom (f1 \+ f2). Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))), is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@PCM.join (@union_map_classPCM K V U) f1 f2)))) *) by rewrite domUn inE => ->->. Qed. Lemma dom_inIR k f1 f2 : valid (f1 \+ f2) -> k \in dom f2 -> k \in dom (f1 \+ f2). Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@PCM.join (@union_map_classPCM K V U) f1 f2)))) *) by rewrite joinC; apply: dom_inIL. Qed. Lemma dom_NNL k f1 f2 : valid (f1 \+ f2) -> k \notin dom (f1 \+ f2) -> k \notin dom f1. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2))) (_ : is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@PCM.join (@union_map_classPCM K V U) f1 f2)))))), is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) *) by move=> D; apply/contra/dom_inIL. Qed. Lemma dom_NNR k f1 f2 : valid (f1 \+ f2) -> k \notin dom (f1 \+ f2) -> k \notin dom f2. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2))) (_ : is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@PCM.join (@union_map_classPCM K V U) f1 f2)))))), is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))) *) by move=> D; apply/contra/dom_inIR. Qed. Lemma dom_free k f : k \notin dom f -> free k f = f. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))), @eq (@UMC.sort K V U) (@UMC.free K V U k f) f *) rewrite -{3}[f]UMC.tfE !umEX /UM.dom /UM.free. (* Goal: forall _ : is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end))), match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k pf) end with | @UM.Undef _ _ _ => match @UMC.from K V U f with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match @UMC.from K V U f with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) by case: (UMC.from f)=>[|f' H] //; apply: rem_supp. Qed. CoInductive dom_find_spec k f : bool -> Type := | dom_find_none' : find k f = None -> dom_find_spec k f false | dom_find_some' v : find k f = Some v -> f = upd k v (free k f) -> dom_find_spec k f true. Lemma dom_find k f : dom_find_spec k f (k \in dom f). Proof. (* Goal: dom_find_spec k f (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f))) *) rewrite !umEX /UM.dom -{1}[f]UMC.tfE. (* Goal: dom_find_spec k (@UMC.to K V U (@UMC.from K V U f)) (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end)) *) case: (UMC.from f)=>[|f' H]. (* Goal: dom_find_spec k (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' H)) (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f'))) *) (* Goal: dom_find_spec k (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K)))) *) - (* Goal: dom_find_spec k (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' H)) (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f'))) *) (* Goal: dom_find_spec k (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K)))) *) by apply: dom_find_none'; rewrite !umEX. (* Goal: dom_find_spec k (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' H)) (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f'))) *) case: suppP (allP H k)=>[v|] H1 I; last first. (* Goal: dom_find_spec k (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' H)) true *) (* Goal: dom_find_spec k (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' H)) false *) - (* Goal: dom_find_spec k (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' H)) true *) (* Goal: dom_find_spec k (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' H)) false *) by apply: dom_find_none'; rewrite !umEX. (* Goal: dom_find_spec k (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' H)) true *) apply: (dom_find_some' (v:=v)); rewrite !umEX // /UM.upd /UM.free. (* Goal: match match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v (@rem K V k f')) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k f') k v pf (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k H)) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end *) case: decP=>H2; last by rewrite I in H2. (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' (@ins K V k v (@rem K V k f')) *) apply/fmapP=>k'; rewrite fnd_ins. (* Goal: @eq (option V) (@fnd K V k' f') (if @eq_op (Ordered.eqType K) k' k then @Some V v else @fnd K V k' (@rem K V k f')) *) by case: ifP=>[/eqP-> //|]; rewrite fnd_rem => ->. Qed. Lemma find_some k v f : find k f = Some v -> k \in dom f. Proof. (* Goal: forall _ : @eq (option V) (@UMC.find K V U k f) (@Some V v), is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f))) *) by case: dom_find=>// ->. Qed. Lemma find_none k f : find k f = None -> k \notin dom f. Proof. (* Goal: forall _ : @eq (option V) (@UMC.find K V U k f) (@None V), is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))) *) by case: dom_find=>// v ->. Qed. Lemma dom_umfilt p f : dom (um_filter p f) =i [predI p & dom f]. Proof. (* Goal: @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.um_filter K V U p f))) (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@predI (Ordered.sort K) (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p))) (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) rewrite !umEX /UM.dom /UM.um_filter. (* Goal: @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p pf) end with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end) (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@predI (Ordered.sort K) (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p))) (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end))))) *) case: (UMC.from f)=>[|f' H] x; first by rewrite !inE /= andbF. (* Goal: @eq bool (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V (@kfilter K V p f')))) (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@predI (Ordered.sort K) (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p))) (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f'))))))) *) by rewrite supp_kfilt mem_filter. Qed. Lemma dom_prec f1 f2 g1 g2 : valid (f1 \+ g1) -> f1 \+ g1 = f2 \+ g2 -> dom f1 =i dom f2 -> f1 = f2. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 g1))) (_ : @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) f1 g1) (@PCM.join (@union_map_classPCM K V U) f2 g2)) (_ : @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))), @eq (@UMC.sort K V U) f1 f2 *) rewrite -{4}[f1]UMC.tfE -{3}[f2]UMC.tfE !pcmE /= !umEX. (* Goal: forall (_ : is_true (@UM.valid K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@UM.union K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@UMC.from K V U f1) (@UMC.from K V U g1)))) (_ : match @UM.union K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@UMC.from K V U f1) (@UMC.from K V U g1) with | @UM.Undef _ _ _ => match @UM.union K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@UMC.from K V U f2) (@UMC.from K V U g2) with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match @UM.union K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@UMC.from K V U f2) (@UMC.from K V U g2) with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end) (_ : @eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UM.dom K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@UMC.from K V U f1))) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UM.dom K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@UMC.from K V U f2)))), match @UMC.from K V U f1 with | @UM.Undef _ _ _ => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) rewrite /UM.valid /UM.union /UM.dom; move=>D E. (* Goal: forall _ : @eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end), match @UMC.from K V U f1 with | @UM.Undef _ _ _ => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) case: (UMC.from f1) (UMC.from f2) (UMC.from g1) (UMC.from g2) E D=> [|f1' F1][|f2' F2][|g1' G1][|g2' G2] //; case: ifP=>// D1; case: ifP=>// D2 E _ E1; apply/fmapP=>k. (* Goal: @eq (option V) (@fnd K V k f1') (@fnd K V k f2') *) move/(_ k): E1=>E1. (* Goal: @eq (option V) (@fnd K V k f1') (@fnd K V k f2') *) case E2: (k \in supp f2') in E1; last first. (* Goal: @eq (option V) (@fnd K V k f1') (@fnd K V k f2') *) (* Goal: @eq (option V) (@fnd K V k f1') (@fnd K V k f2') *) - (* Goal: @eq (option V) (@fnd K V k f1') (@fnd K V k f2') *) (* Goal: @eq (option V) (@fnd K V k f1') (@fnd K V k f2') *) by move/negbT/fnd_supp: E1=>->; move/negbT/fnd_supp: E2=>->. (* Goal: @eq (option V) (@fnd K V k f1') (@fnd K V k f2') *) suff L: forall m s, k \in supp m -> disj m s -> fnd k m = fnd k (fcat m s) :> option V. (* Goal: forall (m s : finMap K V) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V m)))) (_ : is_true (@disj K V m s)), @eq (option V) (@fnd K V k m) (@fnd K V k (@fcat K V m s)) *) (* Goal: @eq (option V) (@fnd K V k f1') (@fnd K V k f2') *) - (* Goal: forall (m s : finMap K V) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V m)))) (_ : is_true (@disj K V m s)), @eq (option V) (@fnd K V k m) (@fnd K V k (@fcat K V m s)) *) (* Goal: @eq (option V) (@fnd K V k f1') (@fnd K V k f2') *) by rewrite (L _ _ E1 D1) (L _ _ E2 D2) E. (* Goal: forall (m s : finMap K V) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V m)))) (_ : is_true (@disj K V m s)), @eq (option V) (@fnd K V k m) (@fnd K V k (@fcat K V m s)) *) by move=>m s S; case: disjP=>//; move/(_ _ S)/negbTE; rewrite fnd_fcat=>->. Qed. Lemma domK f1 f2 g1 g2 : valid (f1 \+ g1) -> valid (f2 \+ g2) -> dom (f1 \+ g1) =i dom (f2 \+ g2) -> dom f1 =i dom f2 -> dom g1 =i dom g2. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 g1))) (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f2 g2))) (_ : @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@PCM.join (@union_map_classPCM K V U) f1 g1))) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@PCM.join (@union_map_classPCM K V U) f2 g2)))) (_ : @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))), @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U g1)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U g2)) *) rewrite !pcmE /= !umEX /UM.valid /UM.union /UM.dom. (* Goal: forall (_ : is_true match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U g1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end) (_ : is_true match match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U g2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end) (_ : @eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U g1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U g2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end)) (_ : @eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end)), @eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U g1 with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U g2 with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end) *) case: (UMC.from f1) (UMC.from f2) (UMC.from g1) (UMC.from g2)=> [|f1' F1][|f2' F2][|g1' G1][|g2' G2] //. (* Goal: forall (_ : is_true match (if @disj K V f1' g1' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' g1') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' g1' F1 G1) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end) (_ : is_true match (if @disj K V f2' g2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' g2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' g2' F2 G2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end) (_ : @eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match (if @disj K V f1' g1' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' g1') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' g1' F1 G1) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match (if @disj K V f2' g2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f2' g2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' g2' F2 G2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end)) (_ : @eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f2'))), @eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V g1')) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V g2')) *) case: disjP=>// D1 _; case: disjP=>// D2 _ E1 E2 x. (* Goal: @eq bool (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V g1'))) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V g2'))) *) move: {E1 E2} (E2 x) (E1 x); rewrite !supp_fcat !inE /= => E. (* Goal: forall _ : @eq bool (orb (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1'))) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V g1')))) (orb (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f2'))) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V g2')))), @eq bool (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V g1'))) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V g2'))) *) move: {D1 D2} E (D1 x) (D2 x)=><- /implyP D1 /implyP D2. (* Goal: forall _ : @eq bool (orb (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1'))) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V g1')))) (orb (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1'))) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V g2')))), @eq bool (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V g1'))) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V g2'))) *) case _ : (x \in supp f1') => //= in D1 D2 *. by move/negbTE: D1=>->; move/negbTE: D2=>->. Qed. Qed. Lemma umfilt_dom f1 f2 : valid (f1 \+ f2) -> um_filter (mem (dom f1)) (f1 \+ f2) = f1. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2)), @eq (@UMC.sort K V U) (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (@PCM.join (@union_map_classPCM K V U) f1 f2)) f1 *) rewrite -{4}[f1]UMC.tfE !pcmE /= !umEX. (* Goal: forall _ : is_true (@UM.valid K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@UM.union K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@UMC.from K V U f1) (@UMC.from K V U f2))), match @UM.um_filter K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UM.dom K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@UMC.from K V U f1))))) (@UM.union K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@UMC.from K V U f1) (@UMC.from K V U f2)) with | @UM.Undef _ _ _ => match @UMC.from K V U f1 with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match @UMC.from K V U f1 with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) rewrite /UM.valid /UM.union /UM.um_filter /UM.dom. (* Goal: forall _ : is_true match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end, match match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs0 i => @supp K V fs0 end))) fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs0 i => @supp K V fs0 end))) pf) end with | @UM.Undef _ _ _ => match @UMC.from K V U f1 with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match @UMC.from K V U f1 with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) case: (UMC.from f1) (UMC.from f2)=>[|f1' F1][|f2' F2] //. (* Goal: forall _ : is_true match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end, match match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')))) fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')))) pf) end with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ f' pf => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' f1' end *) case: ifP=>// D _; rewrite kfilt_fcat /=. (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@fcat K V (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')))) f1') (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')))) f2')) f1' *) have E1: {in supp f1', supp f1' =i predT} by []. (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@fcat K V (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')))) f1') (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')))) f2')) f1' *) have E2: {in supp f2', supp f1' =i pred0}. (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@fcat K V (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')))) f1') (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')))) f2')) f1' *) (* Goal: @prop_in1 (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f2')) (fun x : Equality.sort (Ordered.eqType K) => @eq bool (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f1'))) (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (simplPredType (Equality.sort (Ordered.eqType K))) (@pred0 (Equality.sort (Ordered.eqType K)))))) (inPhantom (@eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f1')) (@mem (Equality.sort (Ordered.eqType K)) (simplPredType (Equality.sort (Ordered.eqType K))) (@pred0 (Equality.sort (Ordered.eqType K)))))) *) - (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@fcat K V (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')))) f1') (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')))) f2')) f1' *) (* Goal: @prop_in1 (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f2')) (fun x : Equality.sort (Ordered.eqType K) => @eq bool (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f1'))) (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (simplPredType (Equality.sort (Ordered.eqType K))) (@pred0 (Equality.sort (Ordered.eqType K)))))) (inPhantom (@eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f1')) (@mem (Equality.sort (Ordered.eqType K)) (simplPredType (Equality.sort (Ordered.eqType K))) (@pred0 (Equality.sort (Ordered.eqType K)))))) *) by move=>x; rewrite disjC in D; case: disjP D=>// D _ /D /negbTE ->. (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@fcat K V (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')))) f1') (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')))) f2')) f1' *) rewrite (eq_in_kfilter E1) (eq_in_kfilter E2). (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@fcat K V (@kfilter K V (fun x : Equality.sort (Ordered.eqType K) => @in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (simplPredType (Equality.sort (Ordered.eqType K))) (@predT (Equality.sort (Ordered.eqType K))))) f1') (@kfilter K V (fun x : Equality.sort (Ordered.eqType K) => @in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (simplPredType (Equality.sort (Ordered.eqType K))) (@pred0 (Equality.sort (Ordered.eqType K))))) f2')) f1' *) by rewrite kfilter_predT kfilter_pred0 fcats0. Qed. Lemma sorted_dom f : sorted (@ord K) (dom f). Proof. (* Goal: is_true (@sorted (Ordered.eqType K) (@ord K) (@UMC.dom K V U f)) *) by rewrite !umEX; case: (UMC.from f)=>[|[]]. Qed. Lemma uniq_dom f : uniq (dom f). Proof. (* Goal: is_true (@uniq (Ordered.eqType K) (@UMC.dom K V U f)) *) apply: sorted_uniq (sorted_dom f); by [apply: ordtype.trans | apply: ordtype.irr]. Qed. Lemma perm_domUn f1 f2 : valid (f1 \+ f2) -> perm_eq (dom (f1 \+ f2)) (dom f1 ++ dom f2). Lemma size_domUn f1 f2 : valid (f1 \+ f2) -> size (dom (f1 \+ f2)) = size (dom f1) + size (dom f2). Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2)), @eq nat (@size (Ordered.sort K) (@UMC.dom K V U (@PCM.join (@union_map_classPCM K V U) f1 f2))) (addn (@size (Ordered.sort K) (@UMC.dom K V U f1)) (@size (Ordered.sort K) (@UMC.dom K V U f2))) *) by move/perm_domUn/perm_eq_size; rewrite size_cat. Qed. End DomLemmas. Hint Resolve sorted_dom uniq_dom : core. Prenex Implicits find_some find_none. Section FilterLemmas. Variables (K : ordType) (V : Type) (U : union_map_class K V). Implicit Type f : U. Lemma eq_in_umfilt p1 p2 f : {in dom f, p1 =1 p2} -> um_filter p1 f = um_filter p2 f. Proof. (* Goal: forall _ : @prop_in1 (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)) (fun x : Equality.sort (Ordered.eqType K) => @eq bool (p1 x) (p2 x)) (inPhantom (@eqfun bool (Equality.sort (Ordered.eqType K)) p1 p2)), @eq (@UMC.sort K V U) (@UMC.um_filter K V U p1 f) (@UMC.um_filter K V U p2 f) *) rewrite !umEX /UM.dom /UM.um_filter /= /dom. (* Goal: forall _ : @prop_in1 (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end) (fun x : Ordered.sort K => @eq bool (p1 x) (p2 x)) (inPhantom (@eqfun bool (Ordered.sort K) p1 p2)), match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p1 fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p1 pf) end with | @UM.Undef _ _ _ => match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p2 fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p2 pf) end with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf0 => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p2 fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p2 pf0) end with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) by case: (UMC.from f)=>[|f' H] //=; apply: eq_in_kfilter. Qed. Lemma umfilt0 q : um_filter q Unit = Unit :> U. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.um_filter K V U q (@PCM.unit (@union_map_classPCM K V U))) (@PCM.unit (@union_map_classPCM K V U)) *) by rewrite !pcmE /= !umEX /UM.um_filter /UM.empty kfilt_nil. Qed. Lemma umfilt_undef q : um_filter q um_undef = um_undef :> U. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.um_filter K V U q (@UMC.um_undef K V U)) (@UMC.um_undef K V U) *) by rewrite !umEX. Qed. Lemma umfiltUn q f1 f2 : valid (f1 \+ f2) -> um_filter q (f1 \+ f2) = um_filter q f1 \+ um_filter q f2. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2)), @eq (@UMC.sort K V U) (@UMC.um_filter K V U q (@PCM.join (@union_map_classPCM K V U) f1 f2)) (@PCM.join (@union_map_classPCM K V U) (@UMC.um_filter K V U q f1) (@UMC.um_filter K V U q f2)) *) rewrite !pcmE /= !umEX /UM.valid /UM.union. (* Goal: forall _ : is_true match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end, match @UM.um_filter K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) q match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => match match @UM.um_filter K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) q (@UMC.from K V U f1) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UM.um_filter K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) q (@UMC.from K V U f2) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match match @UM.um_filter K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) q (@UMC.from K V U f1) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UM.um_filter K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) q (@UMC.from K V U f2) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) case: (UMC.from f1)=>[|f1' H1]; case: (UMC.from f2)=>[|f2' H2] //=. (* Goal: forall _ : is_true match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' H1 H2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end, match @UM.um_filter K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) q (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' H1 H2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => match (if @disj K V (@kfilter K V q f1') (@kfilter K V q f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@kfilter K V q f1') (@kfilter K V q f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V q f1') (@kfilter K V q f2') (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' q H1) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' q H2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match (if @disj K V (@kfilter K V q f1') (@kfilter K V q f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@kfilter K V q f1') (@kfilter K V q f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V q f1') (@kfilter K V q f2') (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' q H1) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' q H2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) by case: ifP=>D //= _; rewrite kfilt_fcat disj_kfilt. Qed. Lemma umfilt_pred0 f : valid f -> um_filter pred0 f = Unit. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) f), @eq (@UMC.sort K V U) (@UMC.um_filter K V U (@pred_of_simpl (Ordered.sort K) (@pred0 (Ordered.sort K))) f) (@PCM.unit (@union_map_classPCM K V U)) *) rewrite !pcmE /= !umEX /UM.valid /UM.empty. (* Goal: forall _ : is_true match @UMC.from K V U f with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end, match @UM.um_filter K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@pred_of_simpl (Ordered.sort K) (@pred0 (Ordered.sort K))) (@UMC.from K V U f) with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ f' pf => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' (nil K V) end *) case: (UMC.from f)=>[|f' H] //= _; case: f' H=>f' P H. (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@pred0 (Ordered.sort K))) (@FinMap K V f' P)) (nil K V) *) by rewrite fmapE /= /kfilter' filter_pred0. Qed. Lemma umfilt_predT f : um_filter predT f = f. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.um_filter K V U (@pred_of_simpl (Ordered.sort K) (@predT (Ordered.sort K))) f) f *) rewrite -[f]UMC.tfE !umEX /UM.um_filter. (* Goal: match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@predT (Ordered.sort K))) fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs (@pred_of_simpl (Ordered.sort K) (@predT (Ordered.sort K))) pf) end with | @UM.Undef _ _ _ => match @UMC.from K V U f with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match @UMC.from K V U f with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) by case: (UMC.from f)=>[|f' H] //; rewrite kfilter_predT. Qed. Lemma umfilt_predI p1 p2 f : um_filter (predI p1 p2) f = um_filter p1 (um_filter p2 f). Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.um_filter K V U (@pred_of_simpl (Ordered.sort K) (@predI (Ordered.sort K) p1 p2)) f) (@UMC.um_filter K V U p1 (@UMC.um_filter K V U p2 f)) *) rewrite -[f]UMC.tfE !umEX /UM.um_filter. (* Goal: match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@predI (Ordered.sort K) p1 p2)) fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs (@pred_of_simpl (Ordered.sort K) (@predI (Ordered.sort K) p1 p2)) pf) end with | @UM.Undef _ _ _ => match match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p2 fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p2 pf) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p1 fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p1 pf) end with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf0 => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p2 fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p2 pf0) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf0 => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p1 fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p1 pf0) end with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) by case: (UMC.from f)=>[|f' H] //; rewrite kfilter_predI. Qed. Lemma umfilt_predU p1 p2 f : um_filter (predU p1 p2) f = um_filter p1 f \+ um_filter (predD p2 p1) f. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.um_filter K V U (@pred_of_simpl (Ordered.sort K) (@predU (Ordered.sort K) p1 p2)) f) (@PCM.join (@union_map_classPCM K V U) (@UMC.um_filter K V U p1 f) (@UMC.um_filter K V U (@pred_of_simpl (Ordered.sort K) (@predD (Ordered.sort K) p2 p1)) f)) *) rewrite pcmE /= !umEX /UM.um_filter /UM.union /=. (* Goal: match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@predU (Ordered.sort K) p1 p2)) fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs (@pred_of_simpl (Ordered.sort K) (@predU (Ordered.sort K) p1 p2)) pf) end with | @UM.Undef _ _ _ => match match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p1 fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p1 pf) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@predD (Ordered.sort K) p2 p1)) fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs (@pred_of_simpl (Ordered.sort K) (@predD (Ordered.sort K) p2 p1)) pf) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf0 => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p1 fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p1 pf0) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf0 => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@predD (Ordered.sort K) p2 p1)) fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs (@pred_of_simpl (Ordered.sort K) (@predD (Ordered.sort K) p2 p1)) pf0) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end *) case: (UMC.from f)=>[|f' H] //=. (* Goal: match (if @disj K V (@kfilter K V p1 f') (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@predD (Ordered.sort K) p2 p1)) f') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@kfilter K V p1 f') (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@predD (Ordered.sort K) p2 p1)) f')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p1 f') (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@predD (Ordered.sort K) p2 p1)) f') (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' p1 H) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' (@pred_of_simpl (Ordered.sort K) (@predD (Ordered.sort K) p2 p1)) H)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@predU (Ordered.sort K) p1 p2)) f') g' end *) rewrite in_disj_kfilt; last by move=>x _; rewrite /= negb_and orbA orbN. (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@predU (Ordered.sort K) p1 p2)) f') (@fcat K V (@kfilter K V p1 f') (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@predD (Ordered.sort K) p2 p1)) f')) *) rewrite -kfilter_predU. (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@predU (Ordered.sort K) p1 p2)) f') (@kfilter K V (@pred_of_simpl (Ordered.sort K) (@predU (Ordered.sort K) p1 (@pred_of_simpl (Ordered.sort K) (@predD (Ordered.sort K) p2 p1)))) f') *) by apply: eq_in_kfilter=>x _; rewrite /= orb_andr orbN. Qed. Lemma umfilt_dpredU f p q : {subset p <= predC q} -> um_filter (predU p q) f = um_filter p f \+ um_filter q f. Proof. (* Goal: forall _ : @sub_mem (Ordered.sort K) (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p) (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@predC (Ordered.sort K) q)), @eq (@UMC.sort K V U) (@UMC.um_filter K V U (@pred_of_simpl (Ordered.sort K) (@predU (Ordered.sort K) p q)) f) (@PCM.join (@union_map_classPCM K V U) (@UMC.um_filter K V U p f) (@UMC.um_filter K V U q f)) *) move=>D; rewrite umfilt_predU (eq_in_umfilt (p1:=predD q p) (p2:=q)) //. (* Goal: @prop_in1 (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)) (fun x : Equality.sort (Ordered.eqType K) => @eq bool (@pred_of_simpl (Ordered.sort K) (@predD (Ordered.sort K) q p) x) (q x)) (inPhantom (@eqfun bool (Equality.sort (Ordered.eqType K)) (@pred_of_simpl (Ordered.sort K) (@predD (Ordered.sort K) q p)) q)) *) by move=>k _ /=; case X : (p k)=>//=; move/D/negbTE: X. Qed. Lemma umfiltUnK p f1 f2 : valid (f1 \+ f2) -> um_filter p (f1 \+ f2) = f1 -> um_filter p f1 = f1 /\ um_filter p f2 = Unit. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2))) (_ : @eq (@UMC.sort K V U) (@UMC.um_filter K V U p (@PCM.join (@union_map_classPCM K V U) f1 f2)) f1), and (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f1) f1) (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f2) (@PCM.unit (@union_map_classPCM K V U))) *) move=>V'; rewrite (umfiltUn _ V') => E. (* Goal: and (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f1) f1) (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f2) (@PCM.unit (@union_map_classPCM K V U))) *) have {V'} V' : valid (um_filter p f1 \+ um_filter p f2). (* Goal: and (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f1) f1) (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f2) (@PCM.unit (@union_map_classPCM K V U))) *) (* Goal: is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.um_filter K V U p f1) (@UMC.um_filter K V U p f2))) *) - (* Goal: and (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f1) f1) (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f2) (@PCM.unit (@union_map_classPCM K V U))) *) (* Goal: is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.um_filter K V U p f1) (@UMC.um_filter K V U p f2))) *) by rewrite E; move/validL: V'. (* Goal: and (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f1) f1) (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f2) (@PCM.unit (@union_map_classPCM K V U))) *) have F : dom (um_filter p f1) =i dom f1. (* Goal: and (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f1) f1) (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f2) (@PCM.unit (@union_map_classPCM K V U))) *) (* Goal: @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.um_filter K V U p f1))) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)) *) - (* Goal: and (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f1) f1) (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f2) (@PCM.unit (@union_map_classPCM K V U))) *) (* Goal: @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.um_filter K V U p f1))) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)) *) move=>x; rewrite dom_umfilt inE /=. (* Goal: and (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f1) f1) (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f2) (@PCM.unit (@union_map_classPCM K V U))) *) (* Goal: @eq bool (andb (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p)) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1))) *) apply/andP/idP=>[[//]| H1]; split=>//; move: H1. (* Goal: and (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f1) f1) (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f2) (@PCM.unit (@union_map_classPCM K V U))) *) (* Goal: forall _ : is_true (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1))), is_true (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p)) *) rewrite -{1}E domUn inE /= !dom_umfilt inE /= inE /=. (* Goal: and (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f1) f1) (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f2) (@PCM.unit (@union_map_classPCM K V U))) *) (* Goal: forall _ : is_true (andb (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.um_filter K V U p f1) (@UMC.um_filter K V U p f2))) (orb (andb (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p)) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (andb (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p)) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))))), is_true (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p)) *) by case: (x \in p)=>//=; rewrite andbF. (* Goal: and (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f1) f1) (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f2) (@PCM.unit (@union_map_classPCM K V U))) *) rewrite -{2}[f1]unitR in E F; move/(dom_prec V' E): F=>X. (* Goal: and (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f1) f1) (@eq (@UMC.sort K V U) (@UMC.um_filter K V U p f2) (@PCM.unit (@union_map_classPCM K V U))) *) by rewrite X in E V' *; rewrite (joinxK V' E). Qed. Lemma umfiltU p k v f : um_filter p (upd k v f) = if p k then upd k v (um_filter p f) else if cond U k then um_filter p f else um_undef. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.um_filter K V U p (@UMC.upd K V U k v f)) (if p k then @UMC.upd K V U k v (@UMC.um_filter K V U p f) else if @pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k then @UMC.um_filter K V U p f else @UMC.um_undef K V U) *) rewrite !umEX /UM.um_filter /UM.upd /cond. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k v pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p pf) end) (if p k then @UMC.to K V U match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p pf) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k v pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end else if @pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x)) k then @UMC.to K V U match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p pf) end else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) case: (UMC.from f)=>[|f' F]; first by case: ifP=>H1 //; case: ifP. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U match match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f') (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k v pf F) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p pf) end) (if p k then @UMC.to K V U match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v (@kfilter K V p f')) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p f') k v pf (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' p F)) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end else if @pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x)) k then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p f') (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' p F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) case: ifP=>H1; case: decP=>H2 //=. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p f') (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' p F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p (@ins K V k v f')) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f') p (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k v H2 F)))) (if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p f') (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' p F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p (@ins K V k v f')) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f') p (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k v H2 F)))) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@FinMap K V (@ins' K V k v (@kfilter' K V p f')) (@sorted_ins' K V (@kfilter' K V p f') k v (@sorted_kfilter K V p f'))) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p f') k v H2 (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' p F)))) *) - (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p f') (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' p F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p (@ins K V k v f')) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f') p (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k v H2 F)))) (if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p f') (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' p F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p (@ins K V k v f')) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f') p (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k v H2 F)))) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@FinMap K V (@ins' K V k v (@kfilter' K V p f')) (@sorted_ins' K V (@kfilter' K V p f') k v (@sorted_kfilter K V p f'))) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p f') k v H2 (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' p F)))) *) by rewrite !umEX kfilt_ins H1. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p f') (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' p F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p (@ins K V k v f')) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f') p (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k v H2 F)))) (if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p f') (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' p F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) - (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p f') (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' p F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p (@ins K V k v f')) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f') p (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k v H2 F)))) (if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p f') (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' p F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) by rewrite H2 !umEX kfilt_ins H1. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p f') (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' p F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) by case: ifP H2. Qed. Lemma umfiltF p k f : um_filter p (free k f) = if p k then free k (um_filter p f) else um_filter p f. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.um_filter K V U p (@UMC.free K V U k f)) (if p k then @UMC.free K V U k (@UMC.um_filter K V U p f) else @UMC.um_filter K V U p f) *) rewrite !umEX /UM.um_filter /UM.free. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k pf) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p pf) end) (if p k then @UMC.to K V U match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p pf) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k pf) end else @UMC.to K V U match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p pf) end) *) by case: (UMC.from f)=>[|f' F]; case: ifP=>// E; rewrite !umEX kfilt_rem E. Qed. End FilterLemmas. Section ValidLemmas. Variables (K : ordType) (V : Type) (U : union_map_class K V). Implicit Types (k : K) (v : V) (f g : U). Lemma invalidE f : ~~ valid f <-> f = um_undef. Proof. (* Goal: iff (is_true (negb (@PCM.valid (@union_map_classPCM K V U) f))) (@eq (@UMC.sort K V U) f (@UMC.um_undef K V U)) *) by rewrite !pcmE /= !umEX -2![f]UMC.tfE !umEX; case: (UMC.from f). Qed. Lemma valid_undef : valid (um_undef : U) = false. Proof. (* Goal: @eq bool (@PCM.valid (@union_map_classPCM K V U) (@UMC.um_undef K V U : @UMC.sort K V U)) false *) by apply/negbTE; apply/invalidE. Qed. Lemma validU k v f : valid (upd k v f) = cond U k && valid f. Lemma validF k f : valid (free k f) = valid f. Proof. (* Goal: @eq bool (@PCM.valid (@union_map_classPCM K V U) (@UMC.free K V U k f)) (@PCM.valid (@union_map_classPCM K V U) f) *) by rewrite !pcmE /= !umEX; case: (UMC.from f). Qed. CoInductive validUn_spec f1 f2 : bool -> Type := | valid_false1 of ~~ valid f1 : validUn_spec f1 f2 false | valid_false2 of ~~ valid f2 : validUn_spec f1 f2 false | valid_false3 k of k \in dom f1 & k \in dom f2 : validUn_spec f1 f2 false | valid_true of valid f1 & valid f2 & (forall x, x \in dom f1 -> x \notin dom f2) : validUn_spec f1 f2 true. Lemma validUn f1 f2 : validUn_spec f1 f2 (valid (f1 \+ f2)). Lemma validFUn k f1 f2 : valid (f1 \+ f2) -> valid (free k f1 \+ f2). Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2)), is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.free K V U k f1) f2)) *) case: validUn=>// V1 V2 H _; case: validUn=>//; last 1 first. (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f2)), is_true false *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) (@UMC.free K V U k f1))), is_true false *) (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.free K V U k f1))))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), is_true false *) - (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f2)), is_true false *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) (@UMC.free K V U k f1))), is_true false *) (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.free K V U k f1))))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), is_true false *) by move=>k'; rewrite domF inE; case: eqP=>// _ /H/negbTE ->. (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f2)), is_true false *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) (@UMC.free K V U k f1))), is_true false *) by rewrite validF V1. (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f2)), is_true false *) by rewrite V2. Qed. Lemma validUnF k f1 f2 : valid (f1 \+ f2) -> valid (f1 \+ free k f2). Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2)), is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.free K V U k f2))) *) by rewrite !(joinC f1); apply: validFUn. Qed. Lemma validUnU k v f1 f2 : k \in dom f2 -> valid (f1 \+ upd k v f2) = valid (f1 \+ f2). Proof. (* Goal: forall _ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))), @eq bool (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2)) *) move=>D; apply/esym; move: D; case: validUn. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f1)) (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f2)) (_ : forall (x : Equality.sort (Ordered.eqType K)) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))), is_true (negb (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool false (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) (* Goal: forall (_ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f2))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool false (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) (* Goal: forall (_ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f1))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool false (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) - (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f1)) (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f2)) (_ : forall (x : Equality.sort (Ordered.eqType K)) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))), is_true (negb (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool false (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) (* Goal: forall (_ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f2))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool false (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) (* Goal: forall (_ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f1))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool false (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) by move=>V' _; apply/esym/negbTE; apply: contra V'; move/validL. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f1)) (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f2)) (_ : forall (x : Equality.sort (Ordered.eqType K)) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))), is_true (negb (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool false (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) (* Goal: forall (_ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f2))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool false (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) - (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f1)) (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f2)) (_ : forall (x : Equality.sort (Ordered.eqType K)) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))), is_true (negb (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool false (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) (* Goal: forall (_ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f2))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool false (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) move=>V' _; apply/esym/negbTE; apply: contra V'; move/validR. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f1)) (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f2)) (_ : forall (x : Equality.sort (Ordered.eqType K)) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))), is_true (negb (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool false (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@UMC.upd K V U k v f2)), is_true (@PCM.valid (@union_map_classPCM K V U) f2) *) by rewrite validU; case/andP. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f1)) (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f2)) (_ : forall (x : Equality.sort (Ordered.eqType K)) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))), is_true (negb (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool false (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) - (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f1)) (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f2)) (_ : forall (x : Equality.sort (Ordered.eqType K)) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))), is_true (negb (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool false (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) move=>k' H1 H2 _; case: validUn=>//; rewrite validU => D1 /andP [/= H D2]. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f1)) (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f2)) (_ : forall (x : Equality.sort (Ordered.eqType K)) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))), is_true (negb (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) (* Goal: forall _ : forall (x : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))), is_true (negb (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.upd K V U k v f2))))), @eq bool false true *) by move/(_ k' H1); rewrite domU !inE H D2 H2; case: ifP. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f1)) (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f2)) (_ : forall (x : Equality.sort (Ordered.eqType K)) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))), is_true (negb (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq bool true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2))) *) move=>V1 V2 H1 H2; case: validUn=>//. (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.upd K V U k v f2))))), @eq bool true false *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) (@UMC.upd K V U k v f2))), @eq bool true false *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f1)), @eq bool true false *) - (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.upd K V U k v f2))))), @eq bool true false *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) (@UMC.upd K V U k v f2))), @eq bool true false *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f1)), @eq bool true false *) by rewrite V1. (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.upd K V U k v f2))))), @eq bool true false *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) (@UMC.upd K V U k v f2))), @eq bool true false *) - (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.upd K V U k v f2))))), @eq bool true false *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) (@UMC.upd K V U k v f2))), @eq bool true false *) by rewrite validU V2 (dom_cond H2). (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.upd K V U k v f2))))), @eq bool true false *) move=>k'; rewrite domU (dom_cond H2) inE /= V2; move/H1=>H3. (* Goal: forall _ : is_true (if @eq_op (Ordered.eqType K) k' k then true else @in_mem (Ordered.sort K) k' (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))), @eq bool true false *) by rewrite (negbTE H3); case: ifP H2 H3=>// /eqP ->->. Qed. Lemma validUUn k v f1 f2 : k \in dom f1 -> valid (upd k v f1 \+ f2) = valid (f1 \+ f2). Proof. (* Goal: forall _ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1))), @eq bool (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.upd K V U k v f1) f2)) (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2)) *) by move=>D; rewrite -!(joinC f2); apply: validUnU D. Qed. Lemma valid_umfilt p f : valid (um_filter p f) = valid f. Proof. (* Goal: @eq bool (@PCM.valid (@union_map_classPCM K V U) (@UMC.um_filter K V U p f)) (@PCM.valid (@union_map_classPCM K V U) f) *) by rewrite !pcmE /= !umEX; case: (UMC.from f). Qed. Lemma dom_inNL k f1 f2 : valid (f1 \+ f2) -> k \in dom f1 -> k \notin dom f2. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))), is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))) *) by case: validUn=>//_ _ H _; apply: H. Qed. Lemma dom_inNR k f1 f2 : valid (f1 \+ f2) -> k \in dom f2 -> k \notin dom f1. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) *) by rewrite joinC; apply: dom_inNL. Qed. End ValidLemmas. Section DomEqLemmas. Variables (K : ordType) (V : Type) (U : union_map_class K V). Implicit Type f : U. Lemma domeqP f1 f2 : reflect (valid f1 = valid f2 /\ dom f1 =i dom f2) (dom_eq f1 f2). Proof. (* Goal: Bool.reflect (and (@eq bool (@PCM.valid (@union_map_classPCM K V U) f1) (@PCM.valid (@union_map_classPCM K V U) f2)) (@eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))) (@UMC.dom_eq K V U f1 f2) *) rewrite !pcmE /= !umEX /UM.valid /UM.dom /UM.dom_eq /in_mem. (* Goal: Bool.reflect (and (@eq bool match @UMC.from K V U f1 with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end match @UMC.from K V U f2 with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end))) match @UMC.from K V U f1 with | @UM.Undef _ _ _ => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => true | @UM.Def _ _ _ f i => false end | @UM.Def _ _ _ fs1 i => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ fs2 i0 => @eq_op (seq_eqType (Ordered.eqType K)) (@supp K V fs1) (@supp K V fs2) end end *) case: (UMC.from f1) (UMC.from f2)=>[|f1' F1][|f2' F2] /=. (* Goal: Bool.reflect (and (@eq bool true true) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f2')))) (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f1') (@supp K V f2')) *) (* Goal: Bool.reflect (and (@eq bool true false) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K))))) false *) (* Goal: Bool.reflect (and (@eq bool false true) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K))) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f2')))) false *) (* Goal: Bool.reflect (and (@eq bool false false) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K))) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K))))) true *) - (* Goal: Bool.reflect (and (@eq bool true true) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f2')))) (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f1') (@supp K V f2')) *) (* Goal: Bool.reflect (and (@eq bool true false) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K))))) false *) (* Goal: Bool.reflect (and (@eq bool false true) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K))) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f2')))) false *) (* Goal: Bool.reflect (and (@eq bool false false) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K))) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K))))) true *) by constructor. (* Goal: Bool.reflect (and (@eq bool true true) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f2')))) (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f1') (@supp K V f2')) *) (* Goal: Bool.reflect (and (@eq bool true false) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K))))) false *) (* Goal: Bool.reflect (and (@eq bool false true) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K))) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f2')))) false *) - (* Goal: Bool.reflect (and (@eq bool true true) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f2')))) (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f1') (@supp K V f2')) *) (* Goal: Bool.reflect (and (@eq bool true false) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K))))) false *) (* Goal: Bool.reflect (and (@eq bool false true) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K))) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f2')))) false *) by constructor; case. (* Goal: Bool.reflect (and (@eq bool true true) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f2')))) (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f1') (@supp K V f2')) *) (* Goal: Bool.reflect (and (@eq bool true false) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K))))) false *) - (* Goal: Bool.reflect (and (@eq bool true true) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f2')))) (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f1') (@supp K V f2')) *) (* Goal: Bool.reflect (and (@eq bool true false) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@Datatypes.nil (Ordered.sort K))))) false *) by constructor; case. (* Goal: Bool.reflect (and (@eq bool true true) (@eq_mem (Ordered.sort K) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f2')))) (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f1') (@supp K V f2')) *) by case: eqP=>H; constructor; [rewrite H | case=>_ /suppE]. Qed. Lemma domeq0E f : dom_eq f Unit -> f = Unit. Proof. (* Goal: forall _ : is_true (@UMC.dom_eq K V U f (@PCM.unit (@union_map_classPCM K V U))), @eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)) *) by case/domeqP; rewrite valid_unit dom0; apply: dom0E. Qed. Lemma domeq_refl f : dom_eq f f. Proof. (* Goal: is_true (@UMC.dom_eq K V U f f) *) by case: domeqP=>//; case. Qed. Hint Resolve domeq_refl : core. Lemma domeq_sym f1 f2 : dom_eq f1 f2 = dom_eq f2 f1. Proof. (* Goal: @eq bool (@UMC.dom_eq K V U f1 f2) (@UMC.dom_eq K V U f2 f1) *) suff L f f' : dom_eq f f' -> dom_eq f' f by apply/idP/idP; apply: L. (* Goal: forall _ : is_true (@UMC.dom_eq K V U f f'), is_true (@UMC.dom_eq K V U f' f) *) by case/domeqP=>H1 H2; apply/domeqP; split. Qed. Lemma domeq_trans f1 f2 f3 : dom_eq f1 f2 -> dom_eq f2 f3 -> dom_eq f1 f3. Lemma domeqVUnE f1 f2 f1' f2' : dom_eq f1 f2 -> dom_eq f1' f2' -> valid (f1 \+ f1') = valid (f2 \+ f2'). Lemma domeqVUn f1 f2 f1' f2' : dom_eq f1 f2 -> dom_eq f1' f2' -> valid (f1 \+ f1') -> valid (f2 \+ f2'). Proof. (* Goal: forall (_ : is_true (@UMC.dom_eq K V U f1 f2)) (_ : is_true (@UMC.dom_eq K V U f1' f2')) (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f1'))), is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f2 f2')) *) by move=>D /(domeqVUnE D) ->. Qed. Lemma domeqUn f1 f2 f1' f2' : dom_eq f1 f2 -> dom_eq f1' f2' -> dom_eq (f1 \+ f1') (f2 \+ f2'). Lemma domeqfUn f f1 f2 f1' f2' : dom_eq (f \+ f1) f2 -> dom_eq f1' (f \+ f2') -> dom_eq (f1 \+ f1') (f2 \+ f2'). Lemma domeqUnf f f1 f2 f1' f2' : dom_eq f1 (f \+ f2) -> dom_eq (f \+ f1') f2' -> dom_eq (f1 \+ f1') (f2 \+ f2'). Proof. (* Goal: forall (_ : is_true (@UMC.dom_eq K V U f1 (@PCM.join (@union_map_classPCM K V U) f f2))) (_ : is_true (@UMC.dom_eq K V U (@PCM.join (@union_map_classPCM K V U) f f1') f2')), is_true (@UMC.dom_eq K V U (@PCM.join (@union_map_classPCM K V U) f1 f1') (@PCM.join (@union_map_classPCM K V U) f2 f2')) *) by move=>D1 D2; rewrite (joinC f1) (joinC f2); apply: domeqfUn D2 D1. Qed. Lemma domeqK f1 f2 f1' f2' : valid (f1 \+ f1') -> dom_eq (f1 \+ f1') (f2 \+ f2') -> dom_eq f1 f2 -> dom_eq f1' f2'. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f1'))) (_ : is_true (@UMC.dom_eq K V U (@PCM.join (@union_map_classPCM K V U) f1 f1') (@PCM.join (@union_map_classPCM K V U) f2 f2'))) (_ : is_true (@UMC.dom_eq K V U f1 f2)), is_true (@UMC.dom_eq K V U f1' f2') *) move=>V1 /domeqP [E1 H1] /domeqP [E2 H2]; move: (V1); rewrite E1=>V2. (* Goal: is_true (@UMC.dom_eq K V U f1' f2') *) apply/domeqP; split; first by rewrite (validR V1) (validR V2). (* Goal: @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1')) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2')) *) by apply: domK V1 V2 H1 H2. Qed. End DomEqLemmas. Hint Resolve domeq_refl : core. Section Precision. Variables (K : ordType) (V : Type) (U : union_map_class K V). Implicit Types (x y : U). Lemma prec_flip x1 x2 y1 y2 : valid (x1 \+ y1) -> x1 \+ y1 = x2 \+ y2 -> valid (y2 \+ x2) /\ y2 \+ x2 = y1 \+ x1. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) x1 y1))) (_ : @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) x1 y1) (@PCM.join (@union_map_classPCM K V U) x2 y2)), and (is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) y2 x2))) (@eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) y2 x2) (@PCM.join (@union_map_classPCM K V U) y1 x1)) *) by move=>X /esym E; rewrite joinC E X joinC. Qed. Lemma prec_domV x1 x2 y1 y2 : valid (x1 \+ y1) -> x1 \+ y1 = x2 \+ y2 -> reflect {subset dom x1 <= dom x2} (valid (x1 \+ y2)). Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) x1 y1))) (_ : @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) x1 y1) (@PCM.join (@union_map_classPCM K V U) x2 y2)), Bool.reflect (@sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x2))) (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) x1 y2)) *) move=>V1 E; case V12 : (valid (x1 \+ y2)); constructor. (* Goal: not (@sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x2))) *) (* Goal: @sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x2)) *) - (* Goal: not (@sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x2))) *) (* Goal: @sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x2)) *) move=>n Hs; have : n \in dom (x1 \+ y1) by rewrite domUn inE V1 Hs. (* Goal: not (@sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x2))) *) (* Goal: forall _ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) n (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@PCM.join (@union_map_classPCM K V U) x1 y1)))), is_true (@in_mem (Equality.sort (Ordered.eqType K)) n (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x2))) *) rewrite E domUn inE -E V1 /= orbC. (* Goal: not (@sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x2))) *) (* Goal: forall _ : is_true (orb (@in_mem (Ordered.sort K) n (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U y2))) (@in_mem (Ordered.sort K) n (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x2)))), is_true (@in_mem (Ordered.sort K) n (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x2))) *) by case: validUn V12 Hs=>// _ _ L _ /L /negbTE ->. (* Goal: not (@sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x2))) *) move=>Hs; case: validUn V12=>//. (* Goal: forall (k : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U y2)))) (_ : @eq bool false false), False *) (* Goal: forall (_ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) y2))) (_ : @eq bool false false), False *) (* Goal: forall (_ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) x1))) (_ : @eq bool false false), False *) - (* Goal: forall (k : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U y2)))) (_ : @eq bool false false), False *) (* Goal: forall (_ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) y2))) (_ : @eq bool false false), False *) (* Goal: forall (_ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) x1))) (_ : @eq bool false false), False *) by rewrite (validL V1). (* Goal: forall (k : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U y2)))) (_ : @eq bool false false), False *) (* Goal: forall (_ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) y2))) (_ : @eq bool false false), False *) - (* Goal: forall (k : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U y2)))) (_ : @eq bool false false), False *) (* Goal: forall (_ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) y2))) (_ : @eq bool false false), False *) by rewrite E in V1; rewrite (validR V1). (* Goal: forall (k : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U y2)))) (_ : @eq bool false false), False *) by move=>k /Hs; rewrite E in V1; case: validUn V1=>// _ _ L _ /L /negbTE ->. Qed. Lemma prec_filtV x1 x2 y1 y2 : valid (x1 \+ y1) -> x1 \+ y1 = x2 \+ y2 -> reflect (x1 = um_filter (mem (dom x1)) x2) (valid (x1 \+ y2)). Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) x1 y1))) (_ : @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) x1 y1) (@PCM.join (@union_map_classPCM K V U) x2 y2)), Bool.reflect (@eq (@UMC.sort K V U) x1 (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) x2)) (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) x1 y2)) *) move=>V1 E; case X : (valid (x1 \+ y2)); constructor; last first. (* Goal: @eq (@UMC.sort K V U) x1 (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) x2) *) (* Goal: not (@eq (@UMC.sort K V U) x1 (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) x2)) *) - (* Goal: @eq (@UMC.sort K V U) x1 (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) x2) *) (* Goal: not (@eq (@UMC.sort K V U) x1 (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) x2)) *) case: (prec_domV V1 E) X=>// St _ H; apply: St. (* Goal: @eq (@UMC.sort K V U) x1 (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) x2) *) (* Goal: @sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x2)) *) by move=>n; rewrite H dom_umfilt inE; case/andP. (* Goal: @eq (@UMC.sort K V U) x1 (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) x2) *) move: (umfilt_dom V1); rewrite E umfiltUn -?E //. (* Goal: forall _ : @eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) x2) (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) y2)) x1, @eq (@UMC.sort K V U) x1 (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) x2) *) rewrite (eq_in_umfilt (f:=y2) (p2:=pred0)). (* Goal: @prop_in1 (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U y2)) (fun x : Equality.sort (Ordered.eqType K) => @eq bool (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1))) x) (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred0 (Equality.sort (Ordered.eqType K))) x)) (inPhantom (@eqfun bool (Equality.sort (Ordered.eqType K)) (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred0 (Equality.sort (Ordered.eqType K)))))) *) (* Goal: forall _ : @eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) x2) (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred0 (Equality.sort (Ordered.eqType K)))) y2)) x1, @eq (@UMC.sort K V U) x1 (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) x2) *) - (* Goal: @prop_in1 (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U y2)) (fun x : Equality.sort (Ordered.eqType K) => @eq bool (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1))) x) (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred0 (Equality.sort (Ordered.eqType K))) x)) (inPhantom (@eqfun bool (Equality.sort (Ordered.eqType K)) (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred0 (Equality.sort (Ordered.eqType K)))))) *) (* Goal: forall _ : @eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) x2) (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred0 (Equality.sort (Ordered.eqType K)))) y2)) x1, @eq (@UMC.sort K V U) x1 (@UMC.um_filter K V U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) x2) *) by rewrite umfilt_pred0 ?unitR //; rewrite E in V1; rewrite (validR V1). (* Goal: @prop_in1 (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U y2)) (fun x : Equality.sort (Ordered.eqType K) => @eq bool (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1))) x) (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred0 (Equality.sort (Ordered.eqType K))) x)) (inPhantom (@eqfun bool (Equality.sort (Ordered.eqType K)) (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U x1)))) (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred0 (Equality.sort (Ordered.eqType K)))))) *) by move=>n; case: validUn X=>// _ _ L _ /(contraL (L _)) /negbTE. Qed. End Precision. Section UpdateLemmas. Variable (K : ordType) (V : Type) (U : union_map_class K V). Implicit Types (k : K) (v : V) (f : U). Lemma upd_invalid k v : upd k v um_undef = um_undef :> U. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.upd K V U k v (@UMC.um_undef K V U)) (@UMC.um_undef K V U) *) by rewrite !umEX. Qed. Lemma upd_inj k v1 v2 f : valid f -> cond U k -> upd k v1 f = upd k v2 f -> v1 = v2. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f)) (_ : is_true (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k)) (_ : @eq (@UMC.sort K V U) (@UMC.upd K V U k v1 f) (@UMC.upd K V U k v2 f)), @eq V v1 v2 *) rewrite !pcmE /= !umEX /UM.valid /UM.upd /cond. (* Goal: forall (_ : is_true match @UMC.from K V U f with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end) (_ : is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (_ : match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v1 fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k v1 pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v2 fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k v2 pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => is_true true | @UM.Def _ _ _ f i => is_true false end | @UM.Def _ _ _ f' pf => match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf0 => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v2 fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k v2 pf0 fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' g' end end), @eq V v1 v2 *) case: (UMC.from f)=>[|f' F] // _; case: decP=>// H _ E. (* Goal: @eq V v1 v2 *) have: fnd k (ins k v1 f') = fnd k (ins k v2 f') by rewrite E. (* Goal: forall _ : @eq (option V) (@fnd K V k (@ins K V k v1 f')) (@fnd K V k (@ins K V k v2 f')), @eq V v1 v2 *) by rewrite !fnd_ins eq_refl; case. Qed. Lemma updU k1 k2 v1 v2 f : upd k1 v1 (upd k2 v2 f) = if k1 == k2 then upd k1 v1 f else upd k2 v2 (upd k1 v1 f). Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.upd K V U k1 v1 (@UMC.upd K V U k2 v2 f)) (if @eq_op (Ordered.eqType K) k1 k2 then @UMC.upd K V U k1 v1 f else @UMC.upd K V U k2 v2 (@UMC.upd K V U k1 v1 f)) *) rewrite !umEX /UM.upd. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v2 fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k2 v2 pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k1 v1 fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k1 v1 pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end) (if @eq_op (Ordered.eqType K) k1 k2 then @UMC.to K V U match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k1 v1 fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k1 v1 pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end else @UMC.to K V U match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k1 v1 fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k1 v1 pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v2 fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k2 v2 pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end) *) case: (UMC.from f)=>[|f' H']; case: ifP=>// E; case: decP=>H1; case: decP=>H2 //; rewrite !umEX. (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@ins K V k1 v1 (@ins K V k2 v2 f')) (@ins K V k2 v2 (@ins K V k1 v1 f')) *) (* Goal: is_true false *) (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@ins K V k1 v1 (@ins K V k2 v2 f')) (@ins K V k1 v1 f') *) - (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@ins K V k1 v1 (@ins K V k2 v2 f')) (@ins K V k2 v2 (@ins K V k1 v1 f')) *) (* Goal: is_true false *) (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@ins K V k1 v1 (@ins K V k2 v2 f')) (@ins K V k1 v1 f') *) by rewrite ins_ins E. (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@ins K V k1 v1 (@ins K V k2 v2 f')) (@ins K V k2 v2 (@ins K V k1 v1 f')) *) (* Goal: is_true false *) - (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@ins K V k1 v1 (@ins K V k2 v2 f')) (@ins K V k2 v2 (@ins K V k1 v1 f')) *) (* Goal: is_true false *) by rewrite (eqP E) in H2 *. by rewrite ins_ins E. Qed. Qed. Lemma updF k1 k2 v f : upd k1 v (free k2 f) = if k1 == k2 then upd k1 v f else free k2 (upd k1 v f). Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.upd K V U k1 v (@UMC.free K V U k2 f)) (if @eq_op (Ordered.eqType K) k1 k2 then @UMC.upd K V U k1 v f else @UMC.free K V U k2 (@UMC.upd K V U k1 v f)) *) rewrite !umEX /UM.dom /UM.upd /UM.free. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k2 fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k2 pf) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k1 v fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k1 v pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end) (if @eq_op (Ordered.eqType K) k1 k2 then @UMC.to K V U match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k1 v fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k1 v pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end else @UMC.to K V U match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k1)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k1 v fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k1 v pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k2 fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k2 pf) end) *) case: (UMC.from f)=>[|f' F] //; case: ifP=>// H1; by case: decP=>H2 //; rewrite !umEX ins_rem H1. Qed. Lemma updUnL k v f1 f2 : upd k v (f1 \+ f2) = if k \in dom f1 then upd k v f1 \+ f2 else f1 \+ upd k v f2. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.upd K V U k v (@PCM.join (@union_map_classPCM K V U) f1 f2)) (if @in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)) then @PCM.join (@union_map_classPCM K V U) (@UMC.upd K V U k v f1) f2 else @PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2)) *) rewrite !pcmE /= !umEX /UM.upd /UM.union /UM.dom. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k v pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end) (if @in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end) then @UMC.to K V U match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k v pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end else @UMC.to K V U match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k v pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end) *) case: (UMC.from f1) (UMC.from f2)=>[|f1' F1][|f2' F2] //=. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k v pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end) (if @in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) then @UMC.to K V U match match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f1') (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k v pf F1) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => if @disj K V fs1 f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 f2' pf1 F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end else @UMC.to K V U match match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f2') (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k v pf F2) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V f1' fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' fs2 F1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (if @in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) then @UMC.to K V U match match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f1') (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k v pf F1) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end else @UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) - (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k v pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end) (if @in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) then @UMC.to K V U match match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f1') (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k v pf F1) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => if @disj K V fs1 f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 f2' pf1 F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end else @UMC.to K V U match match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f2') (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k v pf F2) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V f1' fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' fs2 F1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (if @in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) then @UMC.to K V U match match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f1') (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k v pf F1) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end else @UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) by case: ifP=>//; case: decP. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k v pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end) (if @in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) then @UMC.to K V U match match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f1') (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k v pf F1) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => if @disj K V fs1 f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 f2' pf1 F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end else @UMC.to K V U match match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f2') (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k v pf F2) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V f1' fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' fs2 F1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end) *) case: ifP=>// D; case: ifP=>// H1; case: decP=>// H2. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@UMC.to K V U (if @disj K V f1' (@ins K V k v f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@ins K V k v f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@ins K V k v f2') F1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k v H2 F2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@UMC.to K V U (if @disj K V (@ins K V k v f1') f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@ins K V k v f1') f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f1') f2' (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k v H2 F1) F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v (@fcat K V f1' f2')) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') k v H2 (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2)))) (@UMC.to K V U (if @disj K V f1' (@ins K V k v f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@ins K V k v f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@ins K V k v f2') F1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k v H2 F2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v (@fcat K V f1' f2')) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') k v H2 (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2)))) (@UMC.to K V U (if @disj K V (@ins K V k v f1') f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@ins K V k v f1') f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f1') f2' (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k v H2 F1) F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) - (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@UMC.to K V U (if @disj K V f1' (@ins K V k v f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@ins K V k v f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@ins K V k v f2') F1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k v H2 F2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@UMC.to K V U (if @disj K V (@ins K V k v f1') f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@ins K V k v f1') f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f1') f2' (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k v H2 F1) F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v (@fcat K V f1' f2')) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') k v H2 (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2)))) (@UMC.to K V U (if @disj K V f1' (@ins K V k v f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@ins K V k v f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@ins K V k v f2') F1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k v H2 F2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v (@fcat K V f1' f2')) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') k v H2 (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2)))) (@UMC.to K V U (if @disj K V (@ins K V k v f1') f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@ins K V k v f1') f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f1') f2' (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k v H2 F1) F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) rewrite disjC disj_ins disjC D !umEX; case: disjP D=>// H _. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@UMC.to K V U (if @disj K V f1' (@ins K V k v f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@ins K V k v f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@ins K V k v f2') F1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k v H2 F2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@UMC.to K V U (if @disj K V (@ins K V k v f1') f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@ins K V k v f1') f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f1') f2' (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k v H2 F1) F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v (@fcat K V f1' f2')) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') k v H2 (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2)))) (@UMC.to K V U (if @disj K V f1' (@ins K V k v f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@ins K V k v f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@ins K V k v f2') F1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k v H2 F2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) (* Goal: match (if andb (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f2')))) true then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@ins K V k v f1') f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f1') f2' (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k v H2 F1) F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => is_true false | @UM.Def _ _ _ g' pg => @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@ins K V k v (@fcat K V f1' f2')) g' end *) by rewrite (H _ H1) /= fcat_inss // (H _ H1). (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@UMC.to K V U (if @disj K V f1' (@ins K V k v f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@ins K V k v f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@ins K V k v f2') F1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k v H2 F2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@UMC.to K V U (if @disj K V (@ins K V k v f1') f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@ins K V k v f1') f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f1') f2' (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k v H2 F1) F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v (@fcat K V f1' f2')) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') k v H2 (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2)))) (@UMC.to K V U (if @disj K V f1' (@ins K V k v f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@ins K V k v f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@ins K V k v f2') F1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k v H2 F2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) - (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@UMC.to K V U (if @disj K V f1' (@ins K V k v f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@ins K V k v f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@ins K V k v f2') F1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k v H2 F2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@UMC.to K V U (if @disj K V (@ins K V k v f1') f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@ins K V k v f1') f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f1') f2' (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k v H2 F1) F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v (@fcat K V f1' f2')) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') k v H2 (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2)))) (@UMC.to K V U (if @disj K V f1' (@ins K V k v f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@ins K V k v f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@ins K V k v f2') F1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k v H2 F2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) by rewrite disj_ins H1 D /= !umEX fcat_sins. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@UMC.to K V U (if @disj K V f1' (@ins K V k v f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@ins K V k v f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@ins K V k v f2') F1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k v H2 F2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@UMC.to K V U (if @disj K V (@ins K V k v f1') f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@ins K V k v f1') f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f1') f2' (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k v H2 F1) F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) - (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@UMC.to K V U (if @disj K V f1' (@ins K V k v f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@ins K V k v f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@ins K V k v f2') F1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k v H2 F2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@UMC.to K V U (if @disj K V (@ins K V k v f1') f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@ins K V k v f1') f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v f1') f2' (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k v H2 F1) F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) by rewrite disjC disj_ins disjC D andbF. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (@UMC.to K V U (if @disj K V f1' (@ins K V k v f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' (@ins K V k v f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' (@ins K V k v f2') F1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k v H2 F2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) by rewrite disj_ins D andbF. Qed. Lemma updUnR k v f1 f2 : upd k v (f1 \+ f2) = if k \in dom f2 then f1 \+ upd k v f2 else upd k v f1 \+ f2. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.upd K V U k v (@PCM.join (@union_map_classPCM K V U) f1 f2)) (if @in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)) then @PCM.join (@union_map_classPCM K V U) f1 (@UMC.upd K V U k v f2) else @PCM.join (@union_map_classPCM K V U) (@UMC.upd K V U k v f1) f2) *) by rewrite joinC updUnL (joinC f1) (joinC f2). Qed. End UpdateLemmas. Section FreeLemmas. Variables (K : ordType) (V : Type) (U : union_map_class K V). Implicit Types (k : K) (v : V) (f : U). Lemma free0 k : free k Unit = Unit :> U. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.free K V U k (@PCM.unit (@union_map_classPCM K V U))) (@PCM.unit (@union_map_classPCM K V U)) *) by rewrite !pcmE /= !umEX /UM.free /UM.empty rem_empty. Qed. Lemma freeU k1 k2 v f : free k1 (upd k2 v f) = if k1 == k2 then if cond U k2 then free k1 f else um_undef else upd k2 v (free k1 f). Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.free K V U k1 (@UMC.upd K V U k2 v f)) (if @eq_op (Ordered.eqType K) k1 k2 then if @pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k2 then @UMC.free K V U k1 f else @UMC.um_undef K V U else @UMC.upd K V U k2 v (@UMC.free K V U k1 f)) *) rewrite !umEX /UM.free /UM.upd /cond. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k2 v pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k1 pf) end) (if @eq_op (Ordered.eqType K) k1 k2 then if @pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x)) k2 then @UMC.to K V U match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k1 pf) end else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x)))) else @UMC.to K V U match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k1 pf) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k2 v pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end) *) case: (UMC.from f)=>[|f' F]; first by case: ifP=>H1 //; case: ifP. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U match match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v f') (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k2 v pf F) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k1 pf) end) (if @eq_op (Ordered.eqType K) k1 k2 then if @pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x)) k2 then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 f') (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k1 F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x)))) else @UMC.to K V U match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v (@rem K V k1 f')) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 f') k2 v pf (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k1 F)) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end) *) case: ifP=>H1; case: decP=>H2 //=. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 (@ins K V k2 v f')) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v f') k1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k2 v H2 F)))) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v (@rem K V k1 f')) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 f') k2 v H2 (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k1 F)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2 then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 f') (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k1 F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 (@ins K V k2 v f')) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v f') k1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k2 v H2 F)))) (if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2 then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 f') (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k1 F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) - (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 (@ins K V k2 v f')) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v f') k1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k2 v H2 F)))) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v (@rem K V k1 f')) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 f') k2 v H2 (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k1 F)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2 then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 f') (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k1 F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 (@ins K V k2 v f')) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v f') k1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k2 v H2 F)))) (if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2 then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 f') (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k1 F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) by rewrite H2 !umEX rem_ins H1. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 (@ins K V k2 v f')) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v f') k1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k2 v H2 F)))) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v (@rem K V k1 f')) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 f') k2 v H2 (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k1 F)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2 then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 f') (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k1 F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) - (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 (@ins K V k2 v f')) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v f') k1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k2 v H2 F)))) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v (@rem K V k1 f')) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 f') k2 v H2 (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k1 F)))) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) (if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2 then @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 f') (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k1 F)) else @UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) x))))) *) by case: ifP H2. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 (@ins K V k2 v f')) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v f') k1 (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k2 v H2 F)))) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v (@rem K V k1 f')) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 f') k2 v H2 (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k1 F)))) *) by rewrite !umEX rem_ins H1. Qed. Lemma freeF k1 k2 f : free k1 (free k2 f) = if k1 == k2 then free k1 f else free k2 (free k1 f). Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.free K V U k1 (@UMC.free K V U k2 f)) (if @eq_op (Ordered.eqType K) k1 k2 then @UMC.free K V U k1 f else @UMC.free K V U k2 (@UMC.free K V U k1 f)) *) rewrite !umEX /UM.free. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k2 fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k2 pf) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k1 pf) end) (if @eq_op (Ordered.eqType K) k1 k2 then @UMC.to K V U match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k1 pf) end else @UMC.to K V U match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k1 fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k1 pf) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k2 fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k2 pf) end) *) by case: (UMC.from f)=>[|f' F]; case: ifP=>// E; rewrite !umEX rem_rem E. Qed. Lemma freeUn k f1 f2 : free k (f1 \+ f2) = if k \in dom (f1 \+ f2) then free k f1 \+ free k f2 else f1 \+ f2. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.free K V U k (@PCM.join (@union_map_classPCM K V U) f1 f2)) (if @in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@PCM.join (@union_map_classPCM K V U) f1 f2))) then @PCM.join (@union_map_classPCM K V U) (@UMC.free K V U k f1) (@UMC.free K V U k f2) else @PCM.join (@union_map_classPCM K V U) f1 f2) *) rewrite !pcmE /= !umEX /UM.free /UM.union /UM.dom. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k pf) end) (if @in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end) then @UMC.to K V U match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k pf) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k pf) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end else @UMC.to K V U match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end) *) case: (UMC.from f1) (UMC.from f2)=>[|f1' F1][|f2' F2] //. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k pf) end) (if @in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end) then @UMC.to K V U (if @disj K V (@rem K V k f1') (@rem K V k f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@rem K V k f1') (@rem K V k f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k f1') (@rem K V k f2') (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k F1) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k F2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) else @UMC.to K V U (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) case: ifP=>// E1; rewrite supp_fcat inE /=. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k (@fcat K V f1' f2')) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') k (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2)))) (if orb (@in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1'))) (@in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f2'))) then @UMC.to K V U (if @disj K V (@rem K V k f1') (@rem K V k f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@rem K V k f1') (@rem K V k f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k f1') (@rem K V k f2') (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k F1) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k F2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) else @UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2))) *) case: ifP=>E2; last by rewrite !umEX rem_supp // supp_fcat inE E2. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k (@fcat K V f1' f2')) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') k (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2)))) (@UMC.to K V U (if @disj K V (@rem K V k f1') (@rem K V k f2') then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@rem K V k f1') (@rem K V k f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k f1') (@rem K V k f2') (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k F1) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k F2)) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)))) *) rewrite disj_rem; last by rewrite disjC disj_rem // disjC. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k (@fcat K V f1' f2')) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') k (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2)))) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V (@rem K V k f1') (@rem K V k f2')) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k f1') (@rem K V k f2') (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' k F1) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' k F2)))) *) rewrite !umEX; case/orP: E2=>E2. (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@rem K V k (@fcat K V f1' f2')) (@fcat K V (@rem K V k f1') (@rem K V k f2')) *) (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@rem K V k (@fcat K V f1' f2')) (@fcat K V (@rem K V k f1') (@rem K V k f2')) *) - (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@rem K V k (@fcat K V f1' f2')) (@fcat K V (@rem K V k f1') (@rem K V k f2')) *) (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@rem K V k (@fcat K V f1' f2')) (@fcat K V (@rem K V k f1') (@rem K V k f2')) *) suff E3: k \notin supp f2' by rewrite -fcat_rems // (rem_supp E3). (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@rem K V k (@fcat K V f1' f2')) (@fcat K V (@rem K V k f1') (@rem K V k f2')) *) (* Goal: is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f2')))) *) by case: disjP E1 E2=>// H _; move/H. (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@rem K V k (@fcat K V f1' f2')) (@fcat K V (@rem K V k f1') (@rem K V k f2')) *) suff E3: k \notin supp f1' by rewrite -fcat_srem // (rem_supp E3). (* Goal: is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f1')))) *) by case: disjP E1 E2=>// H _; move/contra: (H k); rewrite negbK. Qed. Lemma freeUnV k f1 f2 : valid (f1 \+ f2) -> free k (f1 \+ f2) = free k f1 \+ free k f2. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2)), @eq (@UMC.sort K V U) (@UMC.free K V U k (@PCM.join (@union_map_classPCM K V U) f1 f2)) (@PCM.join (@union_map_classPCM K V U) (@UMC.free K V U k f1) (@UMC.free K V U k f2)) *) move=>V'; rewrite freeUn domUn V' /=; case: ifP=>//. (* Goal: forall _ : @eq bool (@in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@SimplPred (Ordered.sort K) (fun x : Ordered.sort K => orb (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1))) (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))))))) false, @eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2) (@PCM.join (@union_map_classPCM K V U) (@UMC.free K V U k f1) (@UMC.free K V U k f2)) *) by move/negbT; rewrite negb_or; case/andP=>H1 H2; rewrite !dom_free. Qed. Lemma freeUnL k f1 f2 : k \notin dom f1 -> free k (f1 \+ f2) = f1 \+ free k f2. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))), @eq (@UMC.sort K V U) (@UMC.free K V U k (@PCM.join (@union_map_classPCM K V U) f1 f2)) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.free K V U k f2)) *) move=>V1; rewrite freeUn domUn inE (negbTE V1) /=. (* Goal: @eq (@UMC.sort K V U) (if andb (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2)) (@in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))) then @PCM.join (@union_map_classPCM K V U) (@UMC.free K V U k f1) (@UMC.free K V U k f2) else @PCM.join (@union_map_classPCM K V U) f1 f2) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.free K V U k f2)) *) case: ifP; first by case/andP; rewrite dom_free. (* Goal: forall _ : @eq bool (andb (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2)) (@in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))) false, @eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.free K V U k f2)) *) move/negbT; rewrite negb_and; case/orP=>V2; last by rewrite dom_free. (* Goal: @eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.free K V U k f2)) *) suff: ~~ valid (f1 \+ free k f2) by move/invalidE: V2=>-> /invalidE ->. (* Goal: is_true (negb (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.free K V U k f2)))) *) apply: contra V2; case: validUn=>// H1 H2 H _. (* Goal: is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2)) *) case: validUn=>//; first by rewrite H1. (* Goal: forall (k : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), is_true false *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f2)), is_true false *) - (* Goal: forall (k : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), is_true false *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f2)), is_true false *) by move: H2; rewrite validF => ->. (* Goal: forall (k : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), is_true false *) move=>x H3; move: (H _ H3); rewrite domF inE /=. (* Goal: forall (_ : is_true (negb (if @eq_op (Ordered.eqType K) k x then false else @in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2))))) (_ : is_true (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), is_true false *) by case: ifP H3 V1=>[|_ _ _]; [move/eqP=><- -> | move/negbTE=>->]. Qed. Lemma freeUnR k f1 f2 : k \notin dom f2 -> free k (f1 \+ f2) = free k f1 \+ f2. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)))), @eq (@UMC.sort K V U) (@UMC.free K V U k (@PCM.join (@union_map_classPCM K V U) f1 f2)) (@PCM.join (@union_map_classPCM K V U) (@UMC.free K V U k f1) f2) *) by move=>H; rewrite joinC freeUnL // joinC. Qed. Lemma free_umfilt p k f : free k (um_filter p f) = if p k then um_filter p (free k f) else um_filter p f. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.free K V U k (@UMC.um_filter K V U p f)) (if p k then @UMC.um_filter K V U p (@UMC.free K V U k f) else @UMC.um_filter K V U p f) *) rewrite !umEX /UM.free /UM.um_filter. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p pf) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k pf) end) (if p k then @UMC.to K V U match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k pf) end with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p pf) end else @UMC.to K V U match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p pf) end) *) case: (UMC.from f)=>[|f' F]; case: ifP=>// E; rewrite !umEX. (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@rem K V k (@kfilter K V p f')) (@kfilter K V p f') *) (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@rem K V k (@kfilter K V p f')) (@kfilter K V p (@rem K V k f')) *) - (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@rem K V k (@kfilter K V p f')) (@kfilter K V p f') *) (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@rem K V k (@kfilter K V p f')) (@kfilter K V p (@rem K V k f')) *) by rewrite kfilt_rem E. (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) (@rem K V k (@kfilter K V p f')) (@kfilter K V p f') *) by rewrite rem_kfilt E. Qed. End FreeLemmas. Section FindLemmas. Variables (K : ordType) (V : Type) (U : union_map_class K V). Implicit Types (k : K) (v : V) (f : U). Lemma find0E k : find k (Unit : U) = None. Proof. (* Goal: @eq (option V) (@UMC.find K V U k (@PCM.unit (@union_map_classPCM K V U) : @UMC.sort K V U)) (@None V) *) by rewrite pcmE /= !umEX /UM.find /= fnd_empty. Qed. Lemma find_undef k : find k (um_undef : U) = None. Proof. (* Goal: @eq (option V) (@UMC.find K V U k (@UMC.um_undef K V U : @UMC.sort K V U)) (@None V) *) by rewrite !umEX /UM.find. Qed. Lemma find_cond k f : ~~ cond U k -> find k f = None. Proof. (* Goal: forall _ : is_true (negb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k)), @eq (option V) (@UMC.find K V U k f) (@None V) *) simpl. (* Goal: forall _ : is_true (negb (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)), @eq (option V) (@UMC.find K V U k f) (@None V) *) rewrite !umEX /UM.find; case: (UMC.from f)=>[|f' F] // H. (* Goal: @eq (option V) (@fnd K V k f') (@None V) *) suff: k \notin supp f' by case: suppP. (* Goal: is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f')))) *) by apply: contra H; case: allP F=>// F _ /F. Qed. Lemma findU k1 k2 v f : find k1 (upd k2 v f) = if k1 == k2 then if cond U k2 && valid f then Some v else None else if cond U k2 then find k1 f else None. Proof. (* Goal: @eq (option V) (@UMC.find K V U k1 (@UMC.upd K V U k2 v f)) (if @eq_op (Ordered.eqType K) k1 k2 then if andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k2) (@PCM.valid (@union_map_classPCM K V U) f) then @Some V v else @None V else if @pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k2 then @UMC.find K V U k1 f else @None V) *) rewrite pcmE /= !umEX /UM.valid /UM.find /UM.upd /cond. (* Goal: @eq (option V) match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k2 v pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @None V | @UM.Def _ _ _ fs i => @fnd K V k1 fs end (if @eq_op (Ordered.eqType K) k1 k2 then if andb (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2) match @UMC.from K V U f with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end then @Some V v else @None V else if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2 then match @UMC.from K V U f with | @UM.Undef _ _ _ => @None V | @UM.Def _ _ _ fs i => @fnd K V k1 fs end else @None V) *) case: (UMC.from f)=>[|f' F]; first by rewrite andbF !if_same. (* Goal: @eq (option V) match match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k2 v f') (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' k2 v pf F) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end with | @UM.Undef _ _ _ => @None V | @UM.Def _ _ _ fs i => @fnd K V k1 fs end (if @eq_op (Ordered.eqType K) k1 k2 then if andb (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2) true then @Some V v else @None V else if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2 then @fnd K V k1 f' else @None V) *) case: decP=>H; first by rewrite H /= fnd_ins. (* Goal: @eq (option V) (@None V) (if @eq_op (Ordered.eqType K) k1 k2 then if andb (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2) true then @Some V v else @None V else if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k2 then @fnd K V k1 f' else @None V) *) by rewrite (introF idP H) /= if_same. Qed. Lemma findF k1 k2 f : find k1 (free k2 f) = if k1 == k2 then None else find k1 f. Proof. (* Goal: @eq (option V) (@UMC.find K V U k1 (@UMC.free K V U k2 f)) (if @eq_op (Ordered.eqType K) k1 k2 then @None V else @UMC.find K V U k1 f) *) rewrite !umEX /UM.find /UM.free. (* Goal: @eq (option V) match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@rem K V k2 fs) (@UM.all_supp_remP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k2 pf) end with | @UM.Undef _ _ _ => @None V | @UM.Def _ _ _ fs i => @fnd K V k1 fs end (if @eq_op (Ordered.eqType K) k1 k2 then @None V else match @UMC.from K V U f with | @UM.Undef _ _ _ => @None V | @UM.Def _ _ _ fs i => @fnd K V k1 fs end) *) case: (UMC.from f)=>[|f' F]; first by rewrite if_same. (* Goal: @eq (option V) (@fnd K V k1 (@rem K V k2 f')) (if @eq_op (Ordered.eqType K) k1 k2 then @None V else @fnd K V k1 f') *) by rewrite fnd_rem. Qed. Lemma findUnL k f1 f2 : valid (f1 \+ f2) -> find k (f1 \+ f2) = if k \in dom f1 then find k f1 else find k f2. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2)), @eq (option V) (@UMC.find K V U k (@PCM.join (@union_map_classPCM K V U) f1 f2)) (if @in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f1)) then @UMC.find K V U k f1 else @UMC.find K V U k f2) *) rewrite !pcmE /= !umEX /UM.valid /UM.find /UM.union /UM.dom. (* Goal: forall _ : is_true match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end, @eq (option V) match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => @None V | @UM.Def _ _ _ fs i => @fnd K V k fs end (if @in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end) then match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @None V | @UM.Def _ _ _ fs i => @fnd K V k fs end else match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @None V | @UM.Def _ _ _ fs i => @fnd K V k fs end) *) case: (UMC.from f1) (UMC.from f2)=>[|f1' F1][|f2' F2] //. (* Goal: forall _ : is_true match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end, @eq (option V) match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => @None V | @UM.Def _ _ _ fs i => @fnd K V k fs end (if @in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@supp K V f1')) then @fnd K V k f1' else @fnd K V k f2') *) case: ifP=>// D _; case: ifP=>E1; last first. (* Goal: @eq (option V) (@fnd K V k (@fcat K V f1' f2')) (@fnd K V k f1') *) (* Goal: @eq (option V) (@fnd K V k (@fcat K V f1' f2')) (@fnd K V k f2') *) - (* Goal: @eq (option V) (@fnd K V k (@fcat K V f1' f2')) (@fnd K V k f1') *) (* Goal: @eq (option V) (@fnd K V k (@fcat K V f1' f2')) (@fnd K V k f2') *) rewrite fnd_fcat; case: ifP=>// E2. (* Goal: @eq (option V) (@fnd K V k (@fcat K V f1' f2')) (@fnd K V k f1') *) (* Goal: @eq (option V) (@fnd K V k f1') (@fnd K V k f2') *) by rewrite fnd_supp ?E1 // fnd_supp ?E2. (* Goal: @eq (option V) (@fnd K V k (@fcat K V f1' f2')) (@fnd K V k f1') *) suff E2: k \notin supp f2' by rewrite fnd_fcat (negbTE E2). (* Goal: is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f2')))) *) by case: disjP D E1=>// H _; apply: H. Qed. Lemma findUnR k f1 f2 : valid (f1 \+ f2) -> find k (f1 \+ f2) = if k \in dom f2 then find k f2 else find k f1. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2)), @eq (option V) (@UMC.find K V U k (@PCM.join (@union_map_classPCM K V U) f1 f2)) (if @in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f2)) then @UMC.find K V U k f2 else @UMC.find K V U k f1) *) by rewrite joinC=>D; rewrite findUnL. Qed. Lemma find_eta f1 f2 : valid f1 -> valid f2 -> (forall k, find k f1 = find k f2) -> f1 = f2. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f1)) (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f2)) (_ : forall k : Ordered.sort K, @eq (option V) (@UMC.find K V U k f1) (@UMC.find K V U k f2)), @eq (@UMC.sort K V U) f1 f2 *) rewrite !pcmE /= !umEX /UM.valid /UM.find -{2 3}[f1]UMC.tfE -{2 3}[f2]UMC.tfE. (* Goal: forall (_ : is_true match @UMC.from K V U f1 with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end) (_ : is_true match @UMC.from K V U f2 with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end) (_ : forall k : Ordered.sort K, @eq (option V) (@UMC.find K V U k (@UMC.to K V U (@UMC.from K V U f1))) (@UMC.find K V U k (@UMC.to K V U (@UMC.from K V U f2)))), @eq (@UMC.sort K V U) (@UMC.to K V U (@UMC.from K V U f1)) (@UMC.to K V U (@UMC.from K V U f2)) *) case: (UMC.from f1) (UMC.from f2)=>[|f1' F1][|f2' F2] // _ _ H. (* Goal: @eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' F1)) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f2' F2)) *) by rewrite !umEX; apply/fmapP=>k; move: (H k); rewrite !umEX. Qed. Lemma find_umfilt p k f : find k (um_filter p f) = if p k then find k f else None. Proof. (* Goal: @eq (option V) (@UMC.find K V U k (@UMC.um_filter K V U p f)) (if p k then @UMC.find K V U k f else @None V) *) rewrite !umEX /UM.find /UM.um_filter. (* Goal: @eq (option V) match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p pf) end with | @UM.Undef _ _ _ => @None V | @UM.Def _ _ _ fs i => @fnd K V k fs end (if p k then match @UMC.from K V U f with | @UM.Undef _ _ _ => @None V | @UM.Def _ _ _ fs i => @fnd K V k fs end else @None V) *) case: (UMC.from f)=>[|f' F]; first by rewrite if_same. (* Goal: @eq (option V) (@fnd K V k (@kfilter K V p f')) (if p k then @fnd K V k f' else @None V) *) by rewrite fnd_kfilt. Qed. End FindLemmas. Lemma domeq_eta (K : ordType) (U : union_map_class K unit) (f1 f2 : U) : dom_eq f1 f2 -> f1 = f2. Section EmpbLemmas. Variables (K : ordType) (V : Type) (U : union_map_class K V). Implicit Types (k : K) (v : V) (f : U). Lemma empb_undef : empb (um_undef : U) = false. Proof. (* Goal: @eq bool (@UMC.empb K V U (@UMC.um_undef K V U : @UMC.sort K V U)) false *) by rewrite !umEX. Qed. Lemma empbP f : reflect (f = Unit) (empb f). Proof. (* Goal: Bool.reflect (@eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U))) (@UMC.empb K V U f) *) rewrite pcmE /= !umEX /UM.empty /UM.empb -{1}[f]UMC.tfE. (* Goal: Bool.reflect (@eq (@UMC.sort K V U) (@UMC.to K V U (@UMC.from K V U f)) (@UMC.to K V U (@UM.Def K V (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U)) (nil K V) is_true_true))) match @UMC.from K V U f with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ fs i => @eq_op (seq_eqType (Ordered.eqType K)) (@supp K V fs) (@Datatypes.nil (Equality.sort (Ordered.eqType K))) end *) case: (UMC.from f)=>[|f' F]; first by apply: ReflectF; rewrite !umEX. (* Goal: Bool.reflect (@eq (@UMC.sort K V U) (@UMC.to K V U (@UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f' F)) (@UMC.to K V U (@UM.Def K V (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U)) (nil K V) is_true_true))) (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f') (@Datatypes.nil (Equality.sort (Ordered.eqType K)))) *) case: eqP=>E; constructor; rewrite !umEX. (* Goal: not (@eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' (nil K V)) *) (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' (nil K V) *) - (* Goal: not (@eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' (nil K V)) *) (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' (nil K V) *) by move/supp_nilE: E=>->. (* Goal: not (@eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' (nil K V)) *) by move=>H; rewrite H in E. Qed. Lemma empbU k v f : empb (upd k v f) = false. Proof. (* Goal: @eq bool (@UMC.empb K V U (@UMC.upd K V U k v f)) false *) rewrite !umEX /UM.empb /UM.upd. (* Goal: @eq bool match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs fpf => match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@ins K V k v fs) (@UM.all_supp_insP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs k v pf fpf) | right n => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ fs i => @eq_op (seq_eqType (Ordered.eqType K)) (@supp K V fs) (@Datatypes.nil (Equality.sort (Ordered.eqType K))) end false *) case: (UMC.from f)=>[|f' F] //; case: decP=>// H. (* Goal: @eq bool (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V (@ins K V k v f')) (@Datatypes.nil (Equality.sort (Ordered.eqType K)))) false *) suff: k \in supp (ins k v f') by case: (supp _). (* Goal: is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V (@ins K V k v f')))) *) by rewrite supp_ins inE /= eq_refl. Qed. Lemma empbUn f1 f2 : empb (f1 \+ f2) = empb f1 && empb f2. Proof. (* Goal: @eq bool (@UMC.empb K V U (@PCM.join (@union_map_classPCM K V U) f1 f2)) (andb (@UMC.empb K V U f1) (@UMC.empb K V U f2)) *) rewrite !pcmE /= !umEX /UM.empb /UM.union. (* Goal: @eq bool match match @UMC.from K V U f1 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs1 pf1 => match @UMC.from K V U f2 with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs2 pf2 => if @disj K V fs1 fs2 then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V fs1 fs2) (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs1 fs2 pf1 pf2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) end end with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ fs i => @eq_op (seq_eqType (Ordered.eqType K)) (@supp K V fs) (@Datatypes.nil (Equality.sort (Ordered.eqType K))) end (andb match @UMC.from K V U f1 with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ fs i => @eq_op (seq_eqType (Ordered.eqType K)) (@supp K V fs) (@Datatypes.nil (Equality.sort (Ordered.eqType K))) end match @UMC.from K V U f2 with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ fs i => @eq_op (seq_eqType (Ordered.eqType K)) (@supp K V fs) (@Datatypes.nil (Equality.sort (Ordered.eqType K))) end) *) case: (UMC.from f1) (UMC.from f2)=>[|f1' F1][|f2' F2] //. (* Goal: @eq bool match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ fs i => @eq_op (seq_eqType (Ordered.eqType K)) (@supp K V fs) (@Datatypes.nil (Equality.sort (Ordered.eqType K))) end (andb (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f1') (@Datatypes.nil (Equality.sort (Ordered.eqType K)))) (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) (* Goal: @eq bool false (andb (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f1') (@Datatypes.nil (Equality.sort (Ordered.eqType K)))) false) *) - (* Goal: @eq bool match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ fs i => @eq_op (seq_eqType (Ordered.eqType K)) (@supp K V fs) (@Datatypes.nil (Equality.sort (Ordered.eqType K))) end (andb (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f1') (@Datatypes.nil (Equality.sort (Ordered.eqType K)))) (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) (* Goal: @eq bool false (andb (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f1') (@Datatypes.nil (Equality.sort (Ordered.eqType K)))) false) *) by rewrite andbF. (* Goal: @eq bool match (if @disj K V f1' f2' then @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@fcat K V f1' f2') (@UM.all_supp_fcatP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) f1' f2' F1 F2) else @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U))) with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ fs i => @eq_op (seq_eqType (Ordered.eqType K)) (@supp K V fs) (@Datatypes.nil (Equality.sort (Ordered.eqType K))) end (andb (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f1') (@Datatypes.nil (Equality.sort (Ordered.eqType K)))) (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) case: ifP=>E; case: eqP=>E1; case: eqP=>E2 //; last 2 first. (* Goal: @eq bool true (andb false (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) (* Goal: @eq bool true (andb true (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) (* Goal: @eq bool false (andb true true) *) (* Goal: @eq bool false (andb true (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) - (* Goal: @eq bool true (andb false (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) (* Goal: @eq bool true (andb true (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) (* Goal: @eq bool false (andb true true) *) (* Goal: @eq bool false (andb true (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) by move: E2 E1; move/supp_nilE=>->; rewrite fcat0s; case: eqP. (* Goal: @eq bool true (andb false (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) (* Goal: @eq bool true (andb true (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) (* Goal: @eq bool false (andb true true) *) - (* Goal: @eq bool true (andb false (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) (* Goal: @eq bool true (andb true (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) (* Goal: @eq bool false (andb true true) *) by move: E1 E2 E; do 2![move/supp_nilE=>->]; case: disjP. (* Goal: @eq bool true (andb false (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) (* Goal: @eq bool true (andb true (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) - (* Goal: @eq bool true (andb false (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) (* Goal: @eq bool true (andb true (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) by move/supp_nilE: E2 E1=>-> <-; rewrite fcat0s eq_refl. (* Goal: @eq bool true (andb false (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) have [k H3]: exists k, k \in supp f1'. (* Goal: @eq bool true (andb false (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) (* Goal: @ex (Ordered.sort K) (fun k : Ordered.sort K => is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f1')))) *) - (* Goal: @eq bool true (andb false (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) (* Goal: @ex (Ordered.sort K) (fun k : Ordered.sort K => is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V f1')))) *) case: (supp f1') {E1 E} E2=>[|x s _] //. (* Goal: @eq bool true (andb false (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) (* Goal: @ex (Ordered.sort K) (fun k : Ordered.sort K => is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@cons (Ordered.sort K) x s)))) *) by exists x; rewrite inE eq_refl. (* Goal: @eq bool true (andb false (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f2') (@Datatypes.nil (Equality.sort (Ordered.eqType K))))) *) suff: k \in supp (fcat f1' f2') by rewrite E1. (* Goal: is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@supp K V (@fcat K V f1' f2')))) *) by rewrite supp_fcat inE /= H3. Qed. Lemma empbE f : f = Unit <-> empb f. Lemma empb0 : empb (Unit : U). Proof. (* Goal: is_true (@UMC.empb K V U (@PCM.unit (@union_map_classPCM K V U) : @UMC.sort K V U)) *) by apply/empbE. Qed. Lemma join0E f1 f2 : f1 \+ f2 = Unit <-> f1 = Unit /\ f2 = Unit. Proof. (* Goal: iff (@eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) f1 f2) (@PCM.unit (@union_map_classPCM K V U))) (and (@eq (@UMC.sort K V U) f1 (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f2 (@PCM.unit (@union_map_classPCM K V U)))) *) by rewrite !empbE empbUn; case: andP. Qed. Lemma validEb f : reflect (valid f /\ forall k, k \notin dom f) (empb f). Proof. (* Goal: Bool.reflect (and (is_true (@PCM.valid (@union_map_classPCM K V U) f)) (forall k : Ordered.sort K, is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) (@UMC.empb K V U f) *) case: empbP=>E; constructor; first by rewrite E valid_unit dom0. (* Goal: not (and (is_true (@PCM.valid (@union_map_classPCM K V U) f)) (forall k : Ordered.sort K, is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) case=>V' H; apply: E; move: V' H. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f)) (_ : forall k : Ordered.sort K, is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f))))), @eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)) *) rewrite !pcmE /= !umEX /UM.valid /UM.dom /UM.empty -{3}[f]UMC.tfE. (* Goal: forall (_ : is_true match @UMC.from K V U f with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ f i => true end) (_ : forall k : Ordered.sort K, is_true (negb (@in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) match @UMC.from K V U f with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @supp K V fs end)))), @eq (@UMC.sort K V U) (@UMC.to K V U (@UMC.from K V U f)) (@UMC.to K V U (@UM.Def K V (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U)) (nil K V) is_true_true)) *) case: (UMC.from f)=>[|f' F] // _ H; rewrite !umEX. (* Goal: @eq (@finMap_for K V (Phant (forall _ : Ordered.sort K, V))) f' (nil K V) *) apply/supp_nilE; case: (supp f') H=>// x s /(_ x). (* Goal: forall _ : is_true (negb (@in_mem (Ordered.sort K) x (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@cons (Ordered.sort K) x s)))), @eq (list (Ordered.sort K)) (@cons (Ordered.sort K) x s) (@Datatypes.nil (Ordered.sort K)) *) by rewrite inE eq_refl. Qed. Lemma validUnEb f : valid (f \+ f) = empb f. Proof. (* Goal: @eq bool (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f f)) (@UMC.empb K V U f) *) case E: (empb f); first by move/empbE: E=>->; rewrite unitL valid_unit. (* Goal: @eq bool (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f f)) false *) case: validUn=>// V' _ L; case: validEb E=>//; case; split=>// k. (* Goal: is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))) *) by case E: (k \in dom f)=>//; move: (L k E); rewrite E. Qed. Lemma empb_umfilt p f : empb f -> empb (um_filter p f). Proof. (* Goal: forall _ : is_true (@UMC.empb K V U f), is_true (@UMC.empb K V U (@UMC.um_filter K V U p f)) *) rewrite !umEX /UM.empb /UM.um_filter. (* Goal: forall _ : is_true match @UMC.from K V U f with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ fs i => @eq_op (seq_eqType (Ordered.eqType K)) (@supp K V fs) (@Datatypes.nil (Equality.sort (Ordered.eqType K))) end, is_true match match @UMC.from K V U f with | @UM.Undef _ _ _ => @UM.Undef K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) | @UM.Def _ _ _ fs pf => @UM.Def K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) (@kfilter K V p fs) (@UM.all_supp_kfilterP K V (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U)) fs p pf) end with | @UM.Undef _ _ _ => false | @UM.Def _ _ _ fs i => @eq_op (seq_eqType (Ordered.eqType K)) (@supp K V fs) (@Datatypes.nil (Equality.sort (Ordered.eqType K))) end *) case: (UMC.from f)=>[|f' F] //. (* Goal: forall _ : is_true (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V f') (@Datatypes.nil (Equality.sort (Ordered.eqType K)))), is_true (@eq_op (seq_eqType (Ordered.eqType K)) (@supp K V (@kfilter K V p f')) (@Datatypes.nil (Equality.sort (Ordered.eqType K)))) *) by move/eqP/supp_nilE=>->; rewrite kfilt_nil. Qed. End EmpbLemmas. Section UndefLemmas. Variables (K : ordType) (V : Type) (U : union_map_class K V). Implicit Types (k : K) (v : V) (f : U). Lemma undefb_undef : undefb (um_undef : U). Proof. (* Goal: is_true (@UMC.undefb K V U (@UMC.um_undef K V U : @UMC.sort K V U)) *) by rewrite !umEX. Qed. Lemma undefbP f : reflect (f = um_undef) (undefb f). Proof. (* Goal: Bool.reflect (@eq (@UMC.sort K V U) f (@UMC.um_undef K V U)) (@UMC.undefb K V U f) *) rewrite !umEX /UM.undefb -{1}[f]UMC.tfE. (* Goal: Bool.reflect (@eq (@UMC.sort K V U) (@UMC.to K V U (@UMC.from K V U f)) (@UMC.to K V U (@UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U))))) match @UMC.from K V U f with | @UM.Undef _ _ _ => true | @UM.Def _ _ _ f i => false end *) by case: (UMC.from f)=>[|f' F]; constructor; rewrite !umEX. Qed. Lemma undefbE f : f = um_undef <-> undefb f. Lemma join_undefL f : um_undef \+ f = um_undef. Proof. (* Goal: @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) (@UMC.um_undef K V U) f) (@UMC.um_undef K V U) *) by rewrite /PCM.join /= !umEX. Qed. Lemma join_undefR f : f \+ um_undef = um_undef. Proof. (* Goal: @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) f (@UMC.um_undef K V U)) (@UMC.um_undef K V U) *) by rewrite joinC join_undefL. Qed. End UndefLemmas. Section AllDefLemmas. Variables (K : ordType) (V : Type) (U : union_map_class K V) (P : V -> Prop). Implicit Types (k : K) (v : V) (f : U). Definition um_all f := forall k v, find k f = Some v -> P v. Lemma umall_undef : um_all um_undef. Proof. (* Goal: um_all (@UMC.um_undef K V U) *) by move=>k v; rewrite find_undef. Qed. Hint Resolve umall_undef : core. Lemma umall0 : um_all Unit. Proof. (* Goal: um_all (@PCM.unit (@union_map_classPCM K V U)) *) by move=>k v; rewrite find0E. Qed. Lemma umallUn f1 f2 : um_all f1 -> um_all f2 -> um_all (f1 \+ f2). Proof. (* Goal: forall (_ : um_all f1) (_ : um_all f2), um_all (@PCM.join (@union_map_classPCM K V U) f1 f2) *) case W : (valid (f1 \+ f2)); last by move/invalidE: (negbT W)=>->. (* Goal: forall (_ : um_all f1) (_ : um_all f2), um_all (@PCM.join (@union_map_classPCM K V U) f1 f2) *) by move=>X Y k v; rewrite findUnL //; case: ifP=>_; [apply: X|apply: Y]. Qed. Lemma umallUnL f1 f2 : valid (f1 \+ f2) -> um_all (f1 \+ f2) -> um_all f1. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2))) (_ : um_all (@PCM.join (@union_map_classPCM K V U) f1 f2)), um_all f1 *) by move=>W H k v F; apply: (H k v); rewrite findUnL // (find_some F). Qed. Lemma umallUnR f1 f2 : valid (f1 \+ f2) -> um_all (f1 \+ f2) -> um_all f2. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f1 f2))) (_ : um_all (@PCM.join (@union_map_classPCM K V U) f1 f2)), um_all f2 *) by rewrite joinC; apply: umallUnL. Qed. End AllDefLemmas. Hint Resolve umall_undef umall0 : core. Section Interaction. Variables (K : ordType) (A : Type) (U : union_map_class K A). Implicit Types (x y a b : U) (p q : pred K). Lemma subdom_umfilt x p : {subset dom (um_filter p x) <= p}. Proof. (* Goal: @sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U (@UMC.um_filter K A U p x))) (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p) *) by move=>a; rewrite dom_umfilt; case/andP. Qed. Lemma subdom_indomE x p : {subset dom x <= p} = {in dom x, p =1 predT}. Proof. (* Goal: @eq Prop (@sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U x)) (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p)) (@prop_in1 (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U x)) (fun x : Ordered.sort K => @eq bool (p x) (@pred_of_simpl (Ordered.sort K) (@predT (Ordered.sort K)) x)) (inPhantom (@eqfun bool (Ordered.sort K) p (@pred_of_simpl (Ordered.sort K) (@predT (Ordered.sort K)))))) *) by []. Qed. Lemma subdom_umfiltE x p : {subset dom x <= p} <-> um_filter p x = x. Proof. (* Goal: iff (@sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U x)) (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p)) (@eq (@UMC.sort K A U) (@UMC.um_filter K A U p x) x) *) split; last by move=><- a; rewrite dom_umfilt; case/andP. (* Goal: forall _ : @sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U x)) (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p), @eq (@UMC.sort K A U) (@UMC.um_filter K A U p x) x *) by move/eq_in_umfilt=>->; rewrite umfilt_predT. Qed. Lemma umfilt_memdomE x : um_filter (mem (dom x)) x = x. Proof. (* Goal: @eq (@UMC.sort K A U) (@UMC.um_filter K A U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U x)))) x) x *) by apply/subdom_umfiltE. Qed. Lemma subset_disjE p q : {subset p <= predC q} <-> [predI p & q] =1 pred0. Proof. (* Goal: iff (@sub_mem (Ordered.sort K) (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p) (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@predC (Ordered.sort K) q))) (@eqfun bool (Ordered.sort K) (@pred_of_simpl (Ordered.sort K) (@predI (Ordered.sort K) (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p))) (@pred_of_simpl (Ordered.sort K) (@pred_of_mem_pred (Ordered.sort K) (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) q))))) (@pred_of_simpl (Ordered.sort K) (@pred0 (Ordered.sort K)))) *) split=>H a /=; first by case X: (a \in p)=>//; move/H/negbTE: X. (* Goal: forall _ : is_true (@in_mem (Ordered.sort K) a (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p)), is_true (@in_mem (Ordered.sort K) a (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@predC (Ordered.sort K) q))) *) by move=>D; move: (H a); rewrite inE /= D; move/negbT. Qed. Lemma subset_disjC p q : {subset p <= predC q} <-> {subset q <= predC p}. Proof. (* Goal: iff (@sub_mem (Ordered.sort K) (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p) (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@predC (Ordered.sort K) q))) (@sub_mem (Ordered.sort K) (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) q) (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@predC (Ordered.sort K) p))) *) by split=>H a; apply: contraL (H a). Qed. Lemma valid_subdom x y : valid (x \+ y) -> {subset dom x <= [predC dom y]}. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) x y)), @sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U x)) (@mem (Equality.sort (Ordered.eqType K)) (simplPredType (Equality.sort (Ordered.eqType K))) (@predC (Equality.sort (Ordered.eqType K)) (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U y)))))) *) by case: validUn. Qed. Lemma subdom_valid x y : {subset dom x <= [predC dom y]} -> valid x -> valid y -> valid (x \+ y). Proof. (* Goal: forall (_ : @sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U x)) (@mem (Equality.sort (Ordered.eqType K)) (simplPredType (Equality.sort (Ordered.eqType K))) (@predC (Equality.sort (Ordered.eqType K)) (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U y))))))) (_ : is_true (@PCM.valid (@union_map_classPCM K A U) x)) (_ : is_true (@PCM.valid (@union_map_classPCM K A U) y)), is_true (@PCM.valid (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) x y)) *) by move=>H X Y; case: validUn; rewrite ?X ?Y=>// k /H /negbTE /= ->. Qed. Lemma subdom_umfilt0 x p : valid x -> {subset dom x <= predC p} <-> um_filter p x = Unit. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K A U) x), iff (@sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U x)) (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@predC (Ordered.sort K) p))) (@eq (@UMC.sort K A U) (@UMC.um_filter K A U p x) (@PCM.unit (@union_map_classPCM K A U))) *) move=>V; split=>H. (* Goal: @sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U x)) (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@predC (Ordered.sort K) p)) *) (* Goal: @eq (@UMC.sort K A U) (@UMC.um_filter K A U p x) (@PCM.unit (@union_map_classPCM K A U)) *) - (* Goal: @sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U x)) (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@predC (Ordered.sort K) p)) *) (* Goal: @eq (@UMC.sort K A U) (@UMC.um_filter K A U p x) (@PCM.unit (@union_map_classPCM K A U)) *) by rewrite (eq_in_umfilt (p2:=pred0)) ?umfilt_pred0 // => a /H /negbTE ->. (* Goal: @sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U x)) (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@predC (Ordered.sort K) p)) *) move=>k X; case: dom_find X H=>// a _ -> _; rewrite umfiltU !inE. (* Goal: forall _ : @eq (@UMC.sort K A U) (if p k then @UMC.upd K A U k a (@UMC.um_filter K A U p (@UMC.free K A U k x)) else if @UMC.p K A (@UMC.sort K A U) (@UMC.class K A U) k then @UMC.um_filter K A U p (@UMC.free K A U k x) else @UMC.um_undef K A U) (@PCM.unit (@union_map_classPCM K A U)), is_true (negb (p k)) *) by case: ifP=>// _ /empbE; rewrite /= empbU. Qed. End Interaction. Section UmpleqLemmas. Variables (K : ordType) (A : Type) (U : union_map_class K A). Implicit Types (x y a b : U) (p : pred K). Lemma umpleq_undef x : [pcm x <= um_undef]. Proof. (* Goal: @pcm_preord (@union_map_classPCM K A U) x (@UMC.um_undef K A U) *) by exists um_undef; rewrite join_undefR. Qed. Hint Resolve umpleq_undef : core. Lemma umpleq_asym x y : [pcm x <= y] -> [pcm y <= x] -> x = y. Proof. (* Goal: forall (_ : @pcm_preord (@union_map_classPCM K A U) x y) (_ : @pcm_preord (@union_map_classPCM K A U) y x), @eq (@UMC.sort K A U) x y *) case=>a -> [b]; case V : (valid x); last first. (* Goal: forall _ : @eq (PCM.sort (@union_map_classPCM K A U)) x (@PCM.join (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) x a) b), @eq (@UMC.sort K A U) x (@PCM.join (@union_map_classPCM K A U) x a) *) (* Goal: forall _ : @eq (PCM.sort (@union_map_classPCM K A U)) x (@PCM.join (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) x a) b), @eq (@UMC.sort K A U) x (@PCM.join (@union_map_classPCM K A U) x a) *) - (* Goal: forall _ : @eq (PCM.sort (@union_map_classPCM K A U)) x (@PCM.join (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) x a) b), @eq (@UMC.sort K A U) x (@PCM.join (@union_map_classPCM K A U) x a) *) (* Goal: forall _ : @eq (PCM.sort (@union_map_classPCM K A U)) x (@PCM.join (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) x a) b), @eq (@UMC.sort K A U) x (@PCM.join (@union_map_classPCM K A U) x a) *) by move/invalidE: (negbT V)=>->; rewrite join_undefL. (* Goal: forall _ : @eq (PCM.sort (@union_map_classPCM K A U)) x (@PCM.join (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) x a) b), @eq (@UMC.sort K A U) x (@PCM.join (@union_map_classPCM K A U) x a) *) rewrite -{1 2}[x]unitR -joinA in V *. by case/(joinxK V)/esym/join0E=>->; rewrite unitR. Qed. Qed. Lemma umpleq_filt2 x y p : [pcm x <= y] -> [pcm um_filter p x <= um_filter p y]. Proof. (* Goal: forall _ : @pcm_preord (@union_map_classPCM K A U) x y, @pcm_preord (@union_map_classPCM K A U) (@UMC.um_filter K A U p x) (@UMC.um_filter K A U p y) *) move=>H; case V : (valid y). (* Goal: @pcm_preord (@union_map_classPCM K A U) (@UMC.um_filter K A U p x) (@UMC.um_filter K A U p y) *) (* Goal: @pcm_preord (@union_map_classPCM K A U) (@UMC.um_filter K A U p x) (@UMC.um_filter K A U p y) *) - (* Goal: @pcm_preord (@union_map_classPCM K A U) (@UMC.um_filter K A U p x) (@UMC.um_filter K A U p y) *) (* Goal: @pcm_preord (@union_map_classPCM K A U) (@UMC.um_filter K A U p x) (@UMC.um_filter K A U p y) *) by case: H V=>a -> V; rewrite umfiltUn //; eexists _. (* Goal: @pcm_preord (@union_map_classPCM K A U) (@UMC.um_filter K A U p x) (@UMC.um_filter K A U p y) *) by move/invalidE: (negbT V)=>->; rewrite umfilt_undef; apply: umpleq_undef. Qed. Lemma umpleq_filtI x p : [pcm um_filter p x <= x]. Proof. (* Goal: @pcm_preord (@union_map_classPCM K A U) (@UMC.um_filter K A U p x) x *) exists (um_filter (predD predT p) x); rewrite -umfilt_predU. (* Goal: @eq (PCM.sort (@union_map_classPCM K A U)) x (@UMC.um_filter K A U (@pred_of_simpl (Ordered.sort K) (@predU (Ordered.sort K) p (@pred_of_simpl (Ordered.sort K) (@predT (Ordered.sort K))))) x) *) by rewrite -{1}[x]umfilt_predT; apply: eq_in_umfilt=>a; rewrite /= orbT. Qed. Hint Resolve umpleq_filtI : core. Lemma umpleq_filtE a x : valid x -> [pcm a <= x] <-> um_filter (mem (dom a)) x = a. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K A U) x), iff (@pcm_preord (@union_map_classPCM K A U) a x) (@eq (@UMC.sort K A U) (@UMC.um_filter K A U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U a)))) x) a) *) by move=>V; split=>[|<-] // H; case: H V=>b ->; apply: umfilt_dom. Qed. Lemma umpleq_filt_meet a x p : {subset dom a <= p} -> [pcm a <= x] -> [pcm a <= um_filter p x]. Proof. (* Goal: forall (_ : @sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U a)) (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) p)) (_ : @pcm_preord (@union_map_classPCM K A U) a x), @pcm_preord (@union_map_classPCM K A U) a (@UMC.um_filter K A U p x) *) by move=>D /(umpleq_filt2 p); rewrite (eq_in_umfilt D) umfilt_predT. Qed. Lemma umpleq_join x a b : valid (a \+ b) -> [pcm a <= x] -> [pcm b <= x] -> [pcm a \+ b <= x]. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) a b))) (_ : @pcm_preord (@union_map_classPCM K A U) a x) (_ : @pcm_preord (@union_map_classPCM K A U) b x), @pcm_preord (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) a b) x *) case Vx : (valid x); last by move/invalidE: (negbT Vx)=>->. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) a b))) (_ : @pcm_preord (@union_map_classPCM K A U) a x) (_ : @pcm_preord (@union_map_classPCM K A U) b x), @pcm_preord (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) a b) x *) move=>V /(umpleq_filtE _ Vx) <- /(umpleq_filtE _ Vx) <-. (* Goal: @pcm_preord (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) (@UMC.um_filter K A U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U a)))) x) (@UMC.um_filter K A U (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U b)))) x)) x *) by rewrite -umfilt_dpredU //; apply: valid_subdom V. Qed. Lemma umpleq_subdom x y : valid y -> [pcm x <= y] -> {subset dom x <= dom y}. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K A U) y)) (_ : @pcm_preord (@union_map_classPCM K A U) x y), @sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U x)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U y)) *) by move=>V H; case: H V=>a -> V b D; rewrite domUn inE V D. Qed. Lemma subdom_umpleq a x y : valid (x \+ y) -> [pcm a <= x \+ y] -> {subset dom a <= dom x} -> [pcm a <= x]. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) x y))) (_ : @pcm_preord (@union_map_classPCM K A U) a (@PCM.join (@union_map_classPCM K A U) x y)) (_ : @sub_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U a)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U x))), @pcm_preord (@union_map_classPCM K A U) a x *) move=>V H Sx; move: (umpleq_filt_meet Sx H); rewrite umfiltUn //. (* Goal: forall _ : @pcm_preord (@union_map_classPCM K A U) a (@PCM.join (@union_map_classPCM K A U) (@UMC.um_filter K A U (@pred_of_eq_seq (Ordered.eqType K) (@UMC.dom K A U x)) x) (@UMC.um_filter K A U (@pred_of_eq_seq (Ordered.eqType K) (@UMC.dom K A U x)) y)), @pcm_preord (@union_map_classPCM K A U) a x *) rewrite umfilt_memdomE; move/subset_disjC: (valid_subdom V). (* Goal: forall (_ : @sub_mem (Ordered.sort K) (@mem (Ordered.sort K) (predPredType (Ordered.sort K)) (@pred_of_simpl (Equality.sort (Ordered.eqType K)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U y))))) (@mem (Ordered.sort K) (simplPredType (Ordered.sort K)) (@predC (Ordered.sort K) (@pred_of_eq_seq (Ordered.eqType K) (@UMC.dom K A U x))))) (_ : @pcm_preord (@union_map_classPCM K A U) a (@PCM.join (@union_map_classPCM K A U) x (@UMC.um_filter K A U (@pred_of_eq_seq (Ordered.eqType K) (@UMC.dom K A U x)) y))), @pcm_preord (@union_map_classPCM K A U) a x *) by move/(subdom_umfilt0 _ (validR V))=>->; rewrite unitR. Qed. Lemma umpleq_meet a x y1 y2 : valid (x \+ y1 \+ y2) -> [pcm a <= x \+ y1] -> [pcm a <= x \+ y2] -> [pcm a <= x]. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) x y1) y2))) (_ : @pcm_preord (@union_map_classPCM K A U) a (@PCM.join (@union_map_classPCM K A U) x y1)) (_ : @pcm_preord (@union_map_classPCM K A U) a (@PCM.join (@union_map_classPCM K A U) x y2)), @pcm_preord (@union_map_classPCM K A U) a x *) move=>V H1 H2. (* Goal: @pcm_preord (@union_map_classPCM K A U) a x *) have {V} [V1 V V2] : [/\ valid (x \+ y1), valid (y1 \+ y2) & valid (x \+ y2)]. (* Goal: @pcm_preord (@union_map_classPCM K A U) a x *) (* Goal: and3 (is_true (@PCM.valid (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) x y1))) (is_true (@PCM.valid (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) y1 y2))) (is_true (@PCM.valid (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) x y2))) *) - (* Goal: @pcm_preord (@union_map_classPCM K A U) a x *) (* Goal: and3 (is_true (@PCM.valid (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) x y1))) (is_true (@PCM.valid (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) y1 y2))) (is_true (@PCM.valid (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) x y2))) *) rewrite (validL V); rewrite -joinA in V; rewrite (validR V). (* Goal: @pcm_preord (@union_map_classPCM K A U) a x *) (* Goal: and3 (is_true true) (is_true true) (is_true (@PCM.valid (@union_map_classPCM K A U) (@PCM.join (@union_map_classPCM K A U) x y2))) *) by rewrite joinA joinAC in V; rewrite (validL V). (* Goal: @pcm_preord (@union_map_classPCM K A U) a x *) apply: subdom_umpleq (V1) (H1) _ => k D. (* Goal: is_true (@in_mem (Equality.sort (Ordered.eqType K)) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U x))) *) move: {D} (umpleq_subdom V1 H1 D) (umpleq_subdom V2 H2 D). (* Goal: forall (_ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U (@PCM.join (@union_map_classPCM K A U) x y1))))) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U (@PCM.join (@union_map_classPCM K A U) x y2))))), is_true (@in_mem (Equality.sort (Ordered.eqType K)) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U x))) *) rewrite !domUn !inE V1 V2 /=; case : (k \in dom x)=>//=. (* Goal: forall (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U y1)))) (_ : is_true (@in_mem (Ordered.sort K) k (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K A U y2)))), is_true false *) by case: validUn V=>// _ _ L _ /L /negbTE ->. Qed. Lemma umpleq_some x1 x2 t s : valid x2 -> [pcm x1 <= x2] -> find t x1 = Some s -> find t x2 = Some s. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K A U) x2)) (_ : @pcm_preord (@union_map_classPCM K A U) x1 x2) (_ : @eq (option A) (@UMC.find K A U t x1) (@Some A s)), @eq (option A) (@UMC.find K A U t x2) (@Some A s) *) by move=>V H; case: H V=>a -> V H; rewrite findUnL // (find_some H). Qed. Lemma umpleq_none x1 x2 t : valid x2 -> [pcm x1 <= x2] -> find t x2 = None -> find t x1 = None. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K A U) x2)) (_ : @pcm_preord (@union_map_classPCM K A U) x1 x2) (_ : @eq (option A) (@UMC.find K A U t x2) (@None A)), @eq (option A) (@UMC.find K A U t x1) (@None A) *) by case E: (find t x1)=>[a|] // V H <-; rewrite (umpleq_some V H E). Qed. End UmpleqLemmas. Section PointsToLemmas. Variables (K : ordType) (V : Type) (U : union_map_class K V). Implicit Types (k : K) (v : V) (f : U). Lemma ptsU k v : pts k v = upd k v Unit :> U. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.pts K V U k v) (@UMC.upd K V U k v (@PCM.unit (@union_map_classPCM K V U))) *) by rewrite !pcmE /= !umEX /UM.pts /UM.upd; case: decP. Qed. Lemma domPtK k v : dom (pts k v : U) = if cond U k then [:: k] else [::]. Proof. (* Goal: @eq (list (Ordered.sort K)) (@UMC.dom K V U (@UMC.pts K V U k v : @UMC.sort K V U)) (if @pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k then @cons (Ordered.sort K) k (@Datatypes.nil (Ordered.sort K)) else @Datatypes.nil (Ordered.sort K)) *) rewrite !umEX /= /UM.dom /supp /UM.pts /UM.upd /UM.empty /=. (* Goal: @eq (list (Ordered.sort K)) match match @decP (is_true (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@idP (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k)) with | left pf => @UM.Def K V (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U)) (@FinMap K V (@cons (prod (Ordered.sort K) V) (@pair (Ordered.sort K) V k v) (@Datatypes.nil (prod (Ordered.sort K) V))) (@sorted_ins' K V (@Datatypes.nil (prod (Ordered.sort K) V)) k v (sorted_nil K V))) (@UM.all_supp_insP K V (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U)) (nil K V) k v pf is_true_true) | right n => @UM.Undef K V (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U)) end with | @UM.Undef _ _ _ => @Datatypes.nil (Ordered.sort K) | @UM.Def _ _ _ fs i => @map (prod (Ordered.sort K) V) (Ordered.sort K) (@key K V) (@seq_of K V fs) end (if @UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k then @cons (Ordered.sort K) k (@Datatypes.nil (Ordered.sort K)) else @Datatypes.nil (Ordered.sort K)) *) by case D : (decP _)=>[a|a] /=; rewrite ?a ?(introF idP a). Qed. Lemma domPt k v : dom (pts k v : U) =i [pred x | cond U k & k == x]. Proof. (* Goal: @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.pts K V U k v : @UMC.sort K V U))) (@mem (Equality.sort (Ordered.eqType K)) (simplPredType (Equality.sort (Ordered.eqType K))) (@SimplPred (Equality.sort (Ordered.eqType K)) (fun x : Equality.sort (Ordered.eqType K) => andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (@eq_op (Ordered.eqType K) k x)))) *) by move=>x; rewrite ptsU domU !inE eq_sym valid_unit dom0; case: eqP. Qed. Lemma validPt k v : valid (pts k v : U) = cond U k. Proof. (* Goal: @eq bool (@PCM.valid (@union_map_classPCM K V U) (@UMC.pts K V U k v : @UMC.sort K V U)) (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) *) by rewrite ptsU validU valid_unit andbT. Qed. Lemma domeqPt k v1 v2 : dom_eq (pts k v1 : U) (pts k v2). Proof. (* Goal: is_true (@UMC.dom_eq K V U (@UMC.pts K V U k v1 : @UMC.sort K V U) (@UMC.pts K V U k v2)) *) by apply/domeqP; rewrite !validPt; split=>// x; rewrite !domPt. Qed. Lemma findPt k v : find k (pts k v : U) = if cond U k then Some v else None. Proof. (* Goal: @eq (option V) (@UMC.find K V U k (@UMC.pts K V U k v : @UMC.sort K V U)) (if @pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k then @Some V v else @None V) *) by rewrite ptsU findU eq_refl /= valid_unit andbT. Qed. Lemma findPt2 k1 k2 v : find k1 (pts k2 v : U) = if (k1 == k2) && cond U k2 then Some v else None. Proof. (* Goal: @eq (option V) (@UMC.find K V U k1 (@UMC.pts K V U k2 v : @UMC.sort K V U)) (if andb (@eq_op (Ordered.eqType K) k1 k2) (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k2) then @Some V v else @None V) *) by rewrite ptsU findU valid_unit andbT find0E; case: ifP=>//=; case: ifP. Qed. Lemma findPt_inv k1 k2 v w : find k1 (pts k2 v : U) = Some w -> [/\ k1 = k2, v = w & cond U k2]. Proof. (* Goal: forall _ : @eq (option V) (@UMC.find K V U k1 (@UMC.pts K V U k2 v : @UMC.sort K V U)) (@Some V w), and3 (@eq (Ordered.sort K) k1 k2) (@eq V v w) (is_true (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k2)) *) rewrite ptsU findU; case: eqP; last by case: ifP=>//; rewrite find0E. (* Goal: forall (_ : @eq (Equality.sort (Ordered.eqType K)) k1 k2) (_ : @eq (option V) (if andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k2) (@PCM.valid (@union_map_classPCM K V U) (@PCM.unit (@union_map_classPCM K V U))) then @Some V v else @None V) (@Some V w)), and3 (@eq (Ordered.sort K) k1 k2) (@eq V v w) (is_true (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k2)) *) by move=>->; rewrite valid_unit andbT; case: ifP=>// _ [->]. Qed. Lemma freePt2 k1 k2 v : cond U k2 -> free k1 (pts k2 v : U) = if k1 == k2 then Unit else pts k2 v. Proof. (* Goal: forall _ : is_true (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k2), @eq (@UMC.sort K V U) (@UMC.free K V U k1 (@UMC.pts K V U k2 v : @UMC.sort K V U)) (if @eq_op (Ordered.eqType K) k1 k2 then @PCM.unit (@union_map_classPCM K V U) else @UMC.pts K V U k2 v) *) by move=>N; rewrite ptsU freeU free0 N. Qed. Lemma freePt k v : cond U k -> free k (pts k v : U) = Unit. Proof. (* Goal: forall _ : is_true (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k), @eq (@UMC.sort K V U) (@UMC.free K V U k (@UMC.pts K V U k v : @UMC.sort K V U)) (@PCM.unit (@union_map_classPCM K V U)) *) by move=>N; rewrite freePt2 // eq_refl. Qed. Lemma cancelPt k v1 v2 : valid (pts k v1 : U) -> pts k v1 = pts k v2 :> U -> v1 = v2. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@UMC.pts K V U k v1 : @UMC.sort K V U))) (_ : @eq (@UMC.sort K V U) (@UMC.pts K V U k v1) (@UMC.pts K V U k v2)), @eq V v1 v2 *) by rewrite validPt !ptsU; apply: upd_inj. Qed. Lemma cancelPt2 k1 k2 v1 v2 : valid (pts k1 v1 : U) -> pts k1 v1 = pts k2 v2 :> U -> (k1, v1) = (k2, v2). Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1 : @UMC.sort K V U))) (_ : @eq (@UMC.sort K V U) (@UMC.pts K V U k1 v1) (@UMC.pts K V U k2 v2)), @eq (prod (Ordered.sort K) V) (@pair (Ordered.sort K) V k1 v1) (@pair (Ordered.sort K) V k2 v2) *) move=>H E; have : dom (pts k1 v1 : U) = dom (pts k2 v2 : U) by rewrite E. (* Goal: forall _ : @eq (list (Ordered.sort K)) (@UMC.dom K V U (@UMC.pts K V U k1 v1)) (@UMC.dom K V U (@UMC.pts K V U k2 v2)), @eq (prod (Ordered.sort K) V) (@pair (Ordered.sort K) V k1 v1) (@pair (Ordered.sort K) V k2 v2) *) rewrite !domPtK -(validPt _ v1) -(validPt _ v2) -E H. (* Goal: forall _ : @eq (list (Ordered.sort K)) (@cons (Ordered.sort K) k1 (@Datatypes.nil (Ordered.sort K))) (@cons (Ordered.sort K) k2 (@Datatypes.nil (Ordered.sort K))), @eq (prod (Ordered.sort K) V) (@pair (Ordered.sort K) V k1 v1) (@pair (Ordered.sort K) V k2 v2) *) by case=>E'; rewrite -{k2}E' in E *; rewrite (cancelPt H E). Qed. Lemma updPt k v1 v2 : upd k v1 (pts k v2) = pts k v1 :> U. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.upd K V U k v1 (@UMC.pts K V U k v2)) (@UMC.pts K V U k v1) *) by rewrite !ptsU updU eq_refl. Qed. Lemma empbPt k v : empb (pts k v : U) = false. Proof. (* Goal: @eq bool (@UMC.empb K V U (@UMC.pts K V U k v : @UMC.sort K V U)) false *) by rewrite ptsU empbU. Qed. Lemma validPtUn k v f : valid (pts k v \+ f) = [&& cond U k, valid f & k \notin dom f]. Proof. (* Goal: @eq bool (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f)) (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) case: validUn=>//; last 1 first. (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.pts K V U k v))))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f)), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) (@UMC.pts K V U k v))), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@UMC.pts K V U k v))) (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f)) (_ : forall (x : Equality.sort (Ordered.eqType K)) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.pts K V U k v))))), is_true (negb (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f))))), @eq bool true (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) - (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.pts K V U k v))))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f)), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) (@UMC.pts K V U k v))), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@UMC.pts K V U k v))) (_ : is_true (@PCM.valid (@union_map_classPCM K V U) f)) (_ : forall (x : Equality.sort (Ordered.eqType K)) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.pts K V U k v))))), is_true (negb (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f))))), @eq bool true (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) rewrite validPt=>H1 -> H2; rewrite H1 (H2 k) //. (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.pts K V U k v))))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f)), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) (@UMC.pts K V U k v))), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) (* Goal: is_true (@in_mem (Equality.sort (Ordered.eqType K)) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.pts K V U k v)))) *) by rewrite domPtK H1 inE. (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.pts K V U k v))))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f)), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) (@UMC.pts K V U k v))), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) - (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.pts K V U k v))))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f)), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) (@UMC.pts K V U k v))), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) by rewrite validPt; move/negbTE=>->. (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.pts K V U k v))))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f)), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) - (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.pts K V U k v))))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) (* Goal: forall _ : is_true (negb (@PCM.valid (@union_map_classPCM K V U) f)), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) by move/negbTE=>->; rewrite andbF. (* Goal: forall (k0 : Ordered.sort K) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@UMC.pts K V U k v))))) (_ : is_true (@in_mem (Ordered.sort K) k0 (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))), @eq bool false (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) rewrite domPtK=>x; case: ifP=>// _. (* Goal: forall (_ : is_true (@in_mem (Ordered.sort K) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@cons (Ordered.sort K) k (@Datatypes.nil (Ordered.sort K)))))) (_ : is_true (@in_mem (Ordered.sort K) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))), @eq bool false (andb true (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) by rewrite inE=>/eqP ->->; rewrite andbF. Qed. Lemma validUnPt k v f : valid (f \+ pts k v) = [&& cond U k, valid f & k \notin dom f]. Proof. (* Goal: @eq bool (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k v))) (andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) *) by rewrite joinC; apply: validPtUn. Qed. Lemma validPtUn_cond k v f : valid (pts k v \+ f) -> cond U k. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f)), is_true (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) *) by rewrite validPtUn; case/and3P. Qed. Lemma validUnPt_cond k v f : valid (f \+ pts k v) -> cond U k. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k v))), is_true (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) *) by rewrite joinC; apply: validPtUn_cond. Qed. Lemma validPtUnV k v f : valid (pts k v \+ f) -> valid f. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f)), is_true (@PCM.valid (@union_map_classPCM K V U) f) *) by rewrite validPtUn; case/and3P. Qed. Lemma validUnPtV k v f : valid (f \+ pts k v) -> valid f. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k v))), is_true (@PCM.valid (@union_map_classPCM K V U) f) *) by rewrite joinC; apply: validPtUnV. Qed. Lemma validPtUnD k v f : valid (pts k v \+ f) -> k \notin dom f. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f)), is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))) *) by rewrite validPtUn; case/and3P. Qed. Lemma validUnPtD k v f : valid (f \+ pts k v) -> k \notin dom f. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k v))), is_true (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))) *) by rewrite joinC; apply: validPtUnD. Qed. Lemma domPtUn k v f : dom (pts k v \+ f) =i [pred x | valid (pts k v \+ f) & (k == x) || (x \in dom f)]. Proof. (* Goal: @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f))) (@mem (Equality.sort (Ordered.eqType K)) (simplPredType (Equality.sort (Ordered.eqType K))) (@SimplPred (Equality.sort (Ordered.eqType K)) (fun x : Equality.sort (Ordered.eqType K) => andb (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f)) (orb (@eq_op (Ordered.eqType K) k x) (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f))))))) *) move=>x; rewrite domUn !inE !validPtUn domPt !inE. (* Goal: @eq bool (andb (andb (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) (orb (andb (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (@eq_op (Ordered.eqType K) k x)) (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f))))) (andb (andb (@UMC.p K V (@UMC.sort K V U) (@UMC.class K V U) k) (andb (@PCM.valid (@union_map_classPCM K V U) f) (negb (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)))))) (orb (@eq_op (Ordered.eqType K) k x) (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f))))) *) by rewrite -!andbA; case: (UMC.p _ k). Qed. Lemma domUnPt k v f : dom (f \+ pts k v) =i [pred x | valid (f \+ pts k v) & (k == x) || (x \in dom f)]. Proof. (* Goal: @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k v)))) (@mem (Equality.sort (Ordered.eqType K)) (simplPredType (Equality.sort (Ordered.eqType K))) (@SimplPred (Equality.sort (Ordered.eqType K)) (fun x : Equality.sort (Ordered.eqType K) => andb (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k v))) (orb (@eq_op (Ordered.eqType K) k x) (@in_mem (Equality.sort (Ordered.eqType K)) x (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f))))))) *) by rewrite joinC; apply: domPtUn. Qed. Lemma domPtUnE k v f : k \in dom (pts k v \+ f) = valid (pts k v \+ f). Proof. (* Goal: @eq bool (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f)))) (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f)) *) by rewrite domPtUn inE eq_refl andbT. Qed. Lemma domUnPtE k v f : k \in dom (f \+ pts k v) = valid (f \+ pts k v). Proof. (* Goal: @eq bool (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k v))))) (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k v))) *) by rewrite joinC; apply: domPtUnE. Qed. Lemma validxx f : valid (f \+ f) -> dom f =i pred0. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f f)), @eq_mem (Equality.sort (Ordered.eqType K)) (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)) (@mem (Equality.sort (Ordered.eqType K)) (simplPredType (Equality.sort (Ordered.eqType K))) (@pred0 (Equality.sort (Ordered.eqType K)))) *) by case: validUn=>// _ _ L _ z; case: (_ \in _) (L z)=>//; elim. Qed. Lemma domeqPtUn k v1 v2 f1 f2 : dom_eq f1 f2 -> dom_eq (pts k v1 \+ f1) (pts k v2 \+ f2). Proof. (* Goal: forall _ : is_true (@UMC.dom_eq K V U f1 f2), is_true (@UMC.dom_eq K V U (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v1) f1) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v2) f2)) *) by apply: domeqUn=>//; apply: domeqPt. Qed. Lemma domeqUnPt k v1 v2 f1 f2 : dom_eq f1 f2 -> dom_eq (f1 \+ pts k v1) (f2 \+ pts k v2). Proof. (* Goal: forall _ : is_true (@UMC.dom_eq K V U f1 f2), is_true (@UMC.dom_eq K V U (@PCM.join (@union_map_classPCM K V U) f1 (@UMC.pts K V U k v1)) (@PCM.join (@union_map_classPCM K V U) f2 (@UMC.pts K V U k v2))) *) by rewrite (joinC f1) (joinC f2); apply: domeqPtUn. Qed. Lemma findPtUn k v f : valid (pts k v \+ f) -> find k (pts k v \+ f) = Some v. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f)), @eq (option V) (@UMC.find K V U k (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f)) (@Some V v) *) move=>V'; rewrite findUnL // domPt inE. (* Goal: @eq (option V) (if andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k) (@eq_op (Ordered.eqType K) k k) then @UMC.find K V U k (@UMC.pts K V U k v) else @UMC.find K V U k f) (@Some V v) *) by rewrite ptsU findU eq_refl valid_unit (validPtUn_cond V'). Qed. Lemma findUnPt k v f : valid (f \+ pts k v) -> find k (f \+ pts k v) = Some v. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k v))), @eq (option V) (@UMC.find K V U k (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k v))) (@Some V v) *) by rewrite joinC; apply: findPtUn. Qed. Lemma findPtUn2 k1 k2 v f : valid (pts k2 v \+ f) -> find k1 (pts k2 v \+ f) = if k1 == k2 then Some v else find k1 f. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v) f)), @eq (option V) (@UMC.find K V U k1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v) f)) (if @eq_op (Ordered.eqType K) k1 k2 then @Some V v else @UMC.find K V U k1 f) *) move=>V'; rewrite findUnL // domPt inE eq_sym. (* Goal: @eq (option V) (if andb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k2) (@eq_op (Ordered.eqType K) k1 k2) then @UMC.find K V U k1 (@UMC.pts K V U k2 v) else @UMC.find K V U k1 f) (if @eq_op (Ordered.eqType K) k1 k2 then @Some V v else @UMC.find K V U k1 f) *) by rewrite findPt2 (validPtUn_cond V') andbT /=; case: ifP=>// ->. Qed. Lemma findUnPt2 k1 k2 v f : valid (f \+ pts k2 v) -> find k1 (f \+ pts k2 v) = if k1 == k2 then Some v else find k1 f. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k2 v))), @eq (option V) (@UMC.find K V U k1 (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k2 v))) (if @eq_op (Ordered.eqType K) k1 k2 then @Some V v else @UMC.find K V U k1 f) *) by rewrite joinC; apply: findPtUn2. Qed. Lemma freePtUn2 k1 k2 v f : valid (pts k2 v \+ f) -> free k1 (pts k2 v \+ f) = if k1 == k2 then f else pts k2 v \+ free k1 f. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v) f)), @eq (@UMC.sort K V U) (@UMC.free K V U k1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v) f)) (if @eq_op (Ordered.eqType K) k1 k2 then f else @PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v) (@UMC.free K V U k1 f)) *) move=>V'; rewrite freeUn domPtUn inE V' /= eq_sym. (* Goal: @eq (@UMC.sort K V U) (if orb (@eq_op (Ordered.eqType K) k1 k2) (@in_mem (Ordered.sort K) k1 (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f))) then @PCM.join (@union_map_classPCM K V U) (@UMC.free K V U k1 (@UMC.pts K V U k2 v)) (@UMC.free K V U k1 f) else @PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v) f) (if @eq_op (Ordered.eqType K) k1 k2 then f else @PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v) (@UMC.free K V U k1 f)) *) rewrite ptsU freeU (validPtUn_cond V') free0. (* Goal: @eq (@UMC.sort K V U) (if orb (@eq_op (Ordered.eqType K) k1 k2) (@in_mem (Ordered.sort K) k1 (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f))) then @PCM.join (@union_map_classPCM K V U) (if @eq_op (Ordered.eqType K) k1 k2 then @PCM.unit (@union_map_classPCM K V U) else @UMC.upd K V U k2 v (@PCM.unit (@union_map_classPCM K V U))) (@UMC.free K V U k1 f) else @PCM.join (@union_map_classPCM K V U) (@UMC.upd K V U k2 v (@PCM.unit (@union_map_classPCM K V U))) f) (if @eq_op (Ordered.eqType K) k1 k2 then f else @PCM.join (@union_map_classPCM K V U) (@UMC.upd K V U k2 v (@PCM.unit (@union_map_classPCM K V U))) (@UMC.free K V U k1 f)) *) case: eqP=>/= E; first by rewrite E unitL (dom_free (validPtUnD V')). (* Goal: @eq (@UMC.sort K V U) (if @in_mem (Ordered.sort K) k1 (@mem (Ordered.sort K) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f)) then @PCM.join (@union_map_classPCM K V U) (@UMC.upd K V U k2 v (@PCM.unit (@union_map_classPCM K V U))) (@UMC.free K V U k1 f) else @PCM.join (@union_map_classPCM K V U) (@UMC.upd K V U k2 v (@PCM.unit (@union_map_classPCM K V U))) f) (@PCM.join (@union_map_classPCM K V U) (@UMC.upd K V U k2 v (@PCM.unit (@union_map_classPCM K V U))) (@UMC.free K V U k1 f)) *) by case: ifP=>// N; rewrite dom_free // N. Qed. Lemma freeUnPt2 k1 k2 v f : valid (f \+ pts k2 v) -> free k1 (f \+ pts k2 v) = if k1 == k2 then f else free k1 f \+ pts k2 v. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k2 v))), @eq (@UMC.sort K V U) (@UMC.free K V U k1 (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k2 v))) (if @eq_op (Ordered.eqType K) k1 k2 then f else @PCM.join (@union_map_classPCM K V U) (@UMC.free K V U k1 f) (@UMC.pts K V U k2 v)) *) by rewrite !(joinC _ (pts k2 v)); apply: freePtUn2. Qed. Lemma freePtUn k v f : valid (pts k v \+ f) -> free k (pts k v \+ f) = f. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f)), @eq (@UMC.sort K V U) (@UMC.free K V U k (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f)) f *) by move=>V'; rewrite freePtUn2 // eq_refl. Qed. Lemma freeUnPt k v f : valid (f \+ pts k v) -> free k (f \+ pts k v) = f. Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k v))), @eq (@UMC.sort K V U) (@UMC.free K V U k (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k v))) f *) by rewrite joinC; apply: freePtUn. Qed. Lemma updPtUn k v1 v2 f : upd k v1 (pts k v2 \+ f) = pts k v1 \+ f. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.upd K V U k v1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v2) f)) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v1) f) *) case V1 : (valid (pts k v2 \+ f)). (* Goal: @eq (@UMC.sort K V U) (@UMC.upd K V U k v1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v2) f)) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v1) f) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.upd K V U k v1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v2) f)) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v1) f) *) - (* Goal: @eq (@UMC.sort K V U) (@UMC.upd K V U k v1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v2) f)) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v1) f) *) (* Goal: @eq (@UMC.sort K V U) (@UMC.upd K V U k v1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v2) f)) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v1) f) *) by rewrite updUnL domPt inE eq_refl updPt (validPtUn_cond V1). (* Goal: @eq (@UMC.sort K V U) (@UMC.upd K V U k v1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v2) f)) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v1) f) *) have V2 : valid (pts k v1 \+ f) = false. (* Goal: @eq (@UMC.sort K V U) (@UMC.upd K V U k v1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v2) f)) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v1) f) *) (* Goal: @eq bool (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v1) f)) false *) - (* Goal: @eq (@UMC.sort K V U) (@UMC.upd K V U k v1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v2) f)) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v1) f) *) (* Goal: @eq bool (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v1) f)) false *) by rewrite !validPtUn in V1 *. move/negbT/invalidE: V1=>->; move/negbT/invalidE: V2=>->. by apply: upd_invalid. Qed. Qed. Lemma updUnPt k v1 v2 f : upd k v1 (f \+ pts k v2) = f \+ pts k v1. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.upd K V U k v1 (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k v2))) (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k v1)) *) by rewrite !(joinC f); apply: updPtUn. Qed. Lemma empbPtUn k v f : empb (pts k v \+ f) = false. Proof. (* Goal: @eq bool (@UMC.empb K V U (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f)) false *) by rewrite empbUn empbPt. Qed. Lemma empbUnPt k v f : empb (f \+ pts k v) = false. Proof. (* Goal: @eq bool (@UMC.empb K V U (@PCM.join (@union_map_classPCM K V U) f (@UMC.pts K V U k v))) false *) by rewrite joinC; apply: empbPtUn. Qed. Lemma pts_undef k v1 v2 : pts k v1 \+ pts k v2 = um_undef :> U. Proof. (* Goal: @eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v1) (@UMC.pts K V U k v2)) (@UMC.um_undef K V U) *) apply/invalidE; rewrite validPtUn validPt domPt !negb_and negb_or eq_refl. (* Goal: is_true (orb (negb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k)) (orb (negb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k)) (andb (negb (negb (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k))) (negb (negb true))))) *) by case: (cond U k). Qed. Lemma umfiltPt p k v : um_filter p (pts k v : U) = if p k then pts k v else if cond U k then Unit else um_undef. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.um_filter K V U p (@UMC.pts K V U k v : @UMC.sort K V U)) (if p k then @UMC.pts K V U k v else if @pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k then @PCM.unit (@union_map_classPCM K V U) else @UMC.um_undef K V U) *) by rewrite ptsU umfiltU umfilt0. Qed. Lemma umfiltPtUn p k v f : um_filter p (pts k v \+ f) = if valid (pts k v \+ f) then if p k then pts k v \+ um_filter p f else um_filter p f else um_undef. Proof. (* Goal: @eq (@UMC.sort K V U) (@UMC.um_filter K V U p (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f)) (if @PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f) then if p k then @PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) (@UMC.um_filter K V U p f) else @UMC.um_filter K V U p f else @UMC.um_undef K V U) *) case: ifP=>X; last by move/invalidE: (negbT X)=>->; rewrite umfilt_undef. (* Goal: @eq (@UMC.sort K V U) (@UMC.um_filter K V U p (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f)) (if p k then @PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) (@UMC.um_filter K V U p f) else @UMC.um_filter K V U p f) *) rewrite umfiltUn // umfiltPt (validPtUn_cond X). (* Goal: @eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (if p k then @UMC.pts K V U k v else @PCM.unit (@union_map_classPCM K V U)) (@UMC.um_filter K V U p f)) (if p k then @PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) (@UMC.um_filter K V U p f) else @UMC.um_filter K V U p f) *) by case: ifP=>//; rewrite unitL. Qed. Lemma umallPt (P : V -> Prop) k v : P v -> um_all P (pts k v : U). Proof. (* Goal: forall _ : P v, @um_all K V U P (@UMC.pts K V U k v : @UMC.sort K V U) *) by move=>X u w /findPt_inv [_ <-]. Qed. Lemma umallPtUn (P : V -> Prop) k v f : P v -> um_all P f -> um_all P (pts k v \+ f). Proof. (* Goal: forall (_ : P v) (_ : @um_all K V U P f), @um_all K V U P (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f) *) by move/(umallPt (k:=k)); apply: umallUn. Qed. Lemma umallPtE (P : V -> Prop) k v : cond U k -> um_all P (pts k v : U) -> P v. Proof. (* Goal: forall (_ : is_true (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k)) (_ : @um_all K V U P (@UMC.pts K V U k v : @UMC.sort K V U)), P v *) by move=>C /(_ k v); rewrite findPt C; apply. Qed. Lemma umallPtUnE (P : V -> Prop) k v f : valid (pts k v \+ f) -> um_all P (pts k v \+ f) -> P v /\ um_all P f. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f))) (_ : @um_all K V U P (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) f)), and (P v) (@um_all K V U P f) *) move=>W H; move: (umallUnL W H) (umallUnR W H)=>{H} H1 H2. (* Goal: and (P v) (@um_all K V U P f) *) by split=>//; apply: umallPtE H1; apply: validPtUn_cond W. Qed. Lemma um_eta k f : k \in dom f -> exists v, find k f = Some v /\ f = pts k v \+ free k f. Proof. (* Goal: forall _ : is_true (@in_mem (Ordered.sort K) k (@mem (Equality.sort (Ordered.eqType K)) (seq_predType (Ordered.eqType K)) (@UMC.dom K V U f))), @ex V (fun v : V => and (@eq (option V) (@UMC.find K V U k f) (@Some V v)) (@eq (@UMC.sort K V U) f (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) (@UMC.free K V U k f)))) *) case: dom_find=>// v E1 E2 _; exists v; split=>//. (* Goal: @eq (@UMC.sort K V U) f (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) (@UMC.free K V U k f)) *) by rewrite {1}E2 -{1}[free k f]unitL updUnR domF inE /= eq_refl ptsU. Qed. Lemma um_eta2 k v f : find k f = Some v -> f = pts k v \+ free k f. Proof. (* Goal: forall _ : @eq (option V) (@UMC.find K V U k f) (@Some V v), @eq (@UMC.sort K V U) f (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) (@UMC.free K V U k f)) *) by move=>E; case/um_eta: (find_some E)=>v' []; rewrite E; case=><-. Qed. Lemma cancel k v1 v2 f1 f2 : valid (pts k v1 \+ f1) -> pts k v1 \+ f1 = pts k v2 \+ f2 -> [/\ v1 = v2, valid f1 & f1 = f2]. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v1) f1))) (_ : @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v1) f1) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v2) f2)), and3 (@eq V v1 v2) (is_true (@PCM.valid (@union_map_classPCM K V U) f1)) (@eq (@UMC.sort K V U) f1 f2) *) move=>V' E. (* Goal: and3 (@eq V v1 v2) (is_true (@PCM.valid (@union_map_classPCM K V U) f1)) (@eq (@UMC.sort K V U) f1 f2) *) have: find k (pts k v1 \+ f1) = find k (pts k v2 \+ f2) by rewrite E. (* Goal: forall _ : @eq (option V) (@UMC.find K V U k (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v1) f1)) (@UMC.find K V U k (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v2) f2)), and3 (@eq V v1 v2) (is_true (@PCM.valid (@union_map_classPCM K V U) f1)) (@eq (@UMC.sort K V U) f1 f2) *) rewrite !findPtUn -?E //; case=>X. (* Goal: and3 (@eq V v1 v2) (is_true (@PCM.valid (@union_map_classPCM K V U) f1)) (@eq (@UMC.sort K V U) f1 f2) *) by rewrite -{}X in E *; rewrite -(joinxK V' E) (validR V'). Qed. Lemma cancel2 k1 k2 f1 f2 v1 v2 : valid (pts k1 v1 \+ f1) -> pts k1 v1 \+ f1 = pts k2 v2 \+ f2 -> if k1 == k2 then v1 = v2 /\ f1 = f2 else [/\ free k1 f2 = free k2 f1, f1 = pts k2 v2 \+ free k1 f2 & f2 = pts k1 v1 \+ free k2 f1]. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) f1))) (_ : @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) f1) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v2) f2)), if @eq_op (Ordered.eqType K) k1 k2 then and (@eq V v1 v2) (@eq (@UMC.sort K V U) f1 f2) else and3 (@eq (@UMC.sort K V U) (@UMC.free K V U k1 f2) (@UMC.free K V U k2 f1)) (@eq (@UMC.sort K V U) f1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v2) (@UMC.free K V U k1 f2))) (@eq (@UMC.sort K V U) f2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) (@UMC.free K V U k2 f1))) *) move=>V1 E; case: ifP=>X. (* Goal: and3 (@eq (@UMC.sort K V U) (@UMC.free K V U k1 f2) (@UMC.free K V U k2 f1)) (@eq (@UMC.sort K V U) f1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v2) (@UMC.free K V U k1 f2))) (@eq (@UMC.sort K V U) f2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) (@UMC.free K V U k2 f1))) *) (* Goal: and (@eq V v1 v2) (@eq (@UMC.sort K V U) f1 f2) *) - (* Goal: and3 (@eq (@UMC.sort K V U) (@UMC.free K V U k1 f2) (@UMC.free K V U k2 f1)) (@eq (@UMC.sort K V U) f1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v2) (@UMC.free K V U k1 f2))) (@eq (@UMC.sort K V U) f2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) (@UMC.free K V U k2 f1))) *) (* Goal: and (@eq V v1 v2) (@eq (@UMC.sort K V U) f1 f2) *) by rewrite -(eqP X) in E; case/(cancel V1): E. (* Goal: and3 (@eq (@UMC.sort K V U) (@UMC.free K V U k1 f2) (@UMC.free K V U k2 f1)) (@eq (@UMC.sort K V U) f1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v2) (@UMC.free K V U k1 f2))) (@eq (@UMC.sort K V U) f2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) (@UMC.free K V U k2 f1))) *) move: (V1); rewrite E => V2. (* Goal: and3 (@eq (@UMC.sort K V U) (@UMC.free K V U k1 f2) (@UMC.free K V U k2 f1)) (@eq (@UMC.sort K V U) f1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v2) (@UMC.free K V U k1 f2))) (@eq (@UMC.sort K V U) f2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) (@UMC.free K V U k2 f1))) *) have E' : f2 = pts k1 v1 \+ free k2 f1. (* Goal: and3 (@eq (@UMC.sort K V U) (@UMC.free K V U k1 f2) (@UMC.free K V U k2 f1)) (@eq (@UMC.sort K V U) f1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v2) (@UMC.free K V U k1 f2))) (@eq (@UMC.sort K V U) f2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) (@UMC.free K V U k2 f1))) *) (* Goal: @eq (@UMC.sort K V U) f2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) (@UMC.free K V U k2 f1)) *) - (* Goal: and3 (@eq (@UMC.sort K V U) (@UMC.free K V U k1 f2) (@UMC.free K V U k2 f1)) (@eq (@UMC.sort K V U) f1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v2) (@UMC.free K V U k1 f2))) (@eq (@UMC.sort K V U) f2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) (@UMC.free K V U k2 f1))) *) (* Goal: @eq (@UMC.sort K V U) f2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) (@UMC.free K V U k2 f1)) *) move: (erefl (free k2 (pts k1 v1 \+ f1))). (* Goal: and3 (@eq (@UMC.sort K V U) (@UMC.free K V U k1 f2) (@UMC.free K V U k2 f1)) (@eq (@UMC.sort K V U) f1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v2) (@UMC.free K V U k1 f2))) (@eq (@UMC.sort K V U) f2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) (@UMC.free K V U k2 f1))) *) (* Goal: forall _ : @eq (@UMC.sort K V U) (@UMC.free K V U k2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) f1)) (@UMC.free K V U k2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) f1)), @eq (@UMC.sort K V U) f2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) (@UMC.free K V U k2 f1)) *) rewrite {2}E freeUn E domPtUn inE V2 eq_refl /=. (* Goal: and3 (@eq (@UMC.sort K V U) (@UMC.free K V U k1 f2) (@UMC.free K V U k2 f1)) (@eq (@UMC.sort K V U) f1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v2) (@UMC.free K V U k1 f2))) (@eq (@UMC.sort K V U) f2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) (@UMC.free K V U k2 f1))) *) (* Goal: forall _ : @eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.free K V U k2 (@UMC.pts K V U k1 v1)) (@UMC.free K V U k2 f1)) (@UMC.free K V U k2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v2) f2)), @eq (@UMC.sort K V U) f2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) (@UMC.free K V U k2 f1)) *) by rewrite ptsU freeU eq_sym X free0 -ptsU freePtUn. (* Goal: and3 (@eq (@UMC.sort K V U) (@UMC.free K V U k1 f2) (@UMC.free K V U k2 f1)) (@eq (@UMC.sort K V U) f1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v2) (@UMC.free K V U k1 f2))) (@eq (@UMC.sort K V U) f2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) (@UMC.free K V U k2 f1))) *) suff E'' : free k2 f1 = free k1 f2. (* Goal: @eq (@UMC.sort K V U) (@UMC.free K V U k2 f1) (@UMC.free K V U k1 f2) *) (* Goal: and3 (@eq (@UMC.sort K V U) (@UMC.free K V U k1 f2) (@UMC.free K V U k2 f1)) (@eq (@UMC.sort K V U) f1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v2) (@UMC.free K V U k1 f2))) (@eq (@UMC.sort K V U) f2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) (@UMC.free K V U k2 f1))) *) - (* Goal: @eq (@UMC.sort K V U) (@UMC.free K V U k2 f1) (@UMC.free K V U k1 f2) *) (* Goal: and3 (@eq (@UMC.sort K V U) (@UMC.free K V U k1 f2) (@UMC.free K V U k2 f1)) (@eq (@UMC.sort K V U) f1 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 v2) (@UMC.free K V U k1 f2))) (@eq (@UMC.sort K V U) f2 (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k1 v1) (@UMC.free K V U k2 f1))) *) by rewrite -E''; rewrite E' joinCA in E; case/(cancel V1): E. (* Goal: @eq (@UMC.sort K V U) (@UMC.free K V U k2 f1) (@UMC.free K V U k1 f2) *) move: (erefl (free k1 f2)). (* Goal: forall _ : @eq (@UMC.sort K V U) (@UMC.free K V U k1 f2) (@UMC.free K V U k1 f2), @eq (@UMC.sort K V U) (@UMC.free K V U k2 f1) (@UMC.free K V U k1 f2) *) by rewrite {1}E' freePtUn // -E'; apply: (validR V2). Qed. Lemma um_indf (P : U -> Prop) : P um_undef -> P Unit -> (forall k v f, P f -> valid (pts k v \+ f) -> path ord k (dom f) -> P (pts k v \+ f)) -> forall f, P f. Lemma um_indb (P : U -> Prop) : P um_undef -> P Unit -> (forall k v f, P f -> valid (pts k v \+ f) -> (forall x, x \in dom f -> ord x k) -> P (pts k v \+ f)) -> forall f, P f. Lemma um_valid3 f1 f2 f3 : valid (f1 \+ f2 \+ f3) = [&& valid (f1 \+ f2), valid (f2 \+ f3) & valid (f1 \+ f3)]. Lemma um_prime f1 f2 k v : cond U k -> f1 \+ f2 = pts k v -> f1 = pts k v /\ f2 = Unit \/ f1 = Unit /\ f2 = pts k v. Proof. (* Goal: forall (_ : is_true (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k)) (_ : @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) f1 f2) (@UMC.pts K V U k v)), or (and (@eq (@UMC.sort K V U) f1 (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f2 (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) f1 (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f2 (@UMC.pts K V U k v))) *) move: f1 f2; apply: um_indf=>[f1|f2 _|k2 w2 f1 _ _ _ f X E]. (* Goal: or (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f (@UMC.pts K V U k v))) *) (* Goal: forall _ : @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) (@PCM.unit (@union_map_classPCM K V U)) f2) (@UMC.pts K V U k v), or (and (@eq (@UMC.sort K V U) (@PCM.unit (@union_map_classPCM K V U)) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f2 (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.unit (@union_map_classPCM K V U)) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f2 (@UMC.pts K V U k v))) *) (* Goal: forall (_ : is_true (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k)) (_ : @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) (@UMC.um_undef K V U) f1) (@UMC.pts K V U k v)), or (and (@eq (@UMC.sort K V U) (@UMC.um_undef K V U) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f1 (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@UMC.um_undef K V U) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f1 (@UMC.pts K V U k v))) *) - (* Goal: or (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f (@UMC.pts K V U k v))) *) (* Goal: forall _ : @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) (@PCM.unit (@union_map_classPCM K V U)) f2) (@UMC.pts K V U k v), or (and (@eq (@UMC.sort K V U) (@PCM.unit (@union_map_classPCM K V U)) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f2 (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.unit (@union_map_classPCM K V U)) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f2 (@UMC.pts K V U k v))) *) (* Goal: forall (_ : is_true (@pred_of_simpl (Ordered.sort K) (@UMC.cond K V U) k)) (_ : @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) (@UMC.um_undef K V U) f1) (@UMC.pts K V U k v)), or (and (@eq (@UMC.sort K V U) (@UMC.um_undef K V U) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f1 (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@UMC.um_undef K V U) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f1 (@UMC.pts K V U k v))) *) rewrite join_undefL -(validPt _ v)=>W E. (* Goal: or (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f (@UMC.pts K V U k v))) *) (* Goal: forall _ : @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) (@PCM.unit (@union_map_classPCM K V U)) f2) (@UMC.pts K V U k v), or (and (@eq (@UMC.sort K V U) (@PCM.unit (@union_map_classPCM K V U)) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f2 (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.unit (@union_map_classPCM K V U)) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f2 (@UMC.pts K V U k v))) *) (* Goal: or (and (@eq (@UMC.sort K V U) (@UMC.um_undef K V U) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f1 (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@UMC.um_undef K V U) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f1 (@UMC.pts K V U k v))) *) by rewrite -E in W; rewrite valid_undef in W. (* Goal: or (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f (@UMC.pts K V U k v))) *) (* Goal: forall _ : @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) (@PCM.unit (@union_map_classPCM K V U)) f2) (@UMC.pts K V U k v), or (and (@eq (@UMC.sort K V U) (@PCM.unit (@union_map_classPCM K V U)) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f2 (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.unit (@union_map_classPCM K V U)) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f2 (@UMC.pts K V U k v))) *) - (* Goal: or (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f (@UMC.pts K V U k v))) *) (* Goal: forall _ : @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) (@PCM.unit (@union_map_classPCM K V U)) f2) (@UMC.pts K V U k v), or (and (@eq (@UMC.sort K V U) (@PCM.unit (@union_map_classPCM K V U)) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f2 (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.unit (@union_map_classPCM K V U)) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f2 (@UMC.pts K V U k v))) *) by rewrite unitL=>->; right. (* Goal: or (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f (@UMC.pts K V U k v))) *) have W : valid (pts k2 w2 \+ (f1 \+ f)). (* Goal: or (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f (@UMC.pts K V U k v))) *) (* Goal: is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) (@PCM.join (@union_map_classPCM K V U) f1 f))) *) - (* Goal: or (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f (@UMC.pts K V U k v))) *) (* Goal: is_true (@PCM.valid (@union_map_classPCM K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) (@PCM.join (@union_map_classPCM K V U) f1 f))) *) by rewrite -(validPt _ v) -E -joinA in X. (* Goal: or (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f (@UMC.pts K V U k v))) *) rewrite -[pts k v]unitR -joinA in E. (* Goal: or (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f (@UMC.pts K V U k v))) *) move/(cancel2 W): E; case: ifP. (* Goal: forall (_ : @eq bool (@eq_op (Ordered.eqType K) k2 k) false) (_ : and3 (@eq (@UMC.sort K V U) (@UMC.free K V U k2 (@PCM.unit (@union_map_classPCM K V U))) (@UMC.free K V U k (@PCM.join (@union_map_classPCM K V U) f1 f))) (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) f1 f) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) (@UMC.free K V U k2 (@PCM.unit (@union_map_classPCM K V U))))) (@eq (@UMC.sort K V U) (@PCM.unit (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) (@UMC.free K V U k (@PCM.join (@union_map_classPCM K V U) f1 f))))), or (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f (@UMC.pts K V U k v))) *) (* Goal: forall (_ : is_true (@eq_op (Ordered.eqType K) k2 k)) (_ : and (@eq V w2 v) (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) f1 f) (@PCM.unit (@union_map_classPCM K V U)))), or (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f (@UMC.pts K V U k v))) *) - (* Goal: forall (_ : @eq bool (@eq_op (Ordered.eqType K) k2 k) false) (_ : and3 (@eq (@UMC.sort K V U) (@UMC.free K V U k2 (@PCM.unit (@union_map_classPCM K V U))) (@UMC.free K V U k (@PCM.join (@union_map_classPCM K V U) f1 f))) (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) f1 f) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) (@UMC.free K V U k2 (@PCM.unit (@union_map_classPCM K V U))))) (@eq (@UMC.sort K V U) (@PCM.unit (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) (@UMC.free K V U k (@PCM.join (@union_map_classPCM K V U) f1 f))))), or (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f (@UMC.pts K V U k v))) *) (* Goal: forall (_ : is_true (@eq_op (Ordered.eqType K) k2 k)) (_ : and (@eq V w2 v) (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) f1 f) (@PCM.unit (@union_map_classPCM K V U)))), or (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f (@UMC.pts K V U k v))) *) by move/eqP=>-> [->] /join0E [->->]; rewrite unitR; left. (* Goal: forall (_ : @eq bool (@eq_op (Ordered.eqType K) k2 k) false) (_ : and3 (@eq (@UMC.sort K V U) (@UMC.free K V U k2 (@PCM.unit (@union_map_classPCM K V U))) (@UMC.free K V U k (@PCM.join (@union_map_classPCM K V U) f1 f))) (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) f1 f) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k v) (@UMC.free K V U k2 (@PCM.unit (@union_map_classPCM K V U))))) (@eq (@UMC.sort K V U) (@PCM.unit (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) (@UMC.free K V U k (@PCM.join (@union_map_classPCM K V U) f1 f))))), or (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@UMC.pts K V U k v)) (@eq (@UMC.sort K V U) f (@PCM.unit (@union_map_classPCM K V U)))) (and (@eq (@UMC.sort K V U) (@PCM.join (@union_map_classPCM K V U) (@UMC.pts K V U k2 w2) f1) (@PCM.unit (@union_map_classPCM K V U))) (@eq (@UMC.sort K V U) f (@UMC.pts K V U k v))) *) by move=>_ [_ _] /esym/empbP; rewrite empbPtUn. Qed. End PointsToLemmas. Hint Resolve domeqPt domeqPtUn domeqUnPt : core. Prenex Implicits validPtUn_cond findPt_inv um_eta2. Module UnionClassTPCM. Section UnionClassTPCM. Variables (K : ordType) (V : Type) (U : union_map_class K V). Implicit Type f : U. Lemma join0E f1 f2 : f1 \+ f2 = Unit -> f1 = Unit /\ f2 = Unit. Lemma valid_undefN : ~~ valid (um_undef: U). Proof. (* Goal: is_true (negb (@PCM.valid (@union_map_classPCM K V U) (@UMC.um_undef K V U : @UMC.sort K V U))) *) by rewrite valid_undef. Qed. Lemma undef_join f : um_undef \+ f = um_undef. Proof. (* Goal: @eq (PCM.sort (@union_map_classPCM K V U)) (@PCM.join (@union_map_classPCM K V U) (@UMC.um_undef K V U) f) (@UMC.um_undef K V U) *) by rewrite join_undefL. Qed. End UnionClassTPCM. Module Exports. Definition union_map_classTPCMMix K V (U : union_map_class K V) := TPCMMixin (@empbP K V U) (@join0E K V U) (@valid_undefN K V U) (@undef_join _ _ U). Canonical union_map_classTPCM K V (U : union_map_class K V) := Eval hnf in TPCM _ (@union_map_classTPCMMix K V U). End Exports. End UnionClassTPCM. Export UnionClassTPCM.Exports. Module Type UMSig. Parameter tp : ordType -> Type -> Type. Section Params. Variables (K : ordType) (V : Type). Notation tp := (tp K V). Parameter um_undef : tp. Parameter defined : tp -> bool. Parameter empty : tp. Parameter upd : K -> V -> tp -> tp. Parameter dom : tp -> seq K. Parameter dom_eq : tp -> tp -> bool. Parameter free : K -> tp -> tp. Parameter find : K -> tp -> option V. Parameter union : tp -> tp -> tp. Parameter um_filter : pred K -> tp -> tp. Parameter empb : tp -> bool. Parameter undefb : tp -> bool. Parameter pts : K -> V -> tp. Parameter from : tp -> @UM.base K V predT. Parameter to : @UM.base K V predT -> tp. Axiom ftE : forall b, from (to b) = b. Axiom tfE : forall f, to (from f) = f. Axiom undefE : um_undef = to (@UM.Undef K V predT). Axiom defE : forall f, defined f = UM.valid (from f). Axiom emptyE : empty = to (@UM.empty K V predT). Axiom updE : forall k v f, upd k v f = to (UM.upd k v (from f)). Axiom domE : forall f, dom f = UM.dom (from f). Axiom dom_eqE : forall f1 f2, dom_eq f1 f2 = UM.dom_eq (from f1) (from f2). Axiom freeE : forall k f, free k f = to (UM.free k (from f)). Axiom findE : forall k f, find k f = UM.find k (from f). Axiom unionE : forall f1 f2, union f1 f2 = to (UM.union (from f1) (from f2)). Axiom umfiltE : forall q f, um_filter q f = to (UM.um_filter q (from f)). Axiom empbE : forall f, empb f = UM.empb (from f). Axiom undefbE : forall f, undefb f = UM.undefb (from f). Axiom ptsE : forall k v, pts k v = to (@UM.pts K V predT k v). End Params. End UMSig. Module UMDef : UMSig. Section UMDef. Variables (K : ordType) (V : Type). Definition tp : Type := @UM.base K V predT. Definition um_undef := @UM.Undef K V predT. Definition defined f := @UM.valid K V predT f. Definition empty := @UM.empty K V predT. Definition upd k v f := @UM.upd K V predT k v f. Definition dom f := @UM.dom K V predT f. Definition dom_eq f1 f2 := @UM.dom_eq K V predT f1 f2. Definition free k f := @UM.free K V predT k f. Definition find k f := @UM.find K V predT k f. Definition union f1 f2 := @UM.union K V predT f1 f2. Definition um_filter q f := @UM.um_filter K V predT q f. Definition empb f := @UM.empb K V predT f. Definition undefb f := @UM.undefb K V predT f. Definition pts k v := @UM.pts K V predT k v. Definition from (f : tp) : @UM.base K V predT := f. Definition to (b : @UM.base K V predT) : tp := b. Lemma tfE f : to (from f) = f. Proof. by []. Qed. Lemma defE f : defined f = UM.valid (from f). Proof. by []. Qed. Lemma updE k v f : upd k v f = to (UM.upd k v (from f)). Proof. by []. Qed. Lemma dom_eqE f1 f2 : dom_eq f1 f2 = UM.dom_eq (from f1) (from f2). Lemma freeE k f : free k f = to (UM.free k (from f)). Proof. by []. Qed. Lemma unionE f1 f2 : union f1 f2 = to (UM.union (from f1) (from f2)). Lemma umfiltE q f : um_filter q f = to (UM.um_filter q (from f)). Proof. (* Goal: @eq (@UM.base K V (@pred_of_simpl (Ordered.sort K) (@predT (Ordered.sort K)))) (um_filter q f) (to (@UM.um_filter K V (@pred_of_simpl (Ordered.sort K) (@predT (Ordered.sort K))) q (from f))) *) by []. Qed. Lemma undefbE f : undefb f = UM.undefb (from f). Proof. by []. Qed. End UMDef. End UMDef. Notation union_map := UMDef.tp. Definition unionmapMixin K V := UMCMixin (@UMDef.ftE K V) (@UMDef.tfE K V) (@UMDef.defE K V) (@UMDef.undefE K V) (@UMDef.emptyE K V) (@UMDef.updE K V) (@UMDef.domE K V) (@UMDef.dom_eqE K V) (@UMDef.freeE K V) (@UMDef.findE K V) (@UMDef.unionE K V) (@UMDef.umfiltE K V) (@UMDef.empbE K V) (@UMDef.undefbE K V) (@UMDef.ptsE K V). Canonical union_mapUMC K V := Eval hnf in UMC (union_map K V) (@unionmapMixin K V). Definition union_mapPCMMix K V := union_map_classPCMMix (union_mapUMC K V). Canonical union_mapPCM K V := Eval hnf in PCM (union_map K V) (@union_mapPCMMix K V). Definition union_mapCPCMMix K V := union_map_classCPCMMix (@union_mapUMC K V). Canonical union_mapCPCM K V := Eval hnf in CPCM (union_map K V) (@union_mapCPCMMix K V). Definition union_mapTPCMMix K V := union_map_classTPCMMix (@union_mapUMC K V). Canonical union_mapTPCM K V := Eval hnf in TPCM (union_map K V) (@union_mapTPCMMix K V). Definition union_map_eqMix K (V : eqType) := @union_map_class_eqMix K V _ _ (@unionmapMixin K V). Canonical union_map_eqType K (V : eqType) := Eval hnf in EqType (union_map K V) (@union_map_eqMix K V). Definition um_pts (K : ordType) V (k : K) (v : V) := @UMC.pts K V (@union_mapUMC K V) k v. Notation "x \\-> v" := (@um_pts _ _ x v) (at level 30). Notation fset T := (@union_map T unit). Notation "# x" := (x \\-> tt) (at level 20). Lemma xx : 1 \\-> true = 1 \\-> false. Abort. Lemma xx : ((1 \\-> true) \+ (2 \\-> false)) == (1 \\-> false). simpl. rewrite joinC. Abort. Lemma xx (x : union_map nat_ordType nat) : x \+ x == x \+ x. Abort. Lemma xx (f : union_map nat_ordType nat) : 3 \in dom (free 2 f). try by rewrite domF' /=. rewrite (@domF _ _ (union_mapUMC _ _)). Abort. Lemma xx (f : union_map nat_ordType nat) : 3 \in dom (free 2 f). rewrite domF /=. Abort. Lemma xx : 1 \\-> (1 \\-> 3) = 2 \\-> (7 \\-> 3). Abort. Section UMDecidableEquality. Variables (K : ordType) (V : eqType) (U : union_map_class K V). Lemma umPtPtE (k1 k2 : K) (v1 v2 : V) : (k1 \\-> v1 == k2 \\-> v2) = (k1 == k2) && (v1 == v2). Proof. (* Goal: @eq bool (@eq_op (union_map_eqType K V) (@um_pts K (Equality.sort V) k1 v1) (@um_pts K (Equality.sort V) k2 v2)) (andb (@eq_op (Ordered.eqType K) k1 k2) (@eq_op V v1 v2)) *) rewrite {1}/eq_op /= /UnionMapEq.unionmap_eq /um_pts !umEX /=. (* Goal: @eq bool (@eq_op (fmap_eqType K V) (@FinMap K (Equality.sort V) (@cons (prod (Ordered.sort K) (Equality.sort V)) (@pair (Ordered.sort K) (Equality.sort V) k1 v1) (@Datatypes.nil (prod (Ordered.sort K) (Equality.sort V)))) (@sorted_ins' K (Equality.sort V) (@Datatypes.nil (prod (Ordered.sort K) (Equality.sort V))) k1 v1 (sorted_nil K (Equality.sort V)))) (@FinMap K (Equality.sort V) (@cons (prod (Ordered.sort K) (Equality.sort V)) (@pair (Ordered.sort K) (Equality.sort V) k2 v2) (@Datatypes.nil (prod (Ordered.sort K) (Equality.sort V)))) (@sorted_ins' K (Equality.sort V) (@Datatypes.nil (prod (Ordered.sort K) (Equality.sort V))) k2 v2 (sorted_nil K (Equality.sort V))))) (andb (@eq_op (Ordered.eqType K) k1 k2) (@eq_op V v1 v2)) *) by rewrite {1}/eq_op /= /feq eqseq_cons andbT. Qed. Lemma umPt0E (k : K) (v : V) : (k \\-> v == Unit) = false. Proof. (* Goal: @eq bool (@eq_op (union_map_eqType K V) (@um_pts K (Equality.sort V) k v) (@PCM.unit (union_mapPCM K (Equality.sort V)))) false *) by apply: (introF idP)=>/eqP/empbP; rewrite empbPt. Qed. Lemma um0PtE (k : K) (v : V) : (@Unit [pcm of union_map K V] == k \\-> v) = false. Proof. (* Goal: @eq bool (@eq_op (union_map_eqType K V) (@PCM.unit (@PCM.clone (UMDef.tp K (Equality.sort V)) (union_mapPCM K (Equality.sort V)) (union_mapPCMMix K (Equality.sort V)) (fun x : PCM.sort (union_mapPCM K (Equality.sort V)) => x) (fun x : phantom PCM.type (@PCM.pack (UMDef.tp K (Equality.sort V)) (union_mapPCMMix K (Equality.sort V))) => x))) (@um_pts K (Equality.sort V) k v)) false *) by rewrite eq_sym umPt0E. Qed. Lemma umPtUndefE (k : K) (v : V) : (k \\-> v == um_undef) = false. Proof. (* Goal: @eq bool (@eq_op (union_map_eqType K V) (@um_pts K (Equality.sort V) k v) (@UMC.um_undef K (Equality.sort V) (union_mapUMC K (Equality.sort V)))) false *) by rewrite /eq_op /= /UnionMapEq.unionmap_eq /um_pts !umEX. Qed. Lemma umUndefPtE (k : K) (v : V) : ((um_undef : union_map_eqType K V) == k \\-> v) = false. Proof. (* Goal: @eq bool (@eq_op (union_map_eqType K V) (@UMC.um_undef K (Equality.sort V) (union_mapUMC K (Equality.sort V)) : Equality.sort (union_map_eqType K V)) (@um_pts K (Equality.sort V) k v)) false *) by rewrite eq_sym umPtUndefE. Qed. Lemma umUndef0E : ((um_undef : union_map_eqType K V) == Unit) = false. Proof. (* Goal: @eq bool (@eq_op (union_map_eqType K V) (@UMC.um_undef K (Equality.sort V) (union_mapUMC K (Equality.sort V)) : Equality.sort (union_map_eqType K V)) (@PCM.unit (union_mapPCM K (Equality.sort V)))) false *) by apply/(introF idP)=>/eqP/empbP; rewrite empb_undef. Qed. Lemma um0UndefE : ((Unit : union_mapPCM K V) == um_undef) = false. Proof. (* Goal: @eq bool (@eq_op (union_map_eqType K V) (@PCM.unit (union_mapPCM K (Equality.sort V)) : PCM.sort (union_mapPCM K (Equality.sort V))) (@UMC.um_undef K (Equality.sort V) (union_mapUMC K (Equality.sort V)))) false *) by rewrite eq_sym umUndef0E. Qed. Lemma umPtUE (k : K) (v : V) f : (k \\-> v \+ f == Unit) = false. Proof. (* Goal: @eq bool (@eq_op (union_map_eqType K V) (@PCM.join (@union_map_classPCM K (Equality.sort V) (union_mapUMC K (Equality.sort V))) (@um_pts K (Equality.sort V) k v) f) (@PCM.unit (union_mapPCM K (Equality.sort V)))) false *) by apply: (introF idP)=>/eqP/join0E/proj1/eqP; rewrite umPt0E. Qed. Lemma umUPtE (k : K) (v : V) f : (f \+ k \\-> v == Unit) = false. Proof. (* Goal: @eq bool (@eq_op (union_map_eqType K V) (@PCM.join (@union_map_classPCM K (Equality.sort V) (union_mapUMC K (Equality.sort V))) f (@um_pts K (Equality.sort V) k v)) (@PCM.unit (union_mapPCM K (Equality.sort V)))) false *) by rewrite joinC umPtUE. Qed. Lemma umPtUPtE (k1 k2 : K) (v1 v2 : V) f : (k1 \\-> v1 \+ f == k2 \\-> v2) = [&& k1 == k2, v1 == v2 & empb f]. Lemma umPtPtUE (k1 k2 : K) (v1 v2 : V) f : (k1 \\-> v1 == k2 \\-> v2 \+ f) = [&& k1 == k2, v1 == v2 & empb f]. Proof. (* Goal: @eq bool (@eq_op (union_map_eqType K V) (@um_pts K (Equality.sort V) k1 v1) (@PCM.join (@union_map_classPCM K (Equality.sort V) (union_mapUMC K (Equality.sort V))) (@um_pts K (Equality.sort V) k2 v2) f)) (andb (@eq_op (Ordered.eqType K) k1 k2) (andb (@eq_op V v1 v2) (@UMC.empb K (Equality.sort V) (union_mapUMC K (Equality.sort V)) f))) *) by rewrite eq_sym umPtUPtE (eq_sym k1) (eq_sym v1). Qed. Lemma umUPtPtE (k1 k2 : K) (v1 v2 : V) f : (f \+ k1 \\-> v1 == k2 \\-> v2) = [&& k1 == k2, v1 == v2 & empb f]. Proof. (* Goal: @eq bool (@eq_op (union_map_eqType K V) (@PCM.join (@union_map_classPCM K (Equality.sort V) (union_mapUMC K (Equality.sort V))) f (@um_pts K (Equality.sort V) k1 v1)) (@um_pts K (Equality.sort V) k2 v2)) (andb (@eq_op (Ordered.eqType K) k1 k2) (andb (@eq_op V v1 v2) (@UMC.empb K (Equality.sort V) (union_mapUMC K (Equality.sort V)) f))) *) by rewrite joinC umPtUPtE. Qed. Lemma umPtUPt2E (k1 k2 : K) (v1 v2 : V) f : (k1 \\-> v1 == f \+ k2 \\-> v2) = [&& k1 == k2, v1 == v2 & empb f]. Proof. (* Goal: @eq bool (@eq_op (union_map_eqType K V) (@um_pts K (Equality.sort V) k1 v1) (@PCM.join (@union_map_classPCM K (Equality.sort V) (union_mapUMC K (Equality.sort V))) f (@um_pts K (Equality.sort V) k2 v2))) (andb (@eq_op (Ordered.eqType K) k1 k2) (andb (@eq_op V v1 v2) (@UMC.empb K (Equality.sort V) (union_mapUMC K (Equality.sort V)) f))) *) by rewrite joinC umPtPtUE. Qed. Definition umE := (umPtPtE, umPt0E, um0PtE, umPtUndefE, umUndefPtE, um0UndefE, umUndef0E, umPtUE, umUPtE, umPtUPtE, umPtPtUE, umUPtPtE, umPtUPt2E, unitL, unitR, validPt, valid_unit, eq_refl, empb0, empbPt, join_undefL, join_undefR, empb_undef). End UMDecidableEquality.
From mathcomp Require Import ssreflect ssrfun ssrnat div ssrbool seq. From LemmaOverloading Require Import prelude finmap ordtype. From mathcomp Require Import path eqtype. Require Import Eqdep. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Notation eqn_addl := eqn_add2l. Notation modn_addl := modnDl. Notation modn_mulr := modnMr. Notation modn_add2m := modnDm. Notation modn_addr := modnDr. 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) := 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 Structure 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_addl. 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 Structure ptr_ordType := OrdType ptr ptr_ordMixin. Inductive heap := Undef | Def (finmap : {finMap ptr -> dynamic}) of null \notin supp finmap. Section NullLemmas. Variables (f g : {finMap ptr -> dynamic}) (x : ptr) (d : dynamic). Lemma upd_nullP : x != null -> null \notin supp f -> null \notin supp (ins x d 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 Dyn.dynamic f))))), is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@ins ptr_ordType Dyn.dynamic x d f))))) *) by move=>H1 H2; rewrite supp_ins negb_or /= 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 Dyn.dynamic f)))), is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@rem ptr_ordType Dyn.dynamic 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 Dyn.dynamic f))))) (_ : is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic g))))), is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic f g))))) *) by move=>H1 H2; rewrite supp_fcat negb_or H1 H2. Qed. Lemma heapE pf pg : f = g <-> @Def f pf = @Def g pg. Proof. (* Goal: iff (@eq (@finMap_for ptr_ordType Dyn.dynamic (Phant (forall _ : ptr, Dyn.dynamic))) f g) (@eq heap (@Def f pf) (@Def g pg)) *) split=>[E|[//]]; move: pf pg. (* Goal: forall (pf : is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic f))))) (pg : is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic g))))), @eq heap (@Def f pf) (@Def g pg) *) by rewrite E=>pf pg; congr Def; apply: bool_irrelevance. Qed. End NullLemmas. Definition def h := if h is Def _ _ then true else false. Definition empty := @Def (finmap.nil _ _) is_true_true. Definition upd h x d := nosimpl (if h is Def hs ns then if decP (@idP (x != null)) is left pf then Def (@upd_nullP _ _ d pf ns) else Undef else Undef). Definition dom h : pred ptr := nosimpl (if h is Def f _ then mem (supp f) else pred0). Definition free x h : heap := (if h is Def hs ns then Def (free_nullP x ns) else Undef). Definition look (x : ptr) h := (if h is Def hs _ then if fnd x hs is Some d then d else dyn tt else dyn tt). Definition union2 h1 h2 := nosimpl (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 empb h := if h is Def hs _ then supp hs == [::] else false. Definition fresh h := (if h is Def hs _ then last null (supp hs) else null) .+ 1. Definition subdom h1 h2 := if (h1, h2) is (Def hs1 _, Def hs2 _) then all (fun x => x \in supp hs2) (supp hs1) else false. Definition subheap h1 h2 := subdom h1 h2 /\ forall x, x \in dom h1 -> look x h1 = look x h2. Definition subtract h1 h2 := if h1 is (Def hs1 _) then foldl (fun h x => free x h) h2 (supp hs1) else Undef. Definition pick h := if h is Def hs _ then head null (supp hs) else null. Definition pts A (x : ptr) (v : A) := upd empty x (dyn v). Notation "h1 :+ h2" := (union2 h1 h2) (at level 43, left associativity). Notation "h2 :- h1" := (subtract h1 h2) (at level 43, left associativity). Notation "x :-> v" := (pts x v) (at level 30). Lemma unC : forall h1 h2, h1 :+ h2 = h2 :+ h1. Proof. (* Goal: forall h1 h2 : heap, @eq heap (union2 h1 h2) (union2 h2 h1) *) case=>[|h1 H1]; case=>[|h2 H2] //; rewrite /union2. (* Goal: @eq heap (if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef) (if @disj ptr_ordType Dyn.dynamic h2 h1 then @Def (@fcat ptr_ordType Dyn.dynamic h2 h1) (@un_nullP h2 h1 H2 H1) else Undef) *) by case: ifP=>E; rewrite disjC E // -heapE fcatC. Qed. Lemma unA : forall h1 h2 h3, h1 :+ (h2 :+ h3) = h1 :+ h2 :+ h3. Proof. (* Goal: forall h1 h2 h3 : heap, @eq heap (union2 h1 (union2 h2 h3)) (union2 (union2 h1 h2) h3) *) case=>[|h1 H1]; case=>[|h2 H2]; case=>[|h3 H3] //; rewrite /union2; case: ifP=>//; case: ifP=>//; last first. (* Goal: forall (_ : is_true (@disj ptr_ordType Dyn.dynamic h1 (@fcat ptr_ordType Dyn.dynamic h2 h3))) (_ : is_true (@disj ptr_ordType Dyn.dynamic h2 h3)), @eq heap (@Def (@fcat ptr_ordType Dyn.dynamic h1 (@fcat ptr_ordType Dyn.dynamic h2 h3)) (@un_nullP h1 (@fcat ptr_ordType Dyn.dynamic h2 h3) H1 (@un_nullP h2 h3 H2 H3))) match (if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef) with | Undef => Undef | @Def hs1 ns1 => if @disj ptr_ordType Dyn.dynamic hs1 h3 then @Def (@fcat ptr_ordType Dyn.dynamic hs1 h3) (@un_nullP hs1 h3 ns1 H3) else Undef end *) (* Goal: forall (_ : @eq bool (@disj ptr_ordType Dyn.dynamic h1 (@fcat ptr_ordType Dyn.dynamic h2 h3)) false) (_ : is_true (@disj ptr_ordType Dyn.dynamic h2 h3)), @eq heap Undef match (if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef) with | Undef => Undef | @Def hs1 ns1 => if @disj ptr_ordType Dyn.dynamic hs1 h3 then @Def (@fcat ptr_ordType Dyn.dynamic hs1 h3) (@un_nullP hs1 h3 ns1 H3) else Undef end *) (* Goal: forall (_ : is_true (@disj ptr_ordType Dyn.dynamic h1 h2)) (_ : @eq bool (@disj ptr_ordType Dyn.dynamic h2 h3) false), @eq heap Undef (if @disj ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h2) h3 then @Def (@fcat ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h2) h3) (@un_nullP (@fcat ptr_ordType Dyn.dynamic h1 h2) h3 (@un_nullP h1 h2 H1 H2) H3) else Undef) *) - (* Goal: forall (_ : is_true (@disj ptr_ordType Dyn.dynamic h1 (@fcat ptr_ordType Dyn.dynamic h2 h3))) (_ : is_true (@disj ptr_ordType Dyn.dynamic h2 h3)), @eq heap (@Def (@fcat ptr_ordType Dyn.dynamic h1 (@fcat ptr_ordType Dyn.dynamic h2 h3)) (@un_nullP h1 (@fcat ptr_ordType Dyn.dynamic h2 h3) H1 (@un_nullP h2 h3 H2 H3))) match (if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef) with | Undef => Undef | @Def hs1 ns1 => if @disj ptr_ordType Dyn.dynamic hs1 h3 then @Def (@fcat ptr_ordType Dyn.dynamic hs1 h3) (@un_nullP hs1 h3 ns1 H3) else Undef end *) (* Goal: forall (_ : @eq bool (@disj ptr_ordType Dyn.dynamic h1 (@fcat ptr_ordType Dyn.dynamic h2 h3)) false) (_ : is_true (@disj ptr_ordType Dyn.dynamic h2 h3)), @eq heap Undef match (if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef) with | Undef => Undef | @Def hs1 ns1 => if @disj ptr_ordType Dyn.dynamic hs1 h3 then @Def (@fcat ptr_ordType Dyn.dynamic hs1 h3) (@un_nullP hs1 h3 ns1 H3) else Undef end *) (* Goal: forall (_ : is_true (@disj ptr_ordType Dyn.dynamic h1 h2)) (_ : @eq bool (@disj ptr_ordType Dyn.dynamic h2 h3) false), @eq heap Undef (if @disj ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h2) h3 then @Def (@fcat ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h2) h3) (@un_nullP (@fcat ptr_ordType Dyn.dynamic h1 h2) h3 (@un_nullP h1 h2 H1 H2) H3) else Undef) *) by move=>E1 E2; rewrite disjC disj_fcat andbC disjC E2. (* Goal: forall (_ : is_true (@disj ptr_ordType Dyn.dynamic h1 (@fcat ptr_ordType Dyn.dynamic h2 h3))) (_ : is_true (@disj ptr_ordType Dyn.dynamic h2 h3)), @eq heap (@Def (@fcat ptr_ordType Dyn.dynamic h1 (@fcat ptr_ordType Dyn.dynamic h2 h3)) (@un_nullP h1 (@fcat ptr_ordType Dyn.dynamic h2 h3) H1 (@un_nullP h2 h3 H2 H3))) match (if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef) with | Undef => Undef | @Def hs1 ns1 => if @disj ptr_ordType Dyn.dynamic hs1 h3 then @Def (@fcat ptr_ordType Dyn.dynamic hs1 h3) (@un_nullP hs1 h3 ns1 H3) else Undef end *) (* Goal: forall (_ : @eq bool (@disj ptr_ordType Dyn.dynamic h1 (@fcat ptr_ordType Dyn.dynamic h2 h3)) false) (_ : is_true (@disj ptr_ordType Dyn.dynamic h2 h3)), @eq heap Undef match (if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef) with | Undef => Undef | @Def hs1 ns1 => if @disj ptr_ordType Dyn.dynamic hs1 h3 then @Def (@fcat ptr_ordType Dyn.dynamic hs1 h3) (@un_nullP hs1 h3 ns1 H3) else Undef end *) - (* Goal: forall (_ : is_true (@disj ptr_ordType Dyn.dynamic h1 (@fcat ptr_ordType Dyn.dynamic h2 h3))) (_ : is_true (@disj ptr_ordType Dyn.dynamic h2 h3)), @eq heap (@Def (@fcat ptr_ordType Dyn.dynamic h1 (@fcat ptr_ordType Dyn.dynamic h2 h3)) (@un_nullP h1 (@fcat ptr_ordType Dyn.dynamic h2 h3) H1 (@un_nullP h2 h3 H2 H3))) match (if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef) with | Undef => Undef | @Def hs1 ns1 => if @disj ptr_ordType Dyn.dynamic hs1 h3 then @Def (@fcat ptr_ordType Dyn.dynamic hs1 h3) (@un_nullP hs1 h3 ns1 H3) else Undef end *) (* Goal: forall (_ : @eq bool (@disj ptr_ordType Dyn.dynamic h1 (@fcat ptr_ordType Dyn.dynamic h2 h3)) false) (_ : is_true (@disj ptr_ordType Dyn.dynamic h2 h3)), @eq heap Undef match (if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef) with | Undef => Undef | @Def hs1 ns1 => if @disj ptr_ordType Dyn.dynamic hs1 h3 then @Def (@fcat ptr_ordType Dyn.dynamic hs1 h3) (@un_nullP hs1 h3 ns1 H3) else Undef end *) by case: ifP=>E1 //; rewrite disj_fcat E1 /= -!(disjC h3) disj_fcat=>->->. (* Goal: forall (_ : is_true (@disj ptr_ordType Dyn.dynamic h1 (@fcat ptr_ordType Dyn.dynamic h2 h3))) (_ : is_true (@disj ptr_ordType Dyn.dynamic h2 h3)), @eq heap (@Def (@fcat ptr_ordType Dyn.dynamic h1 (@fcat ptr_ordType Dyn.dynamic h2 h3)) (@un_nullP h1 (@fcat ptr_ordType Dyn.dynamic h2 h3) H1 (@un_nullP h2 h3 H2 H3))) match (if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef) with | Undef => Undef | @Def hs1 ns1 => if @disj ptr_ordType Dyn.dynamic hs1 h3 then @Def (@fcat ptr_ordType Dyn.dynamic hs1 h3) (@un_nullP hs1 h3 ns1 H3) else Undef end *) rewrite disj_fcat; case/andP=>->. (* Goal: forall (_ : is_true (@disj ptr_ordType Dyn.dynamic h1 h3)) (_ : is_true (@disj ptr_ordType Dyn.dynamic h2 h3)), @eq heap (@Def (@fcat ptr_ordType Dyn.dynamic h1 (@fcat ptr_ordType Dyn.dynamic h2 h3)) (@un_nullP h1 (@fcat ptr_ordType Dyn.dynamic h2 h3) H1 (@un_nullP h2 h3 H2 H3))) (if @disj ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h2) h3 then @Def (@fcat ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h2) h3) (@un_nullP (@fcat ptr_ordType Dyn.dynamic h1 h2) h3 (@un_nullP h1 h2 H1 H2) H3) else Undef) *) rewrite -!(disjC h3) disj_fcat=>E2 E3. (* Goal: @eq heap (@Def (@fcat ptr_ordType Dyn.dynamic h1 (@fcat ptr_ordType Dyn.dynamic h2 h3)) (@un_nullP h1 (@fcat ptr_ordType Dyn.dynamic h2 h3) H1 (@un_nullP h2 h3 H2 H3))) (if andb (@disj ptr_ordType Dyn.dynamic h3 h1) (@disj ptr_ordType Dyn.dynamic h3 h2) then @Def (@fcat ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h2) h3) (@un_nullP (@fcat ptr_ordType Dyn.dynamic h1 h2) h3 (@un_nullP h1 h2 H1 H2) H3) else Undef) *) by rewrite E2 E3 -heapE fcatA // disjC. Qed. Lemma unCA h1 h2 h3 : h1 :+ (h2 :+ h3) = h2 :+ (h1 :+ h3). Proof. (* Goal: @eq heap (union2 h1 (union2 h2 h3)) (union2 h2 (union2 h1 h3)) *) by rewrite unC (unC h1) unA. Qed. Lemma unAC h1 h2 h3 : h1 :+ h2 :+ h3 = h1 :+ h3 :+ h2. Proof. (* Goal: @eq heap (union2 (union2 h1 h2) h3) (union2 (union2 h1 h3) h2) *) by rewrite (unC h1) -unA unC. Qed. Lemma un0h h : empty :+ h = h. Proof. (* Goal: @eq heap (union2 empty h) h *) by case: h=>[|h H] //; apply/heapE; rewrite fcat0s. Qed. Lemma unh0 h : h :+ empty = h. Proof. (* Goal: @eq heap (union2 h empty) h *) by rewrite unC un0h. Qed. Lemma unKhl h h1 h2 : def (h1 :+ h) -> h1 :+ h = h2 :+ h -> h1 = h2. Lemma unhKl h h1 h2 : def (h :+ h1) -> h :+ h1 = h :+ h2 -> h1 = h2. Proof. (* Goal: forall (_ : is_true (def (union2 h h1))) (_ : @eq heap (union2 h h1) (union2 h h2)), @eq heap h1 h2 *) by rewrite !(unC h); apply: unKhl. Qed. Lemma unKhr h h1 h2 : def (h2 :+ h) -> h1 :+ h = h2 :+ h -> h1 = h2. Proof. (* Goal: forall (_ : is_true (def (union2 h2 h))) (_ : @eq heap (union2 h1 h) (union2 h2 h)), @eq heap h1 h2 *) by move=>H1 H2; symmetry in H2; rewrite (unKhl H1 H2). Qed. Lemma unhKr h h1 h2 : def (h :+ h2) -> h :+ h1 = h :+ h2 -> h1 = h2. Proof. (* Goal: forall (_ : is_true (def (union2 h h2))) (_ : @eq heap (union2 h h1) (union2 h h2)), @eq heap h1 h2 *) by rewrite !(unC h); apply: unKhr. Qed. Lemma dom0 : dom empty = pred0. Proof. (* Goal: @eq (pred ptr) (dom empty) (@pred_of_simpl ptr (@pred0 ptr)) *) by []. Qed. Lemma domU h y d : dom (upd h y d) =i [pred x | (y != null) && if x == y then def h else x \in dom h]. Proof. (* Goal: @eq_mem ptr (@mem ptr (predPredType ptr) (dom (upd h y d))) (@mem (Equality.sort ptr_eqType) (simplPredType (Equality.sort ptr_eqType)) (@SimplPred (Equality.sort ptr_eqType) (fun x : Equality.sort ptr_eqType => andb (negb (@eq_op ptr_eqType y null)) (if @eq_op ptr_eqType x y then def h else @in_mem (Equality.sort ptr_eqType) x (@mem ptr (predPredType ptr) (dom h)))))) *) case: h=>[|h T] /= x; rewrite inE /upd /=. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (dom match @decP (is_true (negb (@eq_op ptr_eqType y null))) (negb (@eq_op ptr_eqType y null)) (@idP (negb (@eq_op ptr_eqType y null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic y d h) (@upd_nullP h y d pf T) | right n => Undef end))) (andb (negb (@eq_op ptr_eqType y null)) (if @eq_op ptr_eqType x y then true else @in_mem ptr x (@mem ptr (predPredType ptr) (dom (@Def h T))))) *) (* Goal: @eq bool false (@in_mem ptr x (@mem ptr (simplPredType ptr) (@SimplPred ptr (fun x : ptr => andb (negb (@eq_op ptr_eqType y null)) (if @eq_op ptr_eqType x y then false else @in_mem ptr x (@mem ptr (predPredType ptr) (dom Undef))))))) *) - (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (dom match @decP (is_true (negb (@eq_op ptr_eqType y null))) (negb (@eq_op ptr_eqType y null)) (@idP (negb (@eq_op ptr_eqType y null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic y d h) (@upd_nullP h y d pf T) | right n => Undef end))) (andb (negb (@eq_op ptr_eqType y null)) (if @eq_op ptr_eqType x y then true else @in_mem ptr x (@mem ptr (predPredType ptr) (dom (@Def h T))))) *) (* Goal: @eq bool false (@in_mem ptr x (@mem ptr (simplPredType ptr) (@SimplPred ptr (fun x : ptr => andb (negb (@eq_op ptr_eqType y null)) (if @eq_op ptr_eqType x y then false else @in_mem ptr x (@mem ptr (predPredType ptr) (dom Undef))))))) *) rewrite ?inE. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (dom match @decP (is_true (negb (@eq_op ptr_eqType y null))) (negb (@eq_op ptr_eqType y null)) (@idP (negb (@eq_op ptr_eqType y null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic y d h) (@upd_nullP h y d pf T) | right n => Undef end))) (andb (negb (@eq_op ptr_eqType y null)) (if @eq_op ptr_eqType x y then true else @in_mem ptr x (@mem ptr (predPredType ptr) (dom (@Def h T))))) *) (* Goal: @eq bool false (andb (negb (@eq_op ptr_eqType y null)) (if @eq_op ptr_eqType x y then false else false)) *) case: ifP=>//; rewrite andbF; reflexivity. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (dom match @decP (is_true (negb (@eq_op ptr_eqType y null))) (negb (@eq_op ptr_eqType y null)) (@idP (negb (@eq_op ptr_eqType y null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic y d h) (@upd_nullP h y d pf T) | right n => Undef end))) (andb (negb (@eq_op ptr_eqType y null)) (if @eq_op ptr_eqType x y then true else @in_mem ptr x (@mem ptr (predPredType ptr) (dom (@Def h T))))) *) case: ifP=>E; case: decP=>H1; rewrite /dom /=. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred0 ptr)))) (andb (negb (@eq_op ptr_eqType y null)) (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h))))))) *) (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@ins ptr_ordType Dyn.dynamic y d h))))))) (andb (negb (@eq_op ptr_eqType y null)) (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h))))))) *) (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred0 ptr)))) (andb (negb (@eq_op ptr_eqType y null)) true) *) (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@ins ptr_ordType Dyn.dynamic y d h))))))) (andb (negb (@eq_op ptr_eqType y null)) true) *) - (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred0 ptr)))) (andb (negb (@eq_op ptr_eqType y null)) (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h))))))) *) (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@ins ptr_ordType Dyn.dynamic y d h))))))) (andb (negb (@eq_op ptr_eqType y null)) (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h))))))) *) (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred0 ptr)))) (andb (negb (@eq_op ptr_eqType y null)) true) *) (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@ins ptr_ordType Dyn.dynamic y d h))))))) (andb (negb (@eq_op ptr_eqType y null)) true) *) by rewrite (eqP E) H1 supp_ins inE /= eq_refl. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred0 ptr)))) (andb (negb (@eq_op ptr_eqType y null)) (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h))))))) *) (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@ins ptr_ordType Dyn.dynamic y d h))))))) (andb (negb (@eq_op ptr_eqType y null)) (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h))))))) *) (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred0 ptr)))) (andb (negb (@eq_op ptr_eqType y null)) true) *) - (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred0 ptr)))) (andb (negb (@eq_op ptr_eqType y null)) (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h))))))) *) (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@ins ptr_ordType Dyn.dynamic y d h))))))) (andb (negb (@eq_op ptr_eqType y null)) (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h))))))) *) (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred0 ptr)))) (andb (negb (@eq_op ptr_eqType y null)) true) *) by case: eqP H1. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred0 ptr)))) (andb (negb (@eq_op ptr_eqType y null)) (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h))))))) *) (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@ins ptr_ordType Dyn.dynamic y d h))))))) (andb (negb (@eq_op ptr_eqType y null)) (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h))))))) *) - (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred0 ptr)))) (andb (negb (@eq_op ptr_eqType y null)) (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h))))))) *) (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@ins ptr_ordType Dyn.dynamic y d h))))))) (andb (negb (@eq_op ptr_eqType y null)) (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h))))))) *) by rewrite supp_ins inE /= E H1. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred0 ptr)))) (andb (negb (@eq_op ptr_eqType y null)) (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h))))))) *) by case: eqP H1. Qed. Lemma domPt A x (v : A) : dom (x :-> v) =i [pred y | (x == y) && (x != null)]. Proof. (* Goal: @eq_mem ptr (@mem ptr (predPredType ptr) (dom (@pts A x v))) (@mem (Equality.sort ptr_eqType) (simplPredType (Equality.sort ptr_eqType)) (@SimplPred (Equality.sort ptr_eqType) (fun y : Equality.sort ptr_eqType => andb (@eq_op ptr_eqType x y) (negb (@eq_op ptr_eqType x null))))) *) move=>y; rewrite domU dom0 !inE /=. (* Goal: @eq bool (andb (negb (@eq_op ptr_eqType x null)) (if @eq_op ptr_eqType y x then true else false)) (andb (@eq_op ptr_eqType x y) (negb (@eq_op ptr_eqType x null))) *) by case: ifP=>E; rewrite -(eq_sym y) E andbC. Qed. Lemma domF h x : dom (free x h) =i [pred y | if x == y then false else y \in dom h]. Proof. (* Goal: @eq_mem ptr (@mem ptr (predPredType ptr) (dom (free x h))) (@mem (Equality.sort ptr_eqType) (simplPredType (Equality.sort ptr_eqType)) (@SimplPred (Equality.sort ptr_eqType) (fun y : Equality.sort ptr_eqType => if @eq_op ptr_eqType x y then false else @in_mem (Equality.sort ptr_eqType) y (@mem ptr (predPredType ptr) (dom h))))) *) case: h=>[|h H] y /=; rewrite ?inE /=; case: ifP=>// E; by rewrite supp_rem inE /= eq_sym E. Qed. Lemma domUn h1 h2 : dom (h1 :+ h2) =i [pred x | def (h1 :+ h2) && (x \in [predU dom h1 & dom h2])]. Proof. (* Goal: @eq_mem ptr (@mem ptr (predPredType ptr) (dom (union2 h1 h2))) (@mem ptr (simplPredType ptr) (@SimplPred ptr (fun x : ptr => andb (def (union2 h1 h2)) (@in_mem ptr x (@mem ptr (simplPredType ptr) (@predU ptr (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (predPredType ptr) (dom h1)))) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (predPredType ptr) (dom h2)))))))))) *) case: h1 h2 =>[|h1 H1] // [|h2 H2] // x; rewrite /dom /union2. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) match (if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef) with | Undef => @pred_of_simpl ptr (@pred0 ptr) | @Def f i => @pred_of_simpl (Equality.sort (Ordered.eqType ptr_ordType)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType ptr_ordType)) (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic f))) end)) (@in_mem ptr x (@mem ptr (simplPredType ptr) (@SimplPred ptr (fun x : ptr => andb (def (if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef)) (@in_mem ptr x (@mem ptr (simplPredType ptr) (@predU ptr (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (predPredType ptr) (@pred_of_simpl (Equality.sort (Ordered.eqType ptr_ordType)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType ptr_ordType)) (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h1))))))) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (predPredType ptr) (@pred_of_simpl (Equality.sort (Ordered.eqType ptr_ordType)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType ptr_ordType)) (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2)))))))))))))) *) by case: ifP=>// E; rewrite supp_fcat. Qed. Lemma dom_null h x : x \in dom h -> x != null. Proof. (* Goal: forall _ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h))), is_true (negb (@eq_op ptr_eqType x null)) *) by case: h=>[|h H1] //; case: eqP=>// ->; rewrite (negbTE H1). Qed. Lemma dom_def h x : x \in dom h -> def h. Proof. (* Goal: forall _ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h))), is_true (def h) *) by case: h. Qed. Lemma dom_free h x : x \notin dom h -> free x h = h. Proof. (* Goal: forall _ : is_true (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))), @eq heap (free x h) h *) by case: h=>[|h H] // E; apply/heapE; apply: rem_supp. Qed. Lemma dom_look h x : x \notin dom h -> look x h = dyn tt. Proof. (* Goal: forall _ : is_true (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))), @eq Dyn.dynamic (look x h) (@Dyn.dyn unit tt) *) by case: h=>[|h H] //; rewrite /look /dom -topredE /=; case: (suppP x)=>// ->. Qed. Lemma def0 : def empty. Proof. (* Goal: is_true (def empty) *) by []. Qed. Hint Resolve def0 : core. Lemma defU h x d : def (upd h x d) = (x != null) && (def h). Proof. (* Goal: @eq bool (def (upd h x d)) (andb (negb (@eq_op ptr_eqType x null)) (def h)) *) case: h=>[|h H] /=; first by rewrite andbF. (* Goal: @eq bool (def (upd (@Def h H) x d)) (andb (negb (@eq_op ptr_eqType x null)) true) *) by rewrite /upd; case: decP=>/= [->//|]; case: eqP. Qed. Lemma defPt A x (v : A) : def (x :-> v) = (x != null). Proof. (* Goal: @eq bool (def (@pts A x v)) (negb (@eq_op ptr_eqType x null)) *) by rewrite defU andbT. Qed. Lemma defF h x : def (free x h) = def h. Proof. (* Goal: @eq bool (def (free x h)) (def h) *) by case: h. Qed. CoInductive defUn_spec h1 h2 : bool -> Type := | def_false1 of ~~ def h1 : defUn_spec h1 h2 false | def_false2 of ~~ def h2 : defUn_spec h1 h2 false | def_false3 x of x \in dom h1 & x \in dom h2 : defUn_spec h1 h2 false | def_true of def h1 & def h2 & (forall x, x \in dom h1 -> x \notin dom h2) : defUn_spec h1 h2 true. Lemma defUn : forall h1 h2, defUn_spec h1 h2 (def (h1 :+ h2)). Proof. (* Goal: forall h1 h2 : heap, defUn_spec h1 h2 (def (union2 h1 h2)) *) case=>[|h1 H1][|h2 H2] /=; try by [apply: def_false1 | apply: def_false2]. (* Goal: defUn_spec (@Def h1 H1) (@Def h2 H2) (def (union2 (@Def h1 H1) (@Def h2 H2))) *) rewrite /union2; case: ifP=>E. (* Goal: defUn_spec (@Def h1 H1) (@Def h2 H2) (def Undef) *) (* Goal: defUn_spec (@Def h1 H1) (@Def h2 H2) (def (@Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2))) *) - (* Goal: defUn_spec (@Def h1 H1) (@Def h2 H2) (def Undef) *) (* Goal: defUn_spec (@Def h1 H1) (@Def h2 H2) (def (@Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2))) *) by apply: def_true=>// x H; case: disjP E=>//; move/( _ _ H). (* Goal: defUn_spec (@Def h1 H1) (@Def h2 H2) (def Undef) *) by case: disjP E=>// x T1 T2 _; apply: (def_false3 (x:=x)). Qed. Lemma defUnl h1 h2 : def (h1 :+ h2) -> def h1. Proof. (* Goal: forall _ : is_true (def (union2 h1 h2)), is_true (def h1) *) by case: h1. Qed. Lemma defUnr h1 h2 : def (h1 :+ h2) -> def h2. Proof. (* Goal: forall _ : is_true (def (union2 h1 h2)), is_true (def h2) *) by case: h1=>h1 // H; case: h2. Qed. Lemma defFUn h1 h2 x : def (h1 :+ h2) -> def (free x h1 :+ h2). Proof. (* Goal: forall _ : is_true (def (union2 h1 h2)), is_true (def (union2 (free x h1) h2)) *) case: defUn=>// H1 H2 H _. (* Goal: is_true (def (union2 (free x h1) h2)) *) case: defUn=>//; [by rewrite defF H1|by rewrite H2|]. (* Goal: forall (x0 : ptr) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom (free x h1))))) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom h2)))), is_true false *) move=>k; rewrite domF inE /=. (* Goal: forall (_ : is_true (if @eq_op ptr_eqType x k then false else @in_mem ptr k (@mem ptr (predPredType ptr) (dom h1)))) (_ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom h2)))), is_true false *) by case: ifP=>_ //; move/H; move/negbTE=>->. Qed. Lemma defUnF h1 h2 x : def (h1 :+ h2) -> def (h1 :+ free x h2). Proof. (* Goal: forall _ : is_true (def (union2 h1 h2)), is_true (def (union2 h1 (free x h2))) *) by rewrite unC; move/(defFUn x); rewrite unC. Qed. Lemma undefE x : ~~ def x <-> x = Undef. Proof. (* Goal: iff (is_true (negb (def x))) (@eq heap x Undef) *) by case: x; split. Qed. Lemma upd_inj h x d1 d2 : def h -> x != null -> upd h x d1 = upd h x d2 -> d1 = d2. Proof. (* Goal: forall (_ : is_true (def h)) (_ : is_true (negb (@eq_op ptr_eqType x null))) (_ : @eq heap (upd h x d1) (upd h x d2)), @eq Dyn.dynamic d1 d2 *) case: h=>[|h H] // _ H1; rewrite /upd; case: decP=>// H2 [E]. (* Goal: @eq Dyn.dynamic d1 d2 *) have: fnd x (ins x d1 h) = fnd x (ins x d2 h) by rewrite E. (* Goal: forall _ : @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic x (@ins ptr_ordType Dyn.dynamic x d1 h)) (@fnd ptr_ordType Dyn.dynamic x (@ins ptr_ordType Dyn.dynamic x d2 h)), @eq Dyn.dynamic d1 d2 *) by rewrite !fnd_ins eq_refl; case. Qed. Lemma heap_eta h x : x \in dom h -> h = upd (free x h) x (look x h). Proof. (* Goal: forall _ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h))), @eq heap h (upd (free x h) x (look x h)) *) case: h=>[|h H] //; rewrite /upd /look /dom /free. (* Goal: forall _ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl (Equality.sort (Ordered.eqType ptr_ordType)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType ptr_ordType)) (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h)))))), @eq heap (@Def h H) match @decP (is_true (negb (@eq_op ptr_eqType x null))) (negb (@eq_op ptr_eqType x null)) (@idP (negb (@eq_op ptr_eqType x null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic x match @fnd ptr_ordType Dyn.dynamic x h with | Some d => d | None => @Dyn.dyn unit tt end (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) x match @fnd ptr_ordType Dyn.dynamic x h with | Some d => d | None => @Dyn.dyn unit tt end pf (@free_nullP h x H)) | right n => Undef end *) case: decP; rewrite -topredE => /= H1 H2; last first. (* Goal: @eq heap (@Def h H) (@Def (@ins ptr_ordType Dyn.dynamic x match @fnd ptr_ordType Dyn.dynamic x h with | Some d => d | None => @Dyn.dyn unit tt end (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) x match @fnd ptr_ordType Dyn.dynamic x h with | Some d => d | None => @Dyn.dyn unit tt end H1 (@free_nullP h x H))) *) (* Goal: @eq heap (@Def h H) Undef *) - (* Goal: @eq heap (@Def h H) (@Def (@ins ptr_ordType Dyn.dynamic x match @fnd ptr_ordType Dyn.dynamic x h with | Some d => d | None => @Dyn.dyn unit tt end (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) x match @fnd ptr_ordType Dyn.dynamic x h with | Some d => d | None => @Dyn.dyn unit tt end H1 (@free_nullP h x H))) *) (* Goal: @eq heap (@Def h H) Undef *) by case: eqP H1 H H2=>// -> _ H; rewrite (negbTE H). (* Goal: @eq heap (@Def h H) (@Def (@ins ptr_ordType Dyn.dynamic x match @fnd ptr_ordType Dyn.dynamic x h with | Some d => d | None => @Dyn.dyn unit tt end (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) x match @fnd ptr_ordType Dyn.dynamic x h with | Some d => d | None => @Dyn.dyn unit tt end H1 (@free_nullP h x H))) *) apply/heapE; apply: fmapP=>k; rewrite fnd_ins. (* Goal: @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k h) (if @eq_op (Ordered.eqType ptr_ordType) k x then @Some Dyn.dynamic match @fnd ptr_ordType Dyn.dynamic x h with | Some d => d | None => @Dyn.dyn unit tt end else @fnd ptr_ordType Dyn.dynamic k (@rem ptr_ordType Dyn.dynamic x h)) *) case: ifP=>[|E]; last by rewrite fnd_rem E. (* Goal: forall _ : is_true (@eq_op (Ordered.eqType ptr_ordType) k x), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k h) (@Some Dyn.dynamic match @fnd ptr_ordType Dyn.dynamic x h with | Some d => d | None => @Dyn.dyn unit tt end) *) move/eqP=>->; case E1: (fnd x h)=>//. (* Goal: @eq (option Dyn.dynamic) (@None Dyn.dynamic) (@Some Dyn.dynamic (@Dyn.dyn unit tt)) *) by case: (suppP _ h) H2 E1=>// v ->. Qed. Lemma updU h x y d1 d2 : upd (upd h x d1) y d2 = if x == y then upd h x d2 else upd (upd h y d2) x d1. Proof. (* Goal: @eq heap (upd (upd h x d1) y d2) (if @eq_op ptr_eqType x y then upd h x d2 else upd (upd h y d2) x d1) *) case: h =>[|h T]; rewrite /upd; case: ifP=>// H; case: decP=>H1 //; case: decP=>// H2; last 2 first. (* Goal: @eq heap (@Def (@ins ptr_ordType Dyn.dynamic y d2 (@ins ptr_ordType Dyn.dynamic x d1 h)) (@upd_nullP (@ins ptr_ordType Dyn.dynamic x d1 h) y d2 H2 (@upd_nullP h x d1 H1 T))) (@Def (@ins ptr_ordType Dyn.dynamic x d2 h) (@upd_nullP h x d2 H1 T)) *) (* Goal: @eq heap (@Def (@ins ptr_ordType Dyn.dynamic y d2 (@ins ptr_ordType Dyn.dynamic x d1 h)) (@upd_nullP (@ins ptr_ordType Dyn.dynamic x d1 h) y d2 H2 (@upd_nullP h x d1 H1 T))) (@Def (@ins ptr_ordType Dyn.dynamic x d1 (@ins ptr_ordType Dyn.dynamic y d2 h)) (@upd_nullP (@ins ptr_ordType Dyn.dynamic y d2 h) x d1 H1 (@upd_nullP h y d2 H2 T))) *) (* Goal: @eq heap Undef (@Def (@ins ptr_ordType Dyn.dynamic x d2 h) (@upd_nullP h x d2 H1 T)) *) - (* Goal: @eq heap (@Def (@ins ptr_ordType Dyn.dynamic y d2 (@ins ptr_ordType Dyn.dynamic x d1 h)) (@upd_nullP (@ins ptr_ordType Dyn.dynamic x d1 h) y d2 H2 (@upd_nullP h x d1 H1 T))) (@Def (@ins ptr_ordType Dyn.dynamic x d2 h) (@upd_nullP h x d2 H1 T)) *) (* Goal: @eq heap (@Def (@ins ptr_ordType Dyn.dynamic y d2 (@ins ptr_ordType Dyn.dynamic x d1 h)) (@upd_nullP (@ins ptr_ordType Dyn.dynamic x d1 h) y d2 H2 (@upd_nullP h x d1 H1 T))) (@Def (@ins ptr_ordType Dyn.dynamic x d1 (@ins ptr_ordType Dyn.dynamic y d2 h)) (@upd_nullP (@ins ptr_ordType Dyn.dynamic y d2 h) x d1 H1 (@upd_nullP h y d2 H2 T))) *) (* Goal: @eq heap Undef (@Def (@ins ptr_ordType Dyn.dynamic x d2 h) (@upd_nullP h x d2 H1 T)) *) by rewrite -(eqP H) H1 in H2. (* Goal: @eq heap (@Def (@ins ptr_ordType Dyn.dynamic y d2 (@ins ptr_ordType Dyn.dynamic x d1 h)) (@upd_nullP (@ins ptr_ordType Dyn.dynamic x d1 h) y d2 H2 (@upd_nullP h x d1 H1 T))) (@Def (@ins ptr_ordType Dyn.dynamic x d2 h) (@upd_nullP h x d2 H1 T)) *) (* Goal: @eq heap (@Def (@ins ptr_ordType Dyn.dynamic y d2 (@ins ptr_ordType Dyn.dynamic x d1 h)) (@upd_nullP (@ins ptr_ordType Dyn.dynamic x d1 h) y d2 H2 (@upd_nullP h x d1 H1 T))) (@Def (@ins ptr_ordType Dyn.dynamic x d1 (@ins ptr_ordType Dyn.dynamic y d2 h)) (@upd_nullP (@ins ptr_ordType Dyn.dynamic y d2 h) x d1 H1 (@upd_nullP h y d2 H2 T))) *) - (* Goal: @eq heap (@Def (@ins ptr_ordType Dyn.dynamic y d2 (@ins ptr_ordType Dyn.dynamic x d1 h)) (@upd_nullP (@ins ptr_ordType Dyn.dynamic x d1 h) y d2 H2 (@upd_nullP h x d1 H1 T))) (@Def (@ins ptr_ordType Dyn.dynamic x d2 h) (@upd_nullP h x d2 H1 T)) *) (* Goal: @eq heap (@Def (@ins ptr_ordType Dyn.dynamic y d2 (@ins ptr_ordType Dyn.dynamic x d1 h)) (@upd_nullP (@ins ptr_ordType Dyn.dynamic x d1 h) y d2 H2 (@upd_nullP h x d1 H1 T))) (@Def (@ins ptr_ordType Dyn.dynamic x d1 (@ins ptr_ordType Dyn.dynamic y d2 h)) (@upd_nullP (@ins ptr_ordType Dyn.dynamic y d2 h) x d1 H1 (@upd_nullP h y d2 H2 T))) *) by apply/heapE; rewrite ins_ins eq_sym H. (* Goal: @eq heap (@Def (@ins ptr_ordType Dyn.dynamic y d2 (@ins ptr_ordType Dyn.dynamic x d1 h)) (@upd_nullP (@ins ptr_ordType Dyn.dynamic x d1 h) y d2 H2 (@upd_nullP h x d1 H1 T))) (@Def (@ins ptr_ordType Dyn.dynamic x d2 h) (@upd_nullP h x d2 H1 T)) *) by apply/heapE; rewrite ins_ins (eqP H) eq_refl. Qed. Lemma updF h x y d : upd (free x h) y d = if x == y then upd h x d else free x (upd h y d). Proof. (* Goal: @eq heap (upd (free x h) y d) (if @eq_op ptr_eqType x y then upd h x d else free x (upd h y d)) *) case: h=>[|h H] /=; case: ifP=>E //; rewrite /upd; last first. (* Goal: @eq heap match @decP (is_true (negb (@eq_op ptr_eqType y null))) (negb (@eq_op ptr_eqType y null)) (@idP (negb (@eq_op ptr_eqType y null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d pf (@free_nullP h x H)) | right n => Undef end match @decP (is_true (negb (@eq_op ptr_eqType x null))) (negb (@eq_op ptr_eqType x null)) (@idP (negb (@eq_op ptr_eqType x null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic x d h) (@upd_nullP h x d pf H) | right n => Undef end *) (* Goal: @eq heap match @decP (is_true (negb (@eq_op ptr_eqType y null))) (negb (@eq_op ptr_eqType y null)) (@idP (negb (@eq_op ptr_eqType y null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d pf (@free_nullP h x H)) | right n => Undef end (free x match @decP (is_true (negb (@eq_op ptr_eqType y null))) (negb (@eq_op ptr_eqType y null)) (@idP (negb (@eq_op ptr_eqType y null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic y d h) (@upd_nullP h y d pf H) | right n => Undef end) *) - (* Goal: @eq heap match @decP (is_true (negb (@eq_op ptr_eqType y null))) (negb (@eq_op ptr_eqType y null)) (@idP (negb (@eq_op ptr_eqType y null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d pf (@free_nullP h x H)) | right n => Undef end match @decP (is_true (negb (@eq_op ptr_eqType x null))) (negb (@eq_op ptr_eqType x null)) (@idP (negb (@eq_op ptr_eqType x null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic x d h) (@upd_nullP h x d pf H) | right n => Undef end *) (* Goal: @eq heap match @decP (is_true (negb (@eq_op ptr_eqType y null))) (negb (@eq_op ptr_eqType y null)) (@idP (negb (@eq_op ptr_eqType y null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d pf (@free_nullP h x H)) | right n => Undef end (free x match @decP (is_true (negb (@eq_op ptr_eqType y null))) (negb (@eq_op ptr_eqType y null)) (@idP (negb (@eq_op ptr_eqType y null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic y d h) (@upd_nullP h y d pf H) | right n => Undef end) *) case: decP=>// H1. (* Goal: @eq heap match @decP (is_true (negb (@eq_op ptr_eqType y null))) (negb (@eq_op ptr_eqType y null)) (@idP (negb (@eq_op ptr_eqType y null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d pf (@free_nullP h x H)) | right n => Undef end match @decP (is_true (negb (@eq_op ptr_eqType x null))) (negb (@eq_op ptr_eqType x null)) (@idP (negb (@eq_op ptr_eqType x null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic x d h) (@upd_nullP h x d pf H) | right n => Undef end *) (* Goal: @eq heap (@Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d H1 (@free_nullP h x H))) (free x (@Def (@ins ptr_ordType Dyn.dynamic y d h) (@upd_nullP h y d H1 H))) *) by apply/heapE; rewrite ins_rem eq_sym E. (* Goal: @eq heap match @decP (is_true (negb (@eq_op ptr_eqType y null))) (negb (@eq_op ptr_eqType y null)) (@idP (negb (@eq_op ptr_eqType y null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d pf (@free_nullP h x H)) | right n => Undef end match @decP (is_true (negb (@eq_op ptr_eqType x null))) (negb (@eq_op ptr_eqType x null)) (@idP (negb (@eq_op ptr_eqType x null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic x d h) (@upd_nullP h x d pf H) | right n => Undef end *) case: decP=>// H1; case: decP=>// H2. (* Goal: @eq heap Undef (@Def (@ins ptr_ordType Dyn.dynamic x d h) (@upd_nullP h x d H2 H)) *) (* Goal: @eq heap (@Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d H1 (@free_nullP h x H))) Undef *) (* Goal: @eq heap (@Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d H1 (@free_nullP h x H))) (@Def (@ins ptr_ordType Dyn.dynamic x d h) (@upd_nullP h x d H2 H)) *) - (* Goal: @eq heap Undef (@Def (@ins ptr_ordType Dyn.dynamic x d h) (@upd_nullP h x d H2 H)) *) (* Goal: @eq heap (@Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d H1 (@free_nullP h x H))) Undef *) (* Goal: @eq heap (@Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d H1 (@free_nullP h x H))) (@Def (@ins ptr_ordType Dyn.dynamic x d h) (@upd_nullP h x d H2 H)) *) by apply/heapE; rewrite ins_rem (eqP E) eq_refl. (* Goal: @eq heap Undef (@Def (@ins ptr_ordType Dyn.dynamic x d h) (@upd_nullP h x d H2 H)) *) (* Goal: @eq heap (@Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d H1 (@free_nullP h x H))) Undef *) - (* Goal: @eq heap Undef (@Def (@ins ptr_ordType Dyn.dynamic x d h) (@upd_nullP h x d H2 H)) *) (* Goal: @eq heap (@Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d H1 (@free_nullP h x H))) Undef *) by rewrite (eqP E) H1 in H2. (* Goal: @eq heap Undef (@Def (@ins ptr_ordType Dyn.dynamic x d h) (@upd_nullP h x d H2 H)) *) by rewrite -(eqP E) H2 in H1. Qed. Lemma updUnl h1 h2 x d : upd (h1 :+ h2) x d = if x \in dom h1 then upd h1 x d :+ h2 else h1 :+ upd h2 x d. Lemma updUnr h1 h2 x d : upd (h1 :+ h2) x d = if x \in dom h2 then h1 :+ upd h2 x d else upd h1 x d :+ h2. Proof. (* Goal: @eq heap (upd (union2 h1 h2) x d) (if @in_mem (Equality.sort ptr_eqType) x (@mem ptr (predPredType ptr) (dom h2)) then union2 h1 (upd h2 x d) else union2 (upd h1 x d) h2) *) by rewrite unC updUnl (unC h1) (unC h2). Qed. Lemma pts_injP A1 A2 x1 x2 (v1 : A1) (v2 : A2) : def (x1 :-> v1) -> x1 :-> v1 = x2 :-> v2 -> x1 = x2 /\ A1 = A2. Proof. (* Goal: forall (_ : is_true (def (@pts A1 x1 v1))) (_ : @eq heap (@pts A1 x1 v1) (@pts A2 x2 v2)), and (@eq ptr x1 x2) (@eq Type A1 A2) *) rewrite /pts /upd /=. (* Goal: forall (_ : is_true (def match @decP (is_true (negb (@eq_op ptr_eqType x1 null))) (negb (@eq_op ptr_eqType x1 null)) (@idP (negb (@eq_op ptr_eqType x1 null))) with | left pf => @Def (@FinMap ptr_ordType Dyn.dynamic (@cons (prod ptr Dyn.dynamic) (@pair ptr Dyn.dynamic x1 (@Dyn.dyn A1 v1)) (@Datatypes.nil (prod ptr Dyn.dynamic))) (@sorted_ins' ptr_ordType Dyn.dynamic (@Datatypes.nil (prod ptr Dyn.dynamic)) x1 (@Dyn.dyn A1 v1) (sorted_nil ptr_ordType Dyn.dynamic))) (@upd_nullP (nil ptr_ordType Dyn.dynamic) x1 (@Dyn.dyn A1 v1) pf is_true_true) | right n => Undef end)) (_ : @eq heap match @decP (is_true (negb (@eq_op ptr_eqType x1 null))) (negb (@eq_op ptr_eqType x1 null)) (@idP (negb (@eq_op ptr_eqType x1 null))) with | left pf => @Def (@FinMap ptr_ordType Dyn.dynamic (@cons (prod ptr Dyn.dynamic) (@pair ptr Dyn.dynamic x1 (@Dyn.dyn A1 v1)) (@Datatypes.nil (prod ptr Dyn.dynamic))) (@sorted_ins' ptr_ordType Dyn.dynamic (@Datatypes.nil (prod ptr Dyn.dynamic)) x1 (@Dyn.dyn A1 v1) (sorted_nil ptr_ordType Dyn.dynamic))) (@upd_nullP (nil ptr_ordType Dyn.dynamic) x1 (@Dyn.dyn A1 v1) pf is_true_true) | right n => Undef end match @decP (is_true (negb (@eq_op ptr_eqType x2 null))) (negb (@eq_op ptr_eqType x2 null)) (@idP (negb (@eq_op ptr_eqType x2 null))) with | left pf => @Def (@FinMap ptr_ordType Dyn.dynamic (@cons (prod ptr Dyn.dynamic) (@pair ptr Dyn.dynamic x2 (@Dyn.dyn A2 v2)) (@Datatypes.nil (prod ptr Dyn.dynamic))) (@sorted_ins' ptr_ordType Dyn.dynamic (@Datatypes.nil (prod ptr Dyn.dynamic)) x2 (@Dyn.dyn A2 v2) (sorted_nil ptr_ordType Dyn.dynamic))) (@upd_nullP (nil ptr_ordType Dyn.dynamic) x2 (@Dyn.dyn A2 v2) pf is_true_true) | right n => Undef end), and (@eq ptr x1 x2) (@eq Type A1 A2) *) by case: decP=>H1; case: decP=>H2 // _; case. Qed. Lemma pts_injT A1 A2 x (v1 : A1) (v2 : A2) : def (x :-> v1) -> x :-> v1 = x :-> v2 -> A1 = A2. Proof. (* Goal: forall (_ : is_true (def (@pts A1 x v1))) (_ : @eq heap (@pts A1 x v1) (@pts A2 x v2)), @eq Type A1 A2 *) by move=>D; case/(pts_injP D). Qed. Lemma pts_inj A x (v1 v2 : A) : def (x :-> v1) -> x :-> v1 = x :-> v2 -> v1 = v2. Proof. (* Goal: forall (_ : is_true (def (@pts A x v1))) (_ : @eq heap (@pts A x v1) (@pts A x v2)), @eq A v1 v2 *) move=>D; rewrite /pts /upd. (* Goal: forall _ : @eq heap match empty with | Undef => Undef | @Def hs ns => match @decP (is_true (negb (@eq_op ptr_eqType x null))) (negb (@eq_op ptr_eqType x null)) (@idP (negb (@eq_op ptr_eqType x null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic x (@Dyn.dyn A v1) hs) (@upd_nullP hs x (@Dyn.dyn A v1) pf ns) | right n => Undef end end match empty with | Undef => Undef | @Def hs ns => match @decP (is_true (negb (@eq_op ptr_eqType x null))) (negb (@eq_op ptr_eqType x null)) (@idP (negb (@eq_op ptr_eqType x null))) with | left pf => @Def (@ins ptr_ordType Dyn.dynamic x (@Dyn.dyn A v2) hs) (@upd_nullP hs x (@Dyn.dyn A v2) pf ns) | right n => Undef end end, @eq A v1 v2 *) case: decP; last by rewrite -(defPt _ v1) D. (* Goal: forall (a : is_true (negb (@eq_op ptr_eqType x null))) (_ : @eq heap match empty with | Undef => Undef | @Def hs ns => @Def (@ins ptr_ordType Dyn.dynamic x (@Dyn.dyn A v1) hs) (@upd_nullP hs x (@Dyn.dyn A v1) a ns) end match empty with | Undef => Undef | @Def hs ns => @Def (@ins ptr_ordType Dyn.dynamic x (@Dyn.dyn A v2) hs) (@upd_nullP hs x (@Dyn.dyn A v2) a ns) end), @eq A v1 v2 *) by move=>H []; apply: inj_pairT2. Qed. Lemma free0 x : free x empty = empty. Proof. (* Goal: @eq heap (free x empty) empty *) by apply/heapE; rewrite rem_empty. Qed. Lemma freeU h x y d : free x (upd h y d) = if x == y then if y == null then Undef else free x h else upd (free x h) y d. Proof. (* Goal: @eq heap (free x (upd h y d)) (if @eq_op ptr_eqType x y then if @eq_op ptr_eqType y null then Undef else free x h else upd (free x h) y d) *) case: h=>[|h H] /=; first by case: ifP=>// E; case: ifP. (* Goal: @eq heap (free x (upd (@Def h H) y d)) (if @eq_op ptr_eqType x y then if @eq_op ptr_eqType y null then Undef else @Def (@rem ptr_ordType Dyn.dynamic x h) (@free_nullP h x H) else upd (@Def (@rem ptr_ordType Dyn.dynamic x h) (@free_nullP h x H)) y d) *) rewrite /upd; case: ifP=>E1; case: decP=>H1 //. (* Goal: @eq heap (free x (@Def (@ins ptr_ordType Dyn.dynamic y d h) (@upd_nullP h y d H1 H))) (@Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d H1 (@free_nullP h x H))) *) (* Goal: @eq heap (free x Undef) (if @eq_op ptr_eqType y null then Undef else @Def (@rem ptr_ordType Dyn.dynamic x h) (@free_nullP h x H)) *) (* Goal: @eq heap (free x (@Def (@ins ptr_ordType Dyn.dynamic y d h) (@upd_nullP h y d H1 H))) (if @eq_op ptr_eqType y null then Undef else @Def (@rem ptr_ordType Dyn.dynamic x h) (@free_nullP h x H)) *) - (* Goal: @eq heap (free x (@Def (@ins ptr_ordType Dyn.dynamic y d h) (@upd_nullP h y d H1 H))) (@Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d H1 (@free_nullP h x H))) *) (* Goal: @eq heap (free x Undef) (if @eq_op ptr_eqType y null then Undef else @Def (@rem ptr_ordType Dyn.dynamic x h) (@free_nullP h x H)) *) (* Goal: @eq heap (free x (@Def (@ins ptr_ordType Dyn.dynamic y d h) (@upd_nullP h y d H1 H))) (if @eq_op ptr_eqType y null then Undef else @Def (@rem ptr_ordType Dyn.dynamic x h) (@free_nullP h x H)) *) by rewrite (negbTE H1); apply/heapE; rewrite rem_ins E1. (* Goal: @eq heap (free x (@Def (@ins ptr_ordType Dyn.dynamic y d h) (@upd_nullP h y d H1 H))) (@Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d H1 (@free_nullP h x H))) *) (* Goal: @eq heap (free x Undef) (if @eq_op ptr_eqType y null then Undef else @Def (@rem ptr_ordType Dyn.dynamic x h) (@free_nullP h x H)) *) - (* Goal: @eq heap (free x (@Def (@ins ptr_ordType Dyn.dynamic y d h) (@upd_nullP h y d H1 H))) (@Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d H1 (@free_nullP h x H))) *) (* Goal: @eq heap (free x Undef) (if @eq_op ptr_eqType y null then Undef else @Def (@rem ptr_ordType Dyn.dynamic x h) (@free_nullP h x H)) *) by case: ifP H1=>// ->. (* Goal: @eq heap (free x (@Def (@ins ptr_ordType Dyn.dynamic y d h) (@upd_nullP h y d H1 H))) (@Def (@ins ptr_ordType Dyn.dynamic y d (@rem ptr_ordType Dyn.dynamic x h)) (@upd_nullP (@rem ptr_ordType Dyn.dynamic x h) y d H1 (@free_nullP h x H))) *) by apply/heapE; rewrite rem_ins E1. Qed. Lemma freeF h x y : free x (free y h) = if x == y then free x h else free y (free x h). Proof. (* Goal: @eq heap (free x (free y h)) (if @eq_op ptr_eqType x y then free x h else free y (free x h)) *) by case: h=>*; case: ifP=>E //; apply/heapE; rewrite rem_rem E. Qed. Lemma freeUn h1 h2 x : free x (h1 :+ h2) = if x \in dom (h1 :+ h2) then free x h1 :+ free x h2 else h1 :+ h2. Proof. (* Goal: @eq heap (free x (union2 h1 h2)) (if @in_mem ptr x (@mem ptr (predPredType ptr) (dom (union2 h1 h2))) then union2 (free x h1) (free x h2) else union2 h1 h2) *) case: h1 h2=>[|h1 H1] [|h2 H2] //; rewrite /union2 /free /dom /=. (* Goal: @eq heap match (if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef) with | Undef => Undef | @Def hs ns => @Def (@rem ptr_ordType Dyn.dynamic x hs) (@free_nullP hs x ns) end (if @in_mem ptr x (@mem ptr (predPredType ptr) match (if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef) with | Undef => @pred_of_simpl ptr (@pred0 ptr) | @Def f i => @pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic f))) end) then if @disj ptr_ordType Dyn.dynamic (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2) then @Def (@fcat ptr_ordType Dyn.dynamic (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2)) (@un_nullP (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2) (@free_nullP h1 x H1) (@free_nullP h2 x H2)) else Undef else if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef) *) case: ifP=>E1 //; rewrite supp_fcat inE /=. (* Goal: @eq heap (@Def (@rem ptr_ordType Dyn.dynamic x (@fcat ptr_ordType Dyn.dynamic h1 h2)) (@free_nullP (@fcat ptr_ordType Dyn.dynamic h1 h2) x (@un_nullP h1 h2 H1 H2))) (if orb (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h1))) (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2))) then if @disj ptr_ordType Dyn.dynamic (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2) then @Def (@fcat ptr_ordType Dyn.dynamic (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2)) (@un_nullP (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2) (@free_nullP h1 x H1) (@free_nullP h2 x H2)) else Undef else @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2)) *) case: ifP=>E2; last by apply/heapE; rewrite rem_supp // supp_fcat inE /= E2. (* Goal: @eq heap (@Def (@rem ptr_ordType Dyn.dynamic x (@fcat ptr_ordType Dyn.dynamic h1 h2)) (@free_nullP (@fcat ptr_ordType Dyn.dynamic h1 h2) x (@un_nullP h1 h2 H1 H2))) (if @disj ptr_ordType Dyn.dynamic (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2) then @Def (@fcat ptr_ordType Dyn.dynamic (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2)) (@un_nullP (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2) (@free_nullP h1 x H1) (@free_nullP h2 x H2)) else Undef) *) rewrite disj_rem; last by rewrite disjC disj_rem // disjC. (* Goal: @eq heap (@Def (@rem ptr_ordType Dyn.dynamic x (@fcat ptr_ordType Dyn.dynamic h1 h2)) (@free_nullP (@fcat ptr_ordType Dyn.dynamic h1 h2) x (@un_nullP h1 h2 H1 H2))) (@Def (@fcat ptr_ordType Dyn.dynamic (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2)) (@un_nullP (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2) (@free_nullP h1 x H1) (@free_nullP h2 x H2))) *) apply/heapE; case/orP: E2=>E2. (* Goal: @eq (@finMap_for ptr_ordType Dyn.dynamic (Phant (forall _ : ptr, Dyn.dynamic))) (@rem ptr_ordType Dyn.dynamic x (@fcat ptr_ordType Dyn.dynamic h1 h2)) (@fcat ptr_ordType Dyn.dynamic (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2)) *) (* Goal: @eq (@finMap_for ptr_ordType Dyn.dynamic (Phant (forall _ : ptr, Dyn.dynamic))) (@rem ptr_ordType Dyn.dynamic x (@fcat ptr_ordType Dyn.dynamic h1 h2)) (@fcat ptr_ordType Dyn.dynamic (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2)) *) - (* Goal: @eq (@finMap_for ptr_ordType Dyn.dynamic (Phant (forall _ : ptr, Dyn.dynamic))) (@rem ptr_ordType Dyn.dynamic x (@fcat ptr_ordType Dyn.dynamic h1 h2)) (@fcat ptr_ordType Dyn.dynamic (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2)) *) (* Goal: @eq (@finMap_for ptr_ordType Dyn.dynamic (Phant (forall _ : ptr, Dyn.dynamic))) (@rem ptr_ordType Dyn.dynamic x (@fcat ptr_ordType Dyn.dynamic h1 h2)) (@fcat ptr_ordType Dyn.dynamic (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2)) *) suff E3: x \notin supp h2 by rewrite -fcat_rems // (rem_supp E3). (* Goal: @eq (@finMap_for ptr_ordType Dyn.dynamic (Phant (forall _ : ptr, Dyn.dynamic))) (@rem ptr_ordType Dyn.dynamic x (@fcat ptr_ordType Dyn.dynamic h1 h2)) (@fcat ptr_ordType Dyn.dynamic (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2)) *) (* Goal: is_true (negb (@in_mem ptr x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2)))) *) by case: disjP E1 E2=>// H _; move/H. (* Goal: @eq (@finMap_for ptr_ordType Dyn.dynamic (Phant (forall _ : ptr, Dyn.dynamic))) (@rem ptr_ordType Dyn.dynamic x (@fcat ptr_ordType Dyn.dynamic h1 h2)) (@fcat ptr_ordType Dyn.dynamic (@rem ptr_ordType Dyn.dynamic x h1) (@rem ptr_ordType Dyn.dynamic x h2)) *) suff E3: x \notin supp h1 by rewrite -fcat_srem // (rem_supp E3). (* Goal: is_true (negb (@in_mem ptr x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h1)))) *) by case: disjP E1 E2=>// H _; move/contra: (H x); rewrite negbK. Qed. Lemma freeUnD h1 h2 x : def (h1 :+ h2) -> free x (h1 :+ h2) = free x h1 :+ free x h2. Proof. (* Goal: forall _ : is_true (def (union2 h1 h2)), @eq heap (free x (union2 h1 h2)) (union2 (free x h1) (free x h2)) *) move=>D; rewrite freeUn domUn D !inE /=; case: ifP=>//. (* Goal: forall _ : @eq bool (orb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h1))) (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2)))) false, @eq heap (union2 h1 h2) (union2 (free x h1) (free x h2)) *) by move/negbT; rewrite negb_or; case/andP=>H1 H2; rewrite !dom_free. Qed. Lemma freeUnl h1 h2 x : x \notin dom h1 -> free x (h1 :+ h2) = h1 :+ free x h2. Proof. (* Goal: forall _ : is_true (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h1)))), @eq heap (free x (union2 h1 h2)) (union2 h1 (free x h2)) *) move=>D1; rewrite freeUn domUn !inE (negbTE D1) /=. (* Goal: @eq heap (if andb (def (union2 h1 h2)) (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2))) then union2 (free x h1) (free x h2) else union2 h1 h2) (union2 h1 (free x h2)) *) case: ifP; first by case/andP; rewrite dom_free. (* Goal: forall _ : @eq bool (andb (def (union2 h1 h2)) (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2)))) false, @eq heap (union2 h1 h2) (union2 h1 (free x h2)) *) move/negbT; rewrite negb_and; case/orP=>D2; last by rewrite dom_free. (* Goal: @eq heap (union2 h1 h2) (union2 h1 (free x h2)) *) suff: ~~ def (h1 :+ free x h2). (* Goal: is_true (negb (def (union2 h1 (free x h2)))) *) (* Goal: forall _ : is_true (negb (def (union2 h1 (free x h2)))), @eq heap (union2 h1 h2) (union2 h1 (free x h2)) *) - (* Goal: is_true (negb (def (union2 h1 (free x h2)))) *) (* Goal: forall _ : is_true (negb (def (union2 h1 (free x h2)))), @eq heap (union2 h1 h2) (union2 h1 (free x h2)) *) by case: (h1 :+ free x h2)=>// _; case: (h1 :+ h2) D2. (* Goal: is_true (negb (def (union2 h1 (free x h2)))) *) apply: contra D2; case: defUn=>// H1 H2 H _. (* Goal: is_true (def (union2 h1 h2)) *) case: defUn=>//; first by [rewrite H1]; first by move: H2; rewrite defF=>->. (* Goal: forall (x : ptr) (_ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h1)))) (_ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2)))), is_true false *) move=>k H3; move: (H _ H3); rewrite domF inE /=. (* Goal: forall (_ : is_true (negb (if @eq_op ptr_eqType x k then false else @in_mem ptr k (@mem ptr (predPredType ptr) (dom h2))))) (_ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom h2)))), is_true false *) by case: ifP H3 D1=>[|_ _ _]; [move/eqP=><- -> | move/negbTE=>->]. Qed. Lemma freeUnr h1 h2 x : x \notin dom h2 -> free x (h1 :+ h2) = free x h1 :+ h2. Proof. (* Goal: forall _ : is_true (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2)))), @eq heap (free x (union2 h1 h2)) (union2 (free x h1) h2) *) by move=>H; rewrite unC freeUnl // unC. Qed. Lemma lookU h x y d : look x (upd h y d) = if x == y then if def h && (y != null) then d else dyn tt else if y != null then look x h else dyn tt. Proof. (* Goal: @eq Dyn.dynamic (look x (upd h y d)) (if @eq_op ptr_eqType x y then if andb (def h) (negb (@eq_op ptr_eqType y null)) then d else @Dyn.dyn unit tt else if negb (@eq_op ptr_eqType y null) then look x h else @Dyn.dyn unit tt) *) case: h=>[|h H] /=; case: ifP=>E //; case: ifP=>H1 //; rewrite /upd; by case: decP=>// H2; rewrite /look fnd_ins E //; rewrite H1 in H2. Qed. Lemma lookF h x y : look x (free y h) = if x == y then dyn tt else look x h. Proof. (* Goal: @eq Dyn.dynamic (look x (free y h)) (if @eq_op ptr_eqType x y then @Dyn.dyn unit tt else look x h) *) by case: h=>[|h H]; case: ifP=>E //; rewrite /look /free fnd_rem E. Qed. Lemma lookUnl h1 h2 x : def (h1 :+ h2) -> look x (h1 :+ h2) = if x \in dom h1 then look x h1 else look x h2. Proof. (* Goal: forall _ : is_true (def (union2 h1 h2)), @eq Dyn.dynamic (look x (union2 h1 h2)) (if @in_mem ptr x (@mem ptr (predPredType ptr) (dom h1)) then look x h1 else look x h2) *) case: h1 h2=>[|h1 H1] // [|h2 H2] //; rewrite /look /dom /union2. (* Goal: forall _ : is_true (def (if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef)), @eq Dyn.dynamic match (if @disj ptr_ordType Dyn.dynamic h1 h2 then @Def (@fcat ptr_ordType Dyn.dynamic h1 h2) (@un_nullP h1 h2 H1 H2) else Undef) with | Undef => @Dyn.dyn unit tt | @Def hs i => match @fnd ptr_ordType Dyn.dynamic x hs with | Some d => d | None => @Dyn.dyn unit tt end end (if @in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl (Equality.sort (Ordered.eqType ptr_ordType)) (@pred_of_mem_pred (Equality.sort (Ordered.eqType ptr_ordType)) (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h1))))) then match @fnd ptr_ordType Dyn.dynamic x h1 with | Some d => d | None => @Dyn.dyn unit tt end else match @fnd ptr_ordType Dyn.dynamic x h2 with | Some d => d | None => @Dyn.dyn unit tt end) *) case: ifP=>D //= _; case: ifP=>E1; last first. (* Goal: @eq Dyn.dynamic match @fnd ptr_ordType Dyn.dynamic x (@fcat ptr_ordType Dyn.dynamic h1 h2) with | Some d => d | None => @Dyn.dyn unit tt end match @fnd ptr_ordType Dyn.dynamic x h1 with | Some d => d | None => @Dyn.dyn unit tt end *) (* Goal: @eq Dyn.dynamic match @fnd ptr_ordType Dyn.dynamic x (@fcat ptr_ordType Dyn.dynamic h1 h2) with | Some d => d | None => @Dyn.dyn unit tt end match @fnd ptr_ordType Dyn.dynamic x h2 with | Some d => d | None => @Dyn.dyn unit tt end *) - (* Goal: @eq Dyn.dynamic match @fnd ptr_ordType Dyn.dynamic x (@fcat ptr_ordType Dyn.dynamic h1 h2) with | Some d => d | None => @Dyn.dyn unit tt end match @fnd ptr_ordType Dyn.dynamic x h1 with | Some d => d | None => @Dyn.dyn unit tt end *) (* Goal: @eq Dyn.dynamic match @fnd ptr_ordType Dyn.dynamic x (@fcat ptr_ordType Dyn.dynamic h1 h2) with | Some d => d | None => @Dyn.dyn unit tt end match @fnd ptr_ordType Dyn.dynamic x h2 with | Some d => d | None => @Dyn.dyn unit tt end *) by rewrite fnd_fcat; case: ifP=>// E2; rewrite fnd_supp ?E1 // fnd_supp ?E2. (* Goal: @eq Dyn.dynamic match @fnd ptr_ordType Dyn.dynamic x (@fcat ptr_ordType Dyn.dynamic h1 h2) with | Some d => d | None => @Dyn.dyn unit tt end match @fnd ptr_ordType Dyn.dynamic x h1 with | Some d => d | None => @Dyn.dyn unit tt end *) suff E2: x \notin supp h2 by rewrite fnd_fcat (negbTE E2). (* Goal: is_true (negb (@in_mem ptr x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2)))) *) by case: disjP D E1=>// H _; apply: H. Qed. Lemma lookUnr h1 h2 x : def (h1 :+ h2) -> look x (h1 :+ h2) = if x \in dom h2 then look x h2 else look x h1. Proof. (* Goal: forall _ : is_true (def (union2 h1 h2)), @eq Dyn.dynamic (look x (union2 h1 h2)) (if @in_mem ptr x (@mem ptr (predPredType ptr) (dom h2)) then look x h2 else look x h1) *) by rewrite unC=>D; rewrite lookUnl. Qed. Lemma empP h : reflect (h = empty) (empb h). Proof. (* Goal: Bool.reflect (@eq heap h empty) (empb h) *) case: h=>[|h] /=; first by right. (* Goal: forall i : is_true (negb (@in_mem ptr null (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h)))), Bool.reflect (@eq heap (@Def h i) empty) (@eq_op (seq_eqType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h) (@Datatypes.nil ptr)) *) case: eqP=>E H; first by apply: ReflectT; apply/heapE; apply/supp_nilE. (* Goal: Bool.reflect (@eq heap (@Def h H) empty) false *) by apply: ReflectF; move/heapE=>S; rewrite S supp_nil in E. Qed. Lemma empU h x d : empb (upd h x d) = false. Proof. (* Goal: @eq bool (empb (upd h x d)) false *) case: h=>[|h H] //; rewrite /upd /empb; case: decP=>// H1. (* Goal: @eq bool (@eq_op (seq_eqType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@ins ptr_ordType Dyn.dynamic x d h)) (@Datatypes.nil (Equality.sort (Ordered.eqType ptr_ordType)))) false *) suff: x \in supp (ins x d h) by case: (supp _). (* Goal: is_true (@in_mem (Equality.sort ptr_eqType) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@ins ptr_ordType Dyn.dynamic x d h)))) *) by rewrite supp_ins inE /= eq_refl. Qed. Lemma empPt A x (v : A) : empb (x :-> v) = false. Proof. (* Goal: @eq bool (empb (@pts A x v)) false *) by rewrite empU. Qed. Lemma empUn h1 h2 : empb (h1 :+ h2) = empb h1 && empb h2. Proof. (* Goal: @eq bool (empb (union2 h1 h2)) (andb (empb h1) (empb h2)) *) case: h1 h2=>[|h1 H1] // [|h2 H2] /=; first by rewrite andbC. (* Goal: @eq bool (empb (union2 (@Def h1 H1) (@Def h2 H2))) (andb (@eq_op (seq_eqType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h1) (@Datatypes.nil ptr)) (@eq_op (seq_eqType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2) (@Datatypes.nil ptr))) *) rewrite /empb /union2; case: ifP=>E; case: eqP=>E1; case: eqP=>E2 //=; last 2 first. (* Goal: @eq bool true false *) (* Goal: @eq bool true (@eq_op (seq_eqType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2) (@Datatypes.nil ptr)) *) (* Goal: @eq bool false true *) (* Goal: @eq bool false (@eq_op (seq_eqType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2) (@Datatypes.nil ptr)) *) - (* Goal: @eq bool true false *) (* Goal: @eq bool true (@eq_op (seq_eqType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2) (@Datatypes.nil ptr)) *) (* Goal: @eq bool false true *) (* Goal: @eq bool false (@eq_op (seq_eqType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2) (@Datatypes.nil ptr)) *) by move: E2 E1; move/supp_nilE=>->; rewrite fcat0s; case: eqP. (* Goal: @eq bool true false *) (* Goal: @eq bool true (@eq_op (seq_eqType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2) (@Datatypes.nil ptr)) *) (* Goal: @eq bool false true *) - (* Goal: @eq bool true false *) (* Goal: @eq bool true (@eq_op (seq_eqType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2) (@Datatypes.nil ptr)) *) (* Goal: @eq bool false true *) by move: E1 E2 E; do 2![move/supp_nilE=>->]; case: disjP. (* Goal: @eq bool true false *) (* Goal: @eq bool true (@eq_op (seq_eqType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2) (@Datatypes.nil ptr)) *) - (* Goal: @eq bool true false *) (* Goal: @eq bool true (@eq_op (seq_eqType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2) (@Datatypes.nil ptr)) *) by move/supp_nilE: E2 E1=>-> <-; rewrite fcat0s eq_refl. (* Goal: @eq bool true false *) have [k H3]: exists k, k \in supp h1. (* Goal: @eq bool true false *) (* Goal: @ex (Equality.sort (Ordered.eqType ptr_ordType)) (fun k : Equality.sort (Ordered.eqType ptr_ordType) => is_true (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) k (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h1)))) *) - (* Goal: @eq bool true false *) (* Goal: @ex (Equality.sort (Ordered.eqType ptr_ordType)) (fun k : Equality.sort (Ordered.eqType ptr_ordType) => is_true (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) k (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h1)))) *) case: (supp h1) {E1 H1 E} E2=>[|x s _] //. (* Goal: @eq bool true false *) (* Goal: @ex (Equality.sort (Ordered.eqType ptr_ordType)) (fun k : Equality.sort (Ordered.eqType ptr_ordType) => is_true (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) k (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@cons (Ordered.sort ptr_ordType) x s)))) *) by exists x; rewrite inE eq_refl. (* Goal: @eq bool true false *) suff: k \in supp (fcat h1 h2) by rewrite E1. (* Goal: is_true (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) k (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h2)))) *) by rewrite supp_fcat inE /= H3. Qed. Lemma empbE h : h = empty <-> empb h. Proof. (* Goal: iff (@eq heap h empty) (is_true (empb h)) *) by split=>[-> //|]; case: empP. Qed. Lemma un0E h1 h2 : h1 :+ h2 = empty <-> h1 = empty /\ h2 = empty. Proof. (* Goal: iff (@eq heap (union2 h1 h2) empty) (and (@eq heap h1 empty) (@eq heap h2 empty)) *) by rewrite !empbE empUn; case: andP. Qed. Lemma defE h : reflect (def h /\ forall x, x \notin dom h)(empb h). Lemma defUnhh h : def (h :+ h) = empb h. Proof. (* Goal: @eq bool (def (union2 h h)) (empb h) *) case E: (empb h); first by move/empbE: E=>->. (* Goal: @eq bool (def (union2 h h)) false *) case: defUn=>// D _ L. (* Goal: @eq bool true false *) case: defE E=>//; case; split=>// x. (* Goal: is_true (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))) *) case E: (x \in dom h)=>//. (* Goal: is_true (negb true) *) by move: (L x E); rewrite E. Qed. Lemma path_last 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 ptr (predPredType ptr) (dom h)))) *) suff L2: forall h x, x \in dom h -> ord x (fresh h). (* Goal: forall (h : heap) (x : ptr) (_ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))), is_true (@ord ptr_ordType x (fresh h)) *) (* Goal: is_true (negb (@in_mem ptr (ptr_offset (fresh h) n) (@mem ptr (predPredType ptr) (dom h)))) *) - (* Goal: forall (h : heap) (x : ptr) (_ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))), is_true (@ord ptr_ordType x (fresh h)) *) (* Goal: is_true (negb (@in_mem ptr (ptr_offset (fresh h) n) (@mem ptr (predPredType ptr) (dom h)))) *) by apply: (contra (L2 _ _)); rewrite -leqNgt leq_addr. (* Goal: forall (h : heap) (x : ptr) (_ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom 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 (predPredType ptr) (dom (@Def (@FinMap ptr_ordType Dyn.dynamic s H1) H2)))), is_true (@ord ptr_ordType x (fresh (@Def (@FinMap ptr_ordType Dyn.dynamic s H1) H2))) *) rewrite /dom /fresh /supp -topredE /=. (* Goal: forall _ : is_true (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) s))), is_true (@ord ptr_ordType x (ptr_offset (@last ptr null (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) 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 Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) s)))))) (x : ptr) (_ : is_true (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@cons ptr y (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) s))))), is_true (@ord ptr_ordType x (ptr_offset (@last ptr y (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) s)) (S O))) *) rewrite inE negb_or; case/andP=>H3 H4 z; rewrite inE. (* Goal: forall _ : is_true (orb (@eq_op ptr_eqType z y) (@in_mem (Equality.sort ptr_eqType) z (@mem (Equality.sort ptr_eqType) (seq_predType ptr_eqType) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) s)))), is_true (@ord ptr_ordType z (ptr_offset (@last ptr y (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) s)) (S O))) *) case/orP; first by move/eqP=>->{z}; apply: (path_last 0). (* Goal: forall _ : is_true (@in_mem (Equality.sort ptr_eqType) z (@mem (Equality.sort ptr_eqType) (seq_predType ptr_eqType) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) s))), is_true (@ord ptr_ordType z (ptr_offset (@last ptr y (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) 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 : (pick h == null) = (~~ def h || empb h). Proof. (* Goal: @eq bool (@eq_op ptr_eqType (pick h) null) (orb (negb (def h)) (empb h)) *) 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 : def h && ~~ empb h = (pick h \in dom h). Proof. (* Goal: @eq bool (andb (def h) (negb (empb h))) (@in_mem ptr (pick h) (@mem ptr (predPredType ptr) (dom h))) *) by rewrite /dom; case: h=>[|h] //=; case: (supp h)=>// *; rewrite inE eq_refl. Qed. Lemma subdom_def h1 h2 : subdom h1 h2 -> def h1 && def h2. Proof. (* Goal: forall _ : is_true (subdom h1 h2), is_true (andb (def h1) (def h2)) *) by case: h1 h2=>[|h1 H1] // [|h2 H2]. Qed. Lemma subdomP h1 h2 : def h1 -> ~~ empb h1 -> reflect (forall x, x \in dom h1 -> x \in dom h2) (subdom h1 h2). Lemma subdomQ x h1 h2 : subdom h1 h2 -> x \in dom h1 -> x \in dom h2. Proof. (* Goal: forall (_ : is_true (subdom h1 h2)) (_ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h1)))), is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2))) *) move=>S H; case: subdomP S=>//. (* Goal: forall (_ : forall (x : ptr) (_ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h1)))), is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2)))) (_ : is_true true), is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2))) *) (* Goal: is_true (negb (empb h1)) *) (* Goal: is_true (def h1) *) - (* Goal: forall (_ : forall (x : ptr) (_ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h1)))), is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2)))) (_ : is_true true), is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2))) *) (* Goal: is_true (negb (empb h1)) *) (* Goal: is_true (def h1) *) by apply: dom_def H. (* Goal: forall (_ : forall (x : ptr) (_ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h1)))), is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2)))) (_ : is_true true), is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2))) *) (* Goal: is_true (negb (empb h1)) *) - (* Goal: forall (_ : forall (x : ptr) (_ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h1)))), is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2)))) (_ : is_true true), is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2))) *) (* Goal: is_true (negb (empb h1)) *) by case: empP=>// E; rewrite E dom0 in H. (* Goal: forall (_ : forall (x : ptr) (_ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h1)))), is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2)))) (_ : is_true true), is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2))) *) by move=>H2 _; apply: H2. Qed. Lemma subdom_refl h : def h -> subdom h h. Proof. (* Goal: forall _ : is_true (def h), is_true (subdom h h) *) by case: h=>[//|h H _]; apply/allP. Qed. Lemma subdomD h1 h2 h : subdom h1 h2 -> def (h2 :+ h) -> def (h1 :+ h). Proof. (* Goal: forall (_ : is_true (subdom h1 h2)) (_ : is_true (def (union2 h2 h))), is_true (def (union2 h1 h)) *) case: h1 h2 h=>[|h1 H1]; case=>[|h2 H2]; case=>[|h H] //=. (* Goal: forall (_ : is_true (subdom (@Def h1 H1) (@Def h2 H2))) (_ : is_true (def (union2 (@Def h2 H2) (@Def h H)))), is_true (def (union2 (@Def h1 H1) (@Def h H))) *) rewrite /subdom /def /union2 /=; case: ifP=>E1 //; case: ifP=>E2 // E _. (* Goal: is_true false *) case: disjP E2=>// x H3 H4 _; case: disjP E1=>// X1 _. (* Goal: is_true false *) by case: (allP (s := supp h1)) E=>//; move/(_ _ H3); move/X1; rewrite H4. Qed. Lemma subdomE h1 h2 h : def (h2 :+ h) -> subdom h1 h2 -> subdom (h1 :+ h) (h2 :+ h). Proof. (* Goal: forall (_ : is_true (def (union2 h2 h))) (_ : is_true (subdom h1 h2)), is_true (subdom (union2 h1 h) (union2 h2 h)) *) case: h1 h2 h=>[|h1 H1]; case=>[|h2 H2]; case=>[|h H] //=. (* Goal: forall (_ : is_true (def (union2 (@Def h2 H2) (@Def h H)))) (_ : is_true (subdom (@Def h1 H1) (@Def h2 H2))), is_true (subdom (union2 (@Def h1 H1) (@Def h H)) (union2 (@Def h2 H2) (@Def h H))) *) rewrite /union2 /subdom /def /=; case: ifP=>E1 // _; case: ifP=>E2; case: (allP (s:=supp h1))=>// E _; last first. (* Goal: is_true (@all ptr (fun x : ptr => @in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h2 h)))) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h))) *) (* Goal: is_true false *) - (* Goal: is_true (@all ptr (fun x : ptr => @in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h2 h)))) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h))) *) (* Goal: is_true false *) case: disjP E2=>// x H3 H4; move/E: H3. (* Goal: is_true (@all ptr (fun x : ptr => @in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h2 h)))) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h))) *) (* Goal: forall (_ : is_true (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2)))) (_ : @eq bool false false), is_true false *) by case: disjP E1=>// X _; move/X; rewrite H4. (* Goal: is_true (@all ptr (fun x : ptr => @in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h2 h)))) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h))) *) case: (allP (s:=supp (fcat h1 h)))=>//; case=>x. (* Goal: forall _ : is_true (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h)))), is_true (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h2 h)))) *) rewrite !supp_fcat !inE /=. (* Goal: forall _ : is_true (orb (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h1))) (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h)))), is_true (orb (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2))) (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h)))) *) by case/orP; rewrite ?inE; [move/E=>->| move=>->; rewrite orbT]. Qed. Lemma subdomUE h1 h2 h1' h2' : def (h2 :+ h2') -> subdom h1 h2 -> subdom h1' h2' -> subdom (h1 :+ h1') (h2 :+ h2'). Proof. (* Goal: forall (_ : is_true (def (union2 h2 h2'))) (_ : is_true (subdom h1 h2)) (_ : is_true (subdom h1' h2')), is_true (subdom (union2 h1 h1') (union2 h2 h2')) *) case: h1 h2 h1' h2'=>[|h1 H1]; case=>[|h2 H2]; case=>[|h1' H1']; case=>[|h2' H2'] //. (* Goal: forall (_ : is_true (def (union2 (@Def h2 H2) (@Def h2' H2')))) (_ : is_true (subdom (@Def h1 H1) (@Def h2 H2))) (_ : is_true (subdom (@Def h1' H1') (@Def h2' H2'))), is_true (subdom (union2 (@Def h1 H1) (@Def h1' H1')) (union2 (@Def h2 H2) (@Def h2' H2'))) *) rewrite /subdom /def /union2. (* Goal: forall (_ : is_true match (if @disj ptr_ordType Dyn.dynamic h2 h2' then @Def (@fcat ptr_ordType Dyn.dynamic h2 h2') (@un_nullP h2 h2' H2 H2') else Undef) with | Undef => false | @Def finmap i => true end) (_ : is_true (@all (Equality.sort (Ordered.eqType ptr_ordType)) (fun x : Equality.sort (Ordered.eqType ptr_ordType) => @in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2))) (@supp ptr_ordType Dyn.dynamic h1))) (_ : is_true (@all (Equality.sort (Ordered.eqType ptr_ordType)) (fun x : Equality.sort (Ordered.eqType ptr_ordType) => @in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2'))) (@supp ptr_ordType Dyn.dynamic h1'))), is_true match (if @disj ptr_ordType Dyn.dynamic h1 h1' then @Def (@fcat ptr_ordType Dyn.dynamic h1 h1') (@un_nullP h1 h1' H1 H1') else Undef) with | Undef => false | @Def hs1 i => match (if @disj ptr_ordType Dyn.dynamic h2 h2' then @Def (@fcat ptr_ordType Dyn.dynamic h2 h2') (@un_nullP h2 h2' H2 H2') else Undef) with | Undef => false | @Def hs2 i0 => @all (Equality.sort (Ordered.eqType ptr_ordType)) (fun x : Equality.sort (Ordered.eqType ptr_ordType) => @in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic hs2))) (@supp ptr_ordType Dyn.dynamic hs1) end end *) case: ifP=>E1 // _; case: ifP=>E2 // T1 T2; last first. (* Goal: is_true (@all (Equality.sort (Ordered.eqType ptr_ordType)) (fun x : Equality.sort (Ordered.eqType ptr_ordType) => @in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h2 h2')))) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h1'))) *) (* Goal: is_true false *) - (* Goal: is_true (@all (Equality.sort (Ordered.eqType ptr_ordType)) (fun x : Equality.sort (Ordered.eqType ptr_ordType) => @in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h2 h2')))) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h1'))) *) (* Goal: is_true false *) case: disjP E2=>// x; case: allP T1=>// X _; move/X=>{X}. (* Goal: is_true (@all (Equality.sort (Ordered.eqType ptr_ordType)) (fun x : Equality.sort (Ordered.eqType ptr_ordType) => @in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h2 h2')))) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h1'))) *) (* Goal: forall (_ : is_true (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2)))) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h1')))) (_ : @eq bool false false), is_true false *) case: disjP E1=>// X _; move/X=>{X}. (* Goal: is_true (@all (Equality.sort (Ordered.eqType ptr_ordType)) (fun x : Equality.sort (Ordered.eqType ptr_ordType) => @in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h2 h2')))) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h1'))) *) (* Goal: forall (_ : is_true (negb (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2'))))) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h1')))) (_ : @eq bool false false), is_true false *) by case: allP T2=>// X _ H3 H4; move/X: H4 H3=>->. (* Goal: is_true (@all (Equality.sort (Ordered.eqType ptr_ordType)) (fun x : Equality.sort (Ordered.eqType ptr_ordType) => @in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h2 h2')))) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h1'))) *) case: allP=>//; case=>x. (* Goal: forall _ : is_true (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h1 h1')))), is_true (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@fcat ptr_ordType Dyn.dynamic h2 h2')))) *) rewrite !supp_fcat !inE; case/orP=>E. (* Goal: is_true (orb (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2))) (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2')))) *) (* Goal: is_true (orb (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2))) (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2')))) *) - (* Goal: is_true (orb (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2))) (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2')))) *) (* Goal: is_true (orb (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2))) (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2')))) *) by case: allP T1=>//; move/(_ _ E)=>->. (* Goal: is_true (orb (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2))) (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic h2')))) *) by case: allP T2=>//; move/(_ _ E)=>->; rewrite orbT. Qed. Lemma subdom_emp h : def h -> subdom empty h. Proof. (* Goal: forall _ : is_true (def h), is_true (subdom empty h) *) by case: h. Qed. Lemma subdom_emp_inv h : subdom h empty -> h = empty. Proof. (* Goal: forall _ : is_true (subdom h empty), @eq heap h empty *) case: h=>[|h H] //; rewrite /subdom /=. (* Goal: forall _ : is_true (@all ptr (fun x : ptr => @in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (nil ptr_ordType Dyn.dynamic)))) (@supp ptr_ordType Dyn.dynamic h)), @eq heap (@Def h H) empty *) case: (allP (s:=supp h))=>// E _; apply/heapE; apply: fmapP=>x. (* Goal: @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic x h) (@fnd ptr_ordType Dyn.dynamic x (nil ptr_ordType Dyn.dynamic)) *) case: suppP (E x)=>// v E2; move/(_ (erefl _)). (* Goal: forall _ : is_true (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (nil ptr_ordType Dyn.dynamic)))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic x h) (@fnd ptr_ordType Dyn.dynamic x (nil ptr_ordType Dyn.dynamic)) *) by rewrite supp_nil. Qed. Lemma subdomPE A B x (v1 : A) (v2 : B) : x != null -> subdom (x :-> v1) (x :-> v2). Proof. (* Goal: forall _ : is_true (negb (@eq_op ptr_eqType x null)), is_true (subdom (@pts A x v1) (@pts B x v2)) *) move=>H; rewrite /subdom /pts /upd /=; case: decP=>//= _. (* Goal: is_true (andb (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@FinMap ptr_ordType Dyn.dynamic (@cons (prod ptr Dyn.dynamic) (@pair ptr Dyn.dynamic x (@Dyn.dyn B v2)) (@Datatypes.nil (prod ptr Dyn.dynamic))) (@sorted_ins' ptr_ordType Dyn.dynamic (@Datatypes.nil (prod ptr Dyn.dynamic)) x (@Dyn.dyn B v2) (sorted_nil ptr_ordType Dyn.dynamic)))))) true) *) rewrite (_ : FinMap _ = ins x (dyn v2) (finmap.nil _ _)) //. (* Goal: is_true (andb (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic (@ins ptr_ordType Dyn.dynamic x (@Dyn.dyn B v2) (nil ptr_ordType Dyn.dynamic))))) true) *) by rewrite supp_ins inE /= eq_refl. Qed. Lemma subdom_trans h2 h1 h3 : subdom h1 h2 -> subdom h2 h3 -> subdom h1 h3. Proof. (* Goal: forall (_ : is_true (subdom h1 h2)) (_ : is_true (subdom h2 h3)), is_true (subdom h1 h3) *) move=>H1 H2; move: (subdom_def H1) (subdom_def H2). (* Goal: forall (_ : is_true (andb (def h1) (def h2))) (_ : is_true (andb (def h2) (def h3))), is_true (subdom h1 h3) *) case/andP=>D1 _; case/andP=>_ D2. (* Goal: is_true (subdom h1 h3) *) case E: (empb h1). (* Goal: is_true (subdom h1 h3) *) (* Goal: is_true (subdom h1 h3) *) - (* Goal: is_true (subdom h1 h3) *) (* Goal: is_true (subdom h1 h3) *) by move/empP: E =>->; rewrite subdom_emp. (* Goal: is_true (subdom h1 h3) *) apply/subdomP=>[//||x in1]; first by apply negbT. (* Goal: is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h3))) *) by apply: (subdomQ H2) (subdomQ H1 in1). Qed. Hint Resolve subdom_emp subdomPE : core. Lemma subheap_refl h : def h -> subheap h h. Proof. (* Goal: forall _ : is_true (def h), subheap h h *) by move=>D; split=>//; apply: subdom_refl. Qed. Lemma subheapE h : def h -> subheap empty h. Proof. (* Goal: forall _ : is_true (def h), subheap empty h *) by split; [apply subdom_emp | rewrite dom0]. Qed. Lemma subheapUn h1 h2 h1' h2' : def (h2 :+ h2') -> subheap h1 h2 -> subheap h1' h2' -> subheap (h1 :+ h1') (h2 :+ h2'). Proof. (* Goal: forall (_ : is_true (def (union2 h2 h2'))) (_ : subheap h1 h2) (_ : subheap h1' h2'), subheap (union2 h1 h1') (union2 h2 h2') *) move=>defs [Sd1 Sl1] [Sd2 Sl2]. (* Goal: subheap (union2 h1 h1') (union2 h2 h2') *) split=>[|x]; first by apply: subdomUE. (* Goal: forall _ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom (union2 h1 h1')))), @eq Dyn.dynamic (look x (union2 h1 h1')) (look x (union2 h2 h2')) *) rewrite domUn inE /= inE /=; case/andP=>D; case/orP=>H. (* Goal: @eq Dyn.dynamic (look x (union2 h1 h1')) (look x (union2 h2 h2')) *) (* Goal: @eq Dyn.dynamic (look x (union2 h1 h1')) (look x (union2 h2 h2')) *) - (* Goal: @eq Dyn.dynamic (look x (union2 h1 h1')) (look x (union2 h2 h2')) *) (* Goal: @eq Dyn.dynamic (look x (union2 h1 h1')) (look x (union2 h2 h2')) *) by rewrite !lookUnl // H Sl1 // (subdomQ Sd1 H). (* Goal: @eq Dyn.dynamic (look x (union2 h1 h1')) (look x (union2 h2 h2')) *) by rewrite !lookUnr // H Sl2 // (subdomQ Sd2 H). Qed. Lemma subheapUnl h1 h2 : def (h1 :+ h2) -> subheap h1 (h1 :+ h2). Lemma subheapUnr h1 h2 : def (h1 :+ h2) -> subheap h2 (h1 :+ h2). Proof. (* Goal: forall _ : is_true (def (union2 h1 h2)), subheap h2 (union2 h1 h2) *) by rewrite unC; apply: subheapUnl. Qed. Lemma subheap_def h1 h2 : subheap h1 h2 -> def h1 /\ def h2. Proof. (* Goal: forall _ : subheap h1 h2, and (is_true (def h1)) (is_true (def h2)) *) by case=>[subdm _]; move/andP: (subdom_def subdm). Qed. Lemma subheap_trans h2 h1 h3 : subheap h1 h2 -> subheap h2 h3 -> subheap h1 h3. Proof. (* Goal: forall (_ : subheap h1 h2) (_ : subheap h2 h3), subheap h1 h3 *) move=>[S12 E12] [S23 E23]. (* Goal: subheap h1 h3 *) split=> [|x in1]; first by apply: (subdom_trans S12 S23). (* Goal: @eq Dyn.dynamic (look x h1) (look x h3) *) by rewrite (E12 x in1); apply: (E23 x (subdomQ S12 in1)). Qed. Lemma subheap_id hp1 hp2: subheap hp1 hp2 -> subheap hp2 hp1 -> hp1 = hp2. Proof. (* Goal: forall (_ : subheap hp1 hp2) (_ : subheap hp2 hp1), @eq heap hp1 hp2 *) move=>S12; move: (S12) => [D12 _]. (* Goal: forall _ : subheap hp2 hp1, @eq heap hp1 hp2 *) move/andP: (subdom_def D12) S12=>{D12} [D1 D2]. (* Goal: forall (_ : subheap hp1 hp2) (_ : subheap hp2 hp1), @eq heap hp1 hp2 *) case: hp1 D1=>[//=|fm1 pf1]. (* Goal: forall (_ : is_true (def (@Def fm1 pf1))) (_ : subheap (@Def fm1 pf1) hp2) (_ : subheap hp2 (@Def fm1 pf1)), @eq heap (@Def fm1 pf1) hp2 *) case: hp2 D2=>[//=|fm2 pf2] _ _ [S12 L12] [S21 L21]. (* Goal: @eq heap (@Def fm1 pf1) (@Def fm2 pf2) *) rewrite -heapE; apply: fmapP => k. (* Goal: @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) move: (@subdomQ k _ _ S12) (@subdomQ k _ _ S21) => S'12 S'21. (* Goal: @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) move: (L12 k) (L21 k). (* Goal: forall (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm1 pf1)))), @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) case H1: (k \in dom (Def pf1)). (* Goal: forall (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) (* Goal: forall (_ : forall _ : is_true true, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) - (* Goal: forall (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) (* Goal: forall (_ : forall _ : is_true true, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) move: (S'12 H1)=> H2. (* Goal: forall (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) (* Goal: forall (_ : forall _ : is_true true, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) case F1: (fnd k fm1)=> [d1|]; case F2: (fnd k fm2)=> [d2|] //=; rewrite F1 F2. (* Goal: forall (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) (* Goal: forall (_ : forall _ : is_true true, @eq Dyn.dynamic (@Dyn.dyn unit tt) d2) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic d2 (@Dyn.dyn unit tt)), @eq (option Dyn.dynamic) (@None Dyn.dynamic) (@Some Dyn.dynamic d2) *) (* Goal: forall (_ : forall _ : is_true true, @eq Dyn.dynamic d1 (@Dyn.dyn unit tt)) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (@Dyn.dyn unit tt) d1), @eq (option Dyn.dynamic) (@Some Dyn.dynamic d1) (@None Dyn.dynamic) *) (* Goal: forall (_ : forall _ : is_true true, @eq Dyn.dynamic d1 d2) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic d2 d1), @eq (option Dyn.dynamic) (@Some Dyn.dynamic d1) (@Some Dyn.dynamic d2) *) - (* Goal: forall (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) (* Goal: forall (_ : forall _ : is_true true, @eq Dyn.dynamic (@Dyn.dyn unit tt) d2) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic d2 (@Dyn.dyn unit tt)), @eq (option Dyn.dynamic) (@None Dyn.dynamic) (@Some Dyn.dynamic d2) *) (* Goal: forall (_ : forall _ : is_true true, @eq Dyn.dynamic d1 (@Dyn.dyn unit tt)) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (@Dyn.dyn unit tt) d1), @eq (option Dyn.dynamic) (@Some Dyn.dynamic d1) (@None Dyn.dynamic) *) (* Goal: forall (_ : forall _ : is_true true, @eq Dyn.dynamic d1 d2) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic d2 d1), @eq (option Dyn.dynamic) (@Some Dyn.dynamic d1) (@Some Dyn.dynamic d2) *) by move=>H; rewrite (H is_true_true). (* Goal: forall (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) (* Goal: forall (_ : forall _ : is_true true, @eq Dyn.dynamic (@Dyn.dyn unit tt) d2) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic d2 (@Dyn.dyn unit tt)), @eq (option Dyn.dynamic) (@None Dyn.dynamic) (@Some Dyn.dynamic d2) *) (* Goal: forall (_ : forall _ : is_true true, @eq Dyn.dynamic d1 (@Dyn.dyn unit tt)) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (@Dyn.dyn unit tt) d1), @eq (option Dyn.dynamic) (@Some Dyn.dynamic d1) (@None Dyn.dynamic) *) - (* Goal: forall (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) (* Goal: forall (_ : forall _ : is_true true, @eq Dyn.dynamic (@Dyn.dyn unit tt) d2) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic d2 (@Dyn.dyn unit tt)), @eq (option Dyn.dynamic) (@None Dyn.dynamic) (@Some Dyn.dynamic d2) *) (* Goal: forall (_ : forall _ : is_true true, @eq Dyn.dynamic d1 (@Dyn.dyn unit tt)) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (@Dyn.dyn unit tt) d1), @eq (option Dyn.dynamic) (@Some Dyn.dynamic d1) (@None Dyn.dynamic) *) by move: (fnd_supp_in H2); rewrite F2=> [[v]]. (* Goal: forall (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) (* Goal: forall (_ : forall _ : is_true true, @eq Dyn.dynamic (@Dyn.dyn unit tt) d2) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic d2 (@Dyn.dyn unit tt)), @eq (option Dyn.dynamic) (@None Dyn.dynamic) (@Some Dyn.dynamic d2) *) - (* Goal: forall (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) (* Goal: forall (_ : forall _ : is_true true, @eq Dyn.dynamic (@Dyn.dyn unit tt) d2) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic d2 (@Dyn.dyn unit tt)), @eq (option Dyn.dynamic) (@None Dyn.dynamic) (@Some Dyn.dynamic d2) *) by move: (fnd_supp_in H1); rewrite F1=> [[v]]. (* Goal: forall (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true (@in_mem ptr k (@mem ptr (predPredType ptr) (dom (@Def fm2 pf2)))), @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) case H2 : (k \in dom (Def pf2)). (* Goal: forall (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) (* Goal: forall (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true true, @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) - (* Goal: forall (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) (* Goal: forall (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true true, @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) by rewrite (S'21 H2) in H1. (* Goal: forall (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm1 pf1)) (look k (@Def fm2 pf2))) (_ : forall _ : is_true false, @eq Dyn.dynamic (look k (@Def fm2 pf2)) (look k (@Def fm1 pf1))), @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) move => _ _; rewrite /dom -topredE in H2. (* Goal: @eq (option Dyn.dynamic) (@fnd ptr_ordType Dyn.dynamic k fm1) (@fnd ptr_ordType Dyn.dynamic k fm2) *) by rewrite (fnd_supp (negbT H1)) (fnd_supp (negbT H2)). Qed. Lemma noalias h1 h2 x1 x2 : x1 \in dom h1 -> x2 \in dom h2 -> def (h1 :+ h2) -> x1 != x2. Proof. (* Goal: forall (_ : is_true (@in_mem ptr x1 (@mem ptr (predPredType ptr) (dom h1)))) (_ : is_true (@in_mem ptr x2 (@mem ptr (predPredType ptr) (dom h2)))) (_ : is_true (def (union2 h1 h2))), is_true (negb (@eq_op ptr_eqType x1 x2)) *) by case: defUn=>// H1 H2 H; move/H; case: eqP=>// ->; move/negbTE=>->. Qed. Lemma defPtUn A h x (v : A) : def (x :-> v :+ h) = [&& x != null, def h & x \notin dom h]. Proof. (* Goal: @eq bool (def (union2 (@pts A x v) h)) (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) case: defUn; last 1 first. (* Goal: forall (x0 : ptr) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom (@pts A x v))))) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom h)))), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) (* Goal: forall _ : is_true (negb (def h)), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) (* Goal: forall _ : is_true (negb (def (@pts A x v))), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) (* Goal: forall (_ : is_true (def (@pts A x v))) (_ : is_true (def h)) (_ : forall (x0 : ptr) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom (@pts A x v))))), is_true (negb (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom h))))), @eq bool true (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) - (* Goal: forall (x0 : ptr) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom (@pts A x v))))) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom h)))), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) (* Goal: forall _ : is_true (negb (def h)), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) (* Goal: forall _ : is_true (negb (def (@pts A x v))), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) (* Goal: forall (_ : is_true (def (@pts A x v))) (_ : is_true (def h)) (_ : forall (x0 : ptr) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom (@pts A x v))))), is_true (negb (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom h))))), @eq bool true (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) by rewrite defPt=>H1 -> H2; rewrite H1 (H2 x) // domPt inE /= eq_refl. (* Goal: forall (x0 : ptr) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom (@pts A x v))))) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom h)))), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) (* Goal: forall _ : is_true (negb (def h)), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) (* Goal: forall _ : is_true (negb (def (@pts A x v))), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) - (* Goal: forall (x0 : ptr) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom (@pts A x v))))) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom h)))), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) (* Goal: forall _ : is_true (negb (def h)), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) (* Goal: forall _ : is_true (negb (def (@pts A x v))), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) by rewrite defPt; move/negbTE=>->. (* Goal: forall (x0 : ptr) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom (@pts A x v))))) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom h)))), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) (* Goal: forall _ : is_true (negb (def h)), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) - (* Goal: forall (x0 : ptr) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom (@pts A x v))))) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom h)))), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) (* Goal: forall _ : is_true (negb (def h)), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) by move/negbTE=>->; rewrite andbF. (* Goal: forall (x0 : ptr) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom (@pts A x v))))) (_ : is_true (@in_mem ptr x0 (@mem ptr (predPredType ptr) (dom h)))), @eq bool false (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) *) by move=>y; rewrite domPt inE /=; case/andP; move/eqP=><-->->; rewrite andbF. Qed. Lemma defPt_null A h x (v : A) : def (x :-> v :+ h) -> x != null. Proof. (* Goal: forall _ : is_true (def (union2 (@pts A x v) h)), is_true (negb (@eq_op ptr_eqType x null)) *) by rewrite defPtUn; case/and3P. Qed. Lemma defPt_def A h x (v : A) : def (x :-> v :+ h) -> def h. Proof. (* Goal: forall _ : is_true (def (union2 (@pts A x v) h)), is_true (def h) *) by rewrite defPtUn; case/and3P. Qed. Lemma defPt_dom A h x (v : A) : def (x :-> v :+ h) -> x \notin dom h. Proof. (* Goal: forall _ : is_true (def (union2 (@pts A x v) h)), is_true (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))) *) by rewrite defPtUn; case/and3P. Qed. Lemma domPtUn A h x (v : A) : dom (x :-> v :+ h) =i [pred y | def (x :-> v :+ h) && ((x == y) || (y \in dom h))]. Proof. (* Goal: @eq_mem ptr (@mem ptr (predPredType ptr) (dom (union2 (@pts A x v) h))) (@mem (Equality.sort ptr_eqType) (simplPredType (Equality.sort ptr_eqType)) (@SimplPred (Equality.sort ptr_eqType) (fun y : Equality.sort ptr_eqType => andb (def (union2 (@pts A x v) h)) (orb (@eq_op ptr_eqType x y) (@in_mem (Equality.sort ptr_eqType) y (@mem ptr (predPredType ptr) (dom h))))))) *) move=>y; rewrite domUn !inE !defPtUn domPt inE /=. (* Goal: @eq bool (andb (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) (orb (andb (@eq_op ptr_eqType x y) (negb (@eq_op ptr_eqType x null))) (@in_mem ptr y (@mem ptr (predPredType ptr) (dom h))))) (andb (andb (negb (@eq_op ptr_eqType x null)) (andb (def h) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h)))))) (orb (@eq_op ptr_eqType x y) (@in_mem ptr y (@mem ptr (predPredType ptr) (dom h))))) *) by case: (x =P null)=>//= _; rewrite andbT. Qed. Lemma lookPtUn A h x (v : A) : def (x :-> v :+ h) -> look x (x :-> v :+ h) = dyn v. Proof. (* Goal: forall _ : is_true (def (union2 (@pts A x v) h)), @eq Dyn.dynamic (look x (union2 (@pts A x v) h)) (@Dyn.dyn A v) *) by move=>D; rewrite lookUnl // lookU domPt !inE eq_refl (defPt_null D). Qed. Lemma freePtUn A h x (v : A) : def (x :-> v :+ h) -> free x (x :-> v :+ h) = h. Proof. (* Goal: forall _ : is_true (def (union2 (@pts A x v) h)), @eq heap (free x (union2 (@pts A x v) h)) h *) move=>D; rewrite freeUnr; last by rewrite (defPt_dom D). (* Goal: @eq heap (union2 (free x (@pts A x v)) h) h *) by rewrite freeU eqxx (negbTE (defPt_null D)) free0 un0h. Qed. Lemma updPtUn A1 A2 x i (v1 : A1) (v2 : A2) : upd (x :-> v1 :+ i) x (dyn v2) = x :-> v2 :+ i. Proof. (* Goal: @eq heap (upd (union2 (@pts A1 x v1) i) x (@Dyn.dyn A2 v2)) (union2 (@pts A2 x v2) i) *) case E1: (def (x :-> v1 :+ i)). (* Goal: @eq heap (upd (union2 (@pts A1 x v1) i) x (@Dyn.dyn A2 v2)) (union2 (@pts A2 x v2) i) *) (* Goal: @eq heap (upd (union2 (@pts A1 x v1) i) x (@Dyn.dyn A2 v2)) (union2 (@pts A2 x v2) i) *) - (* Goal: @eq heap (upd (union2 (@pts A1 x v1) i) x (@Dyn.dyn A2 v2)) (union2 (@pts A2 x v2) i) *) (* Goal: @eq heap (upd (union2 (@pts A1 x v1) i) x (@Dyn.dyn A2 v2)) (union2 (@pts A2 x v2) i) *) by rewrite updUnl domPt inE /= eqxx (defPt_null E1) /= updU eqxx. (* Goal: @eq heap (upd (union2 (@pts A1 x v1) i) x (@Dyn.dyn A2 v2)) (union2 (@pts A2 x v2) i) *) have E2: def (x :-> v2 :+ i) = false by rewrite !defPtUn in E1 *. by case: (_ :+ _) E1=>// _; case: (_ :+ _) E2. Qed. Qed. Lemma heap_etaP h x : x \in dom h -> h = x :-> Dyn.val (look x h) :+ free x h. Proof. (* Goal: forall _ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h))), @eq heap h (union2 (@pts (Dyn.typ (look x h)) x (Dyn.val (look x h))) (free x h)) *) move=>H; rewrite {1}(heap_eta H) /pts -dyn_eta. (* Goal: @eq heap (upd (free x h) x (look x h)) (union2 (upd empty x (look x h)) (free x h)) *) by rewrite -{1}[free x h]un0h updUnr domF inE /= eq_refl. Qed. Lemma cancelT A1 A2 h1 h2 x (v1 : A1) (v2 : A2) : def (x :-> v1 :+ h1) -> x :-> v1 :+ h1 = x :-> v2 :+ h2 -> A1 = A2. Proof. (* Goal: forall (_ : is_true (def (union2 (@pts A1 x v1) h1))) (_ : @eq heap (union2 (@pts A1 x v1) h1) (union2 (@pts A2 x v2) h2)), @eq Type A1 A2 *) move=>D E. (* Goal: @eq Type A1 A2 *) have: look x (x :-> v1 :+ h1) = look x (x :-> v2 :+ h2) by rewrite E. (* Goal: forall _ : @eq Dyn.dynamic (look x (union2 (@pts A1 x v1) h1)) (look x (union2 (@pts A2 x v2) h2)), @eq Type A1 A2 *) by rewrite !lookPtUn -?E //; apply: dyn_injT. Qed. Lemma cancel A h1 h2 x (v1 v2 : A) : def (x :-> v1 :+ h1) -> x :-> v1 :+ h1 = x :-> v2 :+ h2 -> [/\ v1 = v2, def h1 & h1 = h2]. Proof. (* Goal: forall (_ : is_true (def (union2 (@pts A x v1) h1))) (_ : @eq heap (union2 (@pts A x v1) h1) (union2 (@pts A x v2) h2)), and3 (@eq A v1 v2) (is_true (def h1)) (@eq heap h1 h2) *) move=>D E. (* Goal: and3 (@eq A v1 v2) (is_true (def h1)) (@eq heap h1 h2) *) have: look x (x :-> v1 :+ h1) = look x (x :-> v2 :+ h2) by rewrite E. (* Goal: forall _ : @eq Dyn.dynamic (look x (union2 (@pts A x v1) h1)) (look x (union2 (@pts A x v2) h2)), and3 (@eq A v1 v2) (is_true (def h1)) (@eq heap h1 h2) *) rewrite !lookPtUn -?E // => X; move: (dyn_inj X)=>{X} X. (* Goal: and3 (@eq A v1 v2) (is_true (def h1)) (@eq heap h1 h2) *) by rewrite -{}X in E *; rewrite -(unhKl D E) (defUnr D). Qed. Lemma domPtUnX A (v : A) x i : def (x :-> v :+ i) -> x \in dom (x :-> v :+ i). Proof. (* Goal: forall _ : is_true (def (union2 (@pts A x v) i)), is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom (union2 (@pts A x v) i)))) *) by move=>D; rewrite domPtUn inE /= D eq_refl. Qed. Lemma domPtX A (v : A) x : def (x :-> v) -> x \in dom (x :-> v). Proof. (* Goal: forall _ : is_true (def (@pts A x v)), is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom (@pts A x v)))) *) by move=>D; rewrite -(unh0 (x :-> v)) domPtUnX // unh0. Qed. Lemma dom_notin_notin h1 h2 x : def (h1 :+ h2) -> x \notin dom (h1 :+ h2) -> x \notin dom h1. Proof. (* Goal: forall (_ : is_true (def (union2 h1 h2))) (_ : is_true (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom (union2 h1 h2)))))), is_true (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h1)))) *) by move=>D; rewrite domUn inE /= negb_and negb_or /= D; case/andP. Qed. Lemma dom_in_notin h1 h2 x : def (h1 :+ h2) -> x \in dom h1 -> x \notin dom h2. Proof. (* Goal: forall (_ : is_true (def (union2 h1 h2))) (_ : is_true (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h1)))), is_true (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2)))) *) by case: defUn=>// D1 D2 H _; apply: H. 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 empty. Lemma updiS x v vs : updi x (v :: vs) = x :-> v :+ updi (x .+ 1) vs. Proof. (* Goal: @eq heap (updi x (@cons A v vs)) (union2 (@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 (updi x (@rcons A vs v)) (union2 (updi x vs) (@pts A (ptr_offset x (@size A vs)) v)) *) elim: vs x v=>[|w vs IH] x v /=. (* Goal: @eq heap (union2 (@pts A x w) (updi (ptr_offset x (S O)) (@rcons A vs v))) (union2 (union2 (@pts A x w) (updi (ptr_offset x (S O)) vs)) (@pts A (ptr_offset x (S (@size A vs))) v)) *) (* Goal: @eq heap (union2 (@pts A x v) empty) (union2 empty (@pts A (ptr_offset x O) v)) *) - (* Goal: @eq heap (union2 (@pts A x w) (updi (ptr_offset x (S O)) (@rcons A vs v))) (union2 (union2 (@pts A x w) (updi (ptr_offset x (S O)) vs)) (@pts A (ptr_offset x (S (@size A vs))) v)) *) (* Goal: @eq heap (union2 (@pts A x v) empty) (union2 empty (@pts A (ptr_offset x O) v)) *) by rewrite ptr0 unh0 un0h. (* Goal: @eq heap (union2 (@pts A x w) (updi (ptr_offset x (S O)) (@rcons A vs v))) (union2 (union2 (@pts A x w) (updi (ptr_offset x (S O)) vs)) (@pts A (ptr_offset x (S (@size A vs))) v)) *) by rewrite -(addn1 (size vs)) addnC -ptrA IH unA. Qed. Lemma updi_cat x vs1 vs2 : updi x (vs1 ++ vs2) = updi x vs1 :+ updi x.+(size vs1) vs2. Proof. (* Goal: @eq heap (updi x (@cat A vs1 vs2)) (union2 (updi x vs1) (updi (ptr_offset x (@size A vs1)) vs2)) *) elim: vs1 x vs2=>[|v vs1 IH] x vs2 /=. (* Goal: @eq heap (union2 (@pts A x v) (updi (ptr_offset x (S O)) (@cat A vs1 vs2))) (union2 (union2 (@pts A x v) (updi (ptr_offset x (S O)) vs1)) (updi (ptr_offset x (S (@size A vs1))) vs2)) *) (* Goal: @eq heap (updi x vs2) (union2 empty (updi (ptr_offset x O) vs2)) *) - (* Goal: @eq heap (union2 (@pts A x v) (updi (ptr_offset x (S O)) (@cat A vs1 vs2))) (union2 (union2 (@pts A x v) (updi (ptr_offset x (S O)) vs1)) (updi (ptr_offset x (S (@size A vs1))) vs2)) *) (* Goal: @eq heap (updi x vs2) (union2 empty (updi (ptr_offset x O) vs2)) *) by rewrite ptr0 un0h. (* Goal: @eq heap (union2 (@pts A x v) (updi (ptr_offset x (S O)) (@cat A vs1 vs2))) (union2 (union2 (@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 unA. 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 heap (union2 (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 ptr (predPredType ptr) (dom (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 (predPredType ptr) (dom (union2 (@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 (def (union2 (@pts A (ptr_offset x m) v) (updi (ptr_offset x (addn m (S O))) vs)))) (negb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom (updi (ptr_offset x (addn m (S O))) vs)))))) *) by rewrite orbC IH // addn1. Qed. Lemma updiD x xs : def (updi x xs) = (x != null) || (size xs == 0). Proof. (* Goal: @eq bool (def (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 (def (union2 (@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 defPtUn 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 ptr (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (predPredType ptr) (dom (updi (ptr_offset x (S m)) xs)))) (andb (negb (@eq_op ptr_eqType x null)) false) *) by rewrite andbF; apply: negbTE; apply: updiVm'. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (dom (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 (predPredType ptr) (dom (union2 (@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 ptr (predPredType ptr) (dom (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 (predPredType ptr) (dom (updi x xs)))) (leq (S m) (@size A xs)) *) (* Goal: @eq bool (@in_mem ptr (ptr_offset x m) (@mem ptr (predPredType ptr) (dom (updi x xs)))) false *) - (* Goal: @eq bool (@in_mem ptr (ptr_offset x m) (@mem ptr (predPredType ptr) (dom (updi x xs)))) (leq (S m) (@size A xs)) *) (* Goal: @eq bool (@in_mem ptr (ptr_offset x m) (@mem ptr (predPredType ptr) (dom (updi x xs)))) false *) by case: xs=>// a s; rewrite (eqP H). (* Goal: @eq bool (@in_mem ptr (ptr_offset x m) (@mem ptr (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (def (union2 (@pts A x v) (updi (ptr_offset x (S O)) vs))) (orb (@eq_op ptr_eqType 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 (def (union2 (@pts A x v) (updi (ptr_offset x (S O)) vs))) (orb (@eq_op ptr_eqType 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 (def (union2 (@pts A x v) (updi (ptr_offset x (S O)) vs))) (orb (@eq_op ptr_eqType 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 ptr (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 (predPredType ptr) (dom (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 : def (updi x xs1) -> updi x xs1 = updi x xs2 -> xs1 = xs2. Proof. (* Goal: forall (_ : is_true (def (updi x xs1))) (_ : @eq 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 empUn empPt. (* Goal: forall _ : @eq heap (union2 (@pts A x v1) (updi (ptr_offset x (S O)) xs1)) (union2 (@pts A x v2) (updi (ptr_offset x (S O)) xs2)), @eq (list A) (@cons A v1 xs1) (@cons A v2 xs2) *) by case/(cancel D)=><- {D} D; move/(IH _ _ D)=><-. Qed. Lemma updi_iinv x xs1 xs2 h1 h2 : size xs1 = size xs2 -> def (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 (def (union2 (updi x xs1) h1))) (_ : @eq heap (union2 (updi x xs1) h1) (union2 (updi x xs2) h2)), and (@eq (list A) xs1 xs2) (@eq heap 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 (def (union2 (union2 (@pts A x v1) (updi (ptr_offset x (S O)) xs1)) h1))) (_ : @eq heap (union2 (union2 (@pts A x v1) (updi (ptr_offset x (S O)) xs1)) h1) (union2 (union2 (@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 h1 h2) *) (* Goal: forall (_ : @eq nat O O) (_ : is_true (def (union2 empty h1))) (_ : @eq heap (union2 empty h1) (union2 empty h2)), and (@eq (list A) (@Datatypes.nil A) (@Datatypes.nil A)) (@eq heap h1 h2) *) - (* Goal: forall (_ : @eq nat (S (@size A xs1)) (S (@size A xs2))) (_ : is_true (def (union2 (union2 (@pts A x v1) (updi (ptr_offset x (S O)) xs1)) h1))) (_ : @eq heap (union2 (union2 (@pts A x v1) (updi (ptr_offset x (S O)) xs1)) h1) (union2 (union2 (@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 h1 h2) *) (* Goal: forall (_ : @eq nat O O) (_ : is_true (def (union2 empty h1))) (_ : @eq heap (union2 empty h1) (union2 empty h2)), and (@eq (list A) (@Datatypes.nil A) (@Datatypes.nil A)) (@eq heap h1 h2) *) by rewrite !un0h. (* Goal: forall (_ : @eq nat (S (@size A xs1)) (S (@size A xs2))) (_ : is_true (def (union2 (union2 (@pts A x v1) (updi (ptr_offset x (S O)) xs1)) h1))) (_ : @eq heap (union2 (union2 (@pts A x v1) (updi (ptr_offset x (S O)) xs1)) h1) (union2 (union2 (@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 h1 h2) *) move=>[E]; rewrite -!unA=>D; case/(cancel D)=><- {D} D. (* Goal: forall _ : @eq heap (union2 (updi (ptr_offset x (S O)) xs1) h1) (union2 (updi (ptr_offset x (S O)) xs2) h2), and (@eq (list A) (@cons A v1 xs1) (@cons A v1 xs2)) (@eq heap h1 h2) *) by case/(IH _ _ _ _ E D)=>->->. Qed. End BlockUpdate. Definition low : pred ptr := fun x => 0 == nat_ptr x %[mod 2]. Definition high : pred ptr := fun x => 1 == nat_ptr x %[mod 2]. Definition get_lows h := if h is Def hs _ then filter low (supp hs) else [::]. Definition get_highs h := if h is Def hs _ then filter high (supp hs) else [::]. Definition ldom h : pred ptr := fun x => x \in get_lows h. Definition hdom h : pred ptr := fun x => x \in get_highs h. Lemma ldomP h x : x \in ldom h = (x \in dom h) && low x. Proof. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (ldom h))) (andb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h))) (low x)) *) case: h=>[//|[h S]]; rewrite /ldom /= /dom /supp /= =>H. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (fun x : ptr => @in_mem ptr x (@mem ptr (seq_predType ptr_eqType) (@filter ptr low (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))))) (andb (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))))) (low x)) *) rewrite -!topredE /=. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (seq_predType ptr_eqType) (@filter ptr low (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (andb (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h))) (low x)) *) elim: (map key h)=>[|y s IH] //=. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (seq_predType ptr_eqType) (if low y then @cons ptr y (@filter ptr low s) else @filter ptr low s))) (andb (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@cons ptr y s))) (low x)) *) case: ifP=>E; rewrite !inE IH; case: eqP=>// -> //=. (* Goal: @eq bool (andb (@in_mem ptr y (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) s)) (low y)) (low y) *) by rewrite E andbF. Qed. Lemma hdomP h x : x \in hdom h = (x \in dom h) && high x. Proof. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (hdom h))) (andb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h))) (high x)) *) case: h=>[//|[h S]]; rewrite /hdom /= /dom /supp /= =>H. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (fun x : ptr => @in_mem ptr x (@mem ptr (seq_predType ptr_eqType) (@filter ptr high (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))))) (andb (@in_mem ptr x (@mem ptr (predPredType ptr) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))))) (high x)) *) rewrite -!topredE /=. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (seq_predType ptr_eqType) (@filter ptr high (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (andb (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h))) (high x)) *) elim: (map key h)=>[|y s IH] //=. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (seq_predType ptr_eqType) (if high y then @cons ptr y (@filter ptr high s) else @filter ptr high s))) (andb (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@cons ptr y s))) (high x)) *) case: ifP=>E; rewrite !inE IH; case: eqP=>// -> //=. (* Goal: @eq bool (andb (@in_mem ptr y (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) s)) (high y)) (high y) *) by rewrite E andbF. Qed. Lemma ldomK h1 h2 t1 t2 : def (h1 :+ t1) -> def (h2 :+ t2) -> ldom h1 =i ldom h2 -> ldom (h1 :+ t1) =i ldom (h2 :+ t2) -> ldom t1 =i ldom t2. Proof. (* Goal: forall (_ : is_true (def (union2 h1 t1))) (_ : is_true (def (union2 h2 t2))) (_ : @eq_mem ptr (@mem ptr (predPredType ptr) (ldom h1)) (@mem ptr (predPredType ptr) (ldom h2))) (_ : @eq_mem ptr (@mem ptr (predPredType ptr) (ldom (union2 h1 t1))) (@mem ptr (predPredType ptr) (ldom (union2 h2 t2)))), @eq_mem ptr (@mem ptr (predPredType ptr) (ldom t1)) (@mem ptr (predPredType ptr) (ldom t2)) *) move=>D1 D2 H1 H2 x; move: {H1 H2} (H1 x) (H2 x). (* Goal: forall (_ : @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (ldom h1))) (@in_mem ptr x (@mem ptr (predPredType ptr) (ldom h2)))) (_ : @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (ldom (union2 h1 t1)))) (@in_mem ptr x (@mem ptr (predPredType ptr) (ldom (union2 h2 t2))))), @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (ldom t1))) (@in_mem ptr x (@mem ptr (predPredType ptr) (ldom t2))) *) rewrite !ldomP !domUn !inE. (* Goal: forall (_ : @eq bool (andb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h1))) (low x)) (andb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2))) (low x))) (_ : @eq bool (andb (andb (def (union2 h1 t1)) (orb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h1))) (@in_mem ptr x (@mem ptr (predPredType ptr) (dom t1))))) (low x)) (andb (andb (def (union2 h2 t2)) (orb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2))) (@in_mem ptr x (@mem ptr (predPredType ptr) (dom t2))))) (low x))), @eq bool (andb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom t1))) (low x)) (andb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom t2))) (low x)) *) case: defUn D1=>// H1 H2 L1 _; case: defUn D2=>// H3 H4 L2 _. (* Goal: forall (_ : @eq bool (andb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h1))) (low x)) (andb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2))) (low x))) (_ : @eq bool (andb (andb true (orb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h1))) (@in_mem ptr x (@mem ptr (predPredType ptr) (dom t1))))) (low x)) (andb (andb true (orb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom h2))) (@in_mem ptr x (@mem ptr (predPredType ptr) (dom t2))))) (low x))), @eq bool (andb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom t1))) (low x)) (andb (@in_mem ptr x (@mem ptr (predPredType ptr) (dom t2))) (low x)) *) case E1: (x \in dom t1); case E2: (x \in dom t2)=>//; rewrite orbF orbT /=; case E3: (x \in dom h1); case E4: (x \in dom h2)=>//= _ _; by [move/L1: E3; rewrite E1 | move/L2: E4; rewrite E2]. Qed. Definition lfresh h := (last null (get_lows h)) .+ 2. Definition hfresh h := (last (null .+ 1) (get_highs h)) .+ 2. Lemma last_inv A B (f : A -> B) (x1 x2 : A) (h : seq A) : f x1 = f x2 -> f (last x1 h) = f (last x2 h). Proof. (* Goal: forall _ : @eq B (f x1) (f x2), @eq B (f (@last A x1 h)) (f (@last A x2 h)) *) by elim: h. Qed. Lemma lfresh_low h n : low (lfresh h) .+ (2*n). Proof. (* Goal: is_true (low (ptr_offset (lfresh h) (muln (S (S O)) n))) *) rewrite /lfresh /low /get_lows. (* Goal: is_true (@eq_op nat_eqType (modn O (S (S O))) (modn (nat_ptr (ptr_offset (ptr_offset (@last ptr null match h with | Undef => @Datatypes.nil ptr | @Def hs i => @filter ptr low (@supp ptr_ordType Dyn.dynamic hs) end) (S (S O))) (muln (S (S O)) n))) (S (S O)))) *) case: h; first by rewrite modn_addl modn_mulr. (* Goal: forall (finmap : @finMap_for ptr_ordType Dyn.dynamic (Phant (forall _ : ptr, Dyn.dynamic))) (_ : is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic finmap))))), is_true (@eq_op nat_eqType (modn O (S (S O))) (modn (nat_ptr (ptr_offset (ptr_offset (@last ptr null (@filter ptr low (@supp ptr_ordType Dyn.dynamic finmap))) (S (S O))) (muln (S (S O)) n))) (S (S O)))) *) case; rewrite /supp /low /=. (* Goal: forall (seq_of : list (prod ptr Dyn.dynamic)) (_ : is_true (@sorted (Ordered.eqType ptr_ordType) (@ord ptr_ordType) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) seq_of))) (_ : is_true (negb (@in_mem ptr null (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) seq_of))))), is_true (@eq_op nat_eqType (modn O (S (S O))) (modn (addn (addn (nat_ptr (@last ptr null (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn O (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) seq_of)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) elim=>[|[[x] v] h IH] /=; first by rewrite modn_addl modn_mulr. (* Goal: forall (_ : is_true (@path ptr (@ord ptr_ordType) (ptr_nat x) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h))) (_ : is_true (negb (@in_mem ptr null (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@cons ptr (ptr_nat x) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))))), is_true (@eq_op nat_eqType (modn O (S (S O))) (modn (addn (addn (nat_ptr (@last ptr null (if @eq_op nat_eqType (modn O (S (S O))) (modn x (S (S O))) then @cons ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn O (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)) else @filter ptr (fun x : ptr => @eq_op nat_eqType (modn O (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) rewrite inE negb_or ptrE /=; move/path_sorted=>H1; case/andP=>H2 H3. (* Goal: is_true (@eq_op nat_eqType (modn O (S (S O))) (modn (addn (addn (nat_ptr (@last ptr null (if @eq_op nat_eqType (modn O (S (S O))) (modn x (S (S O))) then @cons ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn O (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)) else @filter ptr (fun x : ptr => @eq_op nat_eqType (modn O (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) case: ifP=>E /=; last by apply: IH. (* Goal: is_true (@eq_op nat_eqType (modn O (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn O (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) set f := fun x => (nat_ptr x + 2 + 2 * n) %% 2. (* Goal: is_true (@eq_op nat_eqType (modn O (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn O (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) have F: f (ptr_nat x) = f null. (* Goal: is_true (@eq_op nat_eqType (modn O (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn O (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) (* Goal: @eq nat (f (ptr_nat x)) (f null) *) - (* Goal: is_true (@eq_op nat_eqType (modn O (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn O (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) (* Goal: @eq nat (f (ptr_nat x)) (f null) *) by rewrite /f -modn_mod -addnA -modn_add2m -(eqP E) !modn_mod. (* Goal: is_true (@eq_op nat_eqType (modn O (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn O (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) move: (last_inv (f := f) (x1 := (ptr_nat x)) (x2 := null))=>L. (* Goal: is_true (@eq_op nat_eqType (modn O (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn O (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) by rewrite /f /= in L; rewrite {}L //; apply: IH. Qed. Lemma hfresh_high h n : high (hfresh h) .+ (2*n). Proof. (* Goal: is_true (high (ptr_offset (hfresh h) (muln (S (S O)) n))) *) rewrite /hfresh /high /get_highs. (* Goal: is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr (ptr_offset (ptr_offset (@last ptr (ptr_offset null (S O)) match h with | Undef => @Datatypes.nil ptr | @Def hs i => @filter ptr high (@supp ptr_ordType Dyn.dynamic hs) end) (S (S O))) (muln (S (S O)) n))) (S (S O)))) *) case: h n=>[n|]. (* Goal: forall (finmap : @finMap_for ptr_ordType Dyn.dynamic (Phant (forall _ : ptr, Dyn.dynamic))) (_ : is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic finmap))))) (n : nat), is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr (ptr_offset (ptr_offset (@last ptr (ptr_offset null (S O)) (@filter ptr high (@supp ptr_ordType Dyn.dynamic finmap))) (S (S O))) (muln (S (S O)) n))) (S (S O)))) *) (* Goal: is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr (ptr_offset (ptr_offset (@last ptr (ptr_offset null (S O)) (@Datatypes.nil ptr)) (S (S O))) (muln (S (S O)) n))) (S (S O)))) *) - (* Goal: forall (finmap : @finMap_for ptr_ordType Dyn.dynamic (Phant (forall _ : ptr, Dyn.dynamic))) (_ : is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic finmap))))) (n : nat), is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr (ptr_offset (ptr_offset (@last ptr (ptr_offset null (S O)) (@filter ptr high (@supp ptr_ordType Dyn.dynamic finmap))) (S (S O))) (muln (S (S O)) n))) (S (S O)))) *) (* Goal: is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr (ptr_offset (ptr_offset (@last ptr (ptr_offset null (S O)) (@Datatypes.nil ptr)) (S (S O))) (muln (S (S O)) n))) (S (S O)))) *) by rewrite /null /= add0n -addnA -modn_add2m modn_addl modn_mulr addn0. (* Goal: forall (finmap : @finMap_for ptr_ordType Dyn.dynamic (Phant (forall _ : ptr, Dyn.dynamic))) (_ : is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType Dyn.dynamic finmap))))) (n : nat), is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr (ptr_offset (ptr_offset (@last ptr (ptr_offset null (S O)) (@filter ptr high (@supp ptr_ordType Dyn.dynamic finmap))) (S (S O))) (muln (S (S O)) n))) (S (S O)))) *) case; rewrite /supp /high /=. (* Goal: forall (seq_of : list (prod ptr Dyn.dynamic)) (_ : is_true (@sorted (Ordered.eqType ptr_ordType) (@ord ptr_ordType) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) seq_of))) (_ : is_true (negb (@in_mem ptr null (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) seq_of))))) (n : nat), is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_offset null (S O)) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) seq_of)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) elim=>[|[[x] v] h IH] /=. (* Goal: forall (_ : is_true (@path ptr (@ord ptr_ordType) (ptr_nat x) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h))) (_ : is_true (negb (@in_mem ptr null (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@cons ptr (ptr_nat x) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))))) (n : nat), is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_offset null (S O)) (if @eq_op nat_eqType (modn (S O) (S (S O))) (modn x (S (S O))) then @cons ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)) else @filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) (* Goal: forall (_ : is_true true) (_ : is_true true) (n : nat), is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (addn (addn (addn O (S O)) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) - (* Goal: forall (_ : is_true (@path ptr (@ord ptr_ordType) (ptr_nat x) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h))) (_ : is_true (negb (@in_mem ptr null (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@cons ptr (ptr_nat x) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))))) (n : nat), is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_offset null (S O)) (if @eq_op nat_eqType (modn (S O) (S (S O))) (modn x (S (S O))) then @cons ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)) else @filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) (* Goal: forall (_ : is_true true) (_ : is_true true) (n : nat), is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (addn (addn (addn O (S O)) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) by move=>_ _ n; rewrite add0n -addnA -modn_add2m modn_addl modn_mulr addn0. (* Goal: forall (_ : is_true (@path ptr (@ord ptr_ordType) (ptr_nat x) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h))) (_ : is_true (negb (@in_mem ptr null (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@cons ptr (ptr_nat x) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))))) (n : nat), is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_offset null (S O)) (if @eq_op nat_eqType (modn (S O) (S (S O))) (modn x (S (S O))) then @cons ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)) else @filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) rewrite inE negb_or ptrE /=; move/path_sorted=>H1; case/andP=>H2 H3. (* Goal: forall n : nat, is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_offset null (S O)) (if @eq_op nat_eqType (modn (S O) (S (S O))) (modn x (S (S O))) then @cons ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)) else @filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) case: ifP=>E n /=; last by apply: IH. (* Goal: is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) set f := fun x => (nat_ptr x + 2 + 2 * n) %% 2. (* Goal: is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) have F: f (ptr_nat x) = f (null .+ 1). (* Goal: is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) (* Goal: @eq nat (f (ptr_nat x)) (f (ptr_offset null (S O))) *) - (* Goal: is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) (* Goal: @eq nat (f (ptr_nat x)) (f (ptr_offset null (S O))) *) rewrite /f -modn_mod /= add0n -addnA. (* Goal: is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) (* Goal: @eq nat (modn (modn (addn x (addn (S (S O)) (muln (S (S O)) n))) (S (S O))) (S (S O))) (modn (addn (addn (S O) (S (S O))) (muln (S (S O)) n)) (S (S O))) *) rewrite -modn_add2m -(eqP E) modn_mod. (* Goal: is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) (* Goal: @eq nat (modn (addn (modn (S O) (S (S O))) (modn (addn (S (S O)) (muln (S (S O)) n)) (S (S O)))) (S (S O))) (modn (addn (addn (S O) (S (S O))) (muln (S (S O)) n)) (S (S O))) *) by rewrite modn_add2m addnA. (* Goal: is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) move: (last_inv (f := f) (x1 := (ptr_nat x)) (x2 := null .+ 1))=>L. (* Goal: is_true (@eq_op nat_eqType (modn (S O) (S (S O))) (modn (addn (addn (nat_ptr (@last ptr (ptr_nat x) (@filter ptr (fun x : ptr => @eq_op nat_eqType (modn (S O) (S (S O))) (modn (nat_ptr x) (S (S O)))) (@map (prod ptr Dyn.dynamic) ptr (@key ptr_ordType Dyn.dynamic) h)))) (S (S O))) (muln (S (S O)) n)) (S (S O)))) *) by rewrite /f /= in L; rewrite {}L //; apply: IH. Qed. Lemma dom_lfresh h n : (lfresh h) .+ (2*n) \notin dom h. Lemma dom_hfresh h n : (hfresh h) .+ (2*n) \notin dom h. Lemma lfresh_null h : lfresh h != null. Proof. (* Goal: is_true (negb (@eq_op ptr_eqType (lfresh h) null)) *) by case: h=>[//|[h H] F]; rewrite /lfresh ptrE -lt0n /= addnS. Qed. Lemma hfresh_null h : hfresh h != null. Proof. (* Goal: is_true (negb (@eq_op ptr_eqType (hfresh h) null)) *) by case: h=>[//|[h H] F]; rewrite /lfresh ptrE -lt0n /= addnS. Qed. Lemma high_lowD : [predI low & high] =i pred0. Proof. (* Goal: @eq_mem ptr (@mem ptr (simplPredType ptr) (@predI ptr (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (predPredType ptr) low))) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (predPredType ptr) high))))) (@mem ptr (simplPredType ptr) (@pred0 ptr)) *) case=>x; rewrite inE /low /high /= -!topredE /=. (* Goal: @eq bool (andb (@eq_op nat_eqType (modn O (S (S O))) (modn x (S (S O)))) (@eq_op nat_eqType (modn (S O) (S (S O))) (modn x (S (S O))))) false *) by case: x=>// n; case E: (0 %% 2 == _)=>//=; rewrite -(eqP E). Qed. Lemma modnS x1 x2 : (x1 == x2 %[mod 2]) = (x1.+1 == x2.+1 %[mod 2]). Proof. (* Goal: @eq bool (@eq_op nat_eqType (modn x1 (S (S O))) (modn x2 (S (S O)))) (@eq_op nat_eqType (modn (S x1) (S (S O))) (modn (S x2) (S (S O)))) *) case E: (x1 %% 2 == _). (* Goal: @eq bool false (@eq_op nat_eqType (modn (S x1) (S (S O))) (modn (S x2) (S (S O)))) *) (* Goal: @eq bool true (@eq_op nat_eqType (modn (S x1) (S (S O))) (modn (S x2) (S (S O)))) *) - (* Goal: @eq bool false (@eq_op nat_eqType (modn (S x1) (S (S O))) (modn (S x2) (S (S O)))) *) (* Goal: @eq bool true (@eq_op nat_eqType (modn (S x1) (S (S O))) (modn (S x2) (S (S O)))) *) by rewrite -addn1 -modn_add2m (eqP E) modn_add2m addn1 eq_refl. (* Goal: @eq bool false (@eq_op nat_eqType (modn (S x1) (S (S O))) (modn (S x2) (S (S O)))) *) suff L: ((x1.+1) %% 2 == (x2.+1) %% 2) -> (x1 %% 2 == x2 %% 2). (* Goal: forall _ : is_true (@eq_op nat_eqType (modn (S x1) (S (S O))) (modn (S x2) (S (S O)))), is_true (@eq_op nat_eqType (modn x1 (S (S O))) (modn x2 (S (S O)))) *) (* Goal: @eq bool false (@eq_op nat_eqType (modn (S x1) (S (S O))) (modn (S x2) (S (S O)))) *) - (* Goal: forall _ : is_true (@eq_op nat_eqType (modn (S x1) (S (S O))) (modn (S x2) (S (S O)))), is_true (@eq_op nat_eqType (modn x1 (S (S O))) (modn x2 (S (S O)))) *) (* Goal: @eq bool false (@eq_op nat_eqType (modn (S x1) (S (S O))) (modn (S x2) (S (S O)))) *) by rewrite E in L; case: eqP L=>// _; apply. (* Goal: forall _ : is_true (@eq_op nat_eqType (modn (S x1) (S (S O))) (modn (S x2) (S (S O)))), is_true (@eq_op nat_eqType (modn x1 (S (S O))) (modn x2 (S (S O)))) *) move=>{E} E; rewrite -(modn_addr x1) -(modn_addr x2). (* Goal: is_true (@eq_op nat_eqType (modn (addn x1 (S (S O))) (S (S O))) (modn (addn x2 (S (S O))) (S (S O)))) *) by rewrite -addSnnS -modn_add2m (eqP E) modn_add2m addSnnS. Qed. Lemma hlE x : high x = ~~ low x. Lemma lhE x : low x = ~~ high x. Proof. (* Goal: @eq bool (low x) (negb (high x)) *) by apply: negb_inj; rewrite negbK hlE. Qed. Lemma ldomUn h1 h2 : ldom (h1 :+ h2) =i [pred x | def (h1 :+ h2) && (x \in [predU ldom h1 & ldom h2])]. Proof. (* Goal: @eq_mem ptr (@mem ptr (predPredType ptr) (ldom (union2 h1 h2))) (@mem ptr (simplPredType ptr) (@SimplPred ptr (fun x : ptr => andb (def (union2 h1 h2)) (@in_mem ptr x (@mem ptr (simplPredType ptr) (@predU ptr (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (predPredType ptr) (ldom h1)))) (@pred_of_simpl ptr (@pred_of_mem_pred ptr (@mem ptr (predPredType ptr) (ldom h2)))))))))) *) by move=>x; rewrite !inE !ldomP domUn !inE /= -andbA andb_orl. Qed. Definition loweq h1 h2 := get_lows h1 == get_lows h2. Notation "h1 =~ h2" := (loweq h1 h2) (at level 80). Lemma low_refl h : h =~ h. Proof. (* Goal: is_true (loweq h h) *) by rewrite /loweq. Qed. Hint Resolve low_refl : core. Lemma low_sym h1 h2 : (h1 =~ h2) = (h2 =~ h1). Proof. (* Goal: @eq bool (loweq h1 h2) (loweq h2 h1) *) by rewrite /loweq eq_sym. Qed. Lemma low_trans h2 h1 h3 : h1 =~ h2 -> h2 =~ h3 -> h1 =~ h3. Proof. (* Goal: forall (_ : is_true (loweq h1 h2)) (_ : is_true (loweq h2 h3)), is_true (loweq h1 h3) *) by rewrite /loweq; move/eqP=>->. Qed. Lemma loweqP h1 h2 : reflect (ldom h1 =i ldom h2) (h1 =~ h2). Lemma loweqK h1 h2 t1 t2 : def (h1 :+ t1) -> def (h2 :+ t2) -> h1 =~ h2 -> h1 :+ t1 =~ h2 :+ t2 -> t1 =~ t2. Lemma loweqE h1 h2 : h1 =~ h2 -> lfresh h1 = lfresh h2. Proof. (* Goal: forall _ : is_true (loweq h1 h2), @eq ptr (lfresh h1) (lfresh h2) *) by rewrite /loweq /lfresh; move/eqP=>->. Qed. Lemma lowUn h1 h2 t1 t2 : def (h1 :+ t1) -> def (h2 :+ t2) -> h1 =~ h2 -> t1 =~ t2 -> h1 :+ t1 =~ h2 :+ t2. Proof. (* Goal: forall (_ : is_true (def (union2 h1 t1))) (_ : is_true (def (union2 h2 t2))) (_ : is_true (loweq h1 h2)) (_ : is_true (loweq t1 t2)), is_true (loweq (union2 h1 t1) (union2 h2 t2)) *) move=>D1 D2; do 2![case: loweqP=>//]=>H1 H2 _ _. (* Goal: is_true (loweq (union2 h1 t1) (union2 h2 t2)) *) apply/loweqP=>x; move: (H1 x) (H2 x). (* Goal: forall (_ : @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (ldom t1))) (@in_mem ptr x (@mem ptr (predPredType ptr) (ldom t2)))) (_ : @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (ldom h1))) (@in_mem ptr x (@mem ptr (predPredType ptr) (ldom h2)))), @eq bool (@in_mem ptr x (@mem ptr (predPredType ptr) (ldom (union2 h1 t1)))) (@in_mem ptr x (@mem ptr (predPredType ptr) (ldom (union2 h2 t2)))) *) by rewrite !ldomP !domUn !inE D1 D2 /= !andb_orl=>-> ->. Qed. Lemma lowPn A1 A2 (x : ptr) (v1 : A1) (v2 : A2) : x :-> v1 =~ x :-> v2. Proof. (* Goal: is_true (loweq (@pts A1 x v1) (@pts A2 x v2)) *) by apply/loweqP=>y; rewrite !ldomP !domPt. Qed. Hint Resolve lowPn : core. Lemma highPn A1 A2 (x1 x2 : ptr) (v1 : A1) (v2 : A2) : high x1 -> high x2 -> x1 :-> v1 =~ x2 :-> v2. Proof. (* Goal: forall (_ : is_true (high x1)) (_ : is_true (high x2)), is_true (loweq (@pts A1 x1 v1) (@pts A2 x2 v2)) *) move=>H1 H2. (* Goal: is_true (loweq (@pts A1 x1 v1) (@pts A2 x2 v2)) *) apply/loweqP=>y; rewrite !ldomP !domPt !inE. (* Goal: @eq bool (andb (andb (@eq_op ptr_eqType x1 y) (negb (@eq_op ptr_eqType x1 null))) (low y)) (andb (andb (@eq_op ptr_eqType x2 y) (negb (@eq_op ptr_eqType x2 null))) (low y)) *) case E1: (x1 == y); first by rewrite -(eqP E1) lhE H1 !andbF. (* Goal: @eq bool (andb (andb false (negb (@eq_op ptr_eqType x1 null))) (low y)) (andb (andb (@eq_op ptr_eqType x2 y) (negb (@eq_op ptr_eqType x2 null))) (low y)) *) case E2: (x2 == y)=>//=. (* Goal: @eq bool false (andb (negb (@eq_op ptr_eqType x2 null)) (low y)) *) by rewrite -(eqP E2) lhE H2 andbF. Qed. Lemma lowPtUn A1 A2 h1 h2 (x : ptr) (v1 : A1) (v2 : A2) : def (x :-> v1 :+ h1) -> def (x :-> v2 :+ h2) -> (x :-> v1 :+ h1 =~ x :-> v2 :+ h2) = (h1 =~ h2). Proof. (* Goal: forall (_ : is_true (def (union2 (@pts A1 x v1) h1))) (_ : is_true (def (union2 (@pts A2 x v2) h2))), @eq bool (loweq (union2 (@pts A1 x v1) h1) (union2 (@pts A2 x v2) h2)) (loweq h1 h2) *) move=>D1 D2. (* Goal: @eq bool (loweq (union2 (@pts A1 x v1) h1) (union2 (@pts A2 x v2) h2)) (loweq h1 h2) *) case E: (h1 =~ h2); first by apply: lowUn. (* Goal: @eq bool (loweq (union2 (@pts A1 x v1) h1) (union2 (@pts A2 x v2) h2)) false *) move/(elimF idP): E=>E; apply: (introF idP)=>F; case: E. (* Goal: is_true (loweq h1 h2) *) by apply: loweqK F. Qed. Lemma highPtUn A h1 h2 (x : ptr) (v : A) : def (x :-> v :+ h1) -> high x -> (x :-> v :+ h1 =~ h2) = (h1 =~ h2). Lemma highPtUn2 A1 A2 h1 h2 (x1 x2 : ptr) (v1 : A1) (v2 : A2) : def (x1 :-> v1 :+ h1) -> def (x2 :-> v2 :+ h2) -> high x1 -> high x2 -> h1 =~ h2 -> x1 :-> v1 :+ h1 =~ x2 :-> v2 :+ h2. Proof. (* Goal: forall (_ : is_true (def (union2 (@pts A1 x1 v1) h1))) (_ : is_true (def (union2 (@pts A2 x2 v2) h2))) (_ : is_true (high x1)) (_ : is_true (high x2)) (_ : is_true (loweq h1 h2)), is_true (loweq (union2 (@pts A1 x1 v1) h1) (union2 (@pts A2 x2 v2) h2)) *) by move=>D1 D2 H1 H2 L; apply: lowUn=>//; apply: highPn. Qed. Definition plus2 (h1 h2 : heap * heap) : heap * heap := (h1.1 :+ h2.1, h1.2 :+ h2.2). Definition def2 (h : heap * heap) := def h.1 && def h.2. Notation "h1 :++ h2" := (plus2 h1 h2) (at level 50). Lemma unA2 h1 h2 h3 : h1 :++ (h2 :++ h3) = h1 :++ h2 :++ h3. Proof. (* Goal: @eq (prod heap heap) (plus2 h1 (plus2 h2 h3)) (plus2 (plus2 h1 h2) h3) *) by congr (_, _); rewrite /= unA. Qed. Lemma unC2 h1 h2 : h1 :++ h2 = h2 :++ h1. Proof. (* Goal: @eq (prod heap heap) (plus2 h1 h2) (plus2 h2 h1) *) by congr (_, _); rewrite unC. Qed. Lemma unKhl2 h h1 h2 : def2 (h1 :++ h) -> h1 :++ h = h2 :++ h -> h1 = h2. Proof. (* Goal: forall (_ : is_true (def2 (plus2 h1 h))) (_ : @eq (prod heap heap) (plus2 h1 h) (plus2 h2 h)), @eq (prod heap heap) h1 h2 *) move: h h1 h2=>[h1 h2][h11 h12][h21 h22]; case/andP=>/= [D1 D2] [E1 E2]. (* Goal: @eq (prod heap heap) (@pair heap heap h11 h12) (@pair heap heap h21 h22) *) by rewrite (unKhl D1 E1) (unKhl D2 E2). Qed. Lemma unKhr2 h h1 h2 : def2 (h2 :++ h) -> h1 :++ h = h2 :++ h -> h1 = h2. Proof. (* Goal: forall (_ : is_true (def2 (plus2 h2 h))) (_ : @eq (prod heap heap) (plus2 h1 h) (plus2 h2 h)), @eq (prod heap heap) h1 h2 *) move: h h1 h2=>[h1 h2][h11 h12][h21 h22]; case/andP=>/= [D1 D2] [E1 E2]. (* Goal: @eq (prod heap heap) (@pair heap heap h11 h12) (@pair heap heap h21 h22) *) by rewrite (unKhr D1 E1) (unKhr D2 E2). Qed. Lemma unDl2 h1 h2 : def2 (h1 :++ h2) -> def2 h1. Proof. (* Goal: forall _ : is_true (def2 (plus2 h1 h2)), is_true (def2 h1) *) by case/andP=>/= D1 D2; rewrite /def2 (defUnl D1) (defUnl D2). Qed. Lemma unDr2 h1 h2 : def2 (h1 :++ h2) -> def2 h2. Proof. (* Goal: forall _ : is_true (def2 (plus2 h1 h2)), is_true (def2 h2) *) by case/andP=>/= D1 D2; rewrite /def2 (defUnr D1) (defUnr D2). Qed. Lemma un0h2 h : (empty, empty) :++ h = h. Proof. (* Goal: @eq (prod heap heap) (plus2 (@pair heap heap empty empty) h) h *) by case: h=>h1 h2; rewrite /plus2 /= !un0h. Qed. Lemma unh02 h : h :++ (empty, empty) = h. Proof. (* Goal: @eq (prod heap heap) (plus2 h (@pair heap heap empty empty)) h *) by case: h=>h1 h2; rewrite /plus2 /= !unh0. Qed. Lemma injUh A h1 h2 x (v1 v2 : A) : def (h1 :+ (x :-> v1)) -> h1 :+ (x :-> v1) = h2 :+ (x :-> v2) -> def h1 /\ h1 = h2 /\ v1 = v2. Proof. (* Goal: forall (_ : is_true (def (union2 h1 (@pts A x v1)))) (_ : @eq heap (union2 h1 (@pts A x v1)) (union2 h2 (@pts A x v2))), and (is_true (def h1)) (and (@eq heap h1 h2) (@eq A v1 v2)) *) by rewrite -!(unC (x :-> _))=>D; case/(cancel D)=><- -> ->. Qed. Lemma eqUh h1 h2 h : def (h1 :+ h) -> h1 :+ h = h2 :+ h -> def h1 /\ h1 = h2. Proof. (* Goal: forall (_ : is_true (def (union2 h1 h))) (_ : @eq heap (union2 h1 h) (union2 h2 h)), and (is_true (def h1)) (@eq heap h1 h2) *) by move=>D E; rewrite {2}(unKhl D E) (defUnl D). Qed. Lemma exit1 h1 h2 h : def (h1 :+ h) -> h1 :+ h = h :+ h2 -> def h1 /\ h1 = h2. Proof. (* Goal: forall (_ : is_true (def (union2 h1 h))) (_ : @eq heap (union2 h1 h) (union2 h h2)), and (is_true (def h1)) (@eq heap h1 h2) *) by move=>D; rewrite (unC h); apply: eqUh. Qed. Lemma exit2 h1 h : def (h1 :+ h) -> h1 :+ h = h -> def h1 /\ h1 = empty. Proof. (* Goal: forall (_ : is_true (def (union2 h1 h))) (_ : @eq heap (union2 h1 h) h), and (is_true (def h1)) (@eq heap h1 empty) *) by move=>H1; rewrite -{2}(unh0 h)=>H2; apply: exit1 H2. Qed. Lemma exit3 h1 h : def h -> h = h :+ h1 -> def empty /\ empty = h1. Proof. (* Goal: forall (_ : is_true (def h)) (_ : @eq heap h (union2 h h1)), and (is_true (def empty)) (@eq heap empty h1) *) move=>H1 H2; split=>//; rewrite -{1}(unh0 h) in H2. (* Goal: @eq heap empty h1 *) by apply: unhKl H2; rewrite unh0. Qed. Lemma exit4 h : def h -> h = h -> def empty /\ empty = empty. Proof. (* Goal: forall (_ : is_true (def h)) (_ : @eq heap h h), and (is_true (def empty)) (@eq heap empty empty) *) by []. Qed. Ltac cancelator t H := match goal with | |- ?h1 :+ t = ?h2 -> _ => let j := fresh "j" in set j := {1}(h1 :+ t); rewrite -1?unA /j {j}; (move/(exit1 H)=>{H} [H] || move/(exit2 H)=>{H} [H]) | |- t = ?h2 -> _ => rewrite -?unA; (move/(exit3 H)=>{H} [H] || move/(exit4 H)=>{H} [H]) | |- (?h1 :+ (?x :-> ?v) = ?h2) -> _ => let j := fresh "j" in set j := {1}(h1 :+ (x :-> v)); rewrite 1?(unC (x :-> _)) -?(unAC _ _ (x :-> _)) /j {j}; (move/(injUh H)=>{H} [H []] || rewrite (unC h1) ?unA in H * ); cancelator t H | |- (?h1 :+ ?h = ?h2) -> _ => let j := fresh "j" in set j := {1}(h1 :+ h); rewrite 1?(unC h) -?(unAC _ _ h) /j {j}; (move/(eqUh H)=>{H} [H []] || rewrite (unC h1) ?unA in H * ); cancelator t H | |- _ => idtac end. Ltac heap_cancel := match goal with | |- ?h1 = ?h2 -> ?GG => let t1 := fresh "t1" in let t2 := fresh "t2" in let t := fresh "t" in let H := fresh "H" in let G := fresh "hidden_goal" in suff : def h1; first ( set t1 := {1 2}h1; set t2 := {1}h2; set G := GG; rewrite -(un0h t1) -(un0h t2) [empty]lock; set t := locked empty; rewrite /t1 /t2 {t1 t2}; move=>H; rewrite ?unA in H *; cancelator t H; move: H {t}; rewrite /G {G}) | |- _ => idtac end. Lemma cexit1 h1 h2 h : h1 = h2 -> h1 :+ h = h :+ h2. Proof. (* Goal: forall _ : @eq heap h1 h2, @eq heap (union2 h1 h) (union2 h h2) *) by move=>->; rewrite unC. Qed. Lemma cexit2 h1 h : h1 = empty -> h1 :+ h = h. Proof. (* Goal: forall _ : @eq heap h1 empty, @eq heap (union2 h1 h) h *) by move=>->; rewrite un0h. Qed. Lemma cexit3 h1 h : empty = h1 -> h = h :+ h1. Proof. (* Goal: forall _ : @eq heap empty h1, @eq heap h (union2 h h1) *) by move=><-; rewrite unh0. Qed. Lemma congUh A h1 h2 x (v1 v2 : A) : h1 = h2 -> v1 = v2 -> h1 :+ (x :-> v1) = h2 :+ (x :-> v2). Proof. (* Goal: forall (_ : @eq heap h1 h2) (_ : @eq A v1 v2), @eq heap (union2 h1 (@pts A x v1)) (union2 h2 (@pts A x v2)) *) by move=>-> ->. Qed. Lemma congeqUh h1 h2 h : h1 = h2 -> h1 :+ h = h2 :+ h. Proof. (* Goal: forall _ : @eq heap h1 h2, @eq heap (union2 h1 h) (union2 h2 h) *) by move=>->. Qed. Ltac congruencer t := match goal with | |- ?h1 :+ t = ?h2 => let j := fresh "j" in set j := {1}(h1 :+ t); rewrite -1?unA /j {j}; (apply: cexit1 || apply: cexit2) | |- t = ?h2 => rewrite -1?unA; (apply: cexit3 || apply: refl_equal) | |- (?h1 :+ (?x :-> ?v) = ?h2) => let j := fresh "j" in set j := {1}(h1 :+ (x :-> v)); rewrite 1?(unC (x :-> _)) -?(unAC _ _ (x :-> _)) /j {j}; ((apply: congUh; [congruencer t | idtac]) || (rewrite (unC h1) ?unA; congruencer t)) | |- (?h1 :+ ?h = ?h2) => let j := fresh "j" in set j := {1}(h1 :+ h); rewrite 1?(unC h) -?(unAC _ _ h) /j {j}; (apply: congeqUh || rewrite (unC h1) ?unA); congruencer t | |- _ => idtac end. Ltac heap_congr := match goal with | |- ?h1 = ?h2 => let t1 := fresh "t1" in let t2 := fresh "t2" in let t := fresh "t" in set t1 := {1}h1; set t2 := {1}h2; rewrite -(un0h t1) -(un0h t2) [empty]lock; set t := locked empty; rewrite /t1 /t2 {t1 t2}; rewrite ?unA; congruencer t=>{t} | |- _ => idtac end. Lemma test h1 h2 h3 x (v1 v2 : nat) : h3 = h2 -> v1 = v2 -> h1 :+ (x :-> v1) :+ h3= h2 :+ h1 :+ (x :-> v2). Proof. (* Goal: forall (_ : @eq heap h3 h2) (_ : @eq nat v1 v2), @eq heap (union2 (union2 h1 (@pts nat x v1)) h3) (union2 (union2 h2 h1) (@pts nat x v2)) *) by move=>H1 H2; heap_congr. Qed. Definition supdom h2 h1 := subdom h1 h2. Lemma sexit1 h1 h2 h : def (h2 :+ h) -> (def h2 -> supdom h2 h1) -> supdom (h2 :+ h) (h :+ h1). Lemma sexit2 h1 h : def (h1 :+ h) -> (def h1 -> supdom h1 empty) -> supdom (h1 :+ h) h. Lemma sexit3 h1 h : def h -> (def empty -> supdom empty h1) -> supdom h (h :+ h1). Proof. (* Goal: forall (_ : is_true (def h)) (_ : forall _ : is_true (def empty), is_true (supdom empty h1)), is_true (supdom h (union2 h h1)) *) move=>H1 H2; rewrite unC -{1}(un0h h). (* Goal: is_true (supdom (union2 empty h) (union2 h1 h)) *) by apply: subdomE; [rewrite un0h | apply: H2]. Qed. Lemma sexit4 h : def h -> (def empty -> empty = empty) -> supdom h h. Proof. (* Goal: forall (_ : is_true (def h)) (_ : forall _ : is_true (def empty), @eq heap empty empty), is_true (supdom h h) *) by move=>*; rewrite -(un0h h); apply: subdomE=>//; rewrite un0h. Qed. Lemma supdomUh A B h1 h2 x (v1 : A) (v2 : B) : def (h2 :+ (x :-> v2)) -> (def h2 -> supdom h2 h1) -> supdom (h2 :+ (x :-> v2)) (h1 :+ (x :-> v1)). Lemma supdomeqUh h1 h2 h : def (h2 :+ h) -> (def h2 -> supdom h2 h1) -> supdom (h2 :+ h) (h1 :+ h). Proof. (* Goal: forall (_ : is_true (def (union2 h2 h))) (_ : forall _ : is_true (def h2), is_true (supdom h2 h1)), is_true (supdom (union2 h2 h) (union2 h1 h)) *) by rewrite (unC h1); apply: sexit1. Qed. Lemma sup_defdef h1 h2 : def h2 -> supdom h2 h1 -> def h1. Proof. (* Goal: forall (_ : is_true (def h2)) (_ : is_true (supdom h2 h1)), is_true (def h1) *) by move=>H1; rewrite /supdom; move/subdom_def; rewrite H1 andbT. Qed. Ltac supdom_checker t H := match goal with | |- is_true (supdom (?h1 :+ t) ?h2) => let j := fresh "j" in set j := {1}(h1 :+ t); rewrite -1?unA /j {j}; (apply: (sexit1 H)=>{H} H || apply: (sexit2 H)=>{H} H) | |- is_true (supdom t ?h1) => rewrite -1?unA; (apply: (sexit3 H)=>{H} H || apply: (sexit4 H)=>{H} H) | |- is_true (supdom (?h1 :+ (?x :-> ?v)) ?h2) => let j := fresh "j" in set j := {1}(h1 :+ (x :-> v)); rewrite 1?(unC (x :-> _)) -?(unAC _ _ (x :-> _)) /j {j}; (apply: (supdomUh _ H)=>{H} H || (rewrite (unC h1) ?unA in H * )); supdom_checker t H | |- is_true (supdom (?h1 :+ ?h) ?h2) => let j := fresh "j" in set j := {1}(h1 :+ h); rewrite 1?(unC h) -?(unAC _ _ h) /j {j}; (apply: (supdomeqUh H)=>{H} H || (rewrite (unC h1) ?unA in H * )); supdom_checker t H | |- _ => idtac end. Ltac defcheck := match goal with | |- is_true (def ?h2) -> is_true (def ?h1) => let t1 := fresh "t1" in let t2 := fresh "t2" in let t := fresh "t" in let H := fresh "H" in set t2 := {1}h2; set t1 := {1}h1; rewrite -(un0h t1) -(un0h t2) [empty]lock; set t := locked empty; rewrite /t1 /t2 {t1 t2}; rewrite ?unA; move=>H; apply: (sup_defdef H); supdom_checker t H; move: H {t}; rewrite /supdom | |- _ => idtac end. Ltac hhauto := (do ?econstructor=>//; try by [heap_congr])=>//.
Require Export nat_trees. Require Import Lt. Inductive min (p : nat) (t : nat_tree) : Prop := min_intro : (forall q : nat, occ t q -> p < q) -> min p t. Hint Resolve min_intro: searchtrees. Inductive maj (p : nat) (t : nat_tree) : Prop := maj_intro : (forall q : nat, occ t q -> q < p) -> maj p t. Hint Resolve maj_intro: searchtrees. Inductive search : nat_tree -> Prop := | nil_search : search NIL | bin_search : forall (n : nat) (t1 t2 : nat_tree), search t1 -> search t2 -> maj n t1 -> min n t2 -> search (bin n t1 t2). Hint Resolve nil_search bin_search: searchtrees. Lemma min_nil : forall p : nat, min p NIL. Proof. (* Goal: forall p : nat, min p NIL *) intro p; apply min_intro. (* Goal: forall (q : nat) (_ : occ NIL q), lt p q *) intros q H; inversion_clear H. Qed. Hint Resolve min_nil: searchtrees. Lemma maj_nil : forall p : nat, maj p NIL. Proof. (* Goal: forall p : nat, maj p NIL *) intro p; apply maj_intro. (* Goal: forall (q : nat) (_ : occ NIL q), lt q p *) intros q H; inversion_clear H. Qed. Hint Resolve maj_nil: searchtrees. Lemma maj_not_occ : forall (p : nat) (t : nat_tree), maj p t -> ~ occ t p. Proof. (* Goal: forall (p : nat) (t : nat_tree) (_ : maj p t), not (occ t p) *) unfold not in |- *; intros p t H H'. (* Goal: False *) elim H; intros; absurd (p < p); auto with searchtrees arith. Qed. Hint Resolve maj_not_occ: searchtrees. Lemma min_not_occ : forall (p : nat) (t : nat_tree), min p t -> ~ occ t p. Proof. (* Goal: forall (p : nat) (t : nat_tree) (_ : min p t), not (occ t p) *) unfold not in |- *; intros p t H H'. (* Goal: False *) elim H; intros; absurd (p < p); auto with searchtrees arith. Qed. Hint Resolve min_not_occ: searchtrees. Section search_tree_basic_properties. Variable n : nat. Variable t1 t2 : nat_tree. Hypothesis se : search (bin n t1 t2). Lemma search_l : search t1. Proof. (* Goal: search t1 *) inversion_clear se; auto with searchtrees arith. Qed. Hint Resolve search_l: searchtrees. Lemma search_r : search t2. Proof. (* Goal: search t2 *) inversion_clear se; auto with searchtrees arith. Qed. Hint Resolve search_r: searchtrees. Lemma maj_l : maj n t1. Proof. (* Goal: maj n t1 *) inversion_clear se; auto with searchtrees arith. Qed. Hint Resolve maj_l: searchtrees. Lemma min_r : min n t2. Proof. (* Goal: min n t2 *) inversion_clear se; auto with searchtrees arith. Qed. Hint Resolve min_r: searchtrees. Lemma not_right : forall p : nat, p <= n -> ~ occ t2 p. Proof. (* Goal: forall (p : nat) (_ : le p n), not (occ t2 p) *) intros p H; elim min_r. (* Goal: forall _ : forall (q : nat) (_ : occ t2 q), lt n q, not (occ t2 p) *) unfold not in |- *; intros; absurd (n < p); auto with searchtrees arith. Qed. Hint Resolve not_right: searchtrees. Lemma not_left : forall p : nat, n <= p -> ~ occ t1 p. Proof. (* Goal: forall (p : nat) (_ : le n p), not (occ t1 p) *) intros p H; elim maj_l. (* Goal: forall _ : forall (q : nat) (_ : occ t1 q), lt q n, not (occ t1 p) *) unfold not in |- *; intros; absurd (p < n); auto with searchtrees arith. Qed. Hint Resolve not_left: searchtrees. Lemma go_left : forall p : nat, occ (bin n t1 t2) p -> p < n -> occ t1 p. Proof. (* Goal: forall (p : nat) (_ : occ (bin n t1 t2) p) (_ : lt p n), occ t1 p *) intros p H H0; elim (occ_inv _ _ _ _ H). (* Goal: forall _ : or (occ t1 p) (occ t2 p), occ t1 p *) (* Goal: forall _ : @eq nat n p, occ t1 p *) simple induction 1; absurd (p < n); [ rewrite H1; auto with searchtrees arith | auto with searchtrees arith ]. (* Goal: forall _ : or (occ t1 p) (occ t2 p), occ t1 p *) simple induction 1; auto with searchtrees arith. (* Goal: forall _ : occ t2 p, occ t1 p *) intro H2; absurd (occ t2 p); auto with searchtrees arith. Qed. Lemma go_right : forall p : nat, occ (bin n t1 t2) p -> n < p -> occ t2 p. Proof. (* Goal: forall (p : nat) (_ : occ (bin n t1 t2) p) (_ : lt n p), occ t2 p *) intros p H H0; elim (occ_inv _ _ _ _ H). (* Goal: forall _ : or (occ t1 p) (occ t2 p), occ t2 p *) (* Goal: forall _ : @eq nat n p, occ t2 p *) simple induction 1; absurd (n < p); [ rewrite H1; auto with searchtrees arith | auto with searchtrees arith ]. (* Goal: forall _ : or (occ t1 p) (occ t2 p), occ t2 p *) simple induction 1; auto with searchtrees arith. (* Goal: forall _ : occ t1 p, occ t2 p *) intro H2; absurd (occ t1 p); auto with searchtrees arith. Qed. Lemma search_inv : forall P : Prop, (search t1 -> search t2 -> maj n t1 -> min n t2 -> P) -> P. Proof. (* Goal: forall (P : Prop) (_ : forall (_ : search t1) (_ : search t2) (_ : maj n t1) (_ : min n t2), P), P *) auto with searchtrees arith. Qed. End search_tree_basic_properties.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrfun ssrbool eqtype ssrnat seq. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Section Paths. Variables (n0 : nat) (T : Type). Section Path. Variables (x0_cycle : T) (e : rel T). Fixpoint path x (p : seq T) := if p is y :: p' then e x y && path y p' else true. Lemma cat_path x p1 p2 : path x (p1 ++ p2) = path x p1 && path (last x p1) p2. Proof. (* Goal: @eq bool (path x (@cat T p1 p2)) (andb (path x p1) (path (@last T x p1) p2)) *) by elim: p1 x => [|y p1 Hrec] x //=; rewrite Hrec -!andbA. Qed. Lemma rcons_path x p y : path x (rcons p y) = path x p && e (last x p) y. Proof. (* Goal: @eq bool (path x (@rcons T p y)) (andb (path x p) (e (@last T x p) y)) *) by rewrite -cats1 cat_path /= andbT. Qed. Lemma pathP x p x0 : reflect (forall i, i < size p -> e (nth x0 (x :: p) i) (nth x0 p i)) (path x p). Proof. (* Goal: Bool.reflect (forall (i : nat) (_ : is_true (leq (S i) (@size T p))), is_true (e (@nth T x0 (@cons T x p) i) (@nth T x0 p i))) (path x p) *) elim: p x => [|y p IHp] x /=; first by left. (* Goal: Bool.reflect (forall (i : nat) (_ : is_true (leq (S i) (S (@size T p)))), is_true (e (@nth T x0 (@cons T x (@cons T y p)) i) (@nth T x0 (@cons T y p) i))) (andb (e x y) (path y p)) *) apply: (iffP andP) => [[e_xy /IHp e_p [] //] | e_p]. (* Goal: and (is_true (e x y)) (is_true (path y p)) *) by split; [apply: (e_p 0) | apply/(IHp y) => i; apply: e_p i.+1]. Qed. Definition cycle p := if p is x :: p' then path x (rcons p' x) else true. Lemma cycle_path p : cycle p = path (last x0_cycle p) p. Proof. (* Goal: @eq bool (cycle p) (path (@last T x0_cycle p) p) *) by case: p => //= x p; rewrite rcons_path andbC. Qed. Lemma rot_cycle p : cycle (rot n0 p) = cycle p. Proof. (* Goal: @eq bool (cycle (@rot T n0 p)) (cycle p) *) case: n0 p => [|n] [|y0 p] //=; first by rewrite /rot /= cats0. (* Goal: @eq bool (cycle (@rot T (S n) (@cons T y0 p))) (path y0 (@rcons T p y0)) *) rewrite /rot /= -{3}(cat_take_drop n p) -cats1 -catA cat_path. (* Goal: @eq bool (cycle (@cat T (@drop T n p) (@cons T y0 (@take T n p)))) (andb (path y0 (@take T n p)) (path (@last T y0 (@take T n p)) (@cat T (@drop T n p) (@cons T y0 (@nil T))))) *) case: (drop n p) => [|z0 q]; rewrite /= -cats1 !cat_path /= !andbT andbC //. (* Goal: @eq bool (andb (e (@last T z0 (@cat T q (@cons T y0 (@take T n p)))) z0) (andb (path z0 q) (andb (e (@last T z0 q) y0) (path y0 (@take T n p))))) (andb (path y0 (@take T n p)) (andb (e (@last T y0 (@take T n p)) z0) (andb (path z0 q) (e (@last T z0 q) y0)))) *) by rewrite last_cat; repeat bool_congr. Qed. Lemma rotr_cycle p : cycle (rotr n0 p) = cycle p. Proof. (* Goal: @eq bool (cycle (@rotr T n0 p)) (cycle p) *) by rewrite -rot_cycle rotrK. Qed. End Path. Lemma eq_path e e' : e =2 e' -> path e =2 path e'. Proof. (* Goal: forall _ : @eqrel bool T T e e', @eqrel bool (list T) T (path e) (path e') *) by move=> ee' x p; elim: p x => //= y p IHp x; rewrite ee' IHp. Qed. Lemma eq_cycle e e' : e =2 e' -> cycle e =1 cycle e'. Proof. (* Goal: forall _ : @eqrel bool T T e e', @eqfun bool (list T) (cycle e) (cycle e') *) by move=> ee' [|x p] //=; apply: eq_path. Qed. Lemma sub_path e e' : subrel e e' -> forall x p, path e x p -> path e' x p. Proof. (* Goal: forall (_ : @subrel T e e') (x : T) (p : list T) (_ : is_true (path e x p)), is_true (path e' x p) *) by move=> ee' x p; elim: p x => //= y p IHp x /andP[/ee'-> /IHp]. Qed. Lemma rev_path e x p : path e (last x p) (rev (belast x p)) = path (fun z => e^~ z) x p. Proof. (* Goal: @eq bool (path e (@last T x p) (@rev T (@belast T x p))) (path (fun z x : T => e x z) x p) *) elim: p x => //= y p IHp x; rewrite rev_cons rcons_path -{}IHp andbC. (* Goal: @eq bool (andb (e (@last T (@last T y p) (@rev T (@belast T y p))) x) (path e (@last T y p) (@rev T (@belast T y p)))) (andb (e y x) (path e (@last T y p) (@rev T (@belast T y p)))) *) by rewrite -(last_cons x) -rev_rcons -lastI rev_cons last_rcons. Qed. End Paths. Arguments pathP {T e x p}. Section EqPath. Variables (n0 : nat) (T : eqType) (x0_cycle : T) (e : rel T). Implicit Type p : seq T. Variant split x : seq T -> seq T -> seq T -> Type := Split p1 p2 : split x (rcons p1 x ++ p2) p1 p2. Lemma splitP p x (i := index x p) : x \in p -> split x p (take i p) (drop i.+1 p). Proof. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p)), split x p (@take (Equality.sort T) i p) (@drop (Equality.sort T) (S i) p) *) move=> p_x; have lt_ip: i < size p by rewrite index_mem. (* Goal: split x p (@take (Equality.sort T) i p) (@drop (Equality.sort T) (S i) p) *) by rewrite -{1}(cat_take_drop i p) (drop_nth x lt_ip) -cat_rcons nth_index. Qed. Variant splitl x1 x : seq T -> Type := Splitl p1 p2 of last x1 p1 = x : splitl x1 x (p1 ++ p2). Lemma splitPl x1 p x : x \in x1 :: p -> splitl x1 x p. Proof. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) x1 p))), splitl x1 x p *) rewrite inE; case: eqP => [->| _ /splitP[]]; first by rewrite -(cat0s p). (* Goal: forall p1 p2 : list (Equality.sort T), splitl x1 x (@cat (Equality.sort T) (@rcons (Equality.sort T) p1 x) p2) *) by split; apply: last_rcons. Qed. Variant splitr x : seq T -> Type := Splitr p1 p2 : splitr x (p1 ++ x :: p2). Lemma splitPr p x : x \in p -> splitr x p. Proof. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p)), splitr x p *) by case/splitP=> p1 p2; rewrite cat_rcons. Qed. Fixpoint next_at x y0 y p := match p with | [::] => if x == y then y0 else x | y' :: p' => if x == y then y' else next_at x y0 y' p' end. Definition next p x := if p is y :: p' then next_at x y y p' else x. Fixpoint prev_at x y0 y p := match p with | [::] => if x == y0 then y else x | y' :: p' => if x == y' then y else prev_at x y0 y' p' end. Definition prev p x := if p is y :: p' then prev_at x y y p' else x. Lemma next_nth p x : next p x = if x \in p then if p is y :: p' then nth y p' (index x p) else x else x. Proof. (* Goal: @eq (Equality.sort T) (next p x) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p) then match p with | nil => x | cons y p' => @nth (Equality.sort T) y p' (@index T x p) end else x) *) case: p => //= y0 p. (* Goal: @eq (Equality.sort T) (next_at x y0 y0 p) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) y0 p)) then @nth (Equality.sort T) y0 p (if @eq_op T y0 x then O else S (@index T x p)) else x) *) elim: p {2 3 5}y0 => [|y' p IHp] y /=; rewrite (eq_sym y) inE; by case: ifP => // _; apply: IHp. Qed. Lemma prev_nth p x : prev p x = if x \in p then if p is y :: p' then nth y p (index x p') else x else x. Proof. (* Goal: @eq (Equality.sort T) (prev p x) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p) then match p with | nil => x | cons y p' => @nth (Equality.sort T) y p (@index T x p') end else x) *) case: p => //= y0 p; rewrite inE orbC. (* Goal: @eq (Equality.sort T) (prev_at x y0 y0 p) (if orb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p)) (@eq_op T x y0) then @nth (Equality.sort T) y0 (@cons (Equality.sort T) y0 p) (@index T x p) else x) *) elim: p {2 5}y0 => [|y' p IHp] y; rewrite /= ?inE // (eq_sym y'). (* Goal: @eq (Equality.sort T) (if @eq_op T x y' then y else prev_at x y0 y' p) (if orb (orb (@eq_op T x y') (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p))) (@eq_op T x y0) then @nth (Equality.sort T) y0 (@cons (Equality.sort T) y (@cons (Equality.sort T) y' p)) (if @eq_op T x y' then O else S (@index T x p)) else x) *) by case: ifP => // _; apply: IHp. Qed. Lemma mem_next p x : (next p x \in p) = (x \in p). Proof. (* Goal: @eq bool (@in_mem (Equality.sort T) (next p x) (@mem (Equality.sort T) (seq_predType T) p)) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p)) *) rewrite next_nth; case p_x: (x \in p) => //. (* Goal: @eq bool (@in_mem (Equality.sort T) match p with | nil => x | cons y p' => @nth (Equality.sort T) y p' (@index T x p) end (@mem (Equality.sort T) (seq_predType T) p)) true *) case: p (index x p) p_x => [|y0 p'] //= i _; rewrite inE. (* Goal: @eq bool (orb (@eq_op T (@nth (Equality.sort T) y0 p' i) y0) (@in_mem (Equality.sort T) (@nth (Equality.sort T) y0 p' i) (@mem (Equality.sort T) (seq_predType T) p'))) true *) have [lt_ip | ge_ip] := ltnP i (size p'); first by rewrite orbC mem_nth. (* Goal: @eq bool (orb (@eq_op T (@nth (Equality.sort T) y0 p' i) y0) (@in_mem (Equality.sort T) (@nth (Equality.sort T) y0 p' i) (@mem (Equality.sort T) (seq_predType T) p'))) true *) by rewrite nth_default ?eqxx. Qed. Lemma mem_prev p x : (prev p x \in p) = (x \in p). Proof. (* Goal: @eq bool (@in_mem (Equality.sort T) (prev p x) (@mem (Equality.sort T) (seq_predType T) p)) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p)) *) rewrite prev_nth; case p_x: (x \in p) => //; case: p => [|y0 p] // in p_x *. by apply mem_nth; rewrite /= ltnS index_size. Qed. Qed. Definition ucycleb p := cycle e p && uniq p. Definition ucycle p : Prop := cycle e p && uniq p. Lemma ucycle_cycle p : ucycle p -> cycle e p. Proof. (* Goal: forall _ : ucycle p, is_true (@cycle (Equality.sort T) e p) *) by case/andP. Qed. Lemma ucycle_uniq p : ucycle p -> uniq p. Proof. (* Goal: forall _ : ucycle p, is_true (@uniq T p) *) by case/andP. Qed. Lemma next_cycle p x : cycle e p -> x \in p -> e x (next p x). Proof. (* Goal: forall (_ : is_true (@cycle (Equality.sort T) e p)) (_ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p))), is_true (e x (next p x)) *) case: p => //= y0 p; elim: p {1 3 5}y0 => [|z p IHp] y /=; rewrite inE. (* Goal: forall (_ : is_true (andb (e y z) (@path (Equality.sort T) e z (@rcons (Equality.sort T) p y0)))) (_ : is_true (orb (@eq_op T x y) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) z p))))), is_true (e x (if @eq_op T x y then z else next_at x y0 z p)) *) (* Goal: forall (_ : is_true (andb (e y y0) true)) (_ : is_true (@eq_op T x y)), is_true (e x (if @eq_op T x y then y0 else x)) *) by rewrite andbT; case: (x =P y) => // ->. (* Goal: forall (_ : is_true (andb (e y z) (@path (Equality.sort T) e z (@rcons (Equality.sort T) p y0)))) (_ : is_true (orb (@eq_op T x y) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) z p))))), is_true (e x (if @eq_op T x y then z else next_at x y0 z p)) *) by case/andP=> eyz /IHp; case: (x =P y) => // ->. Qed. Lemma prev_cycle p x : cycle e p -> x \in p -> e (prev p x) x. Proof. (* Goal: forall (_ : is_true (@cycle (Equality.sort T) e p)) (_ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p))), is_true (e (prev p x) x) *) case: p => //= y0 p; rewrite inE orbC. (* Goal: forall (_ : is_true (@path (Equality.sort T) e y0 (@rcons (Equality.sort T) p y0))) (_ : is_true (orb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p)) (@eq_op T x y0))), is_true (e (prev_at x y0 y0 p) x) *) elim: p {1 5}y0 => [|z p IHp] y /=; rewrite ?inE. (* Goal: forall (_ : is_true (andb (e y z) (@path (Equality.sort T) e z (@rcons (Equality.sort T) p y0)))) (_ : is_true (orb (orb (@eq_op T x z) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p))) (@eq_op T x y0))), is_true (e (if @eq_op T x z then y else prev_at x y0 z p) x) *) (* Goal: forall (_ : is_true (andb (e y y0) true)) (_ : is_true (@eq_op T x y0)), is_true (e (if @eq_op T x y0 then y else x) x) *) by rewrite andbT; case: (x =P y0) => // ->. (* Goal: forall (_ : is_true (andb (e y z) (@path (Equality.sort T) e z (@rcons (Equality.sort T) p y0)))) (_ : is_true (orb (orb (@eq_op T x z) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p))) (@eq_op T x y0))), is_true (e (if @eq_op T x z then y else prev_at x y0 z p) x) *) by case/andP=> eyz /IHp; case: (x =P z) => // ->. Qed. Lemma rot_ucycle p : ucycle (rot n0 p) = ucycle p. Proof. (* Goal: @eq Prop (ucycle (@rot (Equality.sort T) n0 p)) (ucycle p) *) by rewrite /ucycle rot_uniq rot_cycle. Qed. Lemma rotr_ucycle p : ucycle (rotr n0 p) = ucycle p. Proof. (* Goal: @eq Prop (ucycle (@rotr (Equality.sort T) n0 p)) (ucycle p) *) by rewrite /ucycle rotr_uniq rotr_cycle. Qed. Definition mem2 p x y := y \in drop (index x p) p. Lemma mem2l p x y : mem2 p x y -> x \in p. Proof. (* Goal: forall _ : is_true (mem2 p x y), is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p)) *) by rewrite /mem2 -!index_mem size_drop ltn_subRL; apply/leq_ltn_trans/leq_addr. Qed. Lemma mem2lf {p x y} : x \notin p -> mem2 p x y = false. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p))), @eq bool (mem2 p x y) false *) exact/contraNF/mem2l. Qed. Lemma mem2r p x y : mem2 p x y -> y \in p. Proof. (* Goal: forall _ : is_true (mem2 p x y), is_true (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) p)) *) by rewrite -[in y \in p](cat_take_drop (index x p) p) mem_cat orbC /mem2 => ->. Qed. Lemma mem2rf {p x y} : y \notin p -> mem2 p x y = false. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) p))), @eq bool (mem2 p x y) false *) exact/contraNF/mem2r. Qed. Lemma mem2_cat p1 p2 x y : mem2 (p1 ++ p2) x y = mem2 p1 x y || mem2 p2 x y || (x \in p1) && (y \in p2). Proof. (* Goal: @eq bool (mem2 (@cat (Equality.sort T) p1 p2) x y) (orb (orb (mem2 p1 x y) (mem2 p2 x y)) (andb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p1)) (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) p2)))) *) rewrite [LHS]/mem2 index_cat fun_if if_arg !drop_cat addKn. (* Goal: @eq bool (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p1) then if leq (S (@index T x p1)) (@size (Equality.sort T) p1) then @cat (Equality.sort T) (@drop (Equality.sort T) (@index T x p1) p1) p2 else @drop (Equality.sort T) (subn (@index T x p1) (@size (Equality.sort T) p1)) p2 else if leq (S (addn (@size (Equality.sort T) p1) (@index T x p2))) (@size (Equality.sort T) p1) then @cat (Equality.sort T) (@drop (Equality.sort T) (addn (@size (Equality.sort T) p1) (@index T x p2)) p1) p2 else @drop (Equality.sort T) (@index T x p2) p2))) (orb (orb (mem2 p1 x y) (mem2 p2 x y)) (andb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p1)) (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) p2)))) *) case: ifPn => [p1x | /mem2lf->]; last by rewrite ltnNge leq_addr orbF. (* Goal: @eq bool (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) (if leq (S (@index T x p1)) (@size (Equality.sort T) p1) then @cat (Equality.sort T) (@drop (Equality.sort T) (@index T x p1) p1) p2 else @drop (Equality.sort T) (subn (@index T x p1) (@size (Equality.sort T) p1)) p2))) (orb (orb (mem2 p1 x y) (mem2 p2 x y)) (andb true (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) p2)))) *) by rewrite index_mem p1x mem_cat -orbA (orb_idl (@mem2r _ _ _)). Qed. Lemma mem2_splice p1 p3 x y p2 : mem2 (p1 ++ p3) x y -> mem2 (p1 ++ p2 ++ p3) x y. Proof. (* Goal: forall _ : is_true (mem2 (@cat (Equality.sort T) p1 p3) x y), is_true (mem2 (@cat (Equality.sort T) p1 (@cat (Equality.sort T) p2 p3)) x y) *) by rewrite !mem2_cat mem_cat andb_orr orbC => /or3P[]->; rewrite ?orbT. Qed. Lemma mem2_splice1 p1 p3 x y z : mem2 (p1 ++ p3) x y -> mem2 (p1 ++ z :: p3) x y. Proof. (* Goal: forall _ : is_true (mem2 (@cat (Equality.sort T) p1 p3) x y), is_true (mem2 (@cat (Equality.sort T) p1 (@cons (Equality.sort T) z p3)) x y) *) exact: mem2_splice [::z]. Qed. Lemma mem2_cons x p y z : mem2 (x :: p) y z = (if x == y then z \in x :: p else mem2 p y z). Proof. (* Goal: @eq bool (mem2 (@cons (Equality.sort T) x p) y z) (if @eq_op T x y then @in_mem (Equality.sort T) z (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) x p)) else mem2 p y z) *) by rewrite [LHS]/mem2 /=; case: ifP. Qed. Lemma mem2_seq1 x y z : mem2 [:: x] y z = (y == x) && (z == x). Proof. (* Goal: @eq bool (mem2 (@cons (Equality.sort T) x (@nil (Equality.sort T))) y z) (andb (@eq_op T y x) (@eq_op T z x)) *) by rewrite mem2_cons eq_sym inE. Qed. Lemma mem2_last y0 p x : mem2 p x (last y0 p) = (x \in p). Proof. (* Goal: @eq bool (mem2 p x (@last (Equality.sort T) y0 p)) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p)) *) apply/idP/idP; first exact: mem2l; rewrite -index_mem /mem2 => p_x. (* Goal: is_true (@in_mem (Equality.sort T) (@last (Equality.sort T) y0 p) (@mem (Equality.sort T) (seq_predType T) (@drop (Equality.sort T) (@index T x p) p))) *) by rewrite -nth_last -(subnKC p_x) -nth_drop mem_nth // size_drop subnSK. Qed. Lemma mem2l_cat {p1 p2 x} : x \notin p1 -> mem2 (p1 ++ p2) x =1 mem2 p2 x. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p1))), @eqfun bool (Equality.sort T) (mem2 (@cat (Equality.sort T) p1 p2) x) (mem2 p2 x) *) by move=> p1'x y; rewrite mem2_cat (negPf p1'x) mem2lf ?orbF. Qed. Lemma mem2r_cat {p1 p2 x y} : y \notin p2 -> mem2 (p1 ++ p2) x y = mem2 p1 x y. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) p2))), @eq bool (mem2 (@cat (Equality.sort T) p1 p2) x y) (mem2 p1 x y) *) by move=> p2'y; rewrite mem2_cat (negPf p2'y) -orbA orbC andbF mem2rf. Qed. Lemma mem2lr_splice {p1 p2 p3 x y} : x \notin p2 -> y \notin p2 -> mem2 (p1 ++ p2 ++ p3) x y = mem2 (p1 ++ p3) x y. Proof. (* Goal: forall (_ : is_true (negb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p2)))) (_ : is_true (negb (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) p2)))), @eq bool (mem2 (@cat (Equality.sort T) p1 (@cat (Equality.sort T) p2 p3)) x y) (mem2 (@cat (Equality.sort T) p1 p3) x y) *) move=> p2'x p2'y; rewrite catA !mem2_cat !mem_cat. (* Goal: @eq bool (orb (orb (orb (orb (mem2 p1 x y) (mem2 p2 x y)) (andb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p1)) (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) p2)))) (mem2 p3 x y)) (andb (orb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p1)) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p2))) (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) p3)))) (orb (orb (mem2 p1 x y) (mem2 p3 x y)) (andb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p1)) (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) p3)))) *) by rewrite (negPf p2'x) (negPf p2'y) (mem2lf p2'x) andbF !orbF. Qed. Variant split2r x y : seq T -> Type := Split2r p1 p2 of y \in x :: p2 : split2r x y (p1 ++ x :: p2). Lemma splitP2r p x y : mem2 p x y -> split2r x y p. Proof. (* Goal: forall _ : is_true (mem2 p x y), split2r x y p *) move=> pxy; have px := mem2l pxy. (* Goal: split2r x y p *) have:= pxy; rewrite /mem2 (drop_nth x) ?index_mem ?nth_index //. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) x (@drop (Equality.sort T) (S (@index T x p)) p)))), split2r x y p *) by case/splitP: px => p1 p2; rewrite cat_rcons. Qed. Fixpoint shorten x p := if p is y :: p' then if x \in p then shorten x p' else y :: shorten y p' else [::]. Variant shorten_spec x p : T -> seq T -> Type := ShortenSpec p' of path e x p' & uniq (x :: p') & subpred (mem p') (mem p) : shorten_spec x p (last x p') p'. Lemma shortenP x p : path e x p -> shorten_spec x p (last x p) (shorten x p). Proof. (* Goal: forall _ : is_true (@path (Equality.sort T) e x p), shorten_spec x p (@last (Equality.sort T) x p) (shorten x p) *) move=> e_p; have: x \in x :: p by apply: mem_head. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) x p))), shorten_spec x p (@last (Equality.sort T) x p) (shorten x p) *) elim: p x {1 3 5}x e_p => [|y2 p IHp] x y1. (* Goal: forall (_ : is_true (@path (Equality.sort T) e y1 (@cons (Equality.sort T) y2 p))) (_ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) y1 (@cons (Equality.sort T) y2 p))))), shorten_spec x (@cons (Equality.sort T) y2 p) (@last (Equality.sort T) y1 (@cons (Equality.sort T) y2 p)) (shorten x (@cons (Equality.sort T) y2 p)) *) (* Goal: forall (_ : is_true (@path (Equality.sort T) e y1 (@nil (Equality.sort T)))) (_ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) y1 (@nil (Equality.sort T)))))), shorten_spec x (@nil (Equality.sort T)) (@last (Equality.sort T) y1 (@nil (Equality.sort T))) (shorten x (@nil (Equality.sort T))) *) by rewrite mem_seq1 => _ /eqP->. (* Goal: forall (_ : is_true (@path (Equality.sort T) e y1 (@cons (Equality.sort T) y2 p))) (_ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) y1 (@cons (Equality.sort T) y2 p))))), shorten_spec x (@cons (Equality.sort T) y2 p) (@last (Equality.sort T) y1 (@cons (Equality.sort T) y2 p)) (shorten x (@cons (Equality.sort T) y2 p)) *) rewrite inE orbC /= => /andP[ey12 /IHp {IHp}IHp]. (* Goal: forall _ : is_true (orb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) y2 p))) (@eq_op T x y1)), shorten_spec x (@cons (Equality.sort T) y2 p) (@last (Equality.sort T) y2 p) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) y2 p)) then shorten x p else @cons (Equality.sort T) y2 (shorten y2 p)) *) case: ifPn => [y2p_x _ | not_y2p_x /eqP def_x]. (* Goal: shorten_spec x (@cons (Equality.sort T) y2 p) (@last (Equality.sort T) y2 p) (@cons (Equality.sort T) y2 (shorten y2 p)) *) (* Goal: shorten_spec x (@cons (Equality.sort T) y2 p) (@last (Equality.sort T) y2 p) (shorten x p) *) have [p' e_p' Up' p'p] := IHp _ y2p_x. (* Goal: shorten_spec x (@cons (Equality.sort T) y2 p) (@last (Equality.sort T) y2 p) (@cons (Equality.sort T) y2 (shorten y2 p)) *) (* Goal: shorten_spec x (@cons (Equality.sort T) y2 p) (@last (Equality.sort T) x p') p' *) by split=> // y /p'p; apply: predU1r. (* Goal: shorten_spec x (@cons (Equality.sort T) y2 p) (@last (Equality.sort T) y2 p) (@cons (Equality.sort T) y2 (shorten y2 p)) *) have [p' e_p' Up' p'p] := IHp y2 (mem_head y2 p). (* Goal: shorten_spec x (@cons (Equality.sort T) y2 p) (@last (Equality.sort T) y2 p') (@cons (Equality.sort T) y2 p') *) have{p'p} p'p z: z \in y2 :: p' -> z \in y2 :: p. (* Goal: shorten_spec x (@cons (Equality.sort T) y2 p) (@last (Equality.sort T) y2 p') (@cons (Equality.sort T) y2 p') *) (* Goal: forall _ : is_true (@in_mem (Equality.sort T) z (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) y2 p'))), is_true (@in_mem (Equality.sort T) z (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) y2 p))) *) by rewrite !inE; case: (z == y2) => // /p'p. (* Goal: shorten_spec x (@cons (Equality.sort T) y2 p) (@last (Equality.sort T) y2 p') (@cons (Equality.sort T) y2 p') *) rewrite -(last_cons y1) def_x; split=> //=; first by rewrite ey12. (* Goal: is_true (andb (negb (@in_mem (Equality.sort T) y1 (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) y2 p')))) (andb (negb (@in_mem (Equality.sort T) y2 (@mem (Equality.sort T) (seq_predType T) p'))) (@uniq T p'))) *) by rewrite (contra (p'p y1)) -?def_x. Qed. End EqPath. Section SortSeq. Variable T : eqType. Variable leT : rel T. Definition sorted s := if s is x :: s' then path leT x s' else true. Lemma path_sorted x s : path leT x s -> sorted s. Proof. (* Goal: forall _ : is_true (@path (Equality.sort T) leT x s), is_true (sorted s) *) by case: s => //= y s /andP[]. Qed. Lemma path_min_sorted x s : {in s, forall y, leT x y} -> path leT x s = sorted s. Proof. (* Goal: forall _ : @prop_in1 (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s) (fun y : Equality.sort T => is_true (leT x y)) (inPhantom (forall y : Equality.sort T, is_true (leT x y))), @eq bool (@path (Equality.sort T) leT x s) (sorted s) *) by case: s => //= y s -> //; apply: mem_head. Qed. Section Transitive. Hypothesis leT_tr : transitive leT. Lemma subseq_order_path x s1 s2 : subseq s1 s2 -> path leT x s2 -> path leT x s1. Proof. (* Goal: forall (_ : is_true (@subseq T s1 s2)) (_ : is_true (@path (Equality.sort T) leT x s2)), is_true (@path (Equality.sort T) leT x s1) *) elim: s2 x s1 => [|y s2 IHs] x [|z s1] //= {IHs}/(IHs y). (* Goal: forall (_ : forall _ : is_true (@path (Equality.sort T) leT y s2), is_true (@path (Equality.sort T) leT y (if @eq_op T z y then s1 else @cons (Equality.sort T) z s1))) (_ : is_true (andb (leT x y) (@path (Equality.sort T) leT y s2))), is_true (andb (leT x z) (@path (Equality.sort T) leT z s1)) *) case: eqP => [-> | _] IHs /andP[] => [-> // | leTxy /IHs /=]. (* Goal: forall _ : is_true (andb (leT y z) (@path (Equality.sort T) leT z s1)), is_true (andb (leT x z) (@path (Equality.sort T) leT z s1)) *) by case/andP=> /(leT_tr leTxy)->. Qed. Lemma order_path_min x s : path leT x s -> all (leT x) s. Proof. (* Goal: forall _ : is_true (@path (Equality.sort T) leT x s), is_true (@all (Equality.sort T) (leT x) s) *) move/subseq_order_path=> le_x_s; apply/allP=> y. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) s)), is_true (leT x y) *) by rewrite -sub1seq => /le_x_s/andP[]. Qed. Lemma subseq_sorted s1 s2 : subseq s1 s2 -> sorted s2 -> sorted s1. Proof. (* Goal: forall (_ : is_true (@subseq T s1 s2)) (_ : is_true (sorted s2)), is_true (sorted s1) *) case: s1 s2 => [|x1 s1] [|x2 s2] //= sub_s12 /(subseq_order_path sub_s12). (* Goal: forall _ : is_true (@path (Equality.sort T) leT x2 (if @eq_op T x1 x2 then s1 else @cons (Equality.sort T) x1 s1)), is_true (@path (Equality.sort T) leT x1 s1) *) by case: eqP => [-> | _ /andP[]]. Qed. Lemma sorted_filter a s : sorted s -> sorted (filter a s). Proof. (* Goal: forall _ : is_true (sorted s), is_true (sorted (@filter (Equality.sort T) a s)) *) exact: subseq_sorted (filter_subseq a s). Qed. Lemma sorted_uniq : irreflexive leT -> forall s, sorted s -> uniq s. Proof. (* Goal: forall (_ : @irreflexive (Equality.sort T) leT) (s : list (Equality.sort T)) (_ : is_true (sorted s)), is_true (@uniq T s) *) move=> leT_irr; elim=> //= x s IHs s_ord. (* Goal: is_true (andb (negb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) s))) (@uniq T s)) *) rewrite (IHs (path_sorted s_ord)) andbT; apply/negP=> s_x. (* Goal: False *) by case/allPn: (order_path_min s_ord); exists x; rewrite // leT_irr. Qed. Lemma eq_sorted : antisymmetric leT -> forall s1 s2, sorted s1 -> sorted s2 -> perm_eq s1 s2 -> s1 = s2. Proof. (* Goal: forall (_ : @antisymmetric (Equality.sort T) leT) (s1 s2 : list (Equality.sort T)) (_ : is_true (sorted s1)) (_ : is_true (sorted s2)) (_ : is_true (@perm_eq T s1 s2)), @eq (list (Equality.sort T)) s1 s2 *) move=> leT_asym; elim=> [|x1 s1 IHs1] s2 //= ord_s1 ord_s2 eq_s12. (* Goal: @eq (list (Equality.sort T)) (@cons (Equality.sort T) x1 s1) s2 *) (* Goal: @eq (list (Equality.sort T)) (@nil (Equality.sort T)) s2 *) by case: {+}s2 (perm_eq_size eq_s12). (* Goal: @eq (list (Equality.sort T)) (@cons (Equality.sort T) x1 s1) s2 *) have s2_x1: x1 \in s2 by rewrite -(perm_eq_mem eq_s12) mem_head. (* Goal: @eq (list (Equality.sort T)) (@cons (Equality.sort T) x1 s1) s2 *) case: s2 s2_x1 eq_s12 ord_s2 => //= x2 s2; rewrite in_cons. (* Goal: forall (_ : is_true (orb (@eq_op T x1 x2) (@in_mem (Equality.sort T) x1 (@mem (Equality.sort T) (seq_predType T) s2)))) (_ : is_true (@perm_eq T (@cons (Equality.sort T) x1 s1) (@cons (Equality.sort T) x2 s2))) (_ : is_true (@path (Equality.sort T) leT x2 s2)), @eq (list (Equality.sort T)) (@cons (Equality.sort T) x1 s1) (@cons (Equality.sort T) x2 s2) *) case: eqP => [<- _| ne_x12 /= s2_x1] eq_s12 ord_s2. (* Goal: @eq (list (Equality.sort T)) (@cons (Equality.sort T) x1 s1) (@cons (Equality.sort T) x2 s2) *) (* Goal: @eq (list (Equality.sort T)) (@cons (Equality.sort T) x1 s1) (@cons (Equality.sort T) x1 s2) *) by rewrite {IHs1}(IHs1 s2) ?(@path_sorted x1) // -(perm_cons x1). (* Goal: @eq (list (Equality.sort T)) (@cons (Equality.sort T) x1 s1) (@cons (Equality.sort T) x2 s2) *) case: (ne_x12); apply: leT_asym; rewrite (allP (order_path_min ord_s2)) //. (* Goal: is_true (andb (leT x1 x2) true) *) have: x2 \in x1 :: s1 by rewrite (perm_eq_mem eq_s12) mem_head. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) x2 (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) x1 s1))), is_true (andb (leT x1 x2) true) *) case/predU1P=> [eq_x12 | s1_x2]; first by case ne_x12. (* Goal: is_true (andb (leT x1 x2) true) *) by rewrite (allP (order_path_min ord_s1)). Qed. Lemma eq_sorted_irr : irreflexive leT -> forall s1 s2, sorted s1 -> sorted s2 -> s1 =i s2 -> s1 = s2. Proof. (* Goal: forall (_ : @irreflexive (Equality.sort T) leT) (s1 s2 : list (Equality.sort T)) (_ : is_true (sorted s1)) (_ : is_true (sorted s2)) (_ : @eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s1) (@mem (Equality.sort T) (seq_predType T) s2)), @eq (list (Equality.sort T)) s1 s2 *) move=> leT_irr s1 s2 s1_sort s2_sort eq_s12. (* Goal: @eq (list (Equality.sort T)) s1 s2 *) have: antisymmetric leT. (* Goal: forall _ : @antisymmetric (Equality.sort T) leT, @eq (list (Equality.sort T)) s1 s2 *) (* Goal: @antisymmetric (Equality.sort T) leT *) by move=> m n /andP[? ltnm]; case/idP: (leT_irr m); apply: leT_tr ltnm. (* Goal: forall _ : @antisymmetric (Equality.sort T) leT, @eq (list (Equality.sort T)) s1 s2 *) by move/eq_sorted; apply=> //; apply: uniq_perm_eq => //; apply: sorted_uniq. Qed. End Transitive. Hypothesis leT_total : total leT. Fixpoint merge s1 := if s1 is x1 :: s1' then let fix merge_s1 s2 := if s2 is x2 :: s2' then if leT x2 x1 then x2 :: merge_s1 s2' else x1 :: merge s1' s2 else s1 in merge_s1 else id. Lemma merge_path x s1 s2 : path leT x s1 -> path leT x s2 -> path leT x (merge s1 s2). Proof. (* Goal: forall (_ : is_true (@path (Equality.sort T) leT x s1)) (_ : is_true (@path (Equality.sort T) leT x s2)), is_true (@path (Equality.sort T) leT x (merge s1 s2)) *) elim: s1 s2 x => //= x1 s1 IHs1. (* Goal: forall (s2 : list (Equality.sort T)) (x : Equality.sort T) (_ : is_true (andb (leT x x1) (@path (Equality.sort T) leT x1 s1))) (_ : is_true (@path (Equality.sort T) leT x s2)), is_true (@path (Equality.sort T) leT x ((fix merge_s1 (s0 : list (Equality.sort T)) : list (Equality.sort T) := match s0 with | nil => @cons (Equality.sort T) x1 s1 | cons x2 s2' => if leT x2 x1 then @cons (Equality.sort T) x2 (merge_s1 s2') else @cons (Equality.sort T) x1 (merge s1 s0) end) s2)) *) elim=> //= x2 s2 IHs2 x /andP[le_x_x1 ord_s1] /andP[le_x_x2 ord_s2]. (* Goal: is_true (@path (Equality.sort T) leT x (if leT x2 x1 then @cons (Equality.sort T) x2 ((fix merge_s1 (s2 : list (Equality.sort T)) : list (Equality.sort T) := match s2 with | nil => @cons (Equality.sort T) x1 s1 | cons x2 s2' => if leT x2 x1 then @cons (Equality.sort T) x2 (merge_s1 s2') else @cons (Equality.sort T) x1 (merge s1 s2) end) s2) else @cons (Equality.sort T) x1 (merge s1 (@cons (Equality.sort T) x2 s2)))) *) case: ifP => le_x21 /=; first by rewrite le_x_x2 {}IHs2 // le_x21. (* Goal: is_true (andb (leT x x1) (@path (Equality.sort T) leT x1 (merge s1 (@cons (Equality.sort T) x2 s2)))) *) by rewrite le_x_x1 IHs1 //=; have:= leT_total x2 x1; rewrite le_x21 /= => ->. Qed. Lemma merge_sorted s1 s2 : sorted s1 -> sorted s2 -> sorted (merge s1 s2). Proof. (* Goal: forall (_ : is_true (sorted s1)) (_ : is_true (sorted s2)), is_true (sorted (merge s1 s2)) *) case: s1 s2 => [|x1 s1] [|x2 s2] //= ord_s1 ord_s2. (* Goal: is_true (sorted (if leT x2 x1 then @cons (Equality.sort T) x2 ((fix merge_s1 (s2 : list (Equality.sort T)) : list (Equality.sort T) := match s2 with | nil => @cons (Equality.sort T) x1 s1 | cons x2 s2' => if leT x2 x1 then @cons (Equality.sort T) x2 (merge_s1 s2') else @cons (Equality.sort T) x1 (merge s1 s2) end) s2) else @cons (Equality.sort T) x1 (merge s1 (@cons (Equality.sort T) x2 s2)))) *) case: ifP => le_x21 /=. (* Goal: is_true (@path (Equality.sort T) leT x1 (merge s1 (@cons (Equality.sort T) x2 s2))) *) (* Goal: is_true (@path (Equality.sort T) leT x2 ((fix merge_s1 (s2 : list (Equality.sort T)) : list (Equality.sort T) := match s2 with | nil => @cons (Equality.sort T) x1 s1 | cons x2 s2' => if leT x2 x1 then @cons (Equality.sort T) x2 (merge_s1 s2') else @cons (Equality.sort T) x1 (merge s1 s2) end) s2)) *) by apply: (@merge_path x2 (x1 :: s1)) => //=; rewrite le_x21. (* Goal: is_true (@path (Equality.sort T) leT x1 (merge s1 (@cons (Equality.sort T) x2 s2))) *) by apply: merge_path => //=; have:= leT_total x2 x1; rewrite le_x21 /= => ->. Qed. Lemma perm_merge s1 s2 : perm_eql (merge s1 s2) (s1 ++ s2). Proof. (* Goal: @eqfun bool (list (Equality.sort T)) (@perm_eq T (merge s1 s2)) (@perm_eq T (@cat (Equality.sort T) s1 s2)) *) apply/perm_eqlP; rewrite perm_eq_sym; elim: s1 s2 => //= x1 s1 IHs1. (* Goal: forall s2 : list (Equality.sort T), is_true (@perm_eq T (@cons (Equality.sort T) x1 (@cat (Equality.sort T) s1 s2)) ((fix merge_s1 (s0 : list (Equality.sort T)) : list (Equality.sort T) := match s0 with | nil => @cons (Equality.sort T) x1 s1 | cons x2 s2' => if leT x2 x1 then @cons (Equality.sort T) x2 (merge_s1 s2') else @cons (Equality.sort T) x1 (merge s1 s0) end) s2)) *) elim=> [|x2 s2 IHs2]; rewrite /= ?cats0 //. (* Goal: is_true (@perm_eq T (@cons (Equality.sort T) x1 (@cat (Equality.sort T) s1 (@cons (Equality.sort T) x2 s2))) (if leT x2 x1 then @cons (Equality.sort T) x2 ((fix merge_s1 (s2 : list (Equality.sort T)) : list (Equality.sort T) := match s2 with | nil => @cons (Equality.sort T) x1 s1 | cons x2 s2' => if leT x2 x1 then @cons (Equality.sort T) x2 (merge_s1 s2') else @cons (Equality.sort T) x1 (merge s1 s2) end) s2) else @cons (Equality.sort T) x1 (merge s1 (@cons (Equality.sort T) x2 s2)))) *) case: ifP => _ /=; last by rewrite perm_cons. (* Goal: is_true (@perm_eq T (@cons (Equality.sort T) x1 (@cat (Equality.sort T) s1 (@cons (Equality.sort T) x2 s2))) (@cons (Equality.sort T) x2 ((fix merge_s1 (s2 : list (Equality.sort T)) : list (Equality.sort T) := match s2 with | nil => @cons (Equality.sort T) x1 s1 | cons x2 s2' => if leT x2 x1 then @cons (Equality.sort T) x2 (merge_s1 s2') else @cons (Equality.sort T) x1 (merge s1 s2) end) s2))) *) by rewrite (perm_catCA (_ :: _) [::x2]) perm_cons. Qed. Lemma mem_merge s1 s2 : merge s1 s2 =i s1 ++ s2. Proof. (* Goal: @eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) (merge s1 s2)) (@mem (Equality.sort T) (seq_predType T) (@cat (Equality.sort T) s1 s2)) *) by apply: perm_eq_mem; rewrite perm_merge. Qed. Lemma size_merge s1 s2 : size (merge s1 s2) = size (s1 ++ s2). Proof. (* Goal: @eq nat (@size (Equality.sort T) (merge s1 s2)) (@size (Equality.sort T) (@cat (Equality.sort T) s1 s2)) *) by apply: perm_eq_size; rewrite perm_merge. Qed. Lemma merge_uniq s1 s2 : uniq (merge s1 s2) = uniq (s1 ++ s2). Proof. (* Goal: @eq bool (@uniq T (merge s1 s2)) (@uniq T (@cat (Equality.sort T) s1 s2)) *) by apply: perm_eq_uniq; rewrite perm_merge. Qed. Fixpoint merge_sort_push s1 ss := match ss with | [::] :: ss' | [::] as ss' => s1 :: ss' | s2 :: ss' => [::] :: merge_sort_push (merge s1 s2) ss' end. Fixpoint merge_sort_pop s1 ss := if ss is s2 :: ss' then merge_sort_pop (merge s1 s2) ss' else s1. Fixpoint merge_sort_rec ss s := if s is [:: x1, x2 & s'] then let s1 := if leT x1 x2 then [:: x1; x2] else [:: x2; x1] in merge_sort_rec (merge_sort_push s1 ss) s' else merge_sort_pop s ss. Definition sort := merge_sort_rec [::]. Lemma sort_sorted s : sorted (sort s). Proof. (* Goal: is_true (sorted (sort s)) *) rewrite /sort; have allss: all sorted [::] by []. (* Goal: is_true (sorted (merge_sort_rec (@nil (list (Equality.sort T))) s)) *) elim: {s}_.+1 {-2}s [::] allss (ltnSn (size s)) => // n IHn s ss allss. (* Goal: forall _ : is_true (leq (S (@size (Equality.sort T) s)) (S n)), is_true (sorted (merge_sort_rec ss s)) *) have: sorted s -> sorted (merge_sort_pop s ss). (* Goal: forall (_ : forall _ : is_true (sorted s), is_true (sorted (merge_sort_pop s ss))) (_ : is_true (leq (S (@size (Equality.sort T) s)) (S n))), is_true (sorted (merge_sort_rec ss s)) *) (* Goal: forall _ : is_true (sorted s), is_true (sorted (merge_sort_pop s ss)) *) elim: ss allss s => //= s2 ss IHss /andP[ord_s2 ord_ss] s ord_s. (* Goal: forall (_ : forall _ : is_true (sorted s), is_true (sorted (merge_sort_pop s ss))) (_ : is_true (leq (S (@size (Equality.sort T) s)) (S n))), is_true (sorted (merge_sort_rec ss s)) *) (* Goal: is_true (sorted (merge_sort_pop (merge s s2) ss)) *) exact: IHss ord_ss _ (merge_sorted ord_s ord_s2). (* Goal: forall (_ : forall _ : is_true (sorted s), is_true (sorted (merge_sort_pop s ss))) (_ : is_true (leq (S (@size (Equality.sort T) s)) (S n))), is_true (sorted (merge_sort_rec ss s)) *) case: s => [|x1 [|x2 s _]]; try by auto. (* Goal: forall _ : is_true (leq (S (@size (Equality.sort T) (@cons (Equality.sort T) x1 (@cons (Equality.sort T) x2 s)))) (S n)), is_true (sorted (merge_sort_rec ss (@cons (Equality.sort T) x1 (@cons (Equality.sort T) x2 s)))) *) move/ltnW/IHn; apply=> {n IHn s}; set s1 := if _ then _ else _. (* Goal: is_true (@all (list (Equality.sort T)) sorted (merge_sort_push s1 ss)) *) have: sorted s1 by apply: (@merge_sorted [::x2] [::x1]). (* Goal: forall _ : is_true (sorted s1), is_true (@all (list (Equality.sort T)) sorted (merge_sort_push s1 ss)) *) elim: ss {x1 x2}s1 allss => /= [|s2 ss IHss] s1; first by rewrite andbT. (* Goal: forall (_ : is_true (andb (sorted s2) (@all (list (Equality.sort T)) sorted ss))) (_ : is_true (sorted s1)), is_true (@all (list (Equality.sort T)) sorted match s2 with | nil => @cons (list (Equality.sort T)) s1 ss | cons y l => @cons (list (Equality.sort T)) (@nil (Equality.sort T)) (merge_sort_push (merge s1 s2) ss) end) *) case/andP=> ord_s2 ord_ss ord_s1. (* Goal: is_true (@all (list (Equality.sort T)) sorted match s2 with | nil => @cons (list (Equality.sort T)) s1 ss | cons y l => @cons (list (Equality.sort T)) (@nil (Equality.sort T)) (merge_sort_push (merge s1 s2) ss) end) *) by case: {1}s2=> /= [|_ _]; [rewrite ord_s1 | apply: IHss (merge_sorted _ _)]. Qed. Lemma perm_sort s : perm_eql (sort s) s. Lemma mem_sort s : sort s =i s. Proof. (* Goal: @eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) (sort s)) (@mem (Equality.sort T) (seq_predType T) s) *) by apply: perm_eq_mem; rewrite perm_sort. Qed. Lemma size_sort s : size (sort s) = size s. Proof. (* Goal: @eq nat (@size (Equality.sort T) (sort s)) (@size (Equality.sort T) s) *) by apply: perm_eq_size; rewrite perm_sort. Qed. Lemma sort_uniq s : uniq (sort s) = uniq s. Proof. (* Goal: @eq bool (@uniq T (sort s)) (@uniq T s) *) by apply: perm_eq_uniq; rewrite perm_sort. Qed. Lemma perm_sortP : transitive leT -> antisymmetric leT -> forall s1 s2, reflect (sort s1 = sort s2) (perm_eq s1 s2). End SortSeq. Lemma rev_sorted (T : eqType) (leT : rel T) s : sorted leT (rev s) = sorted (fun y x => leT x y) s. Proof. (* Goal: @eq bool (@sorted T leT (@rev (Equality.sort T) s)) (@sorted T (fun y x : Equality.sort T => leT x y) s) *) by case: s => //= x p; rewrite -rev_path lastI rev_rcons. Qed. Lemma ltn_sorted_uniq_leq s : sorted ltn s = uniq s && sorted leq s. Proof. (* Goal: @eq bool (@sorted nat_eqType (@rel_of_simpl_rel nat ltn) s) (andb (@uniq nat_eqType s) (@sorted nat_eqType leq s)) *) case: s => //= n s; elim: s n => //= m s IHs n. (* Goal: @eq bool (andb (leq (S n) m) (@path nat (@rel_of_simpl_rel nat ltn) m s)) (andb (andb (negb (@in_mem nat n (@mem nat (seq_predType nat_eqType) (@cons nat m s)))) (andb (negb (@in_mem nat m (@mem nat (seq_predType nat_eqType) s))) (@uniq nat_eqType s))) (andb (leq n m) (@path nat leq m s))) *) rewrite inE ltn_neqAle negb_or IHs -!andbA. (* Goal: @eq bool (andb (negb (@eq_op nat_eqType n m)) (andb (leq n m) (andb (negb (@in_mem nat m (@mem nat (seq_predType nat_eqType) s))) (andb (@uniq nat_eqType s) (@path nat leq m s))))) (andb (negb (@eq_op nat_eqType n m)) (andb (negb (@in_mem (Equality.sort nat_eqType) n (@mem (Equality.sort nat_eqType) (seq_predType nat_eqType) s))) (andb (negb (@in_mem nat m (@mem nat (seq_predType nat_eqType) s))) (andb (@uniq nat_eqType s) (andb (leq n m) (@path nat leq m s)))))) *) case sn: (n \in s); last do !bool_congr. (* Goal: @eq bool (andb (negb (@eq_op nat_eqType n m)) (andb (leq n m) (andb (negb (@in_mem nat m (@mem nat (seq_predType nat_eqType) s))) (andb (@uniq nat_eqType s) (@path nat leq m s))))) (andb (negb (@eq_op nat_eqType n m)) (andb (negb true) (andb (negb (@in_mem nat m (@mem nat (seq_predType nat_eqType) s))) (andb (@uniq nat_eqType s) (andb (leq n m) (@path nat leq m s)))))) *) rewrite andbF; apply/and5P=> [[ne_nm lenm _ _ le_ms]]; case/negP: ne_nm. (* Goal: is_true (@eq_op nat_eqType n m) *) by rewrite eqn_leq lenm; apply: (allP (order_path_min leq_trans le_ms)). Qed. Lemma iota_sorted i n : sorted leq (iota i n). Proof. (* Goal: is_true (@sorted nat_eqType leq (iota i n)) *) by elim: n i => // [[|n] //= IHn] i; rewrite IHn leqW. Qed. Lemma iota_ltn_sorted i n : sorted ltn (iota i n). Proof. (* Goal: is_true (@sorted nat_eqType (@rel_of_simpl_rel nat ltn) (iota i n)) *) by rewrite ltn_sorted_uniq_leq iota_sorted iota_uniq. Qed. Notation fpath f := (path (coerced_frel f)). Notation fcycle f := (cycle (coerced_frel f)). Notation ufcycle f := (ucycle (coerced_frel f)). Prenex Implicits path next prev cycle ucycle mem2. Section Trajectory. Variables (T : Type) (f : T -> T). Fixpoint traject x n := if n is n'.+1 then x :: traject (f x) n' else [::]. Lemma trajectS x n : traject x n.+1 = x :: traject (f x) n. Proof. (* Goal: @eq (list T) (traject x (S n)) (@cons T x (traject (f x) n)) *) by []. Qed. Lemma trajectSr x n : traject x n.+1 = rcons (traject x n) (iter n f x). Proof. (* Goal: @eq (list T) (traject x (S n)) (@rcons T (traject x n) (@iter T n f x)) *) by elim: n x => //= n IHn x; rewrite IHn -iterSr. Qed. Lemma last_traject x n : last x (traject (f x) n) = iter n f x. Proof. (* Goal: @eq T (@last T x (traject (f x) n)) (@iter T n f x) *) by case: n => // n; rewrite iterSr trajectSr last_rcons. Qed. Lemma traject_iteri x n : traject x n = iteri n (fun i => rcons^~ (iter i f x)) [::]. Proof. (* Goal: @eq (list T) (traject x n) (@iteri (list T) n (fun (i : nat) (x0 : list T) => @rcons T x0 (@iter T i f x)) (@nil T)) *) by elim: n => //= n <-; rewrite -trajectSr. Qed. Lemma size_traject x n : size (traject x n) = n. Proof. (* Goal: @eq nat (@size T (traject x n)) n *) by elim: n x => //= n IHn x //=; rewrite IHn. Qed. Lemma nth_traject i n : i < n -> forall x, nth x (traject x n) i = iter i f x. Proof. (* Goal: forall (_ : is_true (leq (S i) n)) (x : T), @eq T (@nth T x (traject x n) i) (@iter T i f x) *) elim: n => // n IHn; rewrite ltnS leq_eqVlt => le_i_n x. (* Goal: @eq T (@nth T x (traject x (S n)) i) (@iter T i f x) *) rewrite trajectSr nth_rcons size_traject. (* Goal: @eq T (if leq (S i) n then @nth T x (traject x n) i else if @eq_op nat_eqType i n then @iter T n f x else x) (@iter T i f x) *) by case: ltngtP le_i_n => [? _||->] //; apply: IHn. Qed. End Trajectory. Section EqTrajectory. Variables (T : eqType) (f : T -> T). Lemma eq_fpath f' : f =1 f' -> fpath f =2 fpath f'. Proof. (* Goal: forall _ : @eqfun (Equality.sort T) (Equality.sort T) f f', @eqrel bool (list (Equality.sort T)) (Equality.sort T) (@path (Equality.sort T) (@rel_of_simpl_rel (Equality.sort T) (@frel T f))) (@path (Equality.sort T) (@rel_of_simpl_rel (Equality.sort T) (@frel T f'))) *) by move/eq_frel/eq_path. Qed. Lemma eq_fcycle f' : f =1 f' -> fcycle f =1 fcycle f'. Proof. (* Goal: forall _ : @eqfun (Equality.sort T) (Equality.sort T) f f', @eqfun bool (list (Equality.sort T)) (@cycle (Equality.sort T) (@rel_of_simpl_rel (Equality.sort T) (@frel T f))) (@cycle (Equality.sort T) (@rel_of_simpl_rel (Equality.sort T) (@frel T f'))) *) by move/eq_frel/eq_cycle. Qed. Lemma fpathP x p : reflect (exists n, p = traject f (f x) n) (fpath f x p). Proof. (* Goal: Bool.reflect (@ex nat (fun n : nat => @eq (list (Equality.sort T)) p (@traject (Equality.sort T) f (f x) n))) (@path (Equality.sort T) (@rel_of_simpl_rel (Equality.sort T) (@frel T f)) x p) *) elim: p x => [|y p IHp] x; first by left; exists 0. (* Goal: Bool.reflect (@ex nat (fun n : nat => @eq (list (Equality.sort T)) (@cons (Equality.sort T) y p) (@traject (Equality.sort T) f (f x) n))) (@path (Equality.sort T) (@rel_of_simpl_rel (Equality.sort T) (@frel T f)) x (@cons (Equality.sort T) y p)) *) rewrite /= andbC; case: IHp => [fn_p | not_fn_p]; last first. (* Goal: Bool.reflect (@ex nat (fun n : nat => @eq (list (Equality.sort T)) (@cons (Equality.sort T) y p) (@traject (Equality.sort T) f (f x) n))) (andb true (@eq_op T (f x) y)) *) (* Goal: Bool.reflect (@ex nat (fun n : nat => @eq (list (Equality.sort T)) (@cons (Equality.sort T) y p) (@traject (Equality.sort T) f (f x) n))) (andb false (@eq_op T (f x) y)) *) by right=> [] [[//|n]] [<- fn_p]; case: not_fn_p; exists n. (* Goal: Bool.reflect (@ex nat (fun n : nat => @eq (list (Equality.sort T)) (@cons (Equality.sort T) y p) (@traject (Equality.sort T) f (f x) n))) (andb true (@eq_op T (f x) y)) *) apply: (iffP eqP) => [-> | [[] // _ []//]]. (* Goal: @ex nat (fun n : nat => @eq (list (Equality.sort T)) (@cons (Equality.sort T) y p) (@traject (Equality.sort T) f y n)) *) by have [n ->] := fn_p; exists n.+1. Qed. Lemma fpath_traject x n : fpath f x (traject f (f x) n). Proof. (* Goal: is_true (@path (Equality.sort T) (@rel_of_simpl_rel (Equality.sort T) (@frel T f)) x (@traject (Equality.sort T) f (f x) n)) *) by apply/(fpathP x); exists n. Qed. Definition looping x n := iter n f x \in traject f x n. Lemma loopingP x n : reflect (forall m, iter m f x \in traject f x n) (looping x n). Proof. (* Goal: Bool.reflect (forall m : nat, is_true (@in_mem (Equality.sort T) (@iter (Equality.sort T) m f x) (@mem (Equality.sort T) (seq_predType T) (@traject (Equality.sort T) f x n)))) (looping x n) *) apply: (iffP idP) => loop_n; last exact: loop_n. (* Goal: forall m : nat, is_true (@in_mem (Equality.sort T) (@iter (Equality.sort T) m f x) (@mem (Equality.sort T) (seq_predType T) (@traject (Equality.sort T) f x n))) *) case: n => // n in loop_n *; elim=> [|m /= IHm]; first exact: mem_head. (* Goal: is_true (@in_mem (Equality.sort T) (f (@iter (Equality.sort T) m f x)) (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) x (@traject (Equality.sort T) f (f x) n)))) *) move: (fpath_traject x n) loop_n; rewrite /looping !iterS -last_traject /=. (* Goal: forall (_ : is_true (@path (Equality.sort T) (@rel_of_simpl_rel (Equality.sort T) (@frel T f)) x (@traject (Equality.sort T) f (f x) n))) (_ : is_true (@in_mem (Equality.sort T) (f (@last (Equality.sort T) x (@traject (Equality.sort T) f (f x) n))) (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) x (@traject (Equality.sort T) f (f x) n))))), is_true (@in_mem (Equality.sort T) (f (@iter (Equality.sort T) m f x)) (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) x (@traject (Equality.sort T) f (f x) n)))) *) move: (iter m f x) IHm => y /splitPl[p1 p2 def_y]. (* Goal: forall (_ : is_true (@path (Equality.sort T) (@rel_of_simpl_rel (Equality.sort T) (@frel T f)) x (@cat (Equality.sort T) p1 p2))) (_ : is_true (@in_mem (Equality.sort T) (f (@last (Equality.sort T) x (@cat (Equality.sort T) p1 p2))) (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) x (@cat (Equality.sort T) p1 p2))))), is_true (@in_mem (Equality.sort T) (f y) (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) x (@cat (Equality.sort T) p1 p2)))) *) rewrite cat_path last_cat def_y; case: p2 => // z p2 /and3P[_ /eqP-> _] _. (* Goal: is_true (@in_mem (Equality.sort T) z (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) x (@cat (Equality.sort T) p1 (@cons (Equality.sort T) z p2))))) *) by rewrite inE mem_cat mem_head !orbT. Qed. Lemma trajectP x n y : reflect (exists2 i, i < n & y = iter i f x) (y \in traject f x n). Proof. (* Goal: Bool.reflect (@ex2 nat (fun i : nat => is_true (leq (S i) n)) (fun i : nat => @eq (Equality.sort T) y (@iter (Equality.sort T) i f x))) (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) (@traject (Equality.sort T) f x n))) *) elim: n x => [|n IHn] x /=; first by right; case. (* Goal: Bool.reflect (@ex2 nat (fun i : nat => is_true (leq (S i) (S n))) (fun i : nat => @eq (Equality.sort T) y (@iter (Equality.sort T) i f x))) (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) x (@traject (Equality.sort T) f (f x) n)))) *) rewrite inE; have [-> | /= neq_xy] := eqP; first by left; exists 0. (* Goal: Bool.reflect (@ex2 nat (fun i : nat => is_true (leq (S i) (S n))) (fun i : nat => @eq (Equality.sort T) y (@iter (Equality.sort T) i f x))) (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) (@traject (Equality.sort T) f (f x) n))) *) apply: {IHn}(iffP (IHn _)) => [[i] | [[|i]]] // lt_i_n ->. (* Goal: @ex2 nat (fun i : nat => is_true (leq (S i) n)) (fun i0 : nat => @eq (Equality.sort T) (@iter (Equality.sort T) (S i) f x) (@iter (Equality.sort T) i0 f (f x))) *) (* Goal: @ex2 nat (fun i : nat => is_true (leq (S i) (S n))) (fun i0 : nat => @eq (Equality.sort T) (@iter (Equality.sort T) i f (f x)) (@iter (Equality.sort T) i0 f x)) *) by exists i.+1; rewrite ?iterSr. (* Goal: @ex2 nat (fun i : nat => is_true (leq (S i) n)) (fun i0 : nat => @eq (Equality.sort T) (@iter (Equality.sort T) (S i) f x) (@iter (Equality.sort T) i0 f (f x))) *) by exists i; rewrite ?iterSr. Qed. Lemma looping_uniq x n : uniq (traject f x n.+1) = ~~ looping x n. End EqTrajectory. Arguments fpathP {T f x p}. Arguments loopingP {T f x n}. Arguments trajectP {T f x n y}. Prenex Implicits traject. Section UniqCycle. Variables (n0 : nat) (T : eqType) (e : rel T) (p : seq T). Hypothesis Up : uniq p. Lemma prev_next : cancel (next p) (prev p). Proof. (* Goal: @cancel (Equality.sort T) (Equality.sort T) (@next T p) (@prev T p) *) move=> x; rewrite prev_nth mem_next next_nth; case p_x: (x \in p) => //. (* Goal: @eq (Equality.sort T) match p with | nil => match p with | nil => x | cons y p' => @nth (Equality.sort T) y p' (@index T x p) end | cons y p' => @nth (Equality.sort T) y p (@index T match p with | nil => x | cons y0 p'0 => @nth (Equality.sort T) y0 p'0 (@index T x p) end p') end x *) case def_p: p Up p_x => // [y q]; rewrite -{-1}def_p => /= /andP[not_qy Uq] p_x. (* Goal: @eq (Equality.sort T) (@nth (Equality.sort T) y p (@index T (@nth (Equality.sort T) y q (@index T x p)) q)) x *) rewrite -{2}(nth_index y p_x); congr (nth y _ _); set i := index x p. (* Goal: @eq nat (@index T (@nth (Equality.sort T) y q i) q) i *) have: ~~ (size q < i) by rewrite -index_mem -/i def_p leqNgt in p_x. (* Goal: forall _ : is_true (negb (leq (S (@size (Equality.sort T) q)) i)), @eq nat (@index T (@nth (Equality.sort T) y q i) q) i *) case: ltngtP => // [lt_i_q | ->] _; first by rewrite index_uniq. (* Goal: @eq nat (@index T (@nth (Equality.sort T) y q (@size (Equality.sort T) q)) q) (@size (Equality.sort T) q) *) by apply/eqP; rewrite nth_default // eqn_leq index_size leqNgt index_mem. Qed. Lemma next_prev : cancel (prev p) (next p). Proof. (* Goal: @cancel (Equality.sort T) (Equality.sort T) (@prev T p) (@next T p) *) move=> x; rewrite next_nth mem_prev prev_nth; case p_x: (x \in p) => //. (* Goal: @eq (Equality.sort T) match p with | nil => match p with | nil => x | cons y p' => @nth (Equality.sort T) y p (@index T x p') end | cons y p' => @nth (Equality.sort T) y p' (@index T match p with | nil => x | cons y0 p'0 => @nth (Equality.sort T) y0 p (@index T x p'0) end p) end x *) case def_p: p p_x => // [y q]; rewrite -def_p => p_x. (* Goal: @eq (Equality.sort T) (@nth (Equality.sort T) y q (@index T (@nth (Equality.sort T) y p (@index T x q)) p)) x *) rewrite index_uniq //; last by rewrite def_p ltnS index_size. (* Goal: @eq (Equality.sort T) (@nth (Equality.sort T) y q (@index T x q)) x *) case q_x: (x \in q); first exact: nth_index. (* Goal: @eq (Equality.sort T) (@nth (Equality.sort T) y q (@index T x q)) x *) rewrite nth_default; last by rewrite leqNgt index_mem q_x. (* Goal: @eq (Equality.sort T) y x *) by apply/eqP; rewrite def_p inE q_x orbF eq_sym in p_x. Qed. Lemma cycle_next : fcycle (next p) p. Proof. (* Goal: is_true (@cycle (Equality.sort T) (@rel_of_simpl_rel (Equality.sort T) (@frel T (@next T p))) p) *) case def_p: {-2}p Up => [|x q] Uq //. (* Goal: is_true (@cycle (Equality.sort T) (@rel_of_simpl_rel (Equality.sort T) (@frel T (@next T p))) (@cons (Equality.sort T) x q)) *) apply/(pathP x)=> i; rewrite size_rcons => le_i_q. (* Goal: is_true (@rel_of_simpl_rel (Equality.sort T) (@frel T (@next T p)) (@nth (Equality.sort T) x (@cons (Equality.sort T) x (@rcons (Equality.sort T) q x)) i) (@nth (Equality.sort T) x (@rcons (Equality.sort T) q x) i)) *) rewrite -cats1 -cat_cons nth_cat le_i_q /= next_nth {}def_p mem_nth //. (* Goal: is_true (@eq_op T (@nth (Equality.sort T) x q (@index T (@nth (Equality.sort T) x (@cons (Equality.sort T) x q) i) (@cons (Equality.sort T) x q))) (@nth (Equality.sort T) x (@cat (Equality.sort T) q (@cons (Equality.sort T) x (@nil (Equality.sort T)))) i)) *) rewrite index_uniq // nth_cat /= ltn_neqAle andbC -ltnS le_i_q. (* Goal: is_true (@eq_op T (@nth (Equality.sort T) x q i) (if andb true (negb (@eq_op nat_eqType i (@size (Equality.sort T) q))) then @nth (Equality.sort T) x q i else @nth (Equality.sort T) x (@cons (Equality.sort T) x (@nil (Equality.sort T))) (subn i (@size (Equality.sort T) q)))) *) by case: (i =P _) => //= ->; rewrite subnn nth_default. Qed. Lemma cycle_prev : cycle (fun x y => x == prev p y) p. Proof. (* Goal: is_true (@cycle (Equality.sort T) (fun x y : Equality.sort T => @eq_op T x (@prev T p y)) p) *) apply: etrans cycle_next; symmetry; case def_p: p => [|x q] //. (* Goal: @eq bool (@cycle (Equality.sort T) (@rel_of_simpl_rel (Equality.sort T) (@frel T (@next T (@cons (Equality.sort T) x q)))) (@cons (Equality.sort T) x q)) (@cycle (Equality.sort T) (fun x0 y : Equality.sort T => @eq_op T x0 (@prev T (@cons (Equality.sort T) x q) y)) (@cons (Equality.sort T) x q)) *) by apply: eq_path; rewrite -def_p; apply: (can2_eq prev_next next_prev). Qed. Lemma cycle_from_next : (forall x, x \in p -> e x (next p x)) -> cycle e p. Proof. (* Goal: forall _ : forall (x : Equality.sort T) (_ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p))), is_true (e x (@next T p x)), is_true (@cycle (Equality.sort T) e p) *) case: p (next p) cycle_next => //= [x q] n; rewrite -(belast_rcons x q x). (* Goal: forall (_ : is_true (@path (Equality.sort T) (@rel_of_simpl_rel (Equality.sort T) (@frel T n)) x (@rcons (Equality.sort T) q x))) (_ : forall (x0 : Equality.sort T) (_ : is_true (@in_mem (Equality.sort T) x0 (@mem (Equality.sort T) (seq_predType T) (@belast (Equality.sort T) x (@rcons (Equality.sort T) q x))))), is_true (e x0 (n x0))), is_true (@path (Equality.sort T) e x (@rcons (Equality.sort T) q x)) *) move: {q}(rcons q x) => q n_q; move/allP. (* Goal: forall _ : is_true (@all (Equality.sort T) (fun x : Equality.sort T => e x (n x)) (@belast (Equality.sort T) x q)), is_true (@path (Equality.sort T) e x q) *) by elim: q x n_q => //= _ q IHq x /andP[/eqP <- n_q] /andP[-> /IHq->]. Qed. Lemma cycle_from_prev : (forall x, x \in p -> e (prev p x) x) -> cycle e p. Proof. (* Goal: forall _ : forall (x : Equality.sort T) (_ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p))), is_true (e (@prev T p x) x), is_true (@cycle (Equality.sort T) e p) *) move=> e_p; apply: cycle_from_next => x p_x. (* Goal: is_true (e x (@next T p x)) *) by rewrite -{1}[x]prev_next e_p ?mem_next. Qed. Lemma next_rot : next (rot n0 p) =1 next p. Proof. (* Goal: @eqfun (Equality.sort T) (Equality.sort T) (@next T (@rot (Equality.sort T) n0 p)) (@next T p) *) move=> x; have n_p := cycle_next; rewrite -(rot_cycle n0) in n_p. (* Goal: @eq (Equality.sort T) (@next T (@rot (Equality.sort T) n0 p) x) (@next T p x) *) case p_x: (x \in p); last by rewrite !next_nth mem_rot p_x. (* Goal: @eq (Equality.sort T) (@next T (@rot (Equality.sort T) n0 p) x) (@next T p x) *) by rewrite (eqP (next_cycle n_p _)) ?mem_rot. Qed. Lemma prev_rot : prev (rot n0 p) =1 prev p. Proof. (* Goal: @eqfun (Equality.sort T) (Equality.sort T) (@prev T (@rot (Equality.sort T) n0 p)) (@prev T p) *) move=> x; have p_p := cycle_prev; rewrite -(rot_cycle n0) in p_p. (* Goal: @eq (Equality.sort T) (@prev T (@rot (Equality.sort T) n0 p) x) (@prev T p x) *) case p_x: (x \in p); last by rewrite !prev_nth mem_rot p_x. (* Goal: @eq (Equality.sort T) (@prev T (@rot (Equality.sort T) n0 p) x) (@prev T p x) *) by rewrite (eqP (prev_cycle p_p _)) ?mem_rot. Qed. End UniqCycle. Section UniqRotrCycle. Variables (n0 : nat) (T : eqType) (p : seq T). Hypothesis Up : uniq p. Lemma next_rotr : next (rotr n0 p) =1 next p. Proof. exact: next_rot. Qed. Proof. (* Goal: @eqfun (Equality.sort T) (Equality.sort T) (@next T (@rotr (Equality.sort T) n0 p)) (@next T p) *) exact: next_rot. Qed. End UniqRotrCycle. Section UniqCycleRev. Variable T : eqType. Implicit Type p : seq T. Lemma prev_rev p : uniq p -> prev (rev p) =1 next p. Proof. (* Goal: forall _ : is_true (@uniq T p), @eqfun (Equality.sort T) (Equality.sort T) (@prev T (@rev (Equality.sort T) p)) (@next T p) *) move=> Up x; case p_x: (x \in p); last first. (* Goal: @eq (Equality.sort T) (@prev T (@rev (Equality.sort T) p) x) (@next T p x) *) (* Goal: @eq (Equality.sort T) (@prev T (@rev (Equality.sort T) p) x) (@next T p x) *) by rewrite next_nth prev_nth mem_rev p_x. (* Goal: @eq (Equality.sort T) (@prev T (@rev (Equality.sort T) p) x) (@next T p x) *) case/rot_to: p_x (Up) => [i q def_p] Urp; rewrite -rev_uniq in Urp. (* Goal: @eq (Equality.sort T) (@prev T (@rev (Equality.sort T) p) x) (@next T p x) *) rewrite -(prev_rotr i Urp); do 2 rewrite -(prev_rotr 1) ?rotr_uniq //. (* Goal: @eq (Equality.sort T) (@prev T (@rotr (Equality.sort T) (S O) (@rotr (Equality.sort T) (S O) (@rotr (Equality.sort T) i (@rev (Equality.sort T) p)))) x) (@next T p x) *) rewrite -rev_rot -(next_rot i Up) {i p Up Urp}def_p. (* Goal: @eq (Equality.sort T) (@prev T (@rotr (Equality.sort T) (S O) (@rotr (Equality.sort T) (S O) (@rev (Equality.sort T) (@cons (Equality.sort T) x q)))) x) (@next T (@cons (Equality.sort T) x q) x) *) by case: q => // y q; rewrite !rev_cons !(=^~ rcons_cons, rotr1_rcons) /= eqxx. Qed. Lemma next_rev p : uniq p -> next (rev p) =1 prev p. Proof. (* Goal: forall _ : is_true (@uniq T p), @eqfun (Equality.sort T) (Equality.sort T) (@next T (@rev (Equality.sort T) p)) (@prev T p) *) by move=> Up x; rewrite -{2}[p]revK prev_rev // rev_uniq. Qed. End UniqCycleRev. Section MapPath. Variables (T T' : Type) (h : T' -> T) (e : rel T) (e' : rel T'). Definition rel_base (b : pred T) := forall x' y', ~~ b (h x') -> e (h x') (h y') = e' x' y'. Lemma map_path b x' p' (Bb : rel_base b) : ~~ has (preim h b) (belast x' p') -> path e (h x') (map h p') = path e' x' p'. Proof. (* Goal: forall _ : is_true (negb (@has T' (@pred_of_simpl T' (@preim T' T h b)) (@belast T' x' p'))), @eq bool (@path T e (h x') (@map T' T h p')) (@path T' e' x' p') *) by elim: p' x' => [|y' p' IHp'] x' //= /norP[/Bb-> /IHp'->]. Qed. End MapPath. Section MapEqPath. Variables (T T' : eqType) (h : T' -> T) (e : rel T) (e' : rel T'). Hypothesis Ih : injective h. Lemma mem2_map x' y' p' : mem2 (map h p') (h x') (h y') = mem2 p' x' y'. Proof. (* Goal: @eq bool (@mem2 T (@map (Equality.sort T') (Equality.sort T) h p') (h x') (h y')) (@mem2 T' p' x' y') *) by rewrite {1}/mem2 (index_map Ih) -map_drop mem_map. Qed. Lemma next_map p : uniq p -> forall x, next (map h p) (h x) = h (next p x). Proof. (* Goal: forall (_ : is_true (@uniq T' p)) (x : Equality.sort T'), @eq (Equality.sort T) (@next T (@map (Equality.sort T') (Equality.sort T) h p) (h x)) (h (@next T' p x)) *) move=> Up x; case p_x: (x \in p); last by rewrite !next_nth (mem_map Ih) p_x. (* Goal: @eq (Equality.sort T) (@next T (@map (Equality.sort T') (Equality.sort T) h p) (h x)) (h (@next T' p x)) *) case/rot_to: p_x => i p' def_p. (* Goal: @eq (Equality.sort T) (@next T (@map (Equality.sort T') (Equality.sort T) h p) (h x)) (h (@next T' p x)) *) rewrite -(next_rot i Up); rewrite -(map_inj_uniq Ih) in Up. (* Goal: @eq (Equality.sort T) (@next T (@map (Equality.sort T') (Equality.sort T) h p) (h x)) (h (@next T' (@rot (Equality.sort T') i p) x)) *) rewrite -(next_rot i Up) -map_rot {i p Up}def_p /=. (* Goal: @eq (Equality.sort T) (@next_at T (h x) (h x) (h x) (@map (Equality.sort T') (Equality.sort T) h p')) (h (@next_at T' x x x p')) *) by case: p' => [|y p''] //=; rewrite !eqxx. Qed. Lemma prev_map p : uniq p -> forall x, prev (map h p) (h x) = h (prev p x). Proof. (* Goal: forall (_ : is_true (@uniq T' p)) (x : Equality.sort T'), @eq (Equality.sort T) (@prev T (@map (Equality.sort T') (Equality.sort T) h p) (h x)) (h (@prev T' p x)) *) move=> Up x; rewrite -{1}[x](next_prev Up) -(next_map Up). (* Goal: @eq (Equality.sort T) (@prev T (@map (Equality.sort T') (Equality.sort T) h p) (@next T (@map (Equality.sort T') (Equality.sort T) h p) (h (@prev T' p x)))) (h (@prev T' p x)) *) by rewrite prev_next ?map_inj_uniq. Qed. End MapEqPath. Definition fun_base (T T' : eqType) (h : T' -> T) f f' := rel_base h (frel f) (frel f'). Section CycleArc. Variable T : eqType. Implicit Type p : seq T. Definition arc p x y := let px := rot (index x p) p in take (index y px) px. Lemma arc_rot i p : uniq p -> {in p, arc (rot i p) =2 arc p}. Proof. (* Goal: forall _ : is_true (@uniq T p), @prop_in1 (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) p) (fun x : Equality.sort T => forall y : Equality.sort T, @eq (list (Equality.sort T)) (arc (@rot (Equality.sort T) i p) x y) (arc p x y)) (inPhantom (@eqrel (list (Equality.sort T)) (Equality.sort T) (Equality.sort T) (arc (@rot (Equality.sort T) i p)) (arc p))) *) move=> Up x p_x y; congr (fun q => take (index y q) q); move: Up p_x {y}. (* Goal: forall (_ : is_true (@uniq T p)) (_ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p))), @eq (list (Equality.sort T)) (@rot (Equality.sort T) (@index T x (@rot (Equality.sort T) i p)) (@rot (Equality.sort T) i p)) (@rot (Equality.sort T) (@index T x p) p) *) rewrite -{1 2 5 6}(cat_take_drop i p) /rot cat_uniq => /and3P[_ Up12 _]. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@cat (Equality.sort T) (@take (Equality.sort T) i p) (@drop (Equality.sort T) i p)))), @eq (list (Equality.sort T)) (@cat (Equality.sort T) (@drop (Equality.sort T) (@index T x (@cat (Equality.sort T) (@drop (Equality.sort T) i p) (@take (Equality.sort T) i p))) (@cat (Equality.sort T) (@drop (Equality.sort T) i p) (@take (Equality.sort T) i p))) (@take (Equality.sort T) (@index T x (@cat (Equality.sort T) (@drop (Equality.sort T) i p) (@take (Equality.sort T) i p))) (@cat (Equality.sort T) (@drop (Equality.sort T) i p) (@take (Equality.sort T) i p)))) (@cat (Equality.sort T) (@drop (Equality.sort T) (@index T x (@cat (Equality.sort T) (@take (Equality.sort T) i p) (@drop (Equality.sort T) i p))) (@cat (Equality.sort T) (@take (Equality.sort T) i p) (@drop (Equality.sort T) i p))) (@take (Equality.sort T) (@index T x (@cat (Equality.sort T) (@take (Equality.sort T) i p) (@drop (Equality.sort T) i p))) (@cat (Equality.sort T) (@take (Equality.sort T) i p) (@drop (Equality.sort T) i p)))) *) rewrite !drop_cat !take_cat !index_cat mem_cat orbC. (* Goal: forall _ : is_true (orb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@drop (Equality.sort T) i p))) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)))), @eq (list (Equality.sort T)) (@cat (Equality.sort T) (if leq (S (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@drop (Equality.sort T) i p)) then @index T x (@drop (Equality.sort T) i p) else addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p)))) (@size (Equality.sort T) (@drop (Equality.sort T) i p)) then @cat (Equality.sort T) (@drop (Equality.sort T) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@drop (Equality.sort T) i p)) then @index T x (@drop (Equality.sort T) i p) else addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p)) (@take (Equality.sort T) i p) else @drop (Equality.sort T) (subn (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@drop (Equality.sort T) i p)) then @index T x (@drop (Equality.sort T) i p) else addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p))) (@size (Equality.sort T) (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p)) (if leq (S (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@drop (Equality.sort T) i p)) then @index T x (@drop (Equality.sort T) i p) else addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p)))) (@size (Equality.sort T) (@drop (Equality.sort T) i p)) then @take (Equality.sort T) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@drop (Equality.sort T) i p)) then @index T x (@drop (Equality.sort T) i p) else addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p) else @cat (Equality.sort T) (@drop (Equality.sort T) i p) (@take (Equality.sort T) (subn (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@drop (Equality.sort T) i p)) then @index T x (@drop (Equality.sort T) i p) else addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p))) (@size (Equality.sort T) (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p)))) (@cat (Equality.sort T) (if leq (S (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p)))) (@size (Equality.sort T) (@take (Equality.sort T) i p)) then @cat (Equality.sort T) (@drop (Equality.sort T) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p)) (@drop (Equality.sort T) i p) else @drop (Equality.sort T) (subn (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@size (Equality.sort T) (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p)) (if leq (S (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p)))) (@size (Equality.sort T) (@take (Equality.sort T) i p)) then @take (Equality.sort T) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p) else @cat (Equality.sort T) (@take (Equality.sort T) i p) (@take (Equality.sort T) (subn (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@size (Equality.sort T) (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p)))) *) case p2x: (x \in drop i p) => /= => [_ | p1x]. (* Goal: @eq (list (Equality.sort T)) (@cat (Equality.sort T) (if leq (S (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p)))) (@size (Equality.sort T) (@drop (Equality.sort T) i p)) then @cat (Equality.sort T) (@drop (Equality.sort T) (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p)) (@take (Equality.sort T) i p) else @drop (Equality.sort T) (subn (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p))) (@size (Equality.sort T) (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p)) (if leq (S (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p)))) (@size (Equality.sort T) (@drop (Equality.sort T) i p)) then @take (Equality.sort T) (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p) else @cat (Equality.sort T) (@drop (Equality.sort T) i p) (@take (Equality.sort T) (subn (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p))) (@size (Equality.sort T) (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p)))) (@cat (Equality.sort T) (if leq (S (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p)))) (@size (Equality.sort T) (@take (Equality.sort T) i p)) then @cat (Equality.sort T) (@drop (Equality.sort T) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p)) (@drop (Equality.sort T) i p) else @drop (Equality.sort T) (subn (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@size (Equality.sort T) (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p)) (if leq (S (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p)))) (@size (Equality.sort T) (@take (Equality.sort T) i p)) then @take (Equality.sort T) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p) else @cat (Equality.sort T) (@take (Equality.sort T) i p) (@take (Equality.sort T) (subn (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@size (Equality.sort T) (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p)))) *) (* Goal: @eq (list (Equality.sort T)) (@cat (Equality.sort T) (if leq (S (@index T x (@drop (Equality.sort T) i p))) (@size (Equality.sort T) (@drop (Equality.sort T) i p)) then @cat (Equality.sort T) (@drop (Equality.sort T) (@index T x (@drop (Equality.sort T) i p)) (@drop (Equality.sort T) i p)) (@take (Equality.sort T) i p) else @drop (Equality.sort T) (subn (@index T x (@drop (Equality.sort T) i p)) (@size (Equality.sort T) (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p)) (if leq (S (@index T x (@drop (Equality.sort T) i p))) (@size (Equality.sort T) (@drop (Equality.sort T) i p)) then @take (Equality.sort T) (@index T x (@drop (Equality.sort T) i p)) (@drop (Equality.sort T) i p) else @cat (Equality.sort T) (@drop (Equality.sort T) i p) (@take (Equality.sort T) (subn (@index T x (@drop (Equality.sort T) i p)) (@size (Equality.sort T) (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p)))) (@cat (Equality.sort T) (if leq (S (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p)))) (@size (Equality.sort T) (@take (Equality.sort T) i p)) then @cat (Equality.sort T) (@drop (Equality.sort T) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p)) (@drop (Equality.sort T) i p) else @drop (Equality.sort T) (subn (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@size (Equality.sort T) (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p)) (if leq (S (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p)))) (@size (Equality.sort T) (@take (Equality.sort T) i p)) then @take (Equality.sort T) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p) else @cat (Equality.sort T) (@take (Equality.sort T) i p) (@take (Equality.sort T) (subn (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@size (Equality.sort T) (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p)))) *) rewrite index_mem p2x [x \in _](negbTE (hasPn Up12 _ p2x)) /= addKn. (* Goal: @eq (list (Equality.sort T)) (@cat (Equality.sort T) (if leq (S (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p)))) (@size (Equality.sort T) (@drop (Equality.sort T) i p)) then @cat (Equality.sort T) (@drop (Equality.sort T) (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p)) (@take (Equality.sort T) i p) else @drop (Equality.sort T) (subn (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p))) (@size (Equality.sort T) (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p)) (if leq (S (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p)))) (@size (Equality.sort T) (@drop (Equality.sort T) i p)) then @take (Equality.sort T) (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p) else @cat (Equality.sort T) (@drop (Equality.sort T) i p) (@take (Equality.sort T) (subn (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p))) (@size (Equality.sort T) (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p)))) (@cat (Equality.sort T) (if leq (S (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p)))) (@size (Equality.sort T) (@take (Equality.sort T) i p)) then @cat (Equality.sort T) (@drop (Equality.sort T) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p)) (@drop (Equality.sort T) i p) else @drop (Equality.sort T) (subn (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@size (Equality.sort T) (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p)) (if leq (S (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p)))) (@size (Equality.sort T) (@take (Equality.sort T) i p)) then @take (Equality.sort T) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p) else @cat (Equality.sort T) (@take (Equality.sort T) i p) (@take (Equality.sort T) (subn (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@size (Equality.sort T) (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p)))) *) (* Goal: @eq (list (Equality.sort T)) (@cat (Equality.sort T) (@cat (Equality.sort T) (@drop (Equality.sort T) (@index T x (@drop (Equality.sort T) i p)) (@drop (Equality.sort T) i p)) (@take (Equality.sort T) i p)) (@take (Equality.sort T) (@index T x (@drop (Equality.sort T) i p)) (@drop (Equality.sort T) i p))) (@cat (Equality.sort T) (if leq (S (addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p)))) (@size (Equality.sort T) (@take (Equality.sort T) i p)) then @cat (Equality.sort T) (@drop (Equality.sort T) (addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p)) (@drop (Equality.sort T) i p) else @drop (Equality.sort T) (@index T x (@drop (Equality.sort T) i p)) (@drop (Equality.sort T) i p)) (if leq (S (addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p)))) (@size (Equality.sort T) (@take (Equality.sort T) i p)) then @take (Equality.sort T) (addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p) else @cat (Equality.sort T) (@take (Equality.sort T) i p) (@take (Equality.sort T) (@index T x (@drop (Equality.sort T) i p)) (@drop (Equality.sort T) i p)))) *) by rewrite ltnNge leq_addr catA. (* Goal: @eq (list (Equality.sort T)) (@cat (Equality.sort T) (if leq (S (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p)))) (@size (Equality.sort T) (@drop (Equality.sort T) i p)) then @cat (Equality.sort T) (@drop (Equality.sort T) (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p)) (@take (Equality.sort T) i p) else @drop (Equality.sort T) (subn (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p))) (@size (Equality.sort T) (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p)) (if leq (S (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p)))) (@size (Equality.sort T) (@drop (Equality.sort T) i p)) then @take (Equality.sort T) (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p) else @cat (Equality.sort T) (@drop (Equality.sort T) i p) (@take (Equality.sort T) (subn (addn (@size (Equality.sort T) (@drop (Equality.sort T) i p)) (@index T x (@take (Equality.sort T) i p))) (@size (Equality.sort T) (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p)))) (@cat (Equality.sort T) (if leq (S (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p)))) (@size (Equality.sort T) (@take (Equality.sort T) i p)) then @cat (Equality.sort T) (@drop (Equality.sort T) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p)) (@drop (Equality.sort T) i p) else @drop (Equality.sort T) (subn (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@size (Equality.sort T) (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p)) (if leq (S (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p)))) (@size (Equality.sort T) (@take (Equality.sort T) i p)) then @take (Equality.sort T) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@take (Equality.sort T) i p) else @cat (Equality.sort T) (@take (Equality.sort T) i p) (@take (Equality.sort T) (subn (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@take (Equality.sort T) i p)) then @index T x (@take (Equality.sort T) i p) else addn (@size (Equality.sort T) (@take (Equality.sort T) i p)) (@index T x (@drop (Equality.sort T) i p))) (@size (Equality.sort T) (@take (Equality.sort T) i p))) (@drop (Equality.sort T) i p)))) *) by rewrite p1x index_mem p1x addKn ltnNge leq_addr /= catA. Qed. Lemma left_arc x y p1 p2 (p := x :: p1 ++ y :: p2) : uniq p -> arc p x y = x :: p1. Proof. (* Goal: forall _ : is_true (@uniq T p), @eq (list (Equality.sort T)) (arc p x y) (@cons (Equality.sort T) x p1) *) rewrite /arc /p [index x _]/= eqxx rot0 -cat_cons cat_uniq index_cat. (* Goal: forall _ : is_true (andb (@uniq T (@cons (Equality.sort T) x p1)) (andb (negb (@has (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred_of_mem_pred (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) x p1)))) (@cons (Equality.sort T) y p2))) (@uniq T (@cons (Equality.sort T) y p2)))), @eq (list (Equality.sort T)) (@take (Equality.sort T) (if @in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) x p1)) then @index T y (@cons (Equality.sort T) x p1) else addn (@size (Equality.sort T) (@cons (Equality.sort T) x p1)) (@index T y (@cons (Equality.sort T) y p2))) (@cat (Equality.sort T) (@cons (Equality.sort T) x p1) (@cons (Equality.sort T) y p2))) (@cons (Equality.sort T) x p1) *) move: (x :: p1) => xp1 /and3P[_ /norP[/= /negbTE-> _] _]. (* Goal: @eq (list (Equality.sort T)) (@take (Equality.sort T) (addn (@size (Equality.sort T) xp1) (if @eq_op T y y then O else S (@index T y p2))) (@cat (Equality.sort T) xp1 (@cons (Equality.sort T) y p2))) xp1 *) by rewrite eqxx addn0 take_size_cat. Qed. Lemma right_arc x y p1 p2 (p := x :: p1 ++ y :: p2) : uniq p -> arc p y x = y :: p2. Proof. (* Goal: forall _ : is_true (@uniq T p), @eq (list (Equality.sort T)) (arc p y x) (@cons (Equality.sort T) y p2) *) rewrite -[p]cat_cons -rot_size_cat rot_uniq => Up. (* Goal: @eq (list (Equality.sort T)) (arc (@rot (Equality.sort T) (@size (Equality.sort T) (@cons (Equality.sort T) y p2)) (@cat (Equality.sort T) (@cons (Equality.sort T) y p2) (@cons (Equality.sort T) x p1))) y x) (@cons (Equality.sort T) y p2) *) by rewrite arc_rot ?left_arc ?mem_head. Qed. Variant rot_to_arc_spec p x y := RotToArcSpec i p1 p2 of x :: p1 = arc p x y & y :: p2 = arc p y x & rot i p = x :: p1 ++ y :: p2 : rot_to_arc_spec p x y. Lemma rot_to_arc p x y : uniq p -> x \in p -> y \in p -> x != y -> rot_to_arc_spec p x y. Proof. (* Goal: forall (_ : is_true (@uniq T p)) (_ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) p))) (_ : is_true (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) p))) (_ : is_true (negb (@eq_op T x y))), rot_to_arc_spec p x y *) move=> Up p_x p_y ne_xy; case: (rot_to p_x) (p_y) (Up) => [i q def_p] q_y. (* Goal: forall _ : is_true (@uniq T p), rot_to_arc_spec p x y *) rewrite -(mem_rot i) def_p inE eq_sym (negbTE ne_xy) in q_y. (* Goal: forall _ : is_true (@uniq T p), rot_to_arc_spec p x y *) rewrite -(rot_uniq i) def_p. (* Goal: forall _ : is_true (@uniq T (@cons (Equality.sort T) x q)), rot_to_arc_spec p x y *) case/splitPr: q / q_y def_p => q1 q2 def_p Uq12; exists i q1 q2 => //. (* Goal: @eq (list (Equality.sort T)) (@cons (Equality.sort T) y q2) (arc p y x) *) (* Goal: @eq (list (Equality.sort T)) (@cons (Equality.sort T) x q1) (arc p x y) *) by rewrite -(arc_rot i Up p_x) def_p left_arc. (* Goal: @eq (list (Equality.sort T)) (@cons (Equality.sort T) y q2) (arc p y x) *) by rewrite -(arc_rot i Up p_y) def_p right_arc. Qed. End CycleArc. Prenex Implicits arc. Section Monotonicity. Variables (T : eqType) (r : rel T). Hypothesis r_trans : transitive r. Lemma sorted_lt_nth x0 (s : seq T) : sorted r s -> {in [pred n | n < size s] &, {homo nth x0 s : i j / i < j >-> r i j}}. Proof. (* Goal: forall _ : is_true (@sorted T r s), @prop_in2 nat (@mem nat (simplPredType nat) (@SimplPred nat (fun n : nat => leq (S n) (@size (Equality.sort T) s)))) (fun x y : nat => forall _ : (fun i j : nat => is_true (leq (S i) j)) x y, (fun i j : Equality.sort T => is_true (r i j)) (@nth (Equality.sort T) x0 s x) (@nth (Equality.sort T) x0 s y)) (inPhantom (@homomorphism_2 nat (Equality.sort T) (@nth (Equality.sort T) x0 s) (fun i j : nat => is_true (leq (S i) j)) (fun i j : Equality.sort T => is_true (r i j)))) *) move=> s_sorted i j; rewrite -!topredE /=. (* Goal: forall (_ : is_true (leq (S i) (@size (Equality.sort T) s))) (_ : is_true (leq (S j) (@size (Equality.sort T) s))) (_ : is_true (leq (S i) j)), is_true (r (@nth (Equality.sort T) x0 s i) (@nth (Equality.sort T) x0 s j)) *) wlog ->: i j s s_sorted / i = 0 => [/(_ 0 (j - i) (drop i s)) hw|] ilt jlt ltij. (* Goal: is_true (r (@nth (Equality.sort T) x0 s O) (@nth (Equality.sort T) x0 s j)) *) (* Goal: is_true (r (@nth (Equality.sort T) x0 s i) (@nth (Equality.sort T) x0 s j)) *) move: hw; rewrite !size_drop !nth_drop addn0 subnKC ?(ltnW ltij) //. (* Goal: is_true (r (@nth (Equality.sort T) x0 s O) (@nth (Equality.sort T) x0 s j)) *) (* Goal: forall _ : forall (_ : is_true (@sorted T r (@drop (Equality.sort T) i s))) (_ : @eq nat O O) (_ : is_true (leq (S O) (subn (@size (Equality.sort T) s) i))) (_ : is_true (leq (S (subn j i)) (subn (@size (Equality.sort T) s) i))) (_ : is_true (leq (S O) (subn j i))), is_true (r (@nth (Equality.sort T) x0 s i) (@nth (Equality.sort T) x0 s j)), is_true (r (@nth (Equality.sort T) x0 s i) (@nth (Equality.sort T) x0 s j)) *) by rewrite (subseq_sorted _ (drop_subseq _ _)) ?subn_gt0 ?ltn_sub2r//; apply. (* Goal: is_true (r (@nth (Equality.sort T) x0 s O) (@nth (Equality.sort T) x0 s j)) *) case: s ilt j jlt ltij => [|x s] //= _ [//|j] jlt _ in s_sorted *. by have /allP -> //= := order_path_min r_trans s_sorted; rewrite mem_nth. Qed. Qed. Lemma ltn_index (s : seq T) : sorted r s -> {in s &, forall x y, index x s < index y s -> r x y}. Proof. (* Goal: forall _ : is_true (@sorted T r s), @prop_in2 (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s) (fun x y : Equality.sort T => forall _ : is_true (leq (S (@index T x s)) (@index T y s)), is_true (r x y)) (inPhantom (forall (x y : Equality.sort T) (_ : is_true (leq (S (@index T x s)) (@index T y s))), is_true (r x y))) *) case: s => [//|x0 s'] r_sorted x y xs ys. (* Goal: forall _ : is_true (leq (S (@index T x (@cons (Equality.sort T) x0 s'))) (@index T y (@cons (Equality.sort T) x0 s'))), is_true (r x y) *) move=> /(@sorted_lt_nth x0 (x0 :: s')). (* Goal: forall _ : forall (_ : is_true (@sorted T r (@cons (Equality.sort T) x0 s'))) (_ : is_true (@in_mem nat (@index T x (@cons (Equality.sort T) x0 s')) (@mem nat (simplPredType nat) (@SimplPred nat (fun n : nat => leq (S n) (@size (Equality.sort T) (@cons (Equality.sort T) x0 s'))))))) (_ : is_true (@in_mem nat (@index T y (@cons (Equality.sort T) x0 s')) (@mem nat (simplPredType nat) (@SimplPred nat (fun n : nat => leq (S n) (@size (Equality.sort T) (@cons (Equality.sort T) x0 s'))))))), is_true (r (@nth (Equality.sort T) x0 (@cons (Equality.sort T) x0 s') (@index T x (@cons (Equality.sort T) x0 s'))) (@nth (Equality.sort T) x0 (@cons (Equality.sort T) x0 s') (@index T y (@cons (Equality.sort T) x0 s')))), is_true (r x y) *) by rewrite ?nth_index ?[_ \in gtn _]index_mem //; apply. Qed. Hypothesis r_refl : reflexive r. Lemma sorted_le_nth x0 (s : seq T) : sorted r s -> {in [pred n | n < size s] &, {homo nth x0 s : i j / i <= j >-> r i j}}. Proof. (* Goal: forall _ : is_true (@sorted T r s), @prop_in2 nat (@mem nat (simplPredType nat) (@SimplPred nat (fun n : nat => leq (S n) (@size (Equality.sort T) s)))) (fun x y : nat => forall _ : (fun i j : nat => is_true (leq i j)) x y, (fun i j : Equality.sort T => is_true (r i j)) (@nth (Equality.sort T) x0 s x) (@nth (Equality.sort T) x0 s y)) (inPhantom (@homomorphism_2 nat (Equality.sort T) (@nth (Equality.sort T) x0 s) (fun i j : nat => is_true (leq i j)) (fun i j : Equality.sort T => is_true (r i j)))) *) move=> s_sorted x y xs ys. (* Goal: forall _ : is_true (leq x y), is_true (r (@nth (Equality.sort T) x0 s x) (@nth (Equality.sort T) x0 s y)) *) by rewrite leq_eqVlt=> /orP[/eqP->//|/sorted_lt_nth]; apply. Qed. Lemma leq_index (s : seq T) : sorted r s -> {in s &, forall x y, index x s <= index y s -> r x y}. Proof. (* Goal: forall _ : is_true (@sorted T r s), @prop_in2 (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s) (fun x y : Equality.sort T => forall _ : is_true (leq (@index T x s) (@index T y s)), is_true (r x y)) (inPhantom (forall (x y : Equality.sort T) (_ : is_true (leq (@index T x s) (@index T y s))), is_true (r x y))) *) case: s => [//|x0 s'] r_sorted x y xs ys. (* Goal: forall _ : is_true (leq (@index T x (@cons (Equality.sort T) x0 s')) (@index T y (@cons (Equality.sort T) x0 s'))), is_true (r x y) *) move=> /(@sorted_le_nth x0 (x0 :: s')). (* Goal: forall _ : forall (_ : is_true (@sorted T r (@cons (Equality.sort T) x0 s'))) (_ : is_true (@in_mem nat (@index T x (@cons (Equality.sort T) x0 s')) (@mem nat (simplPredType nat) (@SimplPred nat (fun n : nat => leq (S n) (@size (Equality.sort T) (@cons (Equality.sort T) x0 s'))))))) (_ : is_true (@in_mem nat (@index T y (@cons (Equality.sort T) x0 s')) (@mem nat (simplPredType nat) (@SimplPred nat (fun n : nat => leq (S n) (@size (Equality.sort T) (@cons (Equality.sort T) x0 s'))))))), is_true (r (@nth (Equality.sort T) x0 (@cons (Equality.sort T) x0 s') (@index T x (@cons (Equality.sort T) x0 s'))) (@nth (Equality.sort T) x0 (@cons (Equality.sort T) x0 s') (@index T y (@cons (Equality.sort T) x0 s')))), is_true (r x y) *) by rewrite ?nth_index ?[_ \in gtn _]index_mem //; apply. Qed. End Monotonicity.
Set Implicit Arguments. Unset Strict Implicit. Require Export Subcat. Require Export Set_cat. Definition law_of_composition (E : SET) := Hom (cart E E:SET) E. Definition associative (E : SET) (f : law_of_composition E) := forall x y z : E, Equal (f (couple (f (couple x y)) z)) (f (couple x (f (couple y z)))). Record sgroup_on (E : SET) : Type := {sgroup_law_map : law_of_composition E; sgroup_assoc_prf : associative sgroup_law_map}. Record sgroup : Type := {sgroup_set :> Setoid; sgroup_on_def :> sgroup_on sgroup_set}. Coercion Build_sgroup : sgroup_on >-> sgroup. Set Strict Implicit. Unset Implicit Arguments. Definition sgroup_law (E : sgroup) : E -> E -> E := fun x y : E:Setoid => sgroup_law_map E (couple x y). Set Implicit Arguments. Unset Strict Implicit. Section Hom. Variable E F : sgroup. Definition sgroup_hom_prop (f : Hom (E:SET) F) := forall x y : E, Equal (f (sgroup_law _ x y)) (sgroup_law _ (f x) (f y)). Record sgroup_hom : Type := {sgroup_map :> Map E F; sgroup_hom_prf : sgroup_hom_prop sgroup_map}. End Hom. Definition sgroup_hom_comp : forall E F G : sgroup, sgroup_hom F G -> sgroup_hom E F -> sgroup_hom E G. Proof. (* Goal: forall (E F G : sgroup) (_ : sgroup_hom F G) (_ : sgroup_hom E F), sgroup_hom E G *) intros E F G g f; try assumption. (* Goal: sgroup_hom E G *) apply (Build_sgroup_hom (sgroup_map:=comp_map_map g f)). (* Goal: @sgroup_hom_prop E G (@comp_map_map (sgroup_set E) (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@sgroup_map E F f)) *) unfold sgroup_hom_prop in |- *; auto with algebra. (* Goal: forall x y : Carrier (sgroup_set E), @Equal (sgroup_set G) (@Ap (sgroup_set E) (sgroup_set G) (@comp_map_map (sgroup_set E) (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@sgroup_map E F f)) (sgroup_law E x y)) (sgroup_law G (@Ap (sgroup_set E) (sgroup_set G) (@comp_map_map (sgroup_set E) (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@sgroup_map E F f)) x) (@Ap (sgroup_set E) (sgroup_set G) (@comp_map_map (sgroup_set E) (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@sgroup_map E F f)) y)) *) simpl in |- *. (* Goal: forall x y : Carrier (sgroup_set E), @Equal (sgroup_set G) (@comp_map_fun (sgroup_set E) (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@sgroup_map E F f) (sgroup_law E x y)) (sgroup_law G (@comp_map_fun (sgroup_set E) (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@sgroup_map E F f) x) (@comp_map_fun (sgroup_set E) (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@sgroup_map E F f) y)) *) unfold comp_map_fun in |- *. (* Goal: forall x y : Carrier (sgroup_set E), @Equal (sgroup_set G) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) (sgroup_law E x y))) (sgroup_law G (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x)) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) *) intros x y; try assumption. (* Goal: @Equal (sgroup_set G) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) (sgroup_law E x y))) (sgroup_law G (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x)) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) *) apply Trans with (Ap (sgroup_map g) (sgroup_law _ (Ap (sgroup_map f) x) (Ap (sgroup_map f) y))); auto with algebra. (* Goal: @Equal (sgroup_set G) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (sgroup_law F (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) (sgroup_law G (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x)) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) *) (* Goal: @Equal (sgroup_set G) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) (sgroup_law E x y))) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (sgroup_law F (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) *) cut (Equal (Ap (sgroup_map f) (sgroup_law _ x y)) (sgroup_law _ (Ap (sgroup_map f) x) (Ap (sgroup_map f) y))). (* Goal: @Equal (sgroup_set G) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (sgroup_law F (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) (sgroup_law G (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x)) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) *) (* Goal: @Equal (sgroup_set F) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) (sgroup_law E x y)) (sgroup_law F (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y)) *) (* Goal: forall _ : @Equal (sgroup_set F) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) (sgroup_law E x y)) (sgroup_law F (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y)), @Equal (sgroup_set G) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) (sgroup_law E x y))) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (sgroup_law F (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) *) auto with algebra. (* Goal: @Equal (sgroup_set G) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (sgroup_law F (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) (sgroup_law G (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x)) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) *) (* Goal: @Equal (sgroup_set F) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) (sgroup_law E x y)) (sgroup_law F (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y)) *) apply (sgroup_hom_prf f). (* Goal: @Equal (sgroup_set G) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (sgroup_law F (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) (sgroup_law G (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x)) (@Ap (sgroup_set F) (sgroup_set G) (@sgroup_map F G g) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y))) *) apply (sgroup_hom_prf g). Qed. Definition sgroup_id : forall E : sgroup, sgroup_hom E E. Proof. (* Goal: forall E : sgroup, sgroup_hom E E *) intros E; try assumption. (* Goal: sgroup_hom E E *) apply (Build_sgroup_hom (sgroup_map:=Id E)). (* Goal: @sgroup_hom_prop E E (Id (sgroup_set E)) *) red in |- *. (* Goal: forall x y : Carrier (sgroup_set E), @Equal (sgroup_set E) (@Ap (sgroup_set E) (sgroup_set E) (Id (sgroup_set E)) (sgroup_law E x y)) (sgroup_law E (@Ap (sgroup_set E) (sgroup_set E) (Id (sgroup_set E)) x) (@Ap (sgroup_set E) (sgroup_set E) (Id (sgroup_set E)) y)) *) simpl in |- *; auto with algebra. Qed. Definition SGROUP : category. Proof. (* Goal: category *) apply (subcat (C:=SET) (C':=sgroup) (i:=sgroup_set) (homC':=fun E F : sgroup => Build_subtype_image (E:=MAP E F) (subtype_image_carrier:=sgroup_hom E F) (sgroup_map (E:=E) (F:=F))) (CompC':=sgroup_hom_comp) (idC':=sgroup_id)). (* Goal: forall (a b c : sgroup) (g : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) b c)) (f : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) a b)), @Equal (@Hom SET (sgroup_set a) (sgroup_set c)) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set c)) (sgroup_hom a c) (@sgroup_map a c)) (@sgroup_hom_comp a b c g f)) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@subtype_image_inj (@Hom SET (sgroup_set b) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set b) (sgroup_set c)) (sgroup_hom b c) (@sgroup_map b c)) g) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set b)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set b)) (sgroup_hom a b) (@sgroup_map a b)) f)) *) (* Goal: forall a : sgroup, @Equal (@Hom SET (sgroup_set a) (sgroup_set a)) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set a)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set a)) (sgroup_hom a a) (@sgroup_map a a)) (sgroup_id a)) (@Hom_id SET (sgroup_set a)) *) simpl in |- *. (* Goal: forall (a b c : sgroup) (g : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) b c)) (f : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) a b)), @Equal (@Hom SET (sgroup_set a) (sgroup_set c)) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set c)) (sgroup_hom a c) (@sgroup_map a c)) (@sgroup_hom_comp a b c g f)) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@subtype_image_inj (@Hom SET (sgroup_set b) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set b) (sgroup_set c)) (sgroup_hom b c) (@sgroup_map b c)) g) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set b)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set b)) (sgroup_hom a b) (@sgroup_map a b)) f)) *) (* Goal: forall a : sgroup, @Map_eq (sgroup_set a) (sgroup_set a) (Id (sgroup_set a)) (Id (sgroup_set a)) *) intros a; try assumption. (* Goal: forall (a b c : sgroup) (g : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) b c)) (f : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) a b)), @Equal (@Hom SET (sgroup_set a) (sgroup_set c)) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set c)) (sgroup_hom a c) (@sgroup_map a c)) (@sgroup_hom_comp a b c g f)) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@subtype_image_inj (@Hom SET (sgroup_set b) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set b) (sgroup_set c)) (sgroup_hom b c) (@sgroup_map b c)) g) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set b)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set b)) (sgroup_hom a b) (@sgroup_map a b)) f)) *) (* Goal: @Map_eq (sgroup_set a) (sgroup_set a) (Id (sgroup_set a)) (Id (sgroup_set a)) *) red in |- *. (* Goal: forall (a b c : sgroup) (g : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) b c)) (f : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) a b)), @Equal (@Hom SET (sgroup_set a) (sgroup_set c)) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set c)) (sgroup_hom a c) (@sgroup_map a c)) (@sgroup_hom_comp a b c g f)) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@subtype_image_inj (@Hom SET (sgroup_set b) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set b) (sgroup_set c)) (sgroup_hom b c) (@sgroup_map b c)) g) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set b)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set b)) (sgroup_hom a b) (@sgroup_map a b)) f)) *) (* Goal: forall x : Carrier (sgroup_set a), @Equal (sgroup_set a) (@Ap (sgroup_set a) (sgroup_set a) (Id (sgroup_set a)) x) (@Ap (sgroup_set a) (sgroup_set a) (Id (sgroup_set a)) x) *) auto with algebra. (* Goal: forall (a b c : sgroup) (g : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) b c)) (f : Carrier (@subcat_Hom SET sgroup sgroup_set (fun E F : sgroup => @Build_subtype_image (MAP (sgroup_set E) (sgroup_set F)) (sgroup_hom E F) (@sgroup_map E F)) a b)), @Equal (@Hom SET (sgroup_set a) (sgroup_set c)) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set c)) (sgroup_hom a c) (@sgroup_map a c)) (@sgroup_hom_comp a b c g f)) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@subtype_image_inj (@Hom SET (sgroup_set b) (sgroup_set c)) (@Build_subtype_image (MAP (sgroup_set b) (sgroup_set c)) (sgroup_hom b c) (@sgroup_map b c)) g) (@subtype_image_inj (@Hom SET (sgroup_set a) (sgroup_set b)) (@Build_subtype_image (MAP (sgroup_set a) (sgroup_set b)) (sgroup_hom a b) (@sgroup_map a b)) f)) *) simpl in |- *. (* Goal: forall (a b c : sgroup) (g : sgroup_hom b c) (f : sgroup_hom a b), @Map_eq (sgroup_set a) (sgroup_set c) (@comp_map_map (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) *) intros a b c g f; try assumption. (* Goal: @Map_eq (sgroup_set a) (sgroup_set c) (@comp_map_map (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set a), @Equal (sgroup_set c) (@Ap (sgroup_set a) (sgroup_set c) (@comp_map_map (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) x) (@Ap (sgroup_set a) (sgroup_set c) (@comp_hom SET (sgroup_set a) (sgroup_set b) (sgroup_set c) (@sgroup_map b c g) (@sgroup_map a b f)) x) *) auto with algebra. Qed.
Require Import utf_AMM11262. Import NatSet GeneralProperties. Section example_three_inhabitants. Definition town_1:= {1}∪({2}∪({3}∪∅)). Remark population₁ : |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₁ (m n:elt):Prop := match m,n with | 1,2 => True | 2,1 => True | 2,3 => True | 3,2 => True | _,_ => False end. Infix "ℛ₁" := familiarity₁ (at level 70, no associativity). Remark familiarity₁_sym:∀ m n, m ℛ₁ n ⇒ n ℛ₁ m. Remark familiarity₁_extensional:∀ m n p, n≡p ⇒ m ℛ₁ n ⇒ m ℛ₁ p. Remark subsets_1: ∀ B, B⊆town_1 ⇒ |B| = 1 ⇒ (B ≐ {1}∪∅ \/ B ≐ {2}∪∅ ) ∨ B ≐ {3}∪∅. 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: ∀ B, B⊆town_1 ⇒ |B| = 1 ⇒ ∃d, d∈(town_1\B) ∧ (∀ b, b∈B ⇒ 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₁ 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₁ 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₁ d b)) *) (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity₁ d b)) *) (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity₁ 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₁ d b)) *) (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity₁ d b)) *) (* Goal: forall (b : elt) (_ : In b B), familiarity₁ (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₁ d b)) *) (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity₁ d b)) *) (* Goal: forall (b : elt) (_ : In b B), familiarity₁ (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₁ d b)) *) (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity₁ d b)) *) (* Goal: familiarity₁ (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₁ d b)) *) (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity₁ d b)) *) (* Goal: familiarity₁ (S (S O)) b *) (* Goal: familiarity₁ (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₁ d b)) *) (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity₁ d b)) *) (* Goal: familiarity₁ (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₁ d b)) *) (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity₁ 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₁ d b)) *) (* Goal: forall (b : elt) (_ : In b B), familiarity₁ (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₁ d b)) *) (* Goal: forall (b : elt) (_ : In b B), familiarity₁ (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₁ d b)) *) (* Goal: familiarity₁ (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₁ d b)) *) (* Goal: familiarity₁ (S O) b *) (* Goal: familiarity₁ (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₁ d b)) *) (* Goal: familiarity₁ (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₁ d b)) *) exists 2; split. (* Goal: forall (b : elt) (_ : In b B), familiarity₁ (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₁ (S (S O)) b *) intro b; rewrite HB3; intro Hb. (* Goal: familiarity₁ (S (S O)) b *) destruct (proj1 (FM.add_iff _ _ b) Hb) as [H|H]. (* Goal: familiarity₁ (S (S O)) b *) (* Goal: familiarity₁ (S (S O)) b *) compute in H; rewrite <- H; simpl; trivial. (* Goal: familiarity₁ (S (S O)) b *) apply False_ind; apply (proj1 (FM.empty_iff b) H). Qed. Check (AMM11262 town_1 1 population₁ familiarity₁ familiarity₁_sym familiarity₁_extensional acquintance_1). Definition social_citizen_1:=AMM11262 town_1 1 population₁ familiarity₁ familiarity₁_sym familiarity₁_extensional acquintance_1. End example_three_inhabitants. Extraction "social1" social_citizen_1.
Require Import General. Require Export Relations. Unset Standard Proposition Elimination Names. Section SortsOfECC. Inductive calc : Set := | Pos : calc | Neg : calc. Inductive srt_ecc : Set := | Sprop : calc -> srt_ecc | Stype : calc -> nat -> srt_ecc. Inductive axiom_ecc : srt_ecc -> srt_ecc -> Prop := | ax_prop : forall (c : calc) (n : nat), axiom_ecc (Sprop c) (Stype c n) | ax_type : forall (c : calc) (n m : nat), n < m -> axiom_ecc (Stype c n) (Stype c m). Inductive rules_ecc : srt_ecc -> srt_ecc -> srt_ecc -> Prop := | rule_prop_l : forall (c : calc) (s : srt_ecc), rules_ecc (Sprop c) s s | rule_prop_r : forall (c : calc) (s : srt_ecc), rules_ecc s (Sprop c) (Sprop c) | rule_type : forall (c1 c2 : calc) (n m p : nat), n <= p -> m <= p -> rules_ecc (Stype c1 n) (Stype c2 m) (Stype c2 p). Inductive univ_ecc : srt_ecc -> srt_ecc -> Prop := univ_type : forall (c : calc) (n m : nat), n <= m -> univ_ecc (Stype c n) (Stype c m). Definition univ : relation srt_ecc := clos_refl_trans _ univ_ecc. Hint Resolve ax_prop ax_type rule_prop_l rule_prop_r rule_type univ_type: pts. Hint Unfold univ: pts. Let univ_trans : forall x y z : srt_ecc, univ x y -> univ y z -> univ x z. Proof rt_trans srt_ecc univ_ecc. Inductive inv_univ : srt_ecc -> srt_ecc -> Prop := | iu_prop : forall c : calc, inv_univ (Sprop c) (Sprop c) | iu_type : forall (c : calc) (n m : nat), n <= m -> inv_univ (Stype c n) (Stype c m). Hint Resolve iu_prop iu_type: pts. Lemma inv_univ_trans : forall x y z : srt_ecc, inv_univ x y -> inv_univ y z -> inv_univ x z. Proof. (* Goal: forall (x y z : srt_ecc) (_ : inv_univ x y) (_ : inv_univ y z), inv_univ x z *) simple induction 1; intros; auto with arith pts. (* Goal: inv_univ (Stype c n) z *) inversion_clear H1. (* Goal: inv_univ (Stype c n) (Stype c m0) *) apply iu_type. (* Goal: le n m0 *) apply le_trans with m; auto with arith pts. Qed. Lemma univ_inv : forall s s' : srt_ecc, univ s s' -> forall P : Prop, (inv_univ s s' -> P) -> P. Proof. (* Goal: forall (s s' : srt_ecc) (_ : univ s s') (P : Prop) (_ : forall _ : inv_univ s s', P), P *) simple induction 1. (* Goal: forall (x y z : srt_ecc) (_ : clos_refl_trans srt_ecc univ_ecc x y) (_ : forall (P : Prop) (_ : forall _ : inv_univ x y, P), P) (_ : clos_refl_trans srt_ecc univ_ecc y z) (_ : forall (P : Prop) (_ : forall _ : inv_univ y z, P), P) (P : Prop) (_ : forall _ : inv_univ x z, P), P *) (* Goal: forall (x : srt_ecc) (P : Prop) (_ : forall _ : inv_univ x x, P), P *) (* Goal: forall (x y : srt_ecc) (_ : univ_ecc x y) (P : Prop) (_ : forall _ : inv_univ x y, P), P *) simple induction 1; auto with arith pts. (* Goal: forall (x y z : srt_ecc) (_ : clos_refl_trans srt_ecc univ_ecc x y) (_ : forall (P : Prop) (_ : forall _ : inv_univ x y, P), P) (_ : clos_refl_trans srt_ecc univ_ecc y z) (_ : forall (P : Prop) (_ : forall _ : inv_univ y z, P), P) (P : Prop) (_ : forall _ : inv_univ x z, P), P *) (* Goal: forall (x : srt_ecc) (P : Prop) (_ : forall _ : inv_univ x x, P), P *) simple destruct x; auto with arith pts. (* Goal: forall (x y z : srt_ecc) (_ : clos_refl_trans srt_ecc univ_ecc x y) (_ : forall (P : Prop) (_ : forall _ : inv_univ x y, P), P) (_ : clos_refl_trans srt_ecc univ_ecc y z) (_ : forall (P : Prop) (_ : forall _ : inv_univ y z, P), P) (P : Prop) (_ : forall _ : inv_univ x z, P), P *) intros. (* Goal: P *) apply H4. (* Goal: inv_univ x z *) apply inv_univ_trans with y. (* Goal: inv_univ y z *) (* Goal: inv_univ x y *) apply H1; auto with arith pts. (* Goal: inv_univ y z *) apply H3; auto with arith pts. Qed. Lemma calc_dec : forall c c' : calc, decide (c = c'). Proof. (* Goal: forall c c' : calc, decide (@eq calc c c') *) simple destruct c; simple destruct c'; (right; discriminate) || auto with arith pts. Qed. Lemma ecc_sort_dec : forall s s' : srt_ecc, decide (s = s'). Proof. (* Goal: forall s s' : srt_ecc, decide (@eq srt_ecc s s') *) simple destruct s; simple destruct s'; intros; try (right; discriminate). (* Goal: decide (@eq srt_ecc (Stype c n) (Stype c0 n0)) *) (* Goal: decide (@eq srt_ecc (Sprop c) (Sprop c0)) *) elim calc_dec with c c0; intros. (* Goal: decide (@eq srt_ecc (Stype c n) (Stype c0 n0)) *) (* Goal: decide (@eq srt_ecc (Sprop c) (Sprop c0)) *) (* Goal: decide (@eq srt_ecc (Sprop c) (Sprop c0)) *) left; elim a; auto with arith pts. (* Goal: decide (@eq srt_ecc (Stype c n) (Stype c0 n0)) *) (* Goal: decide (@eq srt_ecc (Sprop c) (Sprop c0)) *) right; red in |- *; intros H; apply b; injection H; auto with arith pts. (* Goal: decide (@eq srt_ecc (Stype c n) (Stype c0 n0)) *) elim eq_nat_dec with n n0; intros. (* Goal: decide (@eq srt_ecc (Stype c n) (Stype c0 n0)) *) (* Goal: decide (@eq srt_ecc (Stype c n) (Stype c0 n0)) *) elim calc_dec with c c0; intros. (* Goal: decide (@eq srt_ecc (Stype c n) (Stype c0 n0)) *) (* Goal: decide (@eq srt_ecc (Stype c n) (Stype c0 n0)) *) (* Goal: decide (@eq srt_ecc (Stype c n) (Stype c0 n0)) *) left; elim a; elim a0; auto with arith pts. (* Goal: decide (@eq srt_ecc (Stype c n) (Stype c0 n0)) *) (* Goal: decide (@eq srt_ecc (Stype c n) (Stype c0 n0)) *) right; red in |- *; intros H; apply b; injection H; auto with arith pts. (* Goal: decide (@eq srt_ecc (Stype c n) (Stype c0 n0)) *) right; red in |- *; intros H; apply b; injection H; auto with arith pts. Qed. Lemma univ_ecc_dec : forall s s' : srt_ecc, decide (univ s s'). Proof. (* Goal: forall s s' : srt_ecc, decide (univ s s') *) refine (fun s s' : srt_ecc => match s, s' return (decide (univ s s')) with | Sprop c, Sprop c' => _ | Stype c n, Stype c' n' => _ | Sprop c, Stype c0 n => right _ _ | Stype c n, Sprop c0 => right _ _ end). (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: not (univ (Stype c n) (Sprop c0)) *) (* Goal: not (univ (Sprop c) (Stype c0 n)) *) (* Goal: decide (univ (Sprop c) (Sprop c')) *) case (calc_dec c c'); [ left | right ]. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: not (univ (Stype c n) (Sprop c0)) *) (* Goal: not (univ (Sprop c) (Stype c0 n)) *) (* Goal: not (univ (Sprop c) (Sprop c')) *) (* Goal: univ (Sprop c) (Sprop c') *) elim e; auto with arith pts. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: not (univ (Stype c n) (Sprop c0)) *) (* Goal: not (univ (Sprop c) (Stype c0 n)) *) (* Goal: not (univ (Sprop c) (Sprop c')) *) red in |- *; intro; apply n. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: not (univ (Stype c n) (Sprop c0)) *) (* Goal: not (univ (Sprop c) (Stype c0 n)) *) (* Goal: @eq calc c c' *) apply univ_inv with (Sprop c) (Sprop c'); intros; auto with arith pts. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: not (univ (Stype c n) (Sprop c0)) *) (* Goal: not (univ (Sprop c) (Stype c0 n)) *) (* Goal: @eq calc c c' *) inversion_clear H0; auto with arith pts. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: not (univ (Stype c n) (Sprop c0)) *) (* Goal: not (univ (Sprop c) (Stype c0 n)) *) red in |- *; intros. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: not (univ (Stype c n) (Sprop c0)) *) (* Goal: False *) apply univ_inv with (Sprop c) (Stype c0 n); intros; auto with arith pts. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: not (univ (Stype c n) (Sprop c0)) *) (* Goal: False *) inversion_clear H0. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: not (univ (Stype c n) (Sprop c0)) *) red in |- *; intros. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: False *) apply univ_inv with (Stype c n) (Sprop c0); intros; auto with arith pts. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: False *) inversion_clear H0. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) case (calc_dec c c'); intros. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: decide (univ (Stype c n) (Stype c' n')) *) case (le_gt_dec n n'); [ left | right ]. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: not (univ (Stype c n) (Stype c' n')) *) (* Goal: univ (Stype c n) (Stype c' n') *) elim e; auto with arith pts. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: not (univ (Stype c n) (Stype c' n')) *) red in |- *; intros. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: False *) apply univ_inv with (Stype c n) (Stype c' n'); intros; auto with arith pts. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: False *) inversion_clear H0. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) (* Goal: False *) absurd (n <= n'); auto with arith pts. (* Goal: decide (univ (Stype c n) (Stype c' n')) *) right; red in |- *; intros; apply n0. (* Goal: @eq calc c c' *) apply univ_inv with (Stype c n) (Stype c' n'); intros; auto with arith pts. (* Goal: @eq calc c c' *) inversion_clear H0; auto with arith pts. Qed. Lemma ecc_inf_axiom : forall s : srt_ecc, {sp : srt_ecc | ppal (axiom_ecc s) univ sp}. Proof. (* Goal: forall s : srt_ecc, @sig srt_ecc (fun sp : srt_ecc => @ppal srt_ecc (axiom_ecc s) univ sp) *) refine (fun s : srt_ecc => match s return {sp : srt_ecc | ppal (axiom_ecc s) univ sp} with | Sprop c => exist _ (Stype c 0) _ | Stype c n => exist _ (Stype c (S n)) _ end). (* Goal: @ppal srt_ecc (axiom_ecc (Stype c n)) univ (Stype c (S n)) *) (* Goal: @ppal srt_ecc (axiom_ecc (Sprop c)) univ (Stype c O) *) split; intros; auto with arith pts. (* Goal: @ppal srt_ecc (axiom_ecc (Stype c n)) univ (Stype c (S n)) *) (* Goal: univ (Stype c O) y *) inversion_clear H; auto with arith pts. (* Goal: @ppal srt_ecc (axiom_ecc (Stype c n)) univ (Stype c (S n)) *) split; intros; auto with arith pts. (* Goal: univ (Stype c (S n)) y *) inversion_clear H; auto with arith pts. Qed. Lemma ecc_inf_rule : forall x1 x2 : srt_ecc, {x3 : srt_ecc | rules_ecc x1 x2 x3 & forall s1 s2 s3 : srt_ecc, rules_ecc s1 s2 s3 -> univ x1 s1 -> univ x2 s2 -> univ x3 s3}. Proof. (* Goal: forall x1 x2 : srt_ecc, @sig2 srt_ecc (fun x3 : srt_ecc => rules_ecc x1 x2 x3) (fun x3 : srt_ecc => forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ x1 s1) (_ : univ x2 s2), univ x3 s3) *) refine (fun x1 x2 : srt_ecc => match x1, x2 return {x3 : srt_ecc | rules_ecc x1 x2 x3 & forall s1 s2 s3 : srt_ecc, rules_ecc s1 s2 s3 -> univ x1 s1 -> univ x2 s2 -> univ x3 s3} with | Sprop c, _ => exist2 _ _ x2 _ _ | Stype c n, Sprop c' => exist2 _ _ (Sprop c') _ _ | Stype c n, Stype c' n' => exist2 _ _ (Stype c' (max_nat n n')) _ _ end). (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Stype c' n') s2), univ (Stype c' (max_nat n n')) s3 *) (* Goal: rules_ecc (Stype c n) (Stype c' n') (Stype c' (max_nat n n')) *) (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Sprop c') s2), univ (Sprop c') s3 *) (* Goal: rules_ecc (Stype c n) (Sprop c') (Sprop c') *) (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Sprop c) s1) (_ : univ x2 s2), univ x2 s3 *) (* Goal: rules_ecc (Sprop c) x2 x2 *) auto with pts. (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Stype c' n') s2), univ (Stype c' (max_nat n n')) s3 *) (* Goal: rules_ecc (Stype c n) (Stype c' n') (Stype c' (max_nat n n')) *) (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Sprop c') s2), univ (Sprop c') s3 *) (* Goal: rules_ecc (Stype c n) (Sprop c') (Sprop c') *) (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Sprop c) s1) (_ : univ x2 s2), univ x2 s3 *) simple induction 1; intros; auto with arith pts. (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Stype c' n') s2), univ (Stype c' (max_nat n n')) s3 *) (* Goal: rules_ecc (Stype c n) (Stype c' n') (Stype c' (max_nat n n')) *) (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Sprop c') s2), univ (Sprop c') s3 *) (* Goal: rules_ecc (Stype c n) (Sprop c') (Sprop c') *) (* Goal: univ x2 (Stype c2 p) *) apply univ_trans with (Stype c2 m); auto with arith pts. (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Stype c' n') s2), univ (Stype c' (max_nat n n')) s3 *) (* Goal: rules_ecc (Stype c n) (Stype c' n') (Stype c' (max_nat n n')) *) (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Sprop c') s2), univ (Sprop c') s3 *) (* Goal: rules_ecc (Stype c n) (Sprop c') (Sprop c') *) auto with pts. (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Stype c' n') s2), univ (Stype c' (max_nat n n')) s3 *) (* Goal: rules_ecc (Stype c n) (Stype c' n') (Stype c' (max_nat n n')) *) (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Sprop c') s2), univ (Sprop c') s3 *) intros. (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Stype c' n') s2), univ (Stype c' (max_nat n n')) s3 *) (* Goal: rules_ecc (Stype c n) (Stype c' n') (Stype c' (max_nat n n')) *) (* Goal: univ (Sprop c') s3 *) apply univ_inv with (Sprop c') s2; intros. (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Stype c' n') s2), univ (Stype c' (max_nat n n')) s3 *) (* Goal: rules_ecc (Stype c n) (Stype c' n') (Stype c' (max_nat n n')) *) (* Goal: univ (Sprop c') s3 *) (* Goal: univ (Sprop c') s2 *) auto with arith pts. (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Stype c' n') s2), univ (Stype c' (max_nat n n')) s3 *) (* Goal: rules_ecc (Stype c n) (Stype c' n') (Stype c' (max_nat n n')) *) (* Goal: univ (Sprop c') s3 *) generalize H. (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Stype c' n') s2), univ (Stype c' (max_nat n n')) s3 *) (* Goal: rules_ecc (Stype c n) (Stype c' n') (Stype c' (max_nat n n')) *) (* Goal: forall _ : rules_ecc s1 s2 s3, univ (Sprop c') s3 *) inversion_clear H2; intros. (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Stype c' n') s2), univ (Stype c' (max_nat n n')) s3 *) (* Goal: rules_ecc (Stype c n) (Stype c' n') (Stype c' (max_nat n n')) *) (* Goal: univ (Sprop c') s3 *) inversion_clear H2; auto with arith pts. (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Stype c' n') s2), univ (Stype c' (max_nat n n')) s3 *) (* Goal: rules_ecc (Stype c n) (Stype c' n') (Stype c' (max_nat n n')) *) unfold max_nat in |- *. (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Stype c' n') s2), univ (Stype c' (max_nat n n')) s3 *) (* Goal: rules_ecc (Stype c n) (Stype c' n') (Stype c' (if le_gt_dec n n' then n' else n)) *) elim (le_gt_dec n n'); auto with arith pts. (* Goal: forall (s1 s2 s3 : srt_ecc) (_ : rules_ecc s1 s2 s3) (_ : univ (Stype c n) s1) (_ : univ (Stype c' n') s2), univ (Stype c' (max_nat n n')) s3 *) intros. (* Goal: univ (Stype c' (max_nat n n')) s3 *) apply univ_inv with (Stype c n) s1; intros; auto with arith pts. (* Goal: univ (Stype c' (max_nat n n')) s3 *) apply univ_inv with (Stype c' n') s2; intros; auto with arith pts. (* Goal: univ (Stype c' (max_nat n n')) s3 *) generalize H. (* Goal: forall _ : rules_ecc s1 s2 s3, univ (Stype c' (max_nat n n')) s3 *) inversion_clear H2. (* Goal: forall _ : rules_ecc (Stype c m) s2 s3, univ (Stype c' (max_nat n n')) s3 *) inversion_clear H3; intros. (* Goal: univ (Stype c' (max_nat n n')) s3 *) inversion_clear H3. (* Goal: univ (Stype c' (max_nat n n')) (Stype c' p) *) cut (max_nat n n' <= p); auto with arith pts. (* Goal: le (max_nat n n') p *) apply least_upper_bound_max_nat. (* Goal: le n' p *) (* Goal: le n p *) apply le_trans with m; auto with arith pts. (* Goal: le n' p *) apply le_trans with m0; auto with arith pts. Qed. End SortsOfECC. Require Export GenericSort. Definition sort_of_gen (gs : gen_sort) : Exc srt_ecc := match gs with | Gprop => value (Sprop Neg) | Gset => value (Sprop Pos) | Gtype n => value (Stype Neg n) | Gtypeset n => value (Stype Pos n) end. Definition gen_of_sort (s : srt_ecc) : gen_sort := match s with | Sprop Neg => Gprop | Sprop Pos => Gset | Stype Neg n => Gtype n | Stype Pos n => Gtypeset n end.
Require Import List. Import ListNotations. Require Import StructTact.StructTactics. Require Import StructTact.ListTactics. Require Import StructTact.ListUtil. Set Implicit Arguments. Section dedup. Variable A : Type. Hypothesis A_eq_dec : forall x y : A, {x = y} + {x <> y}. Fixpoint dedup (xs : list A) : list A := match xs with | [] => [] | x :: xs => let tail := dedup xs in if in_dec A_eq_dec x xs then tail else x :: tail end. Lemma dedup_eliminates_duplicates : forall a l l', dedup (a :: l ++ a :: l') = dedup (l ++ a :: l'). Proof. (* Goal: forall (a : A) (l l' : list A), @eq (list A) (dedup (@cons A a (@app A l (@cons A a l')))) (dedup (@app A l (@cons A a l'))) *) intros. (* Goal: @eq (list A) (dedup (@cons A a (@app A l (@cons A a l')))) (dedup (@app A l (@cons A a l'))) *) simpl in *. (* Goal: @eq (list A) (if @in_dec A A_eq_dec a (@app A l (@cons A a l')) then dedup (@app A l (@cons A a l')) else @cons A a (dedup (@app A l (@cons A a l')))) (dedup (@app A l (@cons A a l'))) *) break_match. (* Goal: @eq (list A) (@cons A a (dedup (@app A l (@cons A a l')))) (dedup (@app A l (@cons A a l'))) *) (* Goal: @eq (list A) (dedup (@app A l (@cons A a l'))) (dedup (@app A l (@cons A a l'))) *) + (* Goal: @eq (list A) (dedup (@app A l (@cons A a l'))) (dedup (@app A l (@cons A a l'))) *) auto. (* BG Goal: @eq (list A) (@cons A a (dedup (@app A l (@cons A a l')))) (dedup (@app A l (@cons A a l'))) *) + (* Goal: @eq (list A) (@cons A a (dedup (@app A l (@cons A a l')))) (dedup (@app A l (@cons A a l'))) *) exfalso. (* Goal: False *) intuition. Qed. Lemma dedup_In : forall (x : A) xs, In x xs -> In x (dedup xs). Proof. (* Goal: forall (x : A) (xs : list A) (_ : @In A x xs), @In A x (dedup xs) *) induction xs; intros; simpl in *. (* Goal: @In A x (if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs)) *) (* Goal: False *) - (* Goal: False *) intuition. (* BG Goal: @In A x (if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs)) *) - (* Goal: @In A x (if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs)) *) break_if; intuition; subst; simpl; auto. Qed. Lemma filter_dedup (pred : A -> bool) : forall xs (p : A) ys, pred p = false -> filter pred (dedup (xs ++ ys)) = filter pred (dedup (xs ++ p :: ys)). Proof. (* Goal: forall (xs : list A) (p : A) (ys : list A) (_ : @eq bool (pred p) false), @eq (list A) (@filter A pred (dedup (@app A xs ys))) (@filter A pred (dedup (@app A xs (@cons A p ys)))) *) intros. (* Goal: @eq (list A) (@filter A pred (dedup (@app A xs ys))) (@filter A pred (dedup (@app A xs (@cons A p ys)))) *) induction xs; simpl; repeat (break_match; simpl); auto using f_equal2; try discriminate. (* Goal: @eq (list A) (@cons A a (@filter A pred (dedup (@app A xs ys)))) (@filter A pred (dedup (@app A xs (@cons A p ys)))) *) (* Goal: @eq (list A) (@filter A pred (dedup (@app A xs ys))) (@cons A a (@filter A pred (dedup (@app A xs (@cons A p ys))))) *) + (* Goal: @eq (list A) (@filter A pred (dedup (@app A xs ys))) (@cons A a (@filter A pred (dedup (@app A xs (@cons A p ys))))) *) exfalso. (* Goal: False *) apply n. (* Goal: @In A a (@app A xs (@cons A p ys)) *) apply in_app_iff. (* Goal: or (@In A a xs) (@In A a (@cons A p ys)) *) apply in_app_or in i. (* Goal: or (@In A a xs) (@In A a (@cons A p ys)) *) intuition. (* BG Goal: @eq (list A) (@cons A a (@filter A pred (dedup (@app A xs ys)))) (@filter A pred (dedup (@app A xs (@cons A p ys)))) *) + (* Goal: @eq (list A) (@cons A a (@filter A pred (dedup (@app A xs ys)))) (@filter A pred (dedup (@app A xs (@cons A p ys)))) *) exfalso. (* Goal: False *) apply n. (* Goal: @In A a (@app A xs ys) *) apply in_app_or in i. (* Goal: @In A a (@app A xs ys) *) intuition. (* Goal: @In A a (@app A xs ys) *) * (* Goal: @In A a (@app A xs ys) *) simpl in *. (* Goal: @In A a (@app A xs ys) *) intuition. (* Goal: @In A a (@app A xs ys) *) congruence. Qed. Lemma dedup_app : forall (xs ys : list A), (forall x y, In x xs -> In y ys -> x <> y) -> dedup (xs ++ ys) = dedup xs ++ dedup ys. Proof. (* Goal: forall (xs ys : list A) (_ : forall (x y : A) (_ : @In A x xs) (_ : @In A y ys), not (@eq A x y)), @eq (list A) (dedup (@app A xs ys)) (@app A (dedup xs) (dedup ys)) *) intros. (* Goal: @eq (list A) (dedup (@app A xs ys)) (@app A (dedup xs) (dedup ys)) *) induction xs; simpl; auto. (* Goal: @eq (list A) (if @in_dec A A_eq_dec a (@app A xs ys) then dedup (@app A xs ys) else @cons A a (dedup (@app A xs ys))) (@app A (if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs)) (dedup ys)) *) repeat break_match. (* Goal: @eq (list A) (@cons A a (dedup (@app A xs ys))) (@app A (@cons A a (dedup xs)) (dedup ys)) *) (* Goal: @eq (list A) (@cons A a (dedup (@app A xs ys))) (@app A (dedup xs) (dedup ys)) *) (* Goal: @eq (list A) (dedup (@app A xs ys)) (@app A (@cons A a (dedup xs)) (dedup ys)) *) (* Goal: @eq (list A) (dedup (@app A xs ys)) (@app A (dedup xs) (dedup ys)) *) - (* Goal: @eq (list A) (dedup (@app A xs ys)) (@app A (dedup xs) (dedup ys)) *) apply IHxs. (* Goal: forall (x y : A) (_ : @In A x xs) (_ : @In A y ys), not (@eq A x y) *) intros. (* Goal: not (@eq A x y) *) apply H; intuition. (* BG Goal: @eq (list A) (@cons A a (dedup (@app A xs ys))) (@app A (@cons A a (dedup xs)) (dedup ys)) *) (* BG Goal: @eq (list A) (@cons A a (dedup (@app A xs ys))) (@app A (dedup xs) (dedup ys)) *) (* BG Goal: @eq (list A) (dedup (@app A xs ys)) (@app A (@cons A a (dedup xs)) (dedup ys)) *) - (* Goal: @eq (list A) (dedup (@app A xs ys)) (@app A (@cons A a (dedup xs)) (dedup ys)) *) exfalso. (* Goal: False *) specialize (H a a). (* Goal: False *) apply H; intuition. (* Goal: @In A a ys *) do_in_app. (* Goal: @In A a ys *) intuition. (* BG Goal: @eq (list A) (@cons A a (dedup (@app A xs ys))) (@app A (@cons A a (dedup xs)) (dedup ys)) *) (* BG Goal: @eq (list A) (@cons A a (dedup (@app A xs ys))) (@app A (dedup xs) (dedup ys)) *) - (* Goal: @eq (list A) (@cons A a (dedup (@app A xs ys))) (@app A (dedup xs) (dedup ys)) *) exfalso. (* Goal: False *) apply n. (* Goal: @In A a (@app A xs ys) *) intuition. (* BG Goal: @eq (list A) (@cons A a (dedup (@app A xs ys))) (@app A (@cons A a (dedup xs)) (dedup ys)) *) - (* Goal: @eq (list A) (@cons A a (dedup (@app A xs ys))) (@app A (@cons A a (dedup xs)) (dedup ys)) *) simpl. (* Goal: @eq (list A) (@cons A a (dedup (@app A xs ys))) (@cons A a (@app A (dedup xs) (dedup ys))) *) f_equal. (* Goal: @eq (list A) (dedup (@app A xs ys)) (@app A (dedup xs) (dedup ys)) *) apply IHxs. (* Goal: forall (x y : A) (_ : @In A x xs) (_ : @In A y ys), not (@eq A x y) *) intros. (* Goal: not (@eq A x y) *) apply H; intuition. Qed. Lemma in_dedup_was_in : forall xs (x : A), In x (dedup xs) -> In x xs. Proof. (* Goal: forall (xs : list A) (x : A) (_ : @In A x (dedup xs)), @In A x xs *) induction xs; intros; simpl in *. (* Goal: or (@eq A a x) (@In A x xs) *) (* Goal: False *) - (* Goal: False *) intuition. (* BG Goal: or (@eq A a x) (@In A x xs) *) - (* Goal: or (@eq A a x) (@In A x xs) *) break_if; simpl in *; intuition. Qed. Lemma NoDup_dedup : forall (xs : list A), NoDup (dedup xs). Proof. (* Goal: forall xs : list A, @NoDup A (dedup xs) *) induction xs; simpl. (* Goal: @NoDup A (if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs)) *) (* Goal: @NoDup A (@nil A) *) - (* Goal: @NoDup A (@nil A) *) constructor. (* BG Goal: @NoDup A (if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs)) *) - (* Goal: @NoDup A (if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs)) *) break_if; auto. (* Goal: @NoDup A (@cons A a (dedup xs)) *) constructor; auto. (* Goal: not (@In A a (dedup xs)) *) intro. (* Goal: False *) apply n. (* Goal: @In A a xs *) eapply in_dedup_was_in; eauto. Qed. Lemma remove_dedup_comm : forall (x : A) xs, remove A_eq_dec x (dedup xs) = dedup (remove A_eq_dec x xs). Proof. (* Goal: forall (x : A) (xs : list A), @eq (list A) (@remove A A_eq_dec x (dedup xs)) (dedup (@remove A A_eq_dec x xs)) *) induction xs; intros. (* Goal: @eq (list A) (@remove A A_eq_dec x (dedup (@cons A a xs))) (dedup (@remove A A_eq_dec x (@cons A a xs))) *) (* Goal: @eq (list A) (@remove A A_eq_dec x (dedup (@nil A))) (dedup (@remove A A_eq_dec x (@nil A))) *) - (* Goal: @eq (list A) (@remove A A_eq_dec x (dedup (@nil A))) (dedup (@remove A A_eq_dec x (@nil A))) *) auto. (* BG Goal: @eq (list A) (@remove A A_eq_dec x (dedup (@cons A a xs))) (dedup (@remove A A_eq_dec x (@cons A a xs))) *) - (* Goal: @eq (list A) (@remove A A_eq_dec x (dedup (@cons A a xs))) (dedup (@remove A A_eq_dec x (@cons A a xs))) *) simpl. (* Goal: @eq (list A) (@remove A A_eq_dec x (if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs))) (dedup (if A_eq_dec x a then @remove A A_eq_dec x xs else @cons A a (@remove A A_eq_dec x xs))) *) repeat (break_match; simpl); auto using f_equal. (* Goal: @eq (list A) (@cons A a (@remove A A_eq_dec x (dedup xs))) (dedup (@remove A A_eq_dec x xs)) *) (* Goal: @eq (list A) (@remove A A_eq_dec x (dedup xs)) (@cons A a (dedup (@remove A A_eq_dec x xs))) *) + (* Goal: @eq (list A) (@remove A A_eq_dec x (dedup xs)) (@cons A a (dedup (@remove A A_eq_dec x xs))) *) exfalso. (* Goal: False *) apply n0. (* Goal: @In A a (@remove A A_eq_dec x xs) *) apply remove_preserve; auto. (* BG Goal: @eq (list A) (@cons A a (@remove A A_eq_dec x (dedup xs))) (dedup (@remove A A_eq_dec x xs)) *) + (* Goal: @eq (list A) (@cons A a (@remove A A_eq_dec x (dedup xs))) (dedup (@remove A A_eq_dec x xs)) *) exfalso. (* Goal: False *) apply n. (* Goal: @In A a xs *) eapply in_remove; eauto. Qed. Lemma dedup_partition : forall xs (p : A) ys xs' ys', dedup (xs ++ p :: ys) = xs' ++ p :: ys' -> remove A_eq_dec p (dedup (xs ++ ys)) = xs' ++ ys'. Proof. (* Goal: forall (xs : list A) (p : A) (ys xs' ys' : list A) (_ : @eq (list A) (dedup (@app A xs (@cons A p ys))) (@app A xs' (@cons A p ys'))), @eq (list A) (@remove A A_eq_dec p (dedup (@app A xs ys))) (@app A xs' ys') *) intros xs p ys xs' ys' H. (* Goal: @eq (list A) (@remove A A_eq_dec p (dedup (@app A xs ys))) (@app A xs' ys') *) f_apply H (remove A_eq_dec p). (* Goal: @eq (list A) (@remove A A_eq_dec p (dedup (@app A xs ys))) (@app A xs' ys') *) rewrite remove_dedup_comm, remove_partition in *. (* Goal: @eq (list A) (dedup (@remove A A_eq_dec p (@app A xs ys))) (@app A xs' ys') *) find_rewrite. (* Goal: @eq (list A) (@remove A A_eq_dec p (@app A xs' (@cons A p ys'))) (@app A xs' ys') *) rewrite remove_partition. (* Goal: @eq (list A) (@remove A A_eq_dec p (@app A xs' ys')) (@app A xs' ys') *) apply remove_not_in. (* Goal: not (@In A p (@app A xs' ys')) *) apply NoDup_remove_2. (* Goal: @NoDup A (@app A xs' (@cons A p ys')) *) rewrite <- H. (* Goal: @NoDup A (dedup (@app A xs (@cons A p ys))) *) apply NoDup_dedup. Qed. Lemma dedup_NoDup_id : forall (xs : list A), NoDup xs -> dedup xs = xs. Proof. (* Goal: forall (xs : list A) (_ : @NoDup A xs), @eq (list A) (dedup xs) xs *) induction xs; intros. (* Goal: @eq (list A) (dedup (@cons A a xs)) (@cons A a xs) *) (* Goal: @eq (list A) (dedup (@nil A)) (@nil A) *) - (* Goal: @eq (list A) (dedup (@nil A)) (@nil A) *) auto. (* BG Goal: @eq (list A) (dedup (@cons A a xs)) (@cons A a xs) *) - (* Goal: @eq (list A) (dedup (@cons A a xs)) (@cons A a xs) *) simpl. (* Goal: @eq (list A) (if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs)) (@cons A a xs) *) invc_NoDup. (* Goal: @eq (list A) (if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs)) (@cons A a xs) *) concludes. (* Goal: @eq (list A) (if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs)) (@cons A a xs) *) break_if; congruence. Qed. Lemma dedup_not_in_cons : forall x xs, (~ In x xs) -> x :: dedup xs = dedup (x :: xs). Proof. (* Goal: forall (x : A) (xs : list A) (_ : not (@In A x xs)), @eq (list A) (@cons A x (dedup xs)) (dedup (@cons A x xs)) *) induction xs; intros. (* Goal: @eq (list A) (@cons A x (dedup (@cons A a xs))) (dedup (@cons A x (@cons A a xs))) *) (* Goal: @eq (list A) (@cons A x (dedup (@nil A))) (dedup (@cons A x (@nil A))) *) - (* Goal: @eq (list A) (@cons A x (dedup (@nil A))) (dedup (@cons A x (@nil A))) *) auto. (* BG Goal: @eq (list A) (@cons A x (dedup (@cons A a xs))) (dedup (@cons A x (@cons A a xs))) *) - (* Goal: @eq (list A) (@cons A x (dedup (@cons A a xs))) (dedup (@cons A x (@cons A a xs))) *) simpl in *. (* Goal: @eq (list A) (@cons A x (if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs))) (if match A_eq_dec a x with | left e => @left (or (@eq A a x) (@In A x xs)) (not (or (@eq A a x) (@In A x xs))) (@or_introl (@eq A a x) (@In A x xs) e) | right n => match @in_dec A A_eq_dec x xs with | left i => @left (or (@eq A a x) (@In A x xs)) (not (or (@eq A a x) (@In A x xs))) (@or_intror (@eq A a x) (@In A x xs) i) | right n0 => @right (or (@eq A a x) (@In A x xs)) (not (or (@eq A a x) (@In A x xs))) (fun H0 : or (@eq A a x) (@In A x xs) => match H0 with | or_introl Hc1 => n Hc1 | or_intror Hc2 => n0 Hc2 end) end end then if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs) else @cons A x (if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs))) *) intuition. (* Goal: @eq (list A) (@cons A x (if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs))) (if match A_eq_dec a x with | left e => @left (or (@eq A a x) (@In A x xs)) (forall _ : or (@eq A a x) (@In A x xs), False) (@or_introl (@eq A a x) (@In A x xs) e) | right n => match @in_dec A A_eq_dec x xs with | left i => @left (or (@eq A a x) (@In A x xs)) (forall _ : or (@eq A a x) (@In A x xs), False) (@or_intror (@eq A a x) (@In A x xs) i) | right n0 => @right (or (@eq A a x) (@In A x xs)) (forall _ : or (@eq A a x) (@In A x xs), False) (fun H0 : or (@eq A a x) (@In A x xs) => match H0 with | or_introl Hc1 => n Hc1 | or_intror Hc2 => n0 Hc2 end) end end then if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs) else @cons A x (if @in_dec A A_eq_dec a xs then dedup xs else @cons A a (dedup xs))) *) repeat break_match; intuition. Qed. End dedup.
Require Export GeoCoq.Elements.OriginalProofs.lemma_congruencetransitive. Section Euclid. Context `{Ax:euclidean_neutral}. Lemma lemma_congruenceflip : forall A B C D, Cong A B C D -> Cong B A D C /\ Cong B A C D /\ Cong A B D C. Proof. (* Goal: forall (A B C D : @Point Ax) (_ : @Cong Ax A B C D), and (@Cong Ax B A D C) (and (@Cong Ax B A C D) (@Cong Ax A B D C)) *) intros. (* Goal: and (@Cong Ax B A D C) (and (@Cong Ax B A C D) (@Cong Ax A B D C)) *) assert (Cong B A A B) by (conclude cn_equalityreverse). (* Goal: and (@Cong Ax B A D C) (and (@Cong Ax B A C D) (@Cong Ax A B D C)) *) assert (Cong C D D C) by (conclude cn_equalityreverse). (* Goal: and (@Cong Ax B A D C) (and (@Cong Ax B A C D) (@Cong Ax A B D C)) *) assert (Cong B A C D) by (conclude lemma_congruencetransitive). (* Goal: and (@Cong Ax B A D C) (and (@Cong Ax B A C D) (@Cong Ax A B D C)) *) assert (Cong A B D C) by (conclude lemma_congruencetransitive). (* Goal: and (@Cong Ax B A D C) (and (@Cong Ax B A C D) (@Cong Ax A B D C)) *) assert (Cong B A D C) by (conclude lemma_congruencetransitive). (* Goal: and (@Cong Ax B A D C) (and (@Cong Ax B A C D) (@Cong Ax A B D C)) *) close. Qed. End Euclid.
Set Implicit Arguments. Unset Strict Implicit. Require Export Sub_group. Require Export Module_facts. Require Export Module_util. Require Export Monoid_util. Require Export Group_util. Section Def. Variable R : RING. Variable M : MODULE R. Section Sub_module. Variable N : subgroup M. Hypothesis Nop : forall (a : R) (x : M), in_part x N -> in_part (module_mult a x) N. Let Na : ABELIAN_GROUP. Proof. (* Goal: Ob ABELIAN_GROUP *) apply (BUILD_ABELIAN_GROUP (E:=N) (genlaw:=sgroup_law N) (e:= monoid_unit N) (geninv:=group_inverse_map N)); auto with algebra. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))) (sgroup_law (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))) x y) (sgroup_law (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))) y x) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))) (sgroup_law (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))) x (@Ap (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))) (@group_inverse_map (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)) (group_on_def (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))) x)) (@monoid_unit (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))) (monoid_on_def (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))) *) simpl in |- *. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))) (sgroup_law (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))) x y) (sgroup_law (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))) y x) *) (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (group_inverse (abelian_group_group (@module_carrier R M)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@subgroup_prop (abelian_group_group (@module_carrier R M)) N (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R M))))) (@submonoid_prop (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) *) unfold subtype_image_equal in |- *. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))) (sgroup_law (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))) x y) (sgroup_law (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))) y x) *) (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (group_inverse (abelian_group_group (@module_carrier R M)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@subgroup_prop (abelian_group_group (@module_carrier R M)) N (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R M))))) (@submonoid_prop (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) *) simpl in |- *. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))) (sgroup_law (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))) x y) (sgroup_law (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))) y x) *) (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (group_inverse (abelian_group_group (@module_carrier R M)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R M))))) *) auto with algebra. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))) (sgroup_law (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))) x y) (sgroup_law (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))) y x) *) simpl in |- *. (* Goal: forall x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x y) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y x) *) unfold subtype_image_equal in |- *. (* Goal: forall x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x y)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y x)) *) simpl in |- *. (* Goal: forall x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) *) auto with algebra. Qed. Let endofun : R -> Endo_SET Na. Proof. (* Goal: forall _ : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), Carrier (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))))) *) intros a; try assumption. (* Goal: Carrier (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))))) *) simpl in |- *. (* Goal: Map (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) *) apply (Build_Map (A:=N) (B:=N) (Ap:=fun x : N => Build_subtype (Nop a (subtype_prf x)))). (* Goal: @fun_compatible (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))) (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))) (fun x : Carrier (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))) => @Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) *) red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) *) simpl in |- *. (* Goal: forall (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (_ : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) x y), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) *) unfold subtype_image_equal in |- *. (* Goal: forall (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) *) simpl in |- *. (* Goal: forall (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) *) auto with algebra. Qed. Definition submodule_op : operation (ring_monoid R) Na. Proof. (* Goal: Carrier (operation (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))) *) simpl in |- *. (* Goal: monoid_hom (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) (Endo_SET (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))))) *) apply (BUILD_HOM_MONOID (G:=ring_monoid R) (G':=Endo_SET N) (ff:=endofun)). (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))), @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (sgroup_law (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) x y)) (sgroup_law (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (endofun x) (endofun y)) *) (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))) x y), @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun x) (endofun y) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))), @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (sgroup_law (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) x y)) (sgroup_law (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (endofun x) (endofun y)) *) (* 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))))) x y), @Map_eq (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (endofun x) (endofun y) *) intros x y H'; red in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))), @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (sgroup_law (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) x y)) (sgroup_law (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (endofun x) (endofun y)) *) (* Goal: forall x0 : Carrier (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))), @Equal (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (@Ap (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (endofun x) x0) (@Ap (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (endofun y) x0) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))), @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (sgroup_law (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) x y)) (sgroup_law (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (endofun x) (endofun y)) *) (* Goal: forall x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M x (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)) (@Nop x (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M y (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)) (@Nop y (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0))) *) unfold subtype_image_equal in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))), @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (sgroup_law (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) x y)) (sgroup_law (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (endofun x) (endofun y)) *) (* Goal: forall x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M x (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)) (@Nop x (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M y (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)) (@Nop y (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)))) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))), @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (sgroup_law (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) x y)) (sgroup_law (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (endofun x) (endofun y)) *) (* Goal: forall x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@module_mult R M x (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)) (@module_mult R M y (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))), @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (sgroup_law (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) x y)) (sgroup_law (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (endofun x) (endofun y)) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Map_eq (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (endofun (sgroup_law (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) x y)) (sgroup_law (Endo_SET_sgroup (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))))) (endofun x) (endofun y)) *) intros x y; red in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) *) (* Goal: forall x0 : Carrier (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))), @Equal (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (@Ap (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (endofun (sgroup_law (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) x y)) x0) (@Ap (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (Endo_SET_sgroup (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))))) (endofun x) (endofun y)) x0) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) *) (* Goal: forall x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M (sgroup_law (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) x y) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)) (@Nop (sgroup_law (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) x y) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M x (@module_mult R M y (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0))) (@Nop x (@module_mult R M y (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)) (@Nop y (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)))) *) unfold subtype_image_equal in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) *) (* Goal: forall x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M (sgroup_law (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) x y) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)) (@Nop (sgroup_law (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) x y) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M x (@module_mult R M y (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0))) (@Nop x (@module_mult R M y (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)) (@Nop y (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0))))) *) simpl in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) *) (* Goal: forall x0 : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@module_mult R M (sgroup_law (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) x y) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)) (@module_mult R M x (@module_mult R M y (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0))) *) intros x0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@module_mult R M (sgroup_law (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) x y) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0)) (@module_mult R M x (@module_mult R M y (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0))) *) exact (MODULE_assoc x y (subtype_elt x0)). (* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) (endofun (@monoid_unit (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_on_def (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))))) (@monoid_unit (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (@group_of_subgroup (abelian_group_group (@module_carrier R M)) N))))))) *) simpl in |- *. (* Goal: @Map_eq (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (endofun (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) (Id (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))))) *) red in |- *. (* Goal: forall x : Carrier (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))), @Equal (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (@Ap (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (endofun (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R)))) x) (@Ap (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (Id (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))))) x) *) simpl in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) x *) unfold subtype_image_equal in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) *) simpl in |- *. (* Goal: forall x : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@module_mult R M (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) *) intros x; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@module_mult R M (@monoid_unit (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_monoid (ring_group R) (ring_on_def R))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) *) exact (MODULE_unit_l (subtype_elt x)). Qed. Definition submodule_module : module R. Proof. (* Goal: module R *) apply (Build_module (R:=R) (module_carrier:=Na)). (* Goal: module_on R Na *) apply (Build_module_on (R:=R) (M:=Na) (module_op:=submodule_op)). (* Goal: @op_lin_right R Na submodule_op *) (* Goal: @op_lin_left R Na submodule_op *) red in |- *. (* Goal: @op_lin_right R Na submodule_op *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))) (@Ap (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))) (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))))) (@sgroup_map (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))))) (@monoid_sgroup_hom (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))) (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))) submodule_op)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b)) x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group Na))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))) (@Ap (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))) (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))))) (@sgroup_map (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))))) (@monoid_sgroup_hom (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))) (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))) submodule_op)) a) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))) (@Ap (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))) (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))))) (@sgroup_map (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))))) (@monoid_sgroup_hom (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))) (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))) submodule_op)) b) x)) *) simpl in |- *. (* Goal: @op_lin_right R Na submodule_op *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) x0 x') (H0 : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) y y') => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y y' H H0) (fun x0 y z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M b (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop b (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)))) *) unfold subtype_image_equal in |- *. (* Goal: @op_lin_right R Na submodule_op *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y y' H H0) (fun x0 y z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M b (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop b (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))))) *) simpl in |- *. (* Goal: @op_lin_right R Na submodule_op *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@module_mult R M (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@module_mult R M b (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) *) auto with algebra. (* Goal: @op_lin_right R Na submodule_op *) red in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))) (@Ap (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))) (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))))) (@sgroup_map (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))))) (@monoid_sgroup_hom (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))) (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))) submodule_op)) a) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group Na))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group Na))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))) (@Ap (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))) (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))))) (@sgroup_map (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))))) (@monoid_sgroup_hom (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))) (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))) submodule_op)) a) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))) (@Ap (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))))) (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))))) (@sgroup_map (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R)))) (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na)))))) (@monoid_sgroup_hom (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult_sgroup (ring_group R) (ring_on_def R))) (@ring_mult_monoid (ring_group R) (ring_on_def R)))) (@ring_monoid (ring_group R) (ring_on_def R))) (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group Na))))) submodule_op)) a) y)) *) simpl in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) x0 x') (H0 : @subtype_image_equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) y0 y') => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)))) *) unfold subtype_image_equal in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (@Nop a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@subsgroup_prop (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (sgroup_law (@sg (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))))) (sgroup_law (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (fun (x0 x' y0 y' : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x')) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y0) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y')) => @SGROUP_comp (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 x' y0 y' H H0) (fun x0 y0 z : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) => @SGROUP_assoc (@sgroup_of_subsgroup (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x0 y0 z)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x))) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y)) (@Nop a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y) (@subtype_prf (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))))) *) simpl in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : @subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@module_mult R M a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x) (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) x)) (@module_mult R M a (@subtype_elt (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) N))) y))) *) auto with algebra. Qed. End Sub_module. Record submodule : Type := {submodule_subgroup : subgroup M; submodule_prop : forall (a : R) (x : M), in_part x submodule_subgroup -> in_part (module_mult a x) submodule_subgroup}. Definition module_of_submodule (N : submodule) := submodule_module (submodule_prop (s:=N)). End Def. Coercion module_of_submodule : submodule >-> module. Coercion submodule_subgroup : submodule >-> subgroup. Section Injection. Variable R : RING. Variable M : MODULE R. Variable N : submodule M. Lemma submodule_in_prop : forall (a : R) (x : M), in_part x N -> in_part (module_mult a x) N. Proof. (* 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 M)))))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) x (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) (@submodule_subgroup R M N))))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@module_mult R M a x) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) (@submodule_subgroup R M N)))) *) intros a x H'; try assumption. (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@module_mult R M a x) (@subsgroup_part (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@submonoid_subsgroup (group_monoid (abelian_group_group (@module_carrier R M))) (@subgroup_submonoid (abelian_group_group (@module_carrier R M)) (@submodule_subgroup R M N)))) *) apply (submodule_prop (R:=R) (M:=M) (s:=N)); auto with algebra. Qed. Definition inj_submodule : Hom (N:MODULE R) M. Proof. (* Goal: Carrier (@Hom (MODULE R) (@module_of_submodule R M N : Ob (MODULE R)) M) *) apply (BUILD_HOM_MODULE (R:=R) (Mod:=N:MODULE R) (Mod':=M) (ff:=fun x : N => subtype_elt x)); auto with algebra. Qed. Lemma inj_submodule_injective : injective inj_submodule. Proof. (* Goal: @injective (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) *) red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R M)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))) (group_monoid (abelian_group_group (@module_carrier R M))) (@module_monoid_hom R (@module_of_submodule R M N) M inj_submodule))) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (@module_of_submodule R M N)))))) x y *) auto with algebra. Qed. End Injection. Hint Resolve submodule_in_prop inj_submodule_injective: algebra.
Require Import List. Import ListNotations. Require Import StructTact.StructTactics. Set Implicit Arguments. Fixpoint Prefix {A} (l1 : list A) l2 : Prop := match l1, l2 with | a :: l1', b :: l2' => a = b /\ Prefix l1' l2' | [], _ => True | _, _ => False end. Section prefix. Variable A : Type. Lemma Prefix_refl : forall (l : list A), Prefix l l. Proof. (* Goal: forall l : list A, @Prefix A l l *) intros. (* Goal: @Prefix A l l *) induction l; simpl in *; auto. Qed. Lemma Prefix_nil : forall (l : list A), Prefix l [] -> l = []. Proof. (* Goal: forall (l : list A) (_ : @Prefix A l (@nil A)), @eq (list A) l (@nil A) *) intros. (* Goal: @eq (list A) l (@nil A) *) destruct l. (* Goal: @eq (list A) (@cons A a l) (@nil A) *) (* Goal: @eq (list A) (@nil A) (@nil A) *) - (* Goal: @eq (list A) (@nil A) (@nil A) *) reflexivity. (* BG Goal: @eq (list A) (@cons A a l) (@nil A) *) - (* Goal: @eq (list A) (@cons A a l) (@nil A) *) contradiction. Qed. Lemma Prefix_cons : forall (l l' : list A) a, Prefix l' l -> Prefix (a :: l') (a :: l). Proof. (* Goal: forall (l l' : list A) (a : A) (_ : @Prefix A l' l), @Prefix A (@cons A a l') (@cons A a l) *) simpl. (* Goal: forall (l l' : list A) (a : A) (_ : @Prefix A l' l), and (@eq A a a) (@Prefix A l' l) *) intuition. Qed. Lemma Prefix_in : forall (l l' : list A), Prefix l' l -> forall x, In x l' -> In x l. Proof. (* Goal: forall (l l' : list A) (_ : @Prefix A l' l) (x : A) (_ : @In A x l'), @In A x l *) induction l; intros l' H. (* Goal: forall (x : A) (_ : @In A x l'), @In A x (@cons A a l) *) (* Goal: forall (x : A) (_ : @In A x l'), @In A x (@nil A) *) - (* Goal: forall (x : A) (_ : @In A x l'), @In A x (@nil A) *) find_apply_lem_hyp Prefix_nil. (* Goal: forall (x : A) (_ : @In A x l'), @In A x (@nil A) *) subst. (* Goal: forall (x : A) (_ : @In A x (@nil A)), @In A x (@nil A) *) contradiction. (* BG Goal: forall (x : A) (_ : @In A x l'), @In A x (@cons A a l) *) - (* Goal: forall (x : A) (_ : @In A x l'), @In A x (@cons A a l) *) destruct l'. (* Goal: forall (x : A) (_ : @In A x (@cons A a0 l')), @In A x (@cons A a l) *) (* Goal: forall (x : A) (_ : @In A x (@nil A)), @In A x (@cons A a l) *) + (* Goal: forall (x : A) (_ : @In A x (@nil A)), @In A x (@cons A a l) *) contradiction. (* BG Goal: forall (x : A) (_ : @In A x (@cons A a0 l')), @In A x (@cons A a l) *) + (* Goal: forall (x : A) (_ : @In A x (@cons A a0 l')), @In A x (@cons A a l) *) intros. (* Goal: @In A x (@cons A a l) *) simpl Prefix in *. (* Goal: @In A x (@cons A a l) *) break_and. (* Goal: @In A x (@cons A a l) *) subst. (* Goal: @In A x (@cons A a l) *) simpl in *. (* Goal: or (@eq A a x) (@In A x l) *) intuition. (* Goal: or (@eq A a x) (@In A x l) *) right. (* Goal: @In A x l *) eapply IHl; eauto. Qed. Lemma app_Prefix : forall (xs ys zs : list A), xs ++ ys = zs -> Prefix xs zs. Proof. (* Goal: forall (xs ys zs : list A) (_ : @eq (list A) (@app A xs ys) zs), @Prefix A xs zs *) induction xs; intros; simpl in *. (* Goal: match zs with | nil => False | cons b l2' => and (@eq A a b) (@Prefix A xs l2') end *) (* Goal: True *) - (* Goal: True *) auto. (* BG Goal: match zs with | nil => False | cons b l2' => and (@eq A a b) (@Prefix A xs l2') end *) - (* Goal: match zs with | nil => False | cons b l2' => and (@eq A a b) (@Prefix A xs l2') end *) break_match. (* Goal: and (@eq A a a0) (@Prefix A xs l) *) (* Goal: False *) + (* Goal: False *) discriminate. (* BG Goal: and (@eq A a a0) (@Prefix A xs l) *) + (* Goal: and (@eq A a a0) (@Prefix A xs l) *) subst. (* Goal: and (@eq A a a0) (@Prefix A xs l) *) find_inversion. (* Goal: and (@eq A a0 a0) (@Prefix A xs (@app A xs ys)) *) eauto. Qed. Lemma Prefix_In : forall (l : list A) l' x, Prefix l l' -> In x l -> In x l'. Proof. (* Goal: forall (l l' : list A) (x : A) (_ : @Prefix A l l') (_ : @In A x l), @In A x l' *) induction l; intros; simpl in *; intuition; subst; break_match; intuition; subst; intuition. Qed. Lemma Prefix_exists_rest : forall (l1 l2 : list A), Prefix l1 l2 -> exists rest, l2 = l1 ++ rest. Proof. (* Goal: forall (l1 l2 : list A) (_ : @Prefix A l1 l2), @ex (list A) (fun rest : list A => @eq (list A) l2 (@app A l1 rest)) *) induction l1; intros; simpl in *; eauto. (* Goal: @ex (list A) (fun rest : list A => @eq (list A) l2 (@cons A a (@app A l1 rest))) *) break_match; intuition. (* Goal: @ex (list A) (fun rest : list A => @eq (list A) (@cons A a0 l) (@cons A a (@app A l1 rest))) *) subst. (* Goal: @ex (list A) (fun rest : list A => @eq (list A) (@cons A a0 l) (@cons A a0 (@app A l1 rest))) *) find_apply_hyp_hyp. (* Goal: @ex (list A) (fun rest : list A => @eq (list A) (@cons A a0 l) (@cons A a0 (@app A l1 rest))) *) break_exists_exists. (* Goal: @eq (list A) (@cons A a0 l) (@cons A a0 (@app A l1 x)) *) subst. (* Goal: @eq (list A) (@cons A a0 (@app A l1 x)) (@cons A a0 (@app A l1 x)) *) auto. Qed. End prefix.
Require Export GeoCoq.Tarski_dev.Ch08_orthogonality. Require Export GeoCoq.Tarski_dev.Annexes.coplanar. Ltac clean_reap_hyps := clean_duplicated_hyps; repeat match goal with | H:(Midpoint ?A ?B ?C), H2 : Midpoint ?A ?C ?B |- _ => clear H2 | H:(Col ?A ?B ?C), H2 : Col ?A ?C ?B |- _ => clear H2 | H:(Col ?A ?B ?C), H2 : Col ?B ?A ?C |- _ => clear H2 | H:(Col ?A ?B ?C), H2 : Col ?B ?C ?A |- _ => clear H2 | H:(Col ?A ?B ?C), H2 : Col ?C ?B ?A |- _ => clear H2 | H:(Col ?A ?B ?C), H2 : Col ?C ?A ?B |- _ => clear H2 | H:(Bet ?A ?B ?C), H2 : Bet ?C ?B ?A |- _ => clear H2 | H:(Cong ?A ?B ?C ?D), H2 : Cong ?A ?B ?D ?C |- _ => clear H2 | H:(Cong ?A ?B ?C ?D), H2 : Cong ?C ?D ?A ?B |- _ => clear H2 | H:(Cong ?A ?B ?C ?D), H2 : Cong ?C ?D ?B ?A |- _ => clear H2 | H:(Cong ?A ?B ?C ?D), H2 : Cong ?D ?C ?B ?A |- _ => clear H2 | H:(Cong ?A ?B ?C ?D), H2 : Cong ?D ?C ?A ?B |- _ => clear H2 | H:(Cong ?A ?B ?C ?D), H2 : Cong ?B ?A ?C ?D |- _ => clear H2 | H:(Cong ?A ?B ?C ?D), H2 : Cong ?B ?A ?D ?C |- _ => clear H2 | H:(Perp ?A ?B ?C ?D), H2 : Perp ?A ?B ?D ?C |- _ => clear H2 | H:(Perp ?A ?B ?C ?D), H2 : Perp ?C ?D ?A ?B |- _ => clear H2 | H:(Perp ?A ?B ?C ?D), H2 : Perp ?C ?D ?B ?A |- _ => clear H2 | H:(Perp ?A ?B ?C ?D), H2 : Perp ?D ?C ?B ?A |- _ => clear H2 | H:(Perp ?A ?B ?C ?D), H2 : Perp ?D ?C ?A ?B |- _ => clear H2 | H:(Perp ?A ?B ?C ?D), H2 : Perp ?B ?A ?C ?D |- _ => clear H2 | H:(Perp ?A ?B ?C ?D), H2 : Perp ?B ?A ?D ?C |- _ => clear H2 | H:(?A<>?B), H2 : (?B<>?A) |- _ => clear H2 | H:(Per ?A ?D ?C), H2 : (Per ?C ?D ?A) |- _ => clear H2 | H:(Perp_at ?X ?A ?B ?C ?D), H2 : Perp_at ?X ?A ?B ?D ?C |- _ => clear H2 | H:(Perp_at ?X ?A ?B ?C ?D), H2 : Perp_at ?X ?C ?D ?A ?B |- _ => clear H2 | H:(Perp_at ?X ?A ?B ?C ?D), H2 : Perp_at ?X ?C ?D ?B ?A |- _ => clear H2 | H:(Perp_at ?X ?A ?B ?C ?D), H2 : Perp_at ?X ?D ?C ?B ?A |- _ => clear H2 | H:(Perp_at ?X ?A ?B ?C ?D), H2 : Perp_at ?X ?D ?C ?A ?B |- _ => clear H2 | H:(Perp_at ?X ?A ?B ?C ?D), H2 : Perp_at ?X ?B ?A ?C ?D |- _ => clear H2 | H:(Perp_at ?X ?A ?B ?C ?D), H2 : Perp_at ?X ?B ?A ?D ?C |- _ => clear H2 end. Ltac assert_diffs := repeat match goal with | H:(~Col ?X1 ?X2 ?X3) |- _ => let h := fresh in not_exist_hyp3 X1 X2 X1 X3 X2 X3; assert (h := not_col_distincts X1 X2 X3 H);decompose [and] h;clear h;clean_reap_hyps | H:(~Bet ?X1 ?X2 ?X3) |- _ => let h := fresh in not_exist_hyp2 X1 X2 X2 X3; assert (h := not_bet_distincts X1 X2 X3 H);decompose [and] h;clear h;clean_reap_hyps | H:Bet ?A ?B ?C, H2 : ?A <> ?B |-_ => let T:= fresh in (not_exist_hyp_comm A C); assert (T:= bet_neq12__neq A B C H H2);clean_reap_hyps | H:Bet ?A ?B ?C, H2 : ?B <> ?A |-_ => let T:= fresh in (not_exist_hyp_comm A C); assert (T:= bet_neq21__neq A B C H H2);clean_reap_hyps | H:Bet ?A ?B ?C, H2 : ?B <> ?C |-_ => let T:= fresh in (not_exist_hyp_comm A C); assert (T:= bet_neq23__neq A B C H H2);clean_reap_hyps | H:Bet ?A ?B ?C, H2 : ?C <> ?B |-_ => let T:= fresh in (not_exist_hyp_comm A C); assert (T:= bet_neq32__neq A B C H H2);clean_reap_hyps | H:Cong ?A ?B ?C ?D, H2 : ?A <> ?B |-_ => let T:= fresh in (not_exist_hyp_comm C D); assert (T:= cong_diff A B C D H2 H);clean_reap_hyps | H:Cong ?A ?B ?C ?D, H2 : ?B <> ?A |-_ => let T:= fresh in (not_exist_hyp_comm C D); assert (T:= cong_diff_2 A B C D H2 H);clean_reap_hyps | H:Cong ?A ?B ?C ?D, H2 : ?C <> ?D |-_ => let T:= fresh in (not_exist_hyp_comm A B); assert (T:= cong_diff_3 A B C D H2 H);clean_reap_hyps | H:Cong ?A ?B ?C ?D, H2 : ?D <> ?C |-_ => let T:= fresh in (not_exist_hyp_comm A B); assert (T:= cong_diff_4 A B C D H2 H);clean_reap_hyps | H:Le ?A ?B ?C ?D, H2 : ?A <> ?B |-_ => let T:= fresh in (not_exist_hyp_comm C D); assert (T:= le_diff A B C D H2 H);clean_reap_hyps | H:Le ?A ?B ?C ?D, H2 : ?B <> ?A |-_ => let T:= fresh in (not_exist_hyp_comm C D); assert (T:= le_diff A B C D (swap_diff B A H2) H);clean_reap_hyps | H:Lt ?A ?B ?C ?D |-_ => let T:= fresh in (not_exist_hyp_comm C D); assert (T:= lt_diff A B C D H);clean_reap_hyps | H:Midpoint ?I ?A ?B, H2 : ?A<>?B |- _ => let T:= fresh in (not_exist_hyp2 I B I A); assert (T:= midpoint_distinct_1 I A B H2 H); decompose [and] T;clear T;clean_reap_hyps | H:Midpoint ?I ?A ?B, H2 : ?B<>?A |- _ => let T:= fresh in (not_exist_hyp2 I B I A); assert (T:= midpoint_distinct_1 I A B (swap_diff B A H2) H); decompose [and] T;clear T;clean_reap_hyps | H:Midpoint ?I ?A ?B, H2 : ?I<>?A |- _ => let T:= fresh in (not_exist_hyp2 I B A B); assert (T:= midpoint_distinct_2 I A B H2 H); decompose [and] T;clear T;clean_reap_hyps | H:Midpoint ?I ?A ?B, H2 : ?A<>?I |- _ => let T:= fresh in (not_exist_hyp2 I B A B); assert (T:= midpoint_distinct_2 I A B (swap_diff A I H2) H); decompose [and] T;clear T;clean_reap_hyps | H:Midpoint ?I ?A ?B, H2 : ?I<>?B |- _ => let T:= fresh in (not_exist_hyp2 I A A B); assert (T:= midpoint_distinct_3 I A B H2 H); decompose [and] T;clear T;clean_reap_hyps | H:Midpoint ?I ?A ?B, H2 : ?B<>?I |- _ => let T:= fresh in (not_exist_hyp2 I A A B); assert (T:= midpoint_distinct_3 I A B (swap_diff B I H2) H); decompose [and] T;clear T;clean_reap_hyps | H:Per ?A ?B ?C, H2 : ?A<>?B |- _ => let T:= fresh in (not_exist_hyp_comm A C); assert (T:= per_distinct A B C H H2); clean_reap_hyps | H:Per ?A ?B ?C, H2 : ?B<>?A |- _ => let T:= fresh in (not_exist_hyp_comm A C); assert (T:= per_distinct A B C H (swap_diff B A H2)); clean_reap_hyps | H:Per ?A ?B ?C, H2 : ?B<>?C |- _ => let T:= fresh in (not_exist_hyp_comm A C); assert (T:= per_distinct_1 A B C H H2); clean_reap_hyps | H:Per ?A ?B ?C, H2 : ?C<>?B |- _ => let T:= fresh in (not_exist_hyp_comm A C); assert (T:= per_distinct_1 A B C H (swap_diff C B H2)); clean_reap_hyps | H:Perp ?A ?B ?C ?D |- _ => let T:= fresh in (not_exist_hyp2 A B C D); assert (T:= perp_distinct A B C D H); decompose [and] T;clear T;clean_reap_hyps | H:Perp_at ?X ?A ?B ?C ?D |- _ => let T:= fresh in (not_exist_hyp2 A B C D); assert (T:= perp_in_distinct X A B C D H); decompose [and] T;clear T;clean_reap_hyps | H:Out ?A ?B ?C |- _ => let T:= fresh in (not_exist_hyp2 A B A C); assert (T:= out_distinct A B C H); decompose [and] T;clear T;clean_reap_hyps end. Ltac clean_trivial_hyps := repeat match goal with | H:(Cong ?X1 ?X1 ?X2 ?X2) |- _ => clear H | H:(Cong ?X1 ?X2 ?X2 ?X1) |- _ => clear H | H:(Cong ?X1 ?X2 ?X1 ?X2) |- _ => clear H | H:(Bet ?X1 ?X1 ?X2) |- _ => clear H | H:(Bet ?X2 ?X1 ?X1) |- _ => clear H | H:(Col ?X1 ?X1 ?X2) |- _ => clear H | H:(Col ?X2 ?X1 ?X1) |- _ => clear H | H:(Col ?X1 ?X2 ?X1) |- _ => clear H | H:(Per ?X1 ?X2 ?X2) |- _ => clear H | H:(Per ?X1 ?X1 ?X2) |- _ => clear H | H:(Midpoint ?X1 ?X1 ?X1) |- _ => clear H end. Ltac clean := clean_trivial_hyps;clean_reap_hyps. Section T9. Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}. Lemma ts_distincts : forall A B P Q, TS A B P Q -> A <> B /\ A <> P /\ A <> Q /\ B <> P /\ B <> Q /\ P <> Q. Proof. (* Goal: forall (A B P Q : @Tpoint Tn) (_ : @TS Tn A B P Q), and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B P)) (and (not (@eq (@Tpoint Tn) B Q)) (not (@eq (@Tpoint Tn) P Q)))))) *) intros A B P Q HTS. (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B P)) (and (not (@eq (@Tpoint Tn) B Q)) (not (@eq (@Tpoint Tn) P Q)))))) *) destruct HTS as [HNCol1 [HNCol2 [T [HCol HBet]]]]. (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B P)) (and (not (@eq (@Tpoint Tn) B Q)) (not (@eq (@Tpoint Tn) P Q)))))) *) assert_diffs. (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B P)) (and (not (@eq (@Tpoint Tn) B Q)) (not (@eq (@Tpoint Tn) P Q)))))) *) repeat split; auto. (* Goal: not (@eq (@Tpoint Tn) P Q) *) intro; treat_equalities; auto. Qed. Lemma l9_2 : forall A B P Q, TS A B P Q -> TS A B Q P. Proof. (* Goal: forall (A B P Q : @Tpoint Tn) (_ : @TS Tn A B P Q), @TS Tn A B Q P *) unfold TS. (* Goal: forall (A B P Q : @Tpoint Tn) (_ : and (not (@Col Tn P A B)) (and (not (@Col Tn Q A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn P T Q))))), and (not (@Col Tn Q A B)) (and (not (@Col Tn P A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn Q T P)))) *) intros. (* Goal: and (not (@Col Tn Q A B)) (and (not (@Col Tn P A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn Q T P)))) *) spliter. (* Goal: and (not (@Col Tn Q A B)) (and (not (@Col Tn P A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn Q T P)))) *) repeat split; try Col. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn Q T P)) *) destruct H1 as [T [HCol1 HCol2]]. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn Q T P)) *) exists T; Col; Between. Qed. Lemma invert_two_sides : forall A B P Q, TS A B P Q -> TS B A P Q. Lemma l9_3 : forall P Q A C M R B, TS P Q A C -> Col M P Q -> Midpoint M A C -> Col R P Q -> Out R A B -> TS P Q B C. Lemma mid_preserves_col : forall A B C M A' B' C', Col A B C -> Midpoint M A A' -> Midpoint M B B' -> Midpoint M C C' -> Col A' B' C'. Proof. (* Goal: forall (A B C M A' B' C' : @Tpoint Tn) (_ : @Col Tn A B C) (_ : @Midpoint Tn M A A') (_ : @Midpoint Tn M B B') (_ : @Midpoint Tn M C C'), @Col Tn A' B' C' *) intros. (* Goal: @Col Tn A' B' C' *) induction H. (* Goal: @Col Tn A' B' C' *) (* Goal: @Col Tn A' B' C' *) assert (Bet A' B' C'). (* Goal: @Col Tn A' B' C' *) (* Goal: @Col Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) eapply l7_15 with A B C M;auto. (* Goal: @Col Tn A' B' C' *) (* Goal: @Col Tn A' B' C' *) assert_cols;Col. (* Goal: @Col Tn A' B' C' *) induction H. (* Goal: @Col Tn A' B' C' *) (* Goal: @Col Tn A' B' C' *) assert (Bet B' C' A'). (* Goal: @Col Tn A' B' C' *) (* Goal: @Col Tn A' B' C' *) (* Goal: @Bet Tn B' C' A' *) eapply l7_15 with B C A M;auto. (* Goal: @Col Tn A' B' C' *) (* Goal: @Col Tn A' B' C' *) assert_cols;Col. (* Goal: @Col Tn A' B' C' *) assert (Bet C' A' B'). (* Goal: @Col Tn A' B' C' *) (* Goal: @Bet Tn C' A' B' *) eapply l7_15 with C A B M;auto. (* Goal: @Col Tn A' B' C' *) assert_cols;Col. Qed. Lemma per_mid_per : forall A B X Y M, A <> B -> Per X A B -> Midpoint M A B -> Midpoint M X Y -> Cong A X B Y /\ Per Y B A. Lemma sym_preserve_diff : forall A B M A' B', A <> B -> Midpoint M A A' -> Midpoint M B B' -> A'<> B'. Lemma l9_4_1_aux : forall P Q A C R S M, Le S C R A -> TS P Q A C -> Col R P Q -> Perp P Q A R -> Col S P Q -> Perp P Q C S -> Midpoint M R S -> (forall U C',Midpoint M U C' -> (Out R U A <-> Out S C C')). Lemma per_col_eq : forall A B C, Per A B C -> Col A B C -> B <> C -> A = B. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : @Per Tn A B C) (_ : @Col Tn A B C) (_ : not (@eq (@Tpoint Tn) B C)), @eq (@Tpoint Tn) A B *) intros. (* Goal: @eq (@Tpoint Tn) A B *) unfold Per in H. (* Goal: @eq (@Tpoint Tn) A B *) ex_and H C'. (* Goal: @eq (@Tpoint Tn) A B *) assert_bets. (* Goal: @eq (@Tpoint Tn) A B *) assert_cols. (* Goal: @eq (@Tpoint Tn) A B *) assert (Col A C C') by ColR. (* Goal: @eq (@Tpoint Tn) A B *) assert (C = C' \/ Midpoint A C C') by (eapply l7_20;Col). (* Goal: @eq (@Tpoint Tn) A B *) induction H6. (* Goal: @eq (@Tpoint Tn) A B *) (* Goal: @eq (@Tpoint Tn) A B *) treat_equalities. (* Goal: @eq (@Tpoint Tn) A B *) (* Goal: @eq (@Tpoint Tn) A C *) intuition. (* Goal: @eq (@Tpoint Tn) A B *) eapply l7_17;eauto. Qed. Lemma l9_4_1 : forall P Q A C R S M, TS P Q A C -> Col R P Q -> Perp P Q A R -> Col S P Q -> Perp P Q C S -> Midpoint M R S -> (forall U C',Midpoint M U C' -> (Out R U A <-> Out S C C')). Lemma mid_two_sides : forall A B M X Y, Midpoint M A B -> ~ Col A B X -> Midpoint M X Y -> TS A B X Y. Proof. (* Goal: forall (A B M X Y : @Tpoint Tn) (_ : @Midpoint Tn M A B) (_ : not (@Col Tn A B X)) (_ : @Midpoint Tn M X Y), @TS Tn A B X Y *) intros A B M X Y HM1 HNCol HM2. (* Goal: @TS Tn A B X Y *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Y)) *) (* Goal: not (@Col Tn Y A B) *) assert_diffs. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Y)) *) (* Goal: not (@Col Tn Y A B) *) assert (X<>Y) by (intro; treat_equalities; assert_cols; Col). (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Y)) *) (* Goal: not (@Col Tn Y A B) *) intro Col; apply HNCol; ColR. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Y)) *) exists M; split; Col; Between. Qed. Lemma col_preserves_two_sides : forall A B C D X Y, C <> D -> Col A B C -> Col A B D -> TS A B X Y -> TS C D X Y. Lemma out_out_two_sides : forall A B X Y U V I, A <> B -> TS A B X Y -> Col I A B -> Col I X Y -> Out I X U -> Out I Y V -> TS A B U V. Proof. (* Goal: forall (A B X Y U V I : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : @TS Tn A B X Y) (_ : @Col Tn I A B) (_ : @Col Tn I X Y) (_ : @Out Tn I X U) (_ : @Out Tn I Y V), @TS Tn A B U V *) intros. (* Goal: @TS Tn A B U V *) unfold TS in *. (* Goal: and (not (@Col Tn U A B)) (and (not (@Col Tn V A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)))) *) assert (~ Col X A B). (* Goal: and (not (@Col Tn U A B)) (and (not (@Col Tn V A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)))) *) (* Goal: not (@Col Tn X A B) *) spliter. (* Goal: and (not (@Col Tn U A B)) (and (not (@Col Tn V A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)))) *) (* Goal: not (@Col Tn X A B) *) assumption. (* Goal: and (not (@Col Tn U A B)) (and (not (@Col Tn V A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)))) *) spliter. (* Goal: and (not (@Col Tn U A B)) (and (not (@Col Tn V A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)))) *) repeat split. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) (* Goal: not (@Col Tn V A B) *) (* Goal: not (@Col Tn U A B) *) intro. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) (* Goal: not (@Col Tn V A B) *) (* Goal: False *) apply H5. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) (* Goal: not (@Col Tn V A B) *) (* Goal: @Col Tn X A B *) unfold Out in H3. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) (* Goal: not (@Col Tn V A B) *) (* Goal: @Col Tn X A B *) spliter. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) (* Goal: not (@Col Tn V A B) *) (* Goal: @Col Tn X A B *) induction H10. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) (* Goal: not (@Col Tn V A B) *) (* Goal: @Col Tn X A B *) (* Goal: @Col Tn X A B *) ColR. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) (* Goal: not (@Col Tn V A B) *) (* Goal: @Col Tn X A B *) ColR. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) (* Goal: not (@Col Tn V A B) *) intro. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) (* Goal: False *) apply H6. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) (* Goal: @Col Tn Y A B *) unfold Out in H4. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) (* Goal: @Col Tn Y A B *) spliter. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) (* Goal: @Col Tn Y A B *) induction H10. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) (* Goal: @Col Tn Y A B *) (* Goal: @Col Tn Y A B *) ColR. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) (* Goal: @Col Tn Y A B *) ColR. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) ex_and H7 T. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) assert (I = T). (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) (* Goal: @eq (@Tpoint Tn) I T *) { (* Goal: @eq (@Tpoint Tn) I T *) apply l6_21 with A B X Y; Col. (* Goal: not (@eq (@Tpoint Tn) X Y) *) intro; treat_equalities; Col. (* BG Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) } (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) subst I. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn U T V)) *) exists T. (* Goal: and (@Col Tn T A B) (@Bet Tn U T V) *) split. (* Goal: @Bet Tn U T V *) (* Goal: @Col Tn T A B *) assumption. (* Goal: @Bet Tn U T V *) unfold Out in *. (* Goal: @Bet Tn U T V *) spliter. (* Goal: @Bet Tn U T V *) induction H12; induction H10; eauto using outer_transitivity_between2, between_symmetry, between_inner_transitivity, between_exchange3, outer_transitivity_between. Qed. Lemma l9_4_2_aux : forall P Q A C R S U V, Le S C R A -> TS P Q A C -> Col R P Q -> Perp P Q A R -> Col S P Q -> Perp P Q C S -> Out R U A -> Out S V C -> TS P Q U V. Lemma l9_4_2 : forall P Q A C R S U V, TS P Q A C -> Col R P Q -> Perp P Q A R -> Col S P Q -> Perp P Q C S -> Out R U A -> Out S V C -> TS P Q U V. Lemma l9_5 : forall P Q A C R B, TS P Q A C -> Col R P Q -> Out R A B -> TS P Q B C. Lemma outer_pasch : forall A B C P Q, Bet A C P -> Bet B Q C -> exists X, Bet A X B /\ Bet P Q X. Lemma os_distincts : forall A B X Y, OS A B X Y -> A <> B /\ A <> X /\ A <> Y /\ B <> X /\ B <> Y. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : @OS Tn A B X Y), and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) A Y)) (and (not (@eq (@Tpoint Tn) B X)) (not (@eq (@Tpoint Tn) B Y))))) *) intros A B P Q HOS. (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B P)) (not (@eq (@Tpoint Tn) B Q))))) *) destruct HOS as [Z [HTS1 HTS2]]. (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B P)) (not (@eq (@Tpoint Tn) B Q))))) *) apply ts_distincts in HTS1. (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B P)) (not (@eq (@Tpoint Tn) B Q))))) *) apply ts_distincts in HTS2. (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B P)) (not (@eq (@Tpoint Tn) B Q))))) *) spliter. (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B P)) (not (@eq (@Tpoint Tn) B Q))))) *) repeat split; auto. Qed. Lemma invert_one_side : forall A B P Q, OS A B P Q -> OS B A P Q. Lemma l9_8_1 : forall P Q A B C, TS P Q A C -> TS P Q B C -> OS P Q A B. Proof. (* Goal: forall (P Q A B C : @Tpoint Tn) (_ : @TS Tn P Q A C) (_ : @TS Tn P Q B C), @OS Tn P Q A B *) intros. (* Goal: @OS Tn P Q A B *) unfold OS. (* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@TS Tn P Q A R) (@TS Tn P Q B R)) *) exists C. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q B C) *) split; assumption. Qed. Lemma not_two_sides_id : forall A P Q, ~ TS P Q A A. Proof. (* Goal: forall A P Q : @Tpoint Tn, not (@TS Tn P Q A A) *) intros. (* Goal: not (@TS Tn P Q A A) *) intro. (* Goal: False *) unfold TS in H. (* Goal: False *) spliter. (* Goal: False *) ex_and H1 T. (* Goal: False *) apply between_identity in H2. (* Goal: False *) subst T. (* Goal: False *) apply H0. (* Goal: @Col Tn A P Q *) apply H1. Qed. Lemma l9_8_2 : forall P Q A B C, TS P Q A C -> OS P Q A B -> TS P Q B C. Lemma l9_9 : forall P Q A B, TS P Q A B -> ~ OS P Q A B. Proof. (* Goal: forall (P Q A B : @Tpoint Tn) (_ : @TS Tn P Q A B), not (@OS Tn P Q A B) *) intros. (* Goal: not (@OS Tn P Q A B) *) intro. (* Goal: False *) apply (l9_8_2 P Q A B B ) in H. (* Goal: @OS Tn P Q A B *) (* Goal: False *) apply not_two_sides_id in H. (* Goal: @OS Tn P Q A B *) (* Goal: False *) assumption. (* Goal: @OS Tn P Q A B *) assumption. Qed. Lemma l9_9_bis : forall P Q A B, OS P Q A B -> ~ TS P Q A B. Lemma one_side_chara : forall P Q A B, OS P Q A B -> (forall X, Col X P Q -> ~ Bet A X B). Proof. (* Goal: forall (P Q A B : @Tpoint Tn) (_ : @OS Tn P Q A B) (X : @Tpoint Tn) (_ : @Col Tn X P Q), not (@Bet Tn A X B) *) intros. (* Goal: not (@Bet Tn A X B) *) assert(~ Col A P Q). (* Goal: not (@Bet Tn A X B) *) (* Goal: not (@Col Tn A P Q) *) destruct H as [R [[] _]]; assumption. (* Goal: not (@Bet Tn A X B) *) assert(~ Col B P Q). (* Goal: not (@Bet Tn A X B) *) (* Goal: not (@Col Tn B P Q) *) destruct H as [R [_ []]]; assumption. (* Goal: not (@Bet Tn A X B) *) apply l9_9_bis in H. (* Goal: not (@Bet Tn A X B) *) intro. (* Goal: False *) apply H. (* Goal: @TS Tn P Q A B *) unfold TS. (* Goal: and (not (@Col Tn A P Q)) (and (not (@Col Tn B P Q)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T B)))) *) repeat split. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T B)) *) (* Goal: not (@Col Tn B P Q) *) (* Goal: not (@Col Tn A P Q) *) assumption. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T B)) *) (* Goal: not (@Col Tn B P Q) *) assumption. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T B)) *) exists X. (* Goal: and (@Col Tn X P Q) (@Bet Tn A X B) *) intuition. Qed. Lemma l9_10 : forall P Q A, ~ Col A P Q -> exists C, TS P Q A C. Proof. (* Goal: forall (P Q A : @Tpoint Tn) (_ : not (@Col Tn A P Q)), @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @TS Tn P Q A C) *) intros. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @TS Tn P Q A C) *) double A P A'. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @TS Tn P Q A C) *) exists A'. (* Goal: @TS Tn P Q A A' *) unfold TS. (* Goal: and (not (@Col Tn A P Q)) (and (not (@Col Tn A' P Q)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')))) *) repeat split. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: not (@Col Tn A' P Q) *) (* Goal: not (@Col Tn A P Q) *) assumption. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: not (@Col Tn A' P Q) *) intro. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: @Col Tn A P Q *) eapply col_permutation_2. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: @Col Tn P Q A *) eapply (col_transitivity_1 _ A'). (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: @Col Tn P A' A *) (* Goal: @Col Tn P A' Q *) (* Goal: not (@eq (@Tpoint Tn) P A') *) intro. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: @Col Tn P A' A *) (* Goal: @Col Tn P A' Q *) (* Goal: False *) subst A'. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: @Col Tn P A' A *) (* Goal: @Col Tn P A' Q *) (* Goal: False *) apply l7_2 in H0. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: @Col Tn P A' A *) (* Goal: @Col Tn P A' Q *) (* Goal: False *) eapply is_midpoint_id in H0. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: @Col Tn P A' A *) (* Goal: @Col Tn P A' Q *) (* Goal: False *) subst A. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: @Col Tn P A' A *) (* Goal: @Col Tn P A' Q *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: @Col Tn P A' A *) (* Goal: @Col Tn P A' Q *) (* Goal: @Col Tn P P Q *) assumption. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: @Col Tn P A' A *) (* Goal: @Col Tn P A' Q *) apply col_permutation_4. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: @Col Tn P A' A *) (* Goal: @Col Tn A' P Q *) assumption. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: @Col Tn P A' A *) unfold Col. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: or (@Bet Tn P A' A) (or (@Bet Tn A' A P) (@Bet Tn A P A')) *) right; right. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: @Bet Tn A P A' *) apply midpoint_bet. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) (* Goal: @Midpoint Tn P A A' *) assumption. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T A')) *) exists P. (* Goal: and (@Col Tn P P Q) (@Bet Tn A P A') *) split. (* Goal: @Bet Tn A P A' *) (* Goal: @Col Tn P P Q *) apply col_trivial_1. (* Goal: @Bet Tn A P A' *) apply midpoint_bet. (* Goal: @Midpoint Tn P A A' *) assumption. Qed. Lemma one_side_reflexivity : forall P Q A, ~ Col A P Q -> OS P Q A A. Proof. (* Goal: forall (P Q A : @Tpoint Tn) (_ : not (@Col Tn A P Q)), @OS Tn P Q A A *) intros. (* Goal: @OS Tn P Q A A *) unfold OS. (* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@TS Tn P Q A R) (@TS Tn P Q A R)) *) double A P C. (* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@TS Tn P Q A R) (@TS Tn P Q A R)) *) exists C. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) assert (TS P Q A C). (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @TS Tn P Q A C *) repeat split. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C P Q) *) (* Goal: not (@Col Tn A P Q) *) assumption. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C P Q) *) intro. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: False *) apply H. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: @Col Tn A P Q *) apply col_permutation_2. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: @Col Tn P Q A *) eapply (col_transitivity_1 _ C). (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: @Col Tn P C A *) (* Goal: @Col Tn P C Q *) (* Goal: not (@eq (@Tpoint Tn) P C) *) intro. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: @Col Tn P C A *) (* Goal: @Col Tn P C Q *) (* Goal: False *) subst C. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: @Col Tn P C A *) (* Goal: @Col Tn P C Q *) (* Goal: False *) apply l7_2 in H0. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: @Col Tn P C A *) (* Goal: @Col Tn P C Q *) (* Goal: False *) apply is_midpoint_id in H0. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: @Col Tn P C A *) (* Goal: @Col Tn P C Q *) (* Goal: False *) subst A. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: @Col Tn P C A *) (* Goal: @Col Tn P C Q *) (* Goal: False *) apply H. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: @Col Tn P C A *) (* Goal: @Col Tn P C Q *) (* Goal: @Col Tn P P Q *) assumption. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: @Col Tn P C A *) (* Goal: @Col Tn P C Q *) apply col_permutation_4. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: @Col Tn P C A *) (* Goal: @Col Tn C P Q *) assumption. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: @Col Tn P C A *) unfold Col. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: or (@Bet Tn P C A) (or (@Bet Tn C A P) (@Bet Tn A P C)) *) right; right. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: @Bet Tn A P C *) apply midpoint_bet. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) (* Goal: @Midpoint Tn P A C *) assumption. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T P Q) (@Bet Tn A T C)) *) exists P. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: and (@Col Tn P P Q) (@Bet Tn A P C) *) split. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @Bet Tn A P C *) (* Goal: @Col Tn P P Q *) apply col_trivial_1. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @Bet Tn A P C *) apply midpoint_bet. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) (* Goal: @Midpoint Tn P A C *) assumption. (* Goal: and (@TS Tn P Q A C) (@TS Tn P Q A C) *) split; assumption. Qed. Lemma one_side_symmetry : forall P Q A B, OS P Q A B -> OS P Q B A. Proof. (* Goal: forall (P Q A B : @Tpoint Tn) (_ : @OS Tn P Q A B), @OS Tn P Q B A *) unfold OS. (* Goal: forall (P Q A B : @Tpoint Tn) (_ : @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@TS Tn P Q A R) (@TS Tn P Q B R))), @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@TS Tn P Q B R) (@TS Tn P Q A R)) *) intros. (* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@TS Tn P Q B R) (@TS Tn P Q A R)) *) ex_and H C. (* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@TS Tn P Q B R) (@TS Tn P Q A R)) *) exists C. (* Goal: and (@TS Tn P Q B C) (@TS Tn P Q A C) *) split; assumption. Qed. Lemma one_side_transitivity : forall P Q A B C, OS P Q A B -> OS P Q B C -> OS P Q A C. Lemma col_eq : forall A B X Y, A <> X -> Col A X Y -> Col B X Y -> ~ Col A X B -> X = Y. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A X)) (_ : @Col Tn A X Y) (_ : @Col Tn B X Y) (_ : not (@Col Tn A X B)), @eq (@Tpoint Tn) X Y *) intros. (* Goal: @eq (@Tpoint Tn) X Y *) apply eq_sym. (* Goal: @eq (@Tpoint Tn) Y X *) apply l6_21 with A X B X; assert_diffs; Col. Qed. Lemma l9_17 : forall A B C P Q, OS P Q A C -> Bet A B C -> OS P Q A B. Lemma l9_18 : forall X Y A B P, Col X Y P -> Col A B P -> (TS X Y A B <-> (Bet A P B /\ ~Col X Y A /\ ~Col X Y B)). Proof. (* Goal: forall (X Y A B P : @Tpoint Tn) (_ : @Col Tn X Y P) (_ : @Col Tn A B P), iff (@TS Tn X Y A B) (and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B)))) *) intros. (* Goal: iff (@TS Tn X Y A B) (and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B)))) *) split. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: forall _ : @TS Tn X Y A B, and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) intros. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) unfold TS in H1. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) spliter. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) assert (X <> Y). (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) intro. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) (* Goal: False *) subst Y. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) (* Goal: False *) spliter. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) (* Goal: False *) Col. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) ex_and H3 T. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) assert (P=T). (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) (* Goal: @eq (@Tpoint Tn) P T *) apply l6_21 with X Y A B; Col. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) (* Goal: not (@eq (@Tpoint Tn) A B) *) intro. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) (* Goal: False *) subst B. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) (* Goal: False *) apply between_identity in H5. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) (* Goal: False *) subst A. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) (* Goal: False *) contradiction. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) subst T. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) (* Goal: and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))) *) repeat split; Col. (* Goal: forall _ : and (@Bet Tn A P B) (and (not (@Col Tn X Y A)) (not (@Col Tn X Y B))), @TS Tn X Y A B *) intro. (* Goal: @TS Tn X Y A B *) unfold TS. (* Goal: and (not (@Col Tn A X Y)) (and (not (@Col Tn B X Y)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T X Y) (@Bet Tn A T B)))) *) spliter. (* Goal: and (not (@Col Tn A X Y)) (and (not (@Col Tn B X Y)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T X Y) (@Bet Tn A T B)))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T X Y) (@Bet Tn A T B)) *) exists P. (* Goal: and (@Col Tn P X Y) (@Bet Tn A P B) *) split. (* Goal: @Bet Tn A P B *) (* Goal: @Col Tn P X Y *) apply col_permutation_2. (* Goal: @Bet Tn A P B *) (* Goal: @Col Tn X Y P *) assumption. (* Goal: @Bet Tn A P B *) assumption. Qed. Lemma l9_19 : forall X Y A B P , Col X Y P -> Col A B P -> (OS X Y A B <-> (Out P A B /\ ~Col X Y A)). Lemma one_side_not_col123 : forall A B X Y, OS A B X Y -> ~ Col A B X. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : @OS Tn A B X Y), not (@Col Tn A B X) *) intros. (* Goal: not (@Col Tn A B X) *) unfold OS in H. (* Goal: not (@Col Tn A B X) *) ex_and H C. (* Goal: not (@Col Tn A B X) *) unfold TS in *. (* Goal: not (@Col Tn A B X) *) spliter. (* Goal: not (@Col Tn A B X) *) intro. (* Goal: False *) apply H. (* Goal: @Col Tn X A B *) apply col_permutation_2. (* Goal: @Col Tn A B X *) assumption. Qed. Lemma one_side_not_col124 : forall A B X Y, OS A B X Y -> ~ Col A B Y. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : @OS Tn A B X Y), not (@Col Tn A B Y) *) intros A B X Y HOS. (* Goal: not (@Col Tn A B Y) *) apply one_side_not_col123 with X. (* Goal: @OS Tn A B Y X *) apply one_side_symmetry, HOS. Qed. Lemma col_two_sides : forall A B C P Q, Col A B C -> A <> C -> TS A B P Q -> TS A C P Q. Lemma col_one_side : forall A B C P Q, Col A B C -> A <> C -> OS A B P Q -> OS A C P Q. Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : @Col Tn A B C) (_ : not (@eq (@Tpoint Tn) A C)) (_ : @OS Tn A B P Q), @OS Tn A C P Q *) unfold OS. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : @Col Tn A B C) (_ : not (@eq (@Tpoint Tn) A C)) (_ : @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@TS Tn A B P R) (@TS Tn A B Q R))), @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@TS Tn A C P R) (@TS Tn A C Q R)) *) intros. (* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@TS Tn A C P R) (@TS Tn A C Q R)) *) ex_and H1 T. (* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@TS Tn A C P R) (@TS Tn A C Q R)) *) exists T. (* Goal: and (@TS Tn A C P T) (@TS Tn A C Q T) *) split; eapply (col_two_sides _ B); assumption. Qed. Lemma out_out_one_side : forall A B X Y Z, OS A B X Y -> Out A Y Z -> OS A B X Z. Lemma out_one_side : forall A B X Y, (~ Col A B X \/ ~ Col A B Y) -> Out A X Y -> OS A B X Y. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : or (not (@Col Tn A B X)) (not (@Col Tn A B Y))) (_ : @Out Tn A X Y), @OS Tn A B X Y *) intros. (* Goal: @OS Tn A B X Y *) induction H. (* Goal: @OS Tn A B X Y *) (* Goal: @OS Tn A B X Y *) assert(~ Col X A B). (* Goal: @OS Tn A B X Y *) (* Goal: @OS Tn A B X Y *) (* Goal: not (@Col Tn X A B) *) intro. (* Goal: @OS Tn A B X Y *) (* Goal: @OS Tn A B X Y *) (* Goal: False *) apply H. (* Goal: @OS Tn A B X Y *) (* Goal: @OS Tn A B X Y *) (* Goal: @Col Tn A B X *) apply col_permutation_1. (* Goal: @OS Tn A B X Y *) (* Goal: @OS Tn A B X Y *) (* Goal: @Col Tn X A B *) assumption. (* Goal: @OS Tn A B X Y *) (* Goal: @OS Tn A B X Y *) assert(HH:=one_side_reflexivity A B X H1). (* Goal: @OS Tn A B X Y *) (* Goal: @OS Tn A B X Y *) eapply (out_out_one_side _ _ _ _ _ HH H0). (* Goal: @OS Tn A B X Y *) assert(~ Col Y A B). (* Goal: @OS Tn A B X Y *) (* Goal: not (@Col Tn Y A B) *) intro. (* Goal: @OS Tn A B X Y *) (* Goal: False *) apply H. (* Goal: @OS Tn A B X Y *) (* Goal: @Col Tn A B Y *) apply col_permutation_1. (* Goal: @OS Tn A B X Y *) (* Goal: @Col Tn Y A B *) assumption. (* Goal: @OS Tn A B X Y *) assert(HH:=one_side_reflexivity A B Y H1). (* Goal: @OS Tn A B X Y *) apply one_side_symmetry. (* Goal: @OS Tn A B Y X *) eapply (out_out_one_side _ _ _ _ _ HH). (* Goal: @Out Tn A Y X *) apply l6_6. (* Goal: @Out Tn A X Y *) assumption. Qed. Lemma bet_ts__ts : forall A B X Y Z, TS A B X Y -> Bet X Y Z -> TS A B X Z. Proof. (* Goal: forall (A B X Y Z : @Tpoint Tn) (_ : @TS Tn A B X Y) (_ : @Bet Tn X Y Z), @TS Tn A B X Z *) intros A B X Y Z [HNCol1 [HNCol2 [T [HT1 HT2]]]] HBet. (* Goal: @TS Tn A B X Z *) repeat split; trivial. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Z)) *) (* Goal: not (@Col Tn Z A B) *) intro; assert (Z = T); [apply (l6_21 A B X Y); Col; intro|]; treat_equalities; auto. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Z)) *) exists T; split; eBetween. Qed. Lemma bet_ts__os : forall A B X Y Z, TS A B X Y -> Bet X Y Z -> OS A B Y Z. Proof. (* Goal: forall (A B X Y Z : @Tpoint Tn) (_ : @TS Tn A B X Y) (_ : @Bet Tn X Y Z), @OS Tn A B Y Z *) intros A B X Y Z HTS HBet. (* Goal: @OS Tn A B Y Z *) exists X; split; apply l9_2; trivial. (* Goal: @TS Tn A B X Z *) apply bet_ts__ts with Y; assumption. Qed. Lemma l9_31 : forall A X Y Z, OS A X Y Z -> OS A Z Y X -> TS A Y X Z. Lemma col123__nos : forall A B P Q, Col P Q A -> ~ OS P Q A B. Proof. (* Goal: forall (A B P Q : @Tpoint Tn) (_ : @Col Tn P Q A), not (@OS Tn P Q A B) *) intros A B P Q HCol. (* Goal: not (@OS Tn P Q A B) *) intro HOne. (* Goal: False *) assert (~ Col P Q A) by (apply (one_side_not_col123 P Q A B); auto). (* Goal: False *) auto. Qed. Lemma col124__nos : forall A B P Q, Col P Q B -> ~ OS P Q A B. Proof. (* Goal: forall (A B P Q : @Tpoint Tn) (_ : @Col Tn P Q B), not (@OS Tn P Q A B) *) intros A B P Q HCol. (* Goal: not (@OS Tn P Q A B) *) intro HOne. (* Goal: False *) assert (HN : ~ OS P Q B A) by (apply col123__nos; auto). (* Goal: False *) apply HN; apply one_side_symmetry; auto. Qed. Lemma col2_os__os : forall A B C D X Y, C <> D -> Col A B C -> Col A B D -> OS A B X Y -> OS C D X Y. Proof. (* Goal: forall (A B C D X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) C D)) (_ : @Col Tn A B C) (_ : @Col Tn A B D) (_ : @OS Tn A B X Y), @OS Tn C D X Y *) intros A B C D X Y HCD HColC HColD Hos. (* Goal: @OS Tn C D X Y *) destruct Hos as [Z [Hts1 Hts2]]. (* Goal: @OS Tn C D X Y *) exists Z. (* Goal: and (@TS Tn C D X Z) (@TS Tn C D Y Z) *) split; apply (col_preserves_two_sides A B); auto. Qed. Lemma os_out_os : forall A B C D C' P , Col A B P -> OS A B C D -> Out P C C' -> OS A B C' D. Lemma ts_ts_os : forall A B C D, TS A B C D -> TS C D A B -> OS A C B D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @TS Tn A B C D) (_ : @TS Tn C D A B), @OS Tn A C B D *) intros. (* Goal: @OS Tn A C B D *) unfold TS in *. (* Goal: @OS Tn A C B D *) spliter. (* Goal: @OS Tn A C B D *) ex_and H4 T1. (* Goal: @OS Tn A C B D *) ex_and H2 T. (* Goal: @OS Tn A C B D *) assert(T1 = T). (* Goal: @OS Tn A C B D *) (* Goal: @eq (@Tpoint Tn) T1 T *) assert_cols. (* Goal: @OS Tn A C B D *) (* Goal: @eq (@Tpoint Tn) T1 T *) apply (l6_21 C D A B); Col. (* Goal: @OS Tn A C B D *) (* Goal: not (@eq (@Tpoint Tn) A B) *) intro. (* Goal: @OS Tn A C B D *) (* Goal: False *) subst B. (* Goal: @OS Tn A C B D *) (* Goal: False *) Col. (* Goal: @OS Tn A C B D *) subst T1. (* Goal: @OS Tn A C B D *) assert(OS A C T B). (* Goal: @OS Tn A C B D *) (* Goal: @OS Tn A C T B *) apply(out_one_side A C T B). (* Goal: @OS Tn A C B D *) (* Goal: @Out Tn A T B *) (* Goal: or (not (@Col Tn A C T)) (not (@Col Tn A C B)) *) right. (* Goal: @OS Tn A C B D *) (* Goal: @Out Tn A T B *) (* Goal: not (@Col Tn A C B) *) intro. (* Goal: @OS Tn A C B D *) (* Goal: @Out Tn A T B *) (* Goal: False *) Col. (* Goal: @OS Tn A C B D *) (* Goal: @Out Tn A T B *) unfold Out. (* Goal: @OS Tn A C B D *) (* Goal: and (not (@eq (@Tpoint Tn) T A)) (and (not (@eq (@Tpoint Tn) B A)) (or (@Bet Tn A T B) (@Bet Tn A B T))) *) repeat split. (* Goal: @OS Tn A C B D *) (* Goal: or (@Bet Tn A T B) (@Bet Tn A B T) *) (* Goal: not (@eq (@Tpoint Tn) B A) *) (* Goal: not (@eq (@Tpoint Tn) T A) *) intro. (* Goal: @OS Tn A C B D *) (* Goal: or (@Bet Tn A T B) (@Bet Tn A B T) *) (* Goal: not (@eq (@Tpoint Tn) B A) *) (* Goal: False *) subst T. (* Goal: @OS Tn A C B D *) (* Goal: or (@Bet Tn A T B) (@Bet Tn A B T) *) (* Goal: not (@eq (@Tpoint Tn) B A) *) (* Goal: False *) contradiction. (* Goal: @OS Tn A C B D *) (* Goal: or (@Bet Tn A T B) (@Bet Tn A B T) *) (* Goal: not (@eq (@Tpoint Tn) B A) *) intro. (* Goal: @OS Tn A C B D *) (* Goal: or (@Bet Tn A T B) (@Bet Tn A B T) *) (* Goal: False *) subst B. (* Goal: @OS Tn A C B D *) (* Goal: or (@Bet Tn A T B) (@Bet Tn A B T) *) (* Goal: False *) Col. (* Goal: @OS Tn A C B D *) (* Goal: or (@Bet Tn A T B) (@Bet Tn A B T) *) left. (* Goal: @OS Tn A C B D *) (* Goal: @Bet Tn A T B *) assumption. (* Goal: @OS Tn A C B D *) assert(OS C A T D). (* Goal: @OS Tn A C B D *) (* Goal: @OS Tn C A T D *) apply(out_one_side C A T D). (* Goal: @OS Tn A C B D *) (* Goal: @Out Tn C T D *) (* Goal: or (not (@Col Tn C A T)) (not (@Col Tn C A D)) *) right. (* Goal: @OS Tn A C B D *) (* Goal: @Out Tn C T D *) (* Goal: not (@Col Tn C A D) *) intro. (* Goal: @OS Tn A C B D *) (* Goal: @Out Tn C T D *) (* Goal: False *) apply H0. (* Goal: @OS Tn A C B D *) (* Goal: @Out Tn C T D *) (* Goal: @Col Tn A C D *) Col. (* Goal: @OS Tn A C B D *) (* Goal: @Out Tn C T D *) unfold Out. (* Goal: @OS Tn A C B D *) (* Goal: and (not (@eq (@Tpoint Tn) T C)) (and (not (@eq (@Tpoint Tn) D C)) (or (@Bet Tn C T D) (@Bet Tn C D T))) *) repeat split. (* Goal: @OS Tn A C B D *) (* Goal: or (@Bet Tn C T D) (@Bet Tn C D T) *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: not (@eq (@Tpoint Tn) T C) *) intro. (* Goal: @OS Tn A C B D *) (* Goal: or (@Bet Tn C T D) (@Bet Tn C D T) *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: False *) subst T. (* Goal: @OS Tn A C B D *) (* Goal: or (@Bet Tn C T D) (@Bet Tn C D T) *) (* Goal: not (@eq (@Tpoint Tn) D C) *) (* Goal: False *) contradiction. (* Goal: @OS Tn A C B D *) (* Goal: or (@Bet Tn C T D) (@Bet Tn C D T) *) (* Goal: not (@eq (@Tpoint Tn) D C) *) intro. (* Goal: @OS Tn A C B D *) (* Goal: or (@Bet Tn C T D) (@Bet Tn C D T) *) (* Goal: False *) subst D. (* Goal: @OS Tn A C B D *) (* Goal: or (@Bet Tn C T D) (@Bet Tn C D T) *) (* Goal: False *) Col. (* Goal: @OS Tn A C B D *) (* Goal: or (@Bet Tn C T D) (@Bet Tn C D T) *) left. (* Goal: @OS Tn A C B D *) (* Goal: @Bet Tn C T D *) assumption. (* Goal: @OS Tn A C B D *) apply invert_one_side in H8. (* Goal: @OS Tn A C B D *) apply (one_side_transitivity A C B T). (* Goal: @OS Tn A C T D *) (* Goal: @OS Tn A C B T *) apply one_side_symmetry. (* Goal: @OS Tn A C T D *) (* Goal: @OS Tn A C T B *) assumption. (* Goal: @OS Tn A C T D *) assumption. Qed. Lemma two_sides_not_col : forall A B X Y, TS A B X Y -> ~ Col A B X. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : @TS Tn A B X Y), not (@Col Tn A B X) *) intros. (* Goal: not (@Col Tn A B X) *) unfold TS in H. (* Goal: not (@Col Tn A B X) *) spliter. (* Goal: not (@Col Tn A B X) *) intro. (* Goal: False *) apply H. (* Goal: @Col Tn X A B *) apply col_permutation_2. (* Goal: @Col Tn A B X *) assumption. Qed. Lemma col_one_side_out : forall A B X Y, Col A X Y -> OS A B X Y -> Out A X Y. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : @Col Tn A X Y) (_ : @OS Tn A B X Y), @Out Tn A X Y *) intros. (* Goal: @Out Tn A X Y *) assert(X <> A /\ Y <> A). (* Goal: @Out Tn A X Y *) (* Goal: and (not (@eq (@Tpoint Tn) X A)) (not (@eq (@Tpoint Tn) Y A)) *) unfold OS in H0. (* Goal: @Out Tn A X Y *) (* Goal: and (not (@eq (@Tpoint Tn) X A)) (not (@eq (@Tpoint Tn) Y A)) *) ex_and H0 Z. (* Goal: @Out Tn A X Y *) (* Goal: and (not (@eq (@Tpoint Tn) X A)) (not (@eq (@Tpoint Tn) Y A)) *) unfold TS in *. (* Goal: @Out Tn A X Y *) (* Goal: and (not (@eq (@Tpoint Tn) X A)) (not (@eq (@Tpoint Tn) Y A)) *) spliter. (* Goal: @Out Tn A X Y *) (* Goal: and (not (@eq (@Tpoint Tn) X A)) (not (@eq (@Tpoint Tn) Y A)) *) ex_and H5 T0. (* Goal: @Out Tn A X Y *) (* Goal: and (not (@eq (@Tpoint Tn) X A)) (not (@eq (@Tpoint Tn) Y A)) *) ex_and H3 T1. (* Goal: @Out Tn A X Y *) (* Goal: and (not (@eq (@Tpoint Tn) X A)) (not (@eq (@Tpoint Tn) Y A)) *) split. (* Goal: @Out Tn A X Y *) (* Goal: not (@eq (@Tpoint Tn) Y A) *) (* Goal: not (@eq (@Tpoint Tn) X A) *) intro. (* Goal: @Out Tn A X Y *) (* Goal: not (@eq (@Tpoint Tn) Y A) *) (* Goal: False *) subst X. (* Goal: @Out Tn A X Y *) (* Goal: not (@eq (@Tpoint Tn) Y A) *) (* Goal: False *) Col. (* Goal: @Out Tn A X Y *) (* Goal: not (@eq (@Tpoint Tn) Y A) *) intro. (* Goal: @Out Tn A X Y *) (* Goal: False *) subst Y. (* Goal: @Out Tn A X Y *) (* Goal: False *) Col. (* Goal: @Out Tn A X Y *) spliter. (* Goal: @Out Tn A X Y *) unfold Col in H. (* Goal: @Out Tn A X Y *) induction H. (* Goal: @Out Tn A X Y *) (* Goal: @Out Tn A X Y *) unfold Out. (* Goal: @Out Tn A X Y *) (* Goal: and (not (@eq (@Tpoint Tn) X A)) (and (not (@eq (@Tpoint Tn) Y A)) (or (@Bet Tn A X Y) (@Bet Tn A Y X))) *) repeat split; try assumption. (* Goal: @Out Tn A X Y *) (* Goal: or (@Bet Tn A X Y) (@Bet Tn A Y X) *) left. (* Goal: @Out Tn A X Y *) (* Goal: @Bet Tn A X Y *) assumption. (* Goal: @Out Tn A X Y *) induction H. (* Goal: @Out Tn A X Y *) (* Goal: @Out Tn A X Y *) unfold Out. (* Goal: @Out Tn A X Y *) (* Goal: and (not (@eq (@Tpoint Tn) X A)) (and (not (@eq (@Tpoint Tn) Y A)) (or (@Bet Tn A X Y) (@Bet Tn A Y X))) *) repeat split; try assumption. (* Goal: @Out Tn A X Y *) (* Goal: or (@Bet Tn A X Y) (@Bet Tn A Y X) *) right. (* Goal: @Out Tn A X Y *) (* Goal: @Bet Tn A Y X *) apply between_symmetry. (* Goal: @Out Tn A X Y *) (* Goal: @Bet Tn X Y A *) assumption. (* Goal: @Out Tn A X Y *) assert(TS A B X Y). (* Goal: @Out Tn A X Y *) (* Goal: @TS Tn A B X Y *) unfold TS. (* Goal: @Out Tn A X Y *) (* Goal: and (not (@Col Tn X A B)) (and (not (@Col Tn Y A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Y)))) *) assert(HH0 := H0). (* Goal: @Out Tn A X Y *) (* Goal: and (not (@Col Tn X A B)) (and (not (@Col Tn Y A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Y)))) *) unfold OS in H0. (* Goal: @Out Tn A X Y *) (* Goal: and (not (@Col Tn X A B)) (and (not (@Col Tn Y A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Y)))) *) ex_and H0 Z. (* Goal: @Out Tn A X Y *) (* Goal: and (not (@Col Tn X A B)) (and (not (@Col Tn Y A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Y)))) *) unfold TS in *. (* Goal: @Out Tn A X Y *) (* Goal: and (not (@Col Tn X A B)) (and (not (@Col Tn Y A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Y)))) *) spliter. (* Goal: @Out Tn A X Y *) (* Goal: and (not (@Col Tn X A B)) (and (not (@Col Tn Y A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Y)))) *) repeat split. (* Goal: @Out Tn A X Y *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Y)) *) (* Goal: not (@Col Tn Y A B) *) (* Goal: not (@Col Tn X A B) *) assumption. (* Goal: @Out Tn A X Y *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Y)) *) (* Goal: not (@Col Tn Y A B) *) assumption. (* Goal: @Out Tn A X Y *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Y)) *) exists A. (* Goal: @Out Tn A X Y *) (* Goal: and (@Col Tn A A B) (@Bet Tn X A Y) *) split. (* Goal: @Out Tn A X Y *) (* Goal: @Bet Tn X A Y *) (* Goal: @Col Tn A A B *) apply col_trivial_1. (* Goal: @Out Tn A X Y *) (* Goal: @Bet Tn X A Y *) apply between_symmetry. (* Goal: @Out Tn A X Y *) (* Goal: @Bet Tn Y A X *) assumption. (* Goal: @Out Tn A X Y *) eapply l9_9 in H3. (* Goal: @Out Tn A X Y *) contradiction. Qed. Lemma col_two_sides_bet : forall A B X Y, Col A X Y -> TS A B X Y -> Bet X A Y. Lemma os_ts1324__os : forall A X Y Z, OS A X Y Z -> TS A Y X Z -> OS A Z X Y. Proof. (* Goal: forall (A X Y Z : @Tpoint Tn) (_ : @OS Tn A X Y Z) (_ : @TS Tn A Y X Z), @OS Tn A Z X Y *) intros A X Y Z Hos Hts. (* Goal: @OS Tn A Z X Y *) destruct Hts as [HNColXY [HNColYZ [P [HColP HPBet]]]]. (* Goal: @OS Tn A Z X Y *) apply (one_side_transitivity _ _ _ P). (* Goal: @OS Tn A Z P Y *) (* Goal: @OS Tn A Z X P *) - (* Goal: @OS Tn A Z X P *) apply invert_one_side. (* Goal: @OS Tn Z A X P *) apply one_side_symmetry. (* Goal: @OS Tn Z A P X *) apply one_side_symmetry in Hos. (* Goal: @OS Tn Z A P X *) apply one_side_not_col123 in Hos. (* Goal: @OS Tn Z A P X *) apply out_one_side; Col. (* Goal: @Out Tn Z P X *) apply bet_out; Between; intro; subst Z; Col. (* BG Goal: @OS Tn A Z P Y *) - (* Goal: @OS Tn A Z P Y *) apply out_one_side. (* Goal: @Out Tn A P Y *) (* Goal: or (not (@Col Tn A Z P)) (not (@Col Tn A Z Y)) *) right; Col. (* Goal: @Out Tn A P Y *) apply (col_one_side_out _ X); Col. (* Goal: @OS Tn A X P Y *) apply one_side_symmetry in Hos. (* Goal: @OS Tn A X P Y *) apply (one_side_transitivity _ _ _ Z); auto. (* Goal: @OS Tn A X P Z *) apply invert_one_side. (* Goal: @OS Tn X A P Z *) apply one_side_not_col123 in Hos. (* Goal: @OS Tn X A P Z *) apply out_one_side; Col. (* Goal: @Out Tn X P Z *) apply bet_out; auto; intro; subst X; Col. Qed. Lemma ts2__ex_bet2 : forall A B C D, TS A C B D -> TS B D A C -> exists X, Bet A X C /\ Bet B X D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @TS Tn A C B D) (_ : @TS Tn B D A C), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (@Bet Tn B X D)) *) intros A B C D HTS HTS'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (@Bet Tn B X D)) *) destruct HTS as [HNCol [HNCol1 [X [HCol HBet]]]]. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (@Bet Tn B X D)) *) exists X; split; trivial. (* Goal: @Bet Tn A X C *) apply col_two_sides_bet with B; trivial. (* Goal: @TS Tn X B A C *) assert_diffs. (* Goal: @TS Tn X B A C *) apply invert_two_sides, col_two_sides with D; Col. (* Goal: not (@eq (@Tpoint Tn) B X) *) intro; subst X; auto. Qed. Lemma ts2__inangle : forall A B C P, TS A C B P -> TS B P A C -> InAngle P A B C. Proof. (* Goal: forall (A B C P : @Tpoint Tn) (_ : @TS Tn A C B P) (_ : @TS Tn B P A C), @InAngle Tn P A B C *) intros A B C P HTS1 HTS2. (* Goal: @InAngle Tn P A B C *) destruct (ts2__ex_bet2 A B C P) as [X [HBet1 HBet2]]; trivial. (* Goal: @InAngle Tn P A B C *) apply ts_distincts in HTS2; spliter. (* Goal: @InAngle Tn P A B C *) repeat split; auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *) exists X; split; trivial. (* Goal: or (@eq (@Tpoint Tn) X B) (@Out Tn B X P) *) right; apply bet_out; auto. (* Goal: not (@eq (@Tpoint Tn) X B) *) intro; subst X. (* Goal: False *) apply (two_sides_not_col A C B P HTS1); Col. Qed. Lemma out_one_side_1 : forall A B C D X, ~ Col A B C -> Col A B X -> Out X C D -> OS A B C D. Lemma out_two_sides_two_sides : forall A B X Y P PX, A <> PX -> Col A B PX -> Out PX X P -> TS A B P Y -> TS A B X Y. Lemma l8_21_bis : forall A B C X Y, X <> Y -> ~ Col C A B -> exists P : Tpoint, Cong A P X Y /\ Perp A B P A /\ TS A B C P. Proof. (* Goal: forall (A B C X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) X Y)) (_ : not (@Col Tn C A B)), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) intros. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) assert (A <> B) by (intro; subst; Col). (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) assert(HH:= l8_21 A B C H1). (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) ex_and HH P. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) ex_and H2 T. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) assert(TS A B C P). (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) (* Goal: @TS Tn A B C P *) unfold TS. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) (* Goal: and (not (@Col Tn C A B)) (and (not (@Col Tn P A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P)))) *) repeat split; auto. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P)) *) (* Goal: not (@Col Tn P A B) *) intro. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P)) *) (* Goal: False *) apply perp_not_col in H2. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P)) *) (* Goal: False *) apply H2. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P)) *) (* Goal: @Col Tn A B P *) Col. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P)) *) exists T. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) (* Goal: and (@Col Tn T A B) (@Bet Tn C T P) *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) assert(P <> A). (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) (* Goal: not (@eq (@Tpoint Tn) P A) *) apply perp_distinct in H2. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) (* Goal: not (@eq (@Tpoint Tn) P A) *) tauto. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) assert(HH:= segment_construction_2 P A X Y H6). (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) ex_and HH P'. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Cong Tn A P X Y) (and (@Perp Tn A B P A) (@TS Tn A B C P))) *) exists P'. (* Goal: and (@Cong Tn A P' X Y) (and (@Perp Tn A B P' A) (@TS Tn A B C P')) *) assert(Perp A B P' A). (* Goal: and (@Cong Tn A P' X Y) (and (@Perp Tn A B P' A) (@TS Tn A B C P')) *) (* Goal: @Perp Tn A B P' A *) apply perp_sym. (* Goal: and (@Cong Tn A P' X Y) (and (@Perp Tn A B P' A) (@TS Tn A B C P')) *) (* Goal: @Perp Tn P' A A B *) apply perp_left_comm. (* Goal: and (@Cong Tn A P' X Y) (and (@Perp Tn A B P' A) (@TS Tn A B C P')) *) (* Goal: @Perp Tn A P' A B *) apply (perp_col _ P). (* Goal: and (@Cong Tn A P' X Y) (and (@Perp Tn A B P' A) (@TS Tn A B C P')) *) (* Goal: @Col Tn A P P' *) (* Goal: @Perp Tn A P A B *) (* Goal: not (@eq (@Tpoint Tn) A P') *) intro. (* Goal: and (@Cong Tn A P' X Y) (and (@Perp Tn A B P' A) (@TS Tn A B C P')) *) (* Goal: @Col Tn A P P' *) (* Goal: @Perp Tn A P A B *) (* Goal: False *) subst P'. (* Goal: and (@Cong Tn A P' X Y) (and (@Perp Tn A B P' A) (@TS Tn A B C P')) *) (* Goal: @Col Tn A P P' *) (* Goal: @Perp Tn A P A B *) (* Goal: False *) apply cong_symmetry in H8. (* Goal: and (@Cong Tn A P' X Y) (and (@Perp Tn A B P' A) (@TS Tn A B C P')) *) (* Goal: @Col Tn A P P' *) (* Goal: @Perp Tn A P A B *) (* Goal: False *) apply cong_identity in H8. (* Goal: and (@Cong Tn A P' X Y) (and (@Perp Tn A B P' A) (@TS Tn A B C P')) *) (* Goal: @Col Tn A P P' *) (* Goal: @Perp Tn A P A B *) (* Goal: False *) contradiction. (* Goal: and (@Cong Tn A P' X Y) (and (@Perp Tn A B P' A) (@TS Tn A B C P')) *) (* Goal: @Col Tn A P P' *) (* Goal: @Perp Tn A P A B *) Perp. (* Goal: and (@Cong Tn A P' X Y) (and (@Perp Tn A B P' A) (@TS Tn A B C P')) *) (* Goal: @Col Tn A P P' *) induction H7. (* Goal: and (@Cong Tn A P' X Y) (and (@Perp Tn A B P' A) (@TS Tn A B C P')) *) (* Goal: @Col Tn A P P' *) (* Goal: @Col Tn A P P' *) apply bet_col in H7. (* Goal: and (@Cong Tn A P' X Y) (and (@Perp Tn A B P' A) (@TS Tn A B C P')) *) (* Goal: @Col Tn A P P' *) (* Goal: @Col Tn A P P' *) Col. (* Goal: and (@Cong Tn A P' X Y) (and (@Perp Tn A B P' A) (@TS Tn A B C P')) *) (* Goal: @Col Tn A P P' *) apply bet_col in H7. (* Goal: and (@Cong Tn A P' X Y) (and (@Perp Tn A B P' A) (@TS Tn A B C P')) *) (* Goal: @Col Tn A P P' *) Col. (* Goal: and (@Cong Tn A P' X Y) (and (@Perp Tn A B P' A) (@TS Tn A B C P')) *) repeat split;auto. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) (* Goal: not (@Col Tn P' A B) *) apply perp_not_col in H9. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) (* Goal: not (@Col Tn P' A B) *) intro. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) (* Goal: False *) apply H9. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) (* Goal: @Col Tn A B P' *) Col. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) assert(OS A B P P'). (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) (* Goal: @OS Tn A B P P' *) apply out_one_side. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) (* Goal: @Out Tn A P P' *) (* Goal: or (not (@Col Tn A B P)) (not (@Col Tn A B P')) *) left. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) (* Goal: @Out Tn A P P' *) (* Goal: not (@Col Tn A B P) *) apply perp_not_col in H2. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) (* Goal: @Out Tn A P P' *) (* Goal: not (@Col Tn A B P) *) assumption. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) (* Goal: @Out Tn A P P' *) repeat split; auto. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) (* Goal: not (@eq (@Tpoint Tn) P' A) *) apply perp_distinct in H9. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) (* Goal: not (@eq (@Tpoint Tn) P' A) *) tauto. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) assert(TS A B C P'). (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) (* Goal: @TS Tn A B C P' *) apply l9_2. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) (* Goal: @TS Tn A B P' C *) apply(l9_8_2 A B P P' C); auto. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) (* Goal: @TS Tn A B P C *) apply l9_2. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) (* Goal: @TS Tn A B C P *) assumption. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) unfold TS in H11. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) ex_and H13 T'. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T P')) *) exists T'. (* Goal: and (@Col Tn T' A B) (@Bet Tn C T' P') *) split; auto. Qed. Lemma ts__ncol : forall A B X Y, TS A B X Y -> ~Col A X Y \/ ~Col B X Y. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : @TS Tn A B X Y), or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) intros. (* Goal: or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) unfold TS in H. (* Goal: or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) spliter. (* Goal: or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) ex_and H1 T. (* Goal: or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) assert(X <> Y). (* Goal: or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) intro. (* Goal: or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) (* Goal: False *) treat_equalities. (* Goal: or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) (* Goal: False *) contradiction. (* Goal: or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) induction(eq_dec_points A T). (* Goal: or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) (* Goal: or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) treat_equalities. (* Goal: or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) (* Goal: or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) right. (* Goal: or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) (* Goal: not (@Col Tn B X Y) *) intro. (* Goal: or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) (* Goal: False *) apply H. (* Goal: or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) (* Goal: @Col Tn X A B *) ColR. (* Goal: or (not (@Col Tn A X Y)) (not (@Col Tn B X Y)) *) left. (* Goal: not (@Col Tn A X Y) *) intro. (* Goal: False *) apply H. (* Goal: @Col Tn X A B *) ColR. Qed. Lemma one_or_two_sides_aux : forall A B C D X, ~ Col C A B -> ~ Col D A B -> Col A C X -> Col B D X -> TS A B C D \/ OS A B C D. Proof. (* Goal: forall (A B C D X : @Tpoint Tn) (_ : not (@Col Tn C A B)) (_ : not (@Col Tn D A B)) (_ : @Col Tn A C X) (_ : @Col Tn B D X), or (@TS Tn A B C D) (@OS Tn A B C D) *) intros. (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) assert_diffs. (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) assert (A <> X) by (intro; subst; Col). (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) assert (B <> X) by (intro; subst; Col). (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) assert (~ Col X A B) by (intro; apply H; ColR). (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) destruct H1 as [|[|]]; destruct H2 as [|[|]]. (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) - (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) right. (* Goal: @OS Tn A B C D *) apply one_side_transitivity with X. (* Goal: @OS Tn A B X D *) (* Goal: @OS Tn A B C X *) apply out_one_side; Col. (* Goal: @OS Tn A B X D *) (* Goal: @Out Tn A C X *) apply bet_out; auto. (* Goal: @OS Tn A B X D *) apply invert_one_side, out_one_side; Col. (* Goal: @Out Tn B X D *) apply l6_6, bet_out; auto. (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) - (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) right. (* Goal: @OS Tn A B C D *) apply one_side_transitivity with X. (* Goal: @OS Tn A B X D *) (* Goal: @OS Tn A B C X *) apply out_one_side; Col. (* Goal: @OS Tn A B X D *) (* Goal: @Out Tn A C X *) apply bet_out; auto. (* Goal: @OS Tn A B X D *) apply invert_one_side, out_one_side; Col. (* Goal: @Out Tn B X D *) apply bet_out; Between. (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) - (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) left. (* Goal: @TS Tn A B C D *) apply l9_8_2 with X. (* Goal: @OS Tn A B X C *) (* Goal: @TS Tn A B X D *) repeat split; Col. (* Goal: @OS Tn A B X C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T D)) *) exists B; split; Col. (* Goal: @OS Tn A B X C *) apply out_one_side; Col. (* Goal: @Out Tn A X C *) apply l6_6, bet_out; auto. (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) - (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) right. (* Goal: @OS Tn A B C D *) apply one_side_transitivity with X. (* Goal: @OS Tn A B X D *) (* Goal: @OS Tn A B C X *) apply out_one_side; Col. (* Goal: @OS Tn A B X D *) (* Goal: @Out Tn A C X *) apply l6_6, bet_out; Between. (* Goal: @OS Tn A B X D *) apply invert_one_side, out_one_side; Col. (* Goal: @Out Tn B X D *) apply l6_6, bet_out; auto. (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) - (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) right. (* Goal: @OS Tn A B C D *) apply one_side_transitivity with X. (* Goal: @OS Tn A B X D *) (* Goal: @OS Tn A B C X *) apply out_one_side; Col. (* Goal: @OS Tn A B X D *) (* Goal: @Out Tn A C X *) apply l6_6, bet_out; Between. (* Goal: @OS Tn A B X D *) apply invert_one_side, out_one_side; Col. (* Goal: @Out Tn B X D *) apply bet_out; Between. (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) - (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) left. (* Goal: @TS Tn A B C D *) apply l9_8_2 with X. (* Goal: @OS Tn A B X C *) (* Goal: @TS Tn A B X D *) repeat split; Col. (* Goal: @OS Tn A B X C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T D)) *) exists B; split; Col. (* Goal: @OS Tn A B X C *) apply out_one_side; Col. (* Goal: @Out Tn A X C *) apply bet_out; Between. (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) - (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) left. (* Goal: @TS Tn A B C D *) apply l9_2, l9_8_2 with X. (* Goal: @OS Tn A B X D *) (* Goal: @TS Tn A B X C *) repeat split; Col. (* Goal: @OS Tn A B X D *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T C)) *) exists A; split; Col. (* Goal: @OS Tn A B X D *) apply invert_one_side, out_one_side; Col. (* Goal: @Out Tn B X D *) apply l6_6, bet_out; auto. (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) - (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) left. (* Goal: @TS Tn A B C D *) apply l9_2, l9_8_2 with X. (* Goal: @OS Tn A B X D *) (* Goal: @TS Tn A B X C *) repeat split; Col. (* Goal: @OS Tn A B X D *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T C)) *) exists A; split; Col. (* Goal: @OS Tn A B X D *) apply invert_one_side, out_one_side; Col. (* Goal: @Out Tn B X D *) apply bet_out; Between. (* BG Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) - (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) right. (* Goal: @OS Tn A B C D *) exists X; repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn D T X)) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T X)) *) exists A; split; finish. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn D T X)) *) exists B; split; finish. Qed. Lemma cop__one_or_two_sides : forall A B C D, Coplanar A B C D -> ~ Col C A B -> ~ Col D A B -> TS A B C D \/ OS A B C D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @Coplanar Tn A B C D) (_ : not (@Col Tn C A B)) (_ : not (@Col Tn D A B)), or (@TS Tn A B C D) (@OS Tn A B C D) *) intros. (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) ex_and H X. (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) induction H2; spliter. (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) destruct (or_bet_out C X D) as [|[|]]. (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) left; repeat split; auto; exists X; split; Col. (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) right; apply out_one_side_1 with X; Col. (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) exfalso; Col. (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) induction H; spliter. (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) apply one_or_two_sides_aux with X; assumption. (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) induction (one_or_two_sides_aux A B D C X H1 H0 H H2). (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) left; apply l9_2; assumption. (* Goal: or (@TS Tn A B C D) (@OS Tn A B C D) *) right; apply one_side_symmetry; assumption. Qed. Lemma os__coplanar : forall A B C D, OS A B C D -> Coplanar A B C D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @OS Tn A B C D), @Coplanar Tn A B C D *) intros A B C D HOS. (* Goal: @Coplanar Tn A B C D *) assert (HNCol : ~ Col A B C) by (apply one_side_not_col123 with D, HOS). (* Goal: @Coplanar Tn A B C D *) destruct (segment_construction C B B C) as [C'[]]. (* Goal: @Coplanar Tn A B C D *) assert (HT : TS A B D C'). (* Goal: @Coplanar Tn A B C D *) (* Goal: @TS Tn A B D C' *) { (* Goal: @TS Tn A B D C' *) apply l9_8_2 with C; [|assumption]. (* Goal: @TS Tn A B C C' *) split; [|split]. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T C')) *) (* Goal: not (@Col Tn C' A B) *) (* Goal: not (@Col Tn C A B) *) Col. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T C')) *) (* Goal: not (@Col Tn C' A B) *) intro; apply HNCol; ColR. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn C T C')) *) exists B; split; Col. (* BG Goal: @Coplanar Tn A B C D *) } (* Goal: @Coplanar Tn A B C D *) destruct HT as [HNCol1 [HNCol2 [T []]]]. (* Goal: @Coplanar Tn A B C D *) assert (C' <> T) by (intro; treat_equalities; auto). (* Goal: @Coplanar Tn A B C D *) destruct (col_dec T B C) as [|HNCol3]. (* Goal: @Coplanar Tn A B C D *) (* Goal: @Coplanar Tn A B C D *) exists B; left; split; ColR. (* Goal: @Coplanar Tn A B C D *) destruct (bet_dec T B A) as [|HOut]. (* Goal: @Coplanar Tn A B C D *) (* Goal: @Coplanar Tn A B C D *) - (* Goal: @Coplanar Tn A B C D *) apply coplanar_perm_18, ts__coplanar. (* Goal: @TS Tn B C D A *) apply l9_8_2 with T. (* Goal: @OS Tn B C T D *) (* Goal: @TS Tn B C T A *) repeat split; Col; exists B; split; Col. (* Goal: @OS Tn B C T D *) apply out_one_side_1 with C'; Col. (* Goal: @Out Tn C' T D *) apply bet_out; Between. (* BG Goal: @Coplanar Tn A B C D *) - (* Goal: @Coplanar Tn A B C D *) apply coplanar_perm_19, ts__coplanar, l9_31; [|apply one_side_symmetry, invert_one_side, HOS]. (* Goal: @OS Tn B C D A *) apply one_side_transitivity with T. (* Goal: @OS Tn B C T A *) (* Goal: @OS Tn B C D T *) apply out_one_side_1 with C'; [intro; apply HNCol3; ColR|Col|apply l6_6, bet_out; Between]. (* Goal: @OS Tn B C T A *) apply out_one_side; Col; apply not_bet_out; Col. Qed. Lemma coplanar_trans_1 : forall P Q R A B, ~ Col P Q R -> Coplanar P Q R A -> Coplanar P Q R B -> Coplanar Q R A B. Proof. (* Goal: forall (P Q R A B : @Tpoint Tn) (_ : not (@Col Tn P Q R)) (_ : @Coplanar Tn P Q R A) (_ : @Coplanar Tn P Q R B), @Coplanar Tn Q R A B *) intros P Q R A B HNCol HCop1 HCop2. (* Goal: @Coplanar Tn Q R A B *) destruct (col_dec Q R A). (* Goal: @Coplanar Tn Q R A B *) (* Goal: @Coplanar Tn Q R A B *) exists A; left; split; Col. (* Goal: @Coplanar Tn Q R A B *) destruct (col_dec Q R B). (* Goal: @Coplanar Tn Q R A B *) (* Goal: @Coplanar Tn Q R A B *) exists B; left; split; Col. (* Goal: @Coplanar Tn Q R A B *) destruct (col_dec Q A B). (* Goal: @Coplanar Tn Q R A B *) (* Goal: @Coplanar Tn Q R A B *) exists Q; left; split; Col. (* Goal: @Coplanar Tn Q R A B *) assert (HDij : TS Q R A B \/ OS Q R A B). (* Goal: @Coplanar Tn Q R A B *) (* Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) { (* Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) assert (HA : TS Q R P A \/ OS Q R P A) by (apply cop__one_or_two_sides; Col; Cop). (* Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) assert (HB : TS Q R P B \/ OS Q R P B) by (apply cop__one_or_two_sides; Col; Cop). (* Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) destruct HA; destruct HB. (* Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) (* Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) (* Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) (* Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) - (* Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) right; apply l9_8_1 with P; apply l9_2; assumption. (* BG Goal: @Coplanar Tn Q R A B *) (* BG Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) (* BG Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) (* BG Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) - (* Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) left; apply l9_2, l9_8_2 with P; assumption. (* BG Goal: @Coplanar Tn Q R A B *) (* BG Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) (* BG Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) - (* Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) left; apply l9_8_2 with P; assumption. (* BG Goal: @Coplanar Tn Q R A B *) (* BG Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) - (* Goal: or (@TS Tn Q R A B) (@OS Tn Q R A B) *) right; apply one_side_transitivity with P; [apply one_side_symmetry|]; assumption. (* BG Goal: @Coplanar Tn Q R A B *) } (* Goal: @Coplanar Tn Q R A B *) destruct HDij; [apply ts__coplanar|apply os__coplanar]; assumption. Qed. Lemma coplanar_pseudo_trans : forall A B C D P Q R, ~ Col P Q R -> Coplanar P Q R A -> Coplanar P Q R B -> Coplanar P Q R C -> Coplanar P Q R D -> Coplanar A B C D. Proof. (* Goal: forall (A B C D P Q R : @Tpoint Tn) (_ : not (@Col Tn P Q R)) (_ : @Coplanar Tn P Q R A) (_ : @Coplanar Tn P Q R B) (_ : @Coplanar Tn P Q R C) (_ : @Coplanar Tn P Q R D), @Coplanar Tn A B C D *) intros A B C D P Q R HNC HCop1 HCop2 HCop3 HCop4. (* Goal: @Coplanar Tn A B C D *) elim (col_dec R A B); intro HRAB. (* Goal: @Coplanar Tn A B C D *) (* Goal: @Coplanar Tn A B C D *) { (* Goal: @Coplanar Tn A B C D *) elim (col_dec R C D); intro HRCD. (* Goal: @Coplanar Tn A B C D *) (* Goal: @Coplanar Tn A B C D *) { (* Goal: @Coplanar Tn A B C D *) exists R; Col5. (* BG Goal: @Coplanar Tn A B C D *) (* BG Goal: @Coplanar Tn A B C D *) } (* Goal: @Coplanar Tn A B C D *) { (* Goal: @Coplanar Tn A B C D *) elim (col_dec Q R C); intro HQRC. (* Goal: @Coplanar Tn A B C D *) (* Goal: @Coplanar Tn A B C D *) { (* Goal: @Coplanar Tn A B C D *) assert (HQRD : ~ Col Q R D) by (intro; assert_diffs; apply HRCD; ColR). (* Goal: @Coplanar Tn A B C D *) assert (HCop5 := coplanar_trans_1 P Q R D A HNC HCop4 HCop1). (* Goal: @Coplanar Tn A B C D *) assert (HCop6 := coplanar_trans_1 P Q R D B HNC HCop4 HCop2). (* Goal: @Coplanar Tn A B C D *) assert (HCop7 := coplanar_trans_1 P Q R D C HNC HCop4 HCop3). (* Goal: @Coplanar Tn A B C D *) assert (HCop8 := coplanar_trans_1 Q R D C A HQRD HCop7 HCop5). (* Goal: @Coplanar Tn A B C D *) assert (HCop9 := coplanar_trans_1 Q R D C B HQRD HCop7 HCop6). (* Goal: @Coplanar Tn A B C D *) assert (HRDC : ~ Col R D C) by Col. (* Goal: @Coplanar Tn A B C D *) assert (HCop := coplanar_trans_1 R D C A B HRDC HCop8 HCop9). (* Goal: @Coplanar Tn A B C D *) Cop. (* BG Goal: @Coplanar Tn A B C D *) (* BG Goal: @Coplanar Tn A B C D *) } (* Goal: @Coplanar Tn A B C D *) { (* Goal: @Coplanar Tn A B C D *) assert (HCop5 := coplanar_trans_1 P Q R C A HNC HCop3 HCop1). (* Goal: @Coplanar Tn A B C D *) assert (HCop6 := coplanar_trans_1 P Q R C B HNC HCop3 HCop2). (* Goal: @Coplanar Tn A B C D *) assert (HCop7 := coplanar_trans_1 P Q R C D HNC HCop3 HCop4). (* Goal: @Coplanar Tn A B C D *) assert (HCop8 := coplanar_trans_1 Q R C D A HQRC HCop7 HCop5). (* Goal: @Coplanar Tn A B C D *) assert (HCop9 := coplanar_trans_1 Q R C D B HQRC HCop7 HCop6). (* Goal: @Coplanar Tn A B C D *) assert (HCop := coplanar_trans_1 R C D A B HRCD HCop8 HCop9). (* Goal: @Coplanar Tn A B C D *) Cop. (* BG Goal: @Coplanar Tn A B C D *) } (* BG Goal: @Coplanar Tn A B C D *) } (* BG Goal: @Coplanar Tn A B C D *) } (* Goal: @Coplanar Tn A B C D *) { (* Goal: @Coplanar Tn A B C D *) elim (col_dec Q R A); intro HQRA. (* Goal: @Coplanar Tn A B C D *) (* Goal: @Coplanar Tn A B C D *) { (* Goal: @Coplanar Tn A B C D *) assert (HQRB : ~ Col Q R B) by (intro; assert_diffs; apply HRAB; ColR). (* Goal: @Coplanar Tn A B C D *) assert (HCop5 := coplanar_trans_1 P Q R B A HNC HCop2 HCop1). (* Goal: @Coplanar Tn A B C D *) assert (HCop6 := coplanar_trans_1 P Q R B C HNC HCop2 HCop3). (* Goal: @Coplanar Tn A B C D *) assert (HCop7 := coplanar_trans_1 P Q R B D HNC HCop2 HCop4). (* Goal: @Coplanar Tn A B C D *) assert (HCop8 := coplanar_trans_1 Q R B A C HQRB HCop5 HCop6). (* Goal: @Coplanar Tn A B C D *) assert (HCop9 := coplanar_trans_1 Q R B A D HQRB HCop5 HCop7). (* Goal: @Coplanar Tn A B C D *) assert (HRBA : ~ Col R B A) by Col. (* Goal: @Coplanar Tn A B C D *) assert (HCop := coplanar_trans_1 R B A C D HRBA HCop8 HCop9). (* Goal: @Coplanar Tn A B C D *) Cop. (* BG Goal: @Coplanar Tn A B C D *) } (* Goal: @Coplanar Tn A B C D *) { (* Goal: @Coplanar Tn A B C D *) assert (HCop5 := coplanar_trans_1 P Q R A B HNC HCop1 HCop2). (* Goal: @Coplanar Tn A B C D *) assert (HCop6 := coplanar_trans_1 P Q R A C HNC HCop1 HCop3). (* Goal: @Coplanar Tn A B C D *) assert (HCop7 := coplanar_trans_1 P Q R A D HNC HCop1 HCop4). (* Goal: @Coplanar Tn A B C D *) assert (HCop8 := coplanar_trans_1 Q R A B C HQRA HCop5 HCop6). (* Goal: @Coplanar Tn A B C D *) assert (HCop9 := coplanar_trans_1 Q R A B D HQRA HCop5 HCop7). (* Goal: @Coplanar Tn A B C D *) assert (HCop := coplanar_trans_1 R A B C D HRAB HCop8 HCop9). (* Goal: @Coplanar Tn A B C D *) Cop. Qed. Lemma col_cop__cop : forall A B C D E, Coplanar A B C D -> C <> D -> Col C D E -> Coplanar A B C E. Proof. (* Goal: forall (A B C D E : @Tpoint Tn) (_ : @Coplanar Tn A B C D) (_ : not (@eq (@Tpoint Tn) C D)) (_ : @Col Tn C D E), @Coplanar Tn A B C E *) intros A B C D E HCop HCD HCol. (* Goal: @Coplanar Tn A B C E *) destruct (col_dec D A C). (* Goal: @Coplanar Tn A B C E *) (* Goal: @Coplanar Tn A B C E *) assert (Col A C E) by (apply l6_16_1 with D; Col); Cop. (* Goal: @Coplanar Tn A B C E *) apply coplanar_perm_2, coplanar_trans_1 with D; Cop. Qed. Lemma bet_cop__cop : forall A B C D E, Coplanar A B C E -> Bet C D E -> Coplanar A B C D. Proof. (* Goal: forall (A B C D E : @Tpoint Tn) (_ : @Coplanar Tn A B C E) (_ : @Bet Tn C D E), @Coplanar Tn A B C D *) intros A B C D E HCop HBet. (* Goal: @Coplanar Tn A B C D *) destruct (eq_dec_points C E). (* Goal: @Coplanar Tn A B C D *) (* Goal: @Coplanar Tn A B C D *) treat_equalities; apply HCop. (* Goal: @Coplanar Tn A B C D *) apply col_cop__cop with E; Col. Qed. Lemma col2_cop__cop : forall A B C D E F, Coplanar A B C D -> C <> D -> Col C D E -> Col C D F -> Coplanar A B E F. Proof. (* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @Coplanar Tn A B C D) (_ : not (@eq (@Tpoint Tn) C D)) (_ : @Col Tn C D E) (_ : @Col Tn C D F), @Coplanar Tn A B E F *) intros A B C D E F HCop HCD HE HF. (* Goal: @Coplanar Tn A B E F *) destruct (col_dec C D A). (* Goal: @Coplanar Tn A B E F *) (* Goal: @Coplanar Tn A B E F *) exists A; left; split; Col; apply (col3 C D); assumption. (* Goal: @Coplanar Tn A B E F *) apply coplanar_pseudo_trans with C D A; Cop. Qed. Lemma l9_30 : forall A B C D E F P X Y Z, ~ Coplanar A B C P -> ~ Col D E F -> Coplanar D E F P -> Coplanar A B C X -> Coplanar A B C Y -> Coplanar A B C Z -> Coplanar D E F X -> Coplanar D E F Y -> Coplanar D E F Z -> Col X Y Z. Proof. (* Goal: forall (A B C D E F P X Y Z : @Tpoint Tn) (_ : not (@Coplanar Tn A B C P)) (_ : not (@Col Tn D E F)) (_ : @Coplanar Tn D E F P) (_ : @Coplanar Tn A B C X) (_ : @Coplanar Tn A B C Y) (_ : @Coplanar Tn A B C Z) (_ : @Coplanar Tn D E F X) (_ : @Coplanar Tn D E F Y) (_ : @Coplanar Tn D E F Z), @Col Tn X Y Z *) intros A B C D E F P X Y Z HNCop HNCol HP HX1 HY1 HZ1 HX2 HY2 HZ2. (* Goal: @Col Tn X Y Z *) destruct (col_dec X Y Z); [assumption|]. (* Goal: @Col Tn X Y Z *) assert (~ Col A B C) by (apply ncop__ncol with P, HNCop). (* Goal: @Col Tn X Y Z *) exfalso. (* Goal: False *) apply HNCop. (* Goal: @Coplanar Tn A B C P *) apply coplanar_pseudo_trans with X Y Z; [assumption|apply coplanar_pseudo_trans with A B C; Cop..|]. (* Goal: @Coplanar Tn X Y Z P *) apply coplanar_pseudo_trans with D E F; assumption. Qed. Lemma cop_per2__col : forall A X Y Z, Coplanar A X Y Z -> A <> Z -> Per X Z A -> Per Y Z A -> Col X Y Z. Lemma cop_perp2__col : forall X Y Z A B, Coplanar A B Y Z -> Perp X Y A B -> Perp X Z A B -> Col X Y Z. Lemma two_sides_dec : forall A B C D, TS A B C D \/ ~ TS A B C D. Proof. (* Goal: forall A B C D : @Tpoint Tn, or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) intros. (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) destruct (col_dec C A B). (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) right; intros []; contradiction. (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) destruct (col_dec D A B) as [|HNCol]. (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) right; intros [HN []]; contradiction. (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) destruct (l8_18_existence A B C) as [C0 [HCol1 HPerp1]]; Col. (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) destruct (l8_18_existence A B D) as [D0 [HCol2 HPerp2]]; Col. (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) assert_diffs. (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) destruct (midpoint_existence C0 D0) as [M]. (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) assert (Col M A B). (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) (* Goal: @Col Tn M A B *) destruct (eq_dec_points C0 D0); [treat_equalities; Col|ColR]. (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) destruct (l6_11_existence D0 C0 C D) as [D' []]; auto. (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) destruct (bet_dec C M D') as [|HNBet]. (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) { (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) left; apply l9_2, l9_5 with D' D0; Col. (* Goal: @TS Tn A B D' C *) repeat split; auto. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn D' T C)) *) (* Goal: not (@Col Tn D' A B) *) intro; apply HNCol; ColR. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn D' T C)) *) exists M; split; Between. (* BG Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) } (* Goal: or (@TS Tn A B C D) (not (@TS Tn A B C D)) *) right; intro HTS. (* Goal: False *) apply HNBet. (* Goal: @Bet Tn C M D' *) assert (HTS1 : TS A B D' C). (* Goal: @Bet Tn C M D' *) (* Goal: @TS Tn A B D' C *) apply l9_5 with D D0; [apply l9_2|Col|apply l6_6]; assumption. (* Goal: @Bet Tn C M D' *) destruct (eq_dec_points C0 D0). (* Goal: @Bet Tn C M D' *) (* Goal: @Bet Tn C M D' *) { (* Goal: @Bet Tn C M D' *) treat_equalities. (* Goal: @Bet Tn C M D' *) assert (Col M C D) by (apply cop_perp2__col with A B; Perp; Cop). (* Goal: @Bet Tn C M D' *) destruct (distinct A B M); auto. (* Goal: @Bet Tn C M D' *) (* Goal: @Bet Tn C M D' *) - (* Goal: @Bet Tn C M D' *) apply col_two_sides_bet with A. (* Goal: @TS Tn M A C D' *) (* Goal: @Col Tn M C D' *) ColR. (* Goal: @TS Tn M A C D' *) apply invert_two_sides, col_two_sides with B; Col; apply l9_2, HTS1. (* BG Goal: @Bet Tn C M D' *) (* BG Goal: @Bet Tn C M D' *) - (* Goal: @Bet Tn C M D' *) apply col_two_sides_bet with B. (* Goal: @TS Tn M B C D' *) (* Goal: @Col Tn M C D' *) ColR. (* Goal: @TS Tn M B C D' *) apply invert_two_sides, col_two_sides with A; Col. (* Goal: @TS Tn B A C D' *) apply l9_2, invert_two_sides, HTS1. (* BG Goal: @Bet Tn C M D' *) } (* Goal: @Bet Tn C M D' *) destruct HTS1 as [HNCol' [_ [M' []]]]. (* Goal: @Bet Tn C M D' *) destruct (l8_22 C0 D0 C D' M') as [_ []]; Between; Cong; Col. (* Goal: @Bet Tn C M D' *) (* Goal: @Col Tn C0 D0 M' *) (* Goal: @Per Tn C0 D0 D' *) (* Goal: @Per Tn D0 C0 C *) apply perp_per_1, perp_col2 with A B; auto. (* Goal: @Bet Tn C M D' *) (* Goal: @Col Tn C0 D0 M' *) (* Goal: @Per Tn C0 D0 D' *) assert_diffs; apply per_col with D; Col; apply perp_per_1, perp_col2 with A B; auto. (* Goal: @Bet Tn C M D' *) (* Goal: @Col Tn C0 D0 M' *) ColR. (* Goal: @Bet Tn C M D' *) replace M with M'; Between. (* Goal: @eq (@Tpoint Tn) M' M *) apply (l7_17 C0 D0); assumption. Qed. Lemma cop__not_two_sides_one_side : forall A B C D, Coplanar A B C D -> ~ Col C A B -> ~ Col D A B -> ~ TS A B C D -> OS A B C D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @Coplanar Tn A B C D) (_ : not (@Col Tn C A B)) (_ : not (@Col Tn D A B)) (_ : not (@TS Tn A B C D)), @OS Tn A B C D *) intros. (* Goal: @OS Tn A B C D *) induction (cop__one_or_two_sides A B C D); auto. (* Goal: @OS Tn A B C D *) contradiction. Qed. Lemma cop__not_one_side_two_sides : forall A B C D, Coplanar A B C D -> ~ Col C A B -> ~ Col D A B -> ~ OS A B C D -> TS A B C D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @Coplanar Tn A B C D) (_ : not (@Col Tn C A B)) (_ : not (@Col Tn D A B)) (_ : not (@OS Tn A B C D)), @TS Tn A B C D *) intros. (* Goal: @TS Tn A B C D *) induction (cop__one_or_two_sides A B C D); auto. (* Goal: @TS Tn A B C D *) contradiction. Qed. Lemma one_side_dec : forall A B C D, OS A B C D \/ ~ OS A B C D. Proof. (* Goal: forall A B C D : @Tpoint Tn, or (@OS Tn A B C D) (not (@OS Tn A B C D)) *) intros A B C D. (* Goal: or (@OS Tn A B C D) (not (@OS Tn A B C D)) *) destruct (col_dec A B D). (* Goal: or (@OS Tn A B C D) (not (@OS Tn A B C D)) *) (* Goal: or (@OS Tn A B C D) (not (@OS Tn A B C D)) *) right; intro Habs; apply (one_side_not_col124 A B C D); assumption. (* Goal: or (@OS Tn A B C D) (not (@OS Tn A B C D)) *) destruct (l9_10 A B D) as [D']; Col. (* Goal: or (@OS Tn A B C D) (not (@OS Tn A B C D)) *) destruct (two_sides_dec A B C D') as [|HNTS]. (* Goal: or (@OS Tn A B C D) (not (@OS Tn A B C D)) *) (* Goal: or (@OS Tn A B C D) (not (@OS Tn A B C D)) *) left; apply l9_8_1 with D'; assumption. (* Goal: or (@OS Tn A B C D) (not (@OS Tn A B C D)) *) right; intro. (* Goal: False *) apply HNTS, l9_8_2 with D. (* Goal: @OS Tn A B D C *) (* Goal: @TS Tn A B D D' *) assumption. (* Goal: @OS Tn A B D C *) apply one_side_symmetry; assumption. Qed. Lemma cop_dec : forall A B C D, Coplanar A B C D \/ ~ Coplanar A B C D. Proof. (* Goal: forall A B C D : @Tpoint Tn, or (@Coplanar Tn A B C D) (not (@Coplanar Tn A B C D)) *) intros A B C D. (* Goal: or (@Coplanar Tn A B C D) (not (@Coplanar Tn A B C D)) *) destruct (col_dec C A B). (* Goal: or (@Coplanar Tn A B C D) (not (@Coplanar Tn A B C D)) *) (* Goal: or (@Coplanar Tn A B C D) (not (@Coplanar Tn A B C D)) *) left; exists C; left; split; Col. (* Goal: or (@Coplanar Tn A B C D) (not (@Coplanar Tn A B C D)) *) destruct (col_dec D A B). (* Goal: or (@Coplanar Tn A B C D) (not (@Coplanar Tn A B C D)) *) (* Goal: or (@Coplanar Tn A B C D) (not (@Coplanar Tn A B C D)) *) left; exists D; left; split; Col. (* Goal: or (@Coplanar Tn A B C D) (not (@Coplanar Tn A B C D)) *) destruct (two_sides_dec A B C D). (* Goal: or (@Coplanar Tn A B C D) (not (@Coplanar Tn A B C D)) *) (* Goal: or (@Coplanar Tn A B C D) (not (@Coplanar Tn A B C D)) *) left; apply ts__coplanar; assumption. (* Goal: or (@Coplanar Tn A B C D) (not (@Coplanar Tn A B C D)) *) destruct (one_side_dec A B C D). (* Goal: or (@Coplanar Tn A B C D) (not (@Coplanar Tn A B C D)) *) (* Goal: or (@Coplanar Tn A B C D) (not (@Coplanar Tn A B C D)) *) left; apply os__coplanar; assumption. (* Goal: or (@Coplanar Tn A B C D) (not (@Coplanar Tn A B C D)) *) right; intro; destruct (cop__one_or_two_sides A B C D); auto. Qed. Lemma ex_diff_cop : forall A B C D, exists E, Coplanar A B C E /\ D <> E. Proof. (* Goal: forall A B C D : @Tpoint Tn, @ex (@Tpoint Tn) (fun E : @Tpoint Tn => and (@Coplanar Tn A B C E) (not (@eq (@Tpoint Tn) D E))) *) intros A B C D. (* Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => and (@Coplanar Tn A B C E) (not (@eq (@Tpoint Tn) D E))) *) destruct (eq_dec_points A D); [destruct (eq_dec_points B D); subst|]. (* Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => and (@Coplanar Tn A B C E) (not (@eq (@Tpoint Tn) D E))) *) (* Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => and (@Coplanar Tn D B C E) (not (@eq (@Tpoint Tn) D E))) *) (* Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => and (@Coplanar Tn D D C E) (not (@eq (@Tpoint Tn) D E))) *) - (* Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => and (@Coplanar Tn D D C E) (not (@eq (@Tpoint Tn) D E))) *) destruct (another_point D) as [E]; exists E; split; Cop. (* BG Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => and (@Coplanar Tn A B C E) (not (@eq (@Tpoint Tn) D E))) *) (* BG Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => and (@Coplanar Tn D B C E) (not (@eq (@Tpoint Tn) D E))) *) - (* Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => and (@Coplanar Tn D B C E) (not (@eq (@Tpoint Tn) D E))) *) exists B; split; Cop. (* BG Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => and (@Coplanar Tn A B C E) (not (@eq (@Tpoint Tn) D E))) *) - (* Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => and (@Coplanar Tn A B C E) (not (@eq (@Tpoint Tn) D E))) *) exists A; split; Cop. Qed. Lemma ex_ncol_cop : forall A B C D E, D <> E -> exists F, Coplanar A B C F /\ ~ Col D E F. Proof. (* Goal: forall (A B C D E : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) D E)), @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C F) (not (@Col Tn D E F))) *) intros A B C D E HDE. (* Goal: @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C F) (not (@Col Tn D E F))) *) destruct (col_dec A B C) as [|HNCol]. (* Goal: @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C F) (not (@Col Tn D E F))) *) (* Goal: @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C F) (not (@Col Tn D E F))) *) destruct (not_col_exists D E HDE) as [F]; exists F; split; Cop. (* Goal: @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C F) (not (@Col Tn D E F))) *) destruct (col_dec D E A); [destruct (col_dec D E B)|]. (* Goal: @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C F) (not (@Col Tn D E F))) *) (* Goal: @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C F) (not (@Col Tn D E F))) *) (* Goal: @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C F) (not (@Col Tn D E F))) *) - (* Goal: @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C F) (not (@Col Tn D E F))) *) exists C; split; Cop. (* Goal: not (@Col Tn D E C) *) intro; apply HNCol; ColR. (* BG Goal: @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C F) (not (@Col Tn D E F))) *) (* BG Goal: @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C F) (not (@Col Tn D E F))) *) - (* Goal: @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C F) (not (@Col Tn D E F))) *) exists B; split; Cop. (* BG Goal: @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C F) (not (@Col Tn D E F))) *) - (* Goal: @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C F) (not (@Col Tn D E F))) *) exists A; split; Cop. Qed. Lemma ex_ncol_cop2 : forall A B C D, exists E F, Coplanar A B C E /\ Coplanar A B C F /\ ~ Col D E F. Proof. (* Goal: forall A B C D : @Tpoint Tn, @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C E) (and (@Coplanar Tn A B C F) (not (@Col Tn D E F))))) *) intros A B C D. (* Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C E) (and (@Coplanar Tn A B C F) (not (@Col Tn D E F))))) *) destruct (ex_diff_cop A B C D) as [E [HE HDE]]. (* Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C E) (and (@Coplanar Tn A B C F) (not (@Col Tn D E F))))) *) destruct (ex_ncol_cop A B C D E HDE) as [F []]. (* Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@Coplanar Tn A B C E) (and (@Coplanar Tn A B C F) (not (@Col Tn D E F))))) *) exists E, F; repeat split; assumption. Qed. Lemma cop4__col : forall A1 A2 A3 B1 B2 B3 P Q R, ~ Coplanar A1 A2 A3 B1 -> ~ Col B1 B2 B3 -> Coplanar A1 A2 A3 P -> Coplanar B1 B2 B3 P -> Coplanar A1 A2 A3 Q -> Coplanar B1 B2 B3 Q -> Coplanar A1 A2 A3 R -> Coplanar B1 B2 B3 R -> Col P Q R. Proof. (* Goal: forall (A1 A2 A3 B1 B2 B3 P Q R : @Tpoint Tn) (_ : not (@Coplanar Tn A1 A2 A3 B1)) (_ : not (@Col Tn B1 B2 B3)) (_ : @Coplanar Tn A1 A2 A3 P) (_ : @Coplanar Tn B1 B2 B3 P) (_ : @Coplanar Tn A1 A2 A3 Q) (_ : @Coplanar Tn B1 B2 B3 Q) (_ : @Coplanar Tn A1 A2 A3 R) (_ : @Coplanar Tn B1 B2 B3 R), @Col Tn P Q R *) intros A1 A2 A3 B1 B2 B3 P Q R HNCop HNCol; intros. (* Goal: @Col Tn P Q R *) assert (~ Col A1 A2 A3) by (apply ncop__ncol with B1, HNCop). (* Goal: @Col Tn P Q R *) destruct (col_dec P Q R); trivial. (* Goal: @Col Tn P Q R *) exfalso; apply HNCop. (* Goal: @Coplanar Tn A1 A2 A3 B1 *) apply coplanar_pseudo_trans with P Q R; [assumption|apply coplanar_pseudo_trans with A1 A2 A3; Cop..|]. (* Goal: @Coplanar Tn P Q R B1 *) apply coplanar_pseudo_trans with B1 B2 B3; Cop. Qed. Lemma col_cop2__cop : forall A B C U V P, U <> V -> Coplanar A B C U -> Coplanar A B C V -> Col U V P -> Coplanar A B C P. Proof. (* Goal: forall (A B C U V P : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) U V)) (_ : @Coplanar Tn A B C U) (_ : @Coplanar Tn A B C V) (_ : @Col Tn U V P), @Coplanar Tn A B C P *) intros A B C U V P HUV HU HV HCol. (* Goal: @Coplanar Tn A B C P *) destruct (col_dec A B C) as [HCol1|HNCol]. (* Goal: @Coplanar Tn A B C P *) (* Goal: @Coplanar Tn A B C P *) apply col__coplanar, HCol1. (* Goal: @Coplanar Tn A B C P *) revert dependent C. (* Goal: forall (C : @Tpoint Tn) (_ : @Coplanar Tn A B C U) (_ : @Coplanar Tn A B C V) (_ : not (@Col Tn A B C)), @Coplanar Tn A B C P *) revert A B. (* Goal: forall (A B C : @Tpoint Tn) (_ : @Coplanar Tn A B C U) (_ : @Coplanar Tn A B C V) (_ : not (@Col Tn A B C)), @Coplanar Tn A B C P *) assert (Haux : forall A B C, ~ Col A B C -> ~ Col U A B -> Coplanar A B C U -> Coplanar A B C V -> Coplanar A B C P). (* Goal: forall (A B C : @Tpoint Tn) (_ : @Coplanar Tn A B C U) (_ : @Coplanar Tn A B C V) (_ : not (@Col Tn A B C)), @Coplanar Tn A B C P *) (* Goal: forall (A B C : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : not (@Col Tn U A B)) (_ : @Coplanar Tn A B C U) (_ : @Coplanar Tn A B C V), @Coplanar Tn A B C P *) { (* Goal: forall (A B C : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : not (@Col Tn U A B)) (_ : @Coplanar Tn A B C U) (_ : @Coplanar Tn A B C V), @Coplanar Tn A B C P *) intros A B C HNCol HNCol' HU HV. (* Goal: @Coplanar Tn A B C P *) apply coplanar_trans_1 with U; [Cop..|]. (* Goal: @Coplanar Tn U A B P *) apply coplanar_perm_12, col_cop__cop with V; auto. (* Goal: @Coplanar Tn A B U V *) apply coplanar_pseudo_trans with A B C; Cop. (* BG Goal: forall (A B C : @Tpoint Tn) (_ : @Coplanar Tn A B C U) (_ : @Coplanar Tn A B C V) (_ : not (@Col Tn A B C)), @Coplanar Tn A B C P *) } (* Goal: forall (A B C : @Tpoint Tn) (_ : @Coplanar Tn A B C U) (_ : @Coplanar Tn A B C V) (_ : not (@Col Tn A B C)), @Coplanar Tn A B C P *) intros A B C HU HV HNCol. (* Goal: @Coplanar Tn A B C P *) destruct (col_dec U A B); [destruct (col_dec U A C)|]. (* Goal: @Coplanar Tn A B C P *) (* Goal: @Coplanar Tn A B C P *) (* Goal: @Coplanar Tn A B C P *) - (* Goal: @Coplanar Tn A B C P *) apply coplanar_perm_12, Haux; Cop; Col. (* Goal: not (@Col Tn U B C) *) intro; apply HNCol; destruct (eq_dec_points U A); [subst|]; ColR. (* BG Goal: @Coplanar Tn A B C P *) (* BG Goal: @Coplanar Tn A B C P *) - (* Goal: @Coplanar Tn A B C P *) apply coplanar_perm_2, Haux; Cop; Col. (* BG Goal: @Coplanar Tn A B C P *) - (* Goal: @Coplanar Tn A B C P *) apply Haux; assumption. Qed. Lemma bet_cop2__cop : forall A B C U V W, Coplanar A B C U -> Coplanar A B C W -> Bet U V W -> Coplanar A B C V. Proof. (* Goal: forall (A B C U V W : @Tpoint Tn) (_ : @Coplanar Tn A B C U) (_ : @Coplanar Tn A B C W) (_ : @Bet Tn U V W), @Coplanar Tn A B C V *) intros A B C U V W HU HW HBet. (* Goal: @Coplanar Tn A B C V *) destruct (eq_dec_points U W). (* Goal: @Coplanar Tn A B C V *) (* Goal: @Coplanar Tn A B C V *) treat_equalities; assumption. (* Goal: @Coplanar Tn A B C V *) apply col_cop2__cop with U W; Col. Qed. Lemma col2_cop2__eq : forall A B C U V P Q, ~ Coplanar A B C U -> U <> V -> Coplanar A B C P -> Coplanar A B C Q -> Col U V P -> Col U V Q -> P = Q. Proof. (* Goal: forall (A B C U V P Q : @Tpoint Tn) (_ : not (@Coplanar Tn A B C U)) (_ : not (@eq (@Tpoint Tn) U V)) (_ : @Coplanar Tn A B C P) (_ : @Coplanar Tn A B C Q) (_ : @Col Tn U V P) (_ : @Col Tn U V Q), @eq (@Tpoint Tn) P Q *) intros A B C U V P Q HNCop; intros. (* Goal: @eq (@Tpoint Tn) P Q *) destruct (eq_dec_points P Q); [assumption|]. (* Goal: @eq (@Tpoint Tn) P Q *) exfalso. (* Goal: False *) apply HNCop, col_cop2__cop with P Q; ColR. Qed. Lemma cong3_cop2__col : forall A B C P Q, Coplanar A B C P -> Coplanar A B C Q -> P <> Q -> Cong A P A Q -> Cong B P B Q -> Cong C P C Q -> Col A B C. Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : @Coplanar Tn A B C P) (_ : @Coplanar Tn A B C Q) (_ : not (@eq (@Tpoint Tn) P Q)) (_ : @Cong Tn A P A Q) (_ : @Cong Tn B P B Q) (_ : @Cong Tn C P C Q), @Col Tn A B C *) intros A B C P Q HP HQ HPQ HA HB HC. (* Goal: @Col Tn A B C *) destruct (col_dec A B C); [assumption|]. (* Goal: @Col Tn A B C *) destruct (midpoint_existence P Q) as [M HMid]. (* Goal: @Col Tn A B C *) assert (Per A M P) by (exists Q; Cong). (* Goal: @Col Tn A B C *) assert (Per B M P) by (exists Q; Cong). (* Goal: @Col Tn A B C *) assert (Per C M P) by (exists Q; Cong). (* Goal: @Col Tn A B C *) elim (eq_dec_points A M); intro HAM. (* Goal: @Col Tn A B C *) (* Goal: @Col Tn A B C *) treat_equalities. (* Goal: @Col Tn A B C *) (* Goal: @Col Tn A B C *) assert_diffs; apply col_permutation_2, cop_per2__col with P; Cop. (* Goal: @Col Tn A B C *) assert (Col A B M). (* Goal: @Col Tn A B C *) (* Goal: @Col Tn A B M *) apply cop_per2__col with P; try apply HUD; assert_diffs; auto. (* Goal: @Col Tn A B C *) (* Goal: @Coplanar Tn P A B M *) apply coplanar_perm_12, col_cop__cop with Q; Col. (* Goal: @Col Tn A B C *) (* Goal: @Coplanar Tn A B P Q *) apply coplanar_trans_1 with C; Cop; Col. (* Goal: @Col Tn A B C *) assert (Col A C M). (* Goal: @Col Tn A B C *) (* Goal: @Col Tn A C M *) apply cop_per2__col with P; try apply HUD; assert_diffs; auto. (* Goal: @Col Tn A B C *) (* Goal: @Coplanar Tn P A C M *) apply coplanar_perm_12, col_cop__cop with Q; Col. (* Goal: @Col Tn A B C *) (* Goal: @Coplanar Tn A C P Q *) apply coplanar_trans_1 with B; Cop; Col. (* Goal: @Col Tn A B C *) apply col_transitivity_1 with M; Col. Qed. Lemma l9_38 : forall A B C P Q, TSP A B C P Q -> TSP A B C Q P. Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : @TSP Tn A B C P Q), @TSP Tn A B C Q P *) intros A B C P Q [HP [HQ [T [HT HBet]]]]. (* Goal: @TSP Tn A B C Q P *) repeat split; trivial. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn Q T P)) *) exists T; split; Between. Qed. Lemma l9_39 : forall A B C D P Q R, TSP A B C P R -> Coplanar A B C D -> Out D P Q -> TSP A B C Q R. Proof. (* Goal: forall (A B C D P Q R : @Tpoint Tn) (_ : @TSP Tn A B C P R) (_ : @Coplanar Tn A B C D) (_ : @Out Tn D P Q), @TSP Tn A B C Q R *) intros A B C D P Q R [HP [HR [T [HT HBet]]]] HCop HOut. (* Goal: @TSP Tn A B C Q R *) assert (HNCol : ~ Col A B C) by (apply ncop__ncol with P, HP). (* Goal: @TSP Tn A B C Q R *) split. (* Goal: and (not (@Coplanar Tn A B C R)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn Q T R))) *) (* Goal: not (@Coplanar Tn A B C Q) *) intro; assert_diffs; apply HP, col_cop2__cop with D Q; Col. (* Goal: and (not (@Coplanar Tn A B C R)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn Q T R))) *) split; [assumption|]. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn Q T R)) *) destruct (eq_dec_points D T). (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn Q T R)) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn Q T R)) *) subst T; exists D; split; [|apply (bet_out__bet P)]; assumption. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn Q T R)) *) assert (HTS : TS D T Q R). (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn Q T R)) *) (* Goal: @TS Tn D T Q R *) { (* Goal: @TS Tn D T Q R *) assert (~ Col P D T) by (intro; apply HP, col_cop2__cop with D T; Col). (* Goal: @TS Tn D T Q R *) apply l9_8_2 with P. (* Goal: @OS Tn D T P Q *) (* Goal: @TS Tn D T P R *) - (* Goal: @TS Tn D T P R *) repeat split; auto. (* Goal: @ex (@Tpoint Tn) (fun T0 : @Tpoint Tn => and (@Col Tn T0 D T) (@Bet Tn P T0 R)) *) (* Goal: not (@Col Tn R D T) *) intro; apply HR, col_cop2__cop with D T; Col. (* Goal: @ex (@Tpoint Tn) (fun T0 : @Tpoint Tn => and (@Col Tn T0 D T) (@Bet Tn P T0 R)) *) exists T; split; Col. (* BG Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn Q T R)) *) (* BG Goal: @OS Tn D T P Q *) - (* Goal: @OS Tn D T P Q *) apply out_one_side; Col. (* BG Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn Q T R)) *) } (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn Q T R)) *) destruct HTS as [HNCol1 [HNCol2 [T' []]]]. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn Q T R)) *) exists T'; split; [|assumption]. (* Goal: @Coplanar Tn A B C T' *) apply col_cop2__cop with D T; Col. Qed. Lemma l9_41_1 : forall A B C P Q R, TSP A B C P R -> TSP A B C Q R -> OSP A B C P Q. Proof. (* Goal: forall (A B C P Q R : @Tpoint Tn) (_ : @TSP Tn A B C P R) (_ : @TSP Tn A B C Q R), @OSP Tn A B C P Q *) intros A B C P Q R H1 H2. (* Goal: @OSP Tn A B C P Q *) exists R; split; assumption. Qed. Lemma l9_41_2 : forall A B C P Q R, TSP A B C P R -> OSP A B C P Q -> TSP A B C Q R. Proof. (* Goal: forall (A B C P Q R : @Tpoint Tn) (_ : @TSP Tn A B C P R) (_ : @OSP Tn A B C P Q), @TSP Tn A B C Q R *) intros A B C P Q R HPR [S [[HP [_ [X []]]] [HQ [HS [Y []]]]]]. (* Goal: @TSP Tn A B C Q R *) assert (P <> X /\ S <> X /\ Q <> Y /\ S <> Y) by (repeat split; intro; subst; auto); spliter. (* Goal: @TSP Tn A B C Q R *) destruct (col_dec P Q S) as [|HNCol]. (* Goal: @TSP Tn A B C Q R *) (* Goal: @TSP Tn A B C Q R *) { (* Goal: @TSP Tn A B C Q R *) assert (X = Y) by (apply (col2_cop2__eq A B C Q S); ColR). (* Goal: @TSP Tn A B C Q R *) subst Y. (* Goal: @TSP Tn A B C Q R *) apply l9_39 with X P; trivial. (* Goal: @Out Tn X P Q *) apply l6_2 with S; auto. (* BG Goal: @TSP Tn A B C Q R *) } (* Goal: @TSP Tn A B C Q R *) destruct (inner_pasch P Q S X Y) as [Z []]; trivial. (* Goal: @TSP Tn A B C Q R *) assert (X <> Z) by (intro; subst; apply HNCol; ColR). (* Goal: @TSP Tn A B C Q R *) apply l9_39 with X Z; [|assumption|apply bet_out; auto]. (* Goal: @TSP Tn A B C Z R *) assert (Y <> Z) by (intro; subst; apply HNCol; ColR). (* Goal: @TSP Tn A B C Z R *) apply l9_39 with Y P; [assumption..|apply l6_6, bet_out; auto]. Qed. Lemma tsp_exists : forall A B C P, ~ Coplanar A B C P -> exists Q, TSP A B C P Q. Proof. (* Goal: forall (A B C P : @Tpoint Tn) (_ : not (@Coplanar Tn A B C P)), @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @TSP Tn A B C P Q) *) intros A B C P HP. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @TSP Tn A B C P Q) *) destruct (segment_construction P A A P) as [Q []]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @TSP Tn A B C P Q) *) assert (HA : Coplanar A B C A) by Cop. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @TSP Tn A B C P Q) *) exists Q; repeat split. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn P T Q)) *) (* Goal: not (@Coplanar Tn A B C Q) *) (* Goal: not (@Coplanar Tn A B C P) *) - (* Goal: not (@Coplanar Tn A B C P) *) assumption. (* BG Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn P T Q)) *) (* BG Goal: not (@Coplanar Tn A B C Q) *) - (* Goal: not (@Coplanar Tn A B C Q) *) assert (A <> P) by (intro; subst; apply HP, HA); assert_diffs. (* Goal: not (@Coplanar Tn A B C Q) *) intro; apply HP, col_cop2__cop with A Q; Col. (* BG Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn P T Q)) *) - (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn P T Q)) *) exists A; split; assumption. Qed. Lemma osp_reflexivity : forall A B C P, ~ Coplanar A B C P -> OSP A B C P P. Proof. (* Goal: forall (A B C P : @Tpoint Tn) (_ : not (@Coplanar Tn A B C P)), @OSP Tn A B C P P *) intros A B C P HP. (* Goal: @OSP Tn A B C P P *) destruct (tsp_exists A B C P HP) as [Q]. (* Goal: @OSP Tn A B C P P *) exists Q; split; assumption. Qed. Lemma osp_symmetry : forall A B C P Q, OSP A B C P Q -> OSP A B C Q P. Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : @OSP Tn A B C P Q), @OSP Tn A B C Q P *) intros A B C P Q [R []]. (* Goal: @OSP Tn A B C Q P *) exists R; split; assumption. Qed. Lemma osp_transitivity : forall A B C P Q R, OSP A B C P Q -> OSP A B C Q R -> OSP A B C P R. Proof. (* Goal: forall (A B C P Q R : @Tpoint Tn) (_ : @OSP Tn A B C P Q) (_ : @OSP Tn A B C Q R), @OSP Tn A B C P R *) intros A B C P Q R [S [HPS HQS]] HQR. (* Goal: @OSP Tn A B C P R *) exists S; split; [|apply l9_41_2 with Q]; assumption. Qed. Lemma cop3_tsp__tsp : forall A B C D E F P Q, ~ Col D E F -> Coplanar A B C D -> Coplanar A B C E -> Coplanar A B C F -> TSP A B C P Q -> TSP D E F P Q. Proof. (* Goal: forall (A B C D E F P Q : @Tpoint Tn) (_ : not (@Col Tn D E F)) (_ : @Coplanar Tn A B C D) (_ : @Coplanar Tn A B C E) (_ : @Coplanar Tn A B C F) (_ : @TSP Tn A B C P Q), @TSP Tn D E F P Q *) intros A B C D E F P Q HNCol HD HE HF [HP [HQ [T [HT HBet]]]]. (* Goal: @TSP Tn D E F P Q *) assert (~ Col A B C) by (apply ncop__ncol with P, HP). (* Goal: @TSP Tn D E F P Q *) assert (Coplanar D E F A /\ Coplanar D E F B /\ Coplanar D E F C /\ Coplanar D E F T). (* Goal: @TSP Tn D E F P Q *) (* Goal: and (@Coplanar Tn D E F A) (and (@Coplanar Tn D E F B) (and (@Coplanar Tn D E F C) (@Coplanar Tn D E F T))) *) repeat split; apply coplanar_pseudo_trans with A B C; Cop. (* Goal: @TSP Tn D E F P Q *) spliter. (* Goal: @TSP Tn D E F P Q *) repeat split. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn D E F T) (@Bet Tn P T Q)) *) (* Goal: not (@Coplanar Tn D E F Q) *) (* Goal: not (@Coplanar Tn D E F P) *) intro; apply HP; apply coplanar_pseudo_trans with D E F; Cop. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn D E F T) (@Bet Tn P T Q)) *) (* Goal: not (@Coplanar Tn D E F Q) *) intro; apply HQ; apply coplanar_pseudo_trans with D E F; Cop. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn D E F T) (@Bet Tn P T Q)) *) exists T; split; assumption. Qed. Lemma cop3_osp__osp : forall A B C D E F P Q, ~ Col D E F -> Coplanar A B C D -> Coplanar A B C E -> Coplanar A B C F -> OSP A B C P Q -> OSP D E F P Q. Proof. (* Goal: forall (A B C D E F P Q : @Tpoint Tn) (_ : not (@Col Tn D E F)) (_ : @Coplanar Tn A B C D) (_ : @Coplanar Tn A B C E) (_ : @Coplanar Tn A B C F) (_ : @OSP Tn A B C P Q), @OSP Tn D E F P Q *) intros A B C D E F P Q HNCol HD HE HF [R []]. (* Goal: @OSP Tn D E F P Q *) exists R; split; apply (cop3_tsp__tsp A B C); assumption. Qed. Lemma ncop_distincts : forall A B C D, ~ Coplanar A B C D -> A <> B /\ A <> C /\ A <> D /\ B <> C /\ B <> D /\ C <> D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : not (@Coplanar Tn A B C D)), and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A C)) (and (not (@eq (@Tpoint Tn) A D)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) B D)) (not (@eq (@Tpoint Tn) C D)))))) *) intros A B C D H; repeat split; intro; subst; apply H; Cop. Qed. Lemma tsp_distincts : forall A B C P Q, TSP A B C P Q -> A <> B /\ A <> C /\ B <> C /\ A <> P /\ B <> P /\ C <> P /\ A <> Q /\ B <> Q /\ C <> Q /\ P <> Q. Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : @TSP Tn A B C P Q), and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A C)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) B P)) (and (not (@eq (@Tpoint Tn) C P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B Q)) (and (not (@eq (@Tpoint Tn) C Q)) (not (@eq (@Tpoint Tn) P Q)))))))))) *) intros A B C P Q [HP [HQ HT]]. (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A C)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) B P)) (and (not (@eq (@Tpoint Tn) C P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B Q)) (and (not (@eq (@Tpoint Tn) C Q)) (not (@eq (@Tpoint Tn) P Q)))))))))) *) assert (HP' := ncop_distincts A B C P HP). (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A C)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) B P)) (and (not (@eq (@Tpoint Tn) C P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B Q)) (and (not (@eq (@Tpoint Tn) C Q)) (not (@eq (@Tpoint Tn) P Q)))))))))) *) assert (HQ' := ncop_distincts A B C Q HQ). (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A C)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) B P)) (and (not (@eq (@Tpoint Tn) C P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B Q)) (and (not (@eq (@Tpoint Tn) C Q)) (not (@eq (@Tpoint Tn) P Q)))))))))) *) spliter; clean. (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A C)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) B P)) (and (not (@eq (@Tpoint Tn) C P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B Q)) (and (not (@eq (@Tpoint Tn) C Q)) (not (@eq (@Tpoint Tn) P Q)))))))))) *) repeat split; auto. (* Goal: not (@eq (@Tpoint Tn) P Q) *) destruct HT; spliter. (* Goal: not (@eq (@Tpoint Tn) P Q) *) intro; apply HP; treat_equalities; assumption. Qed. Lemma osp_distincts : forall A B C P Q, OSP A B C P Q -> A <> B /\ A <> C /\ B <> C /\ A <> P /\ B <> P /\ C <> P /\ A <> Q /\ B <> Q /\ C <> Q. Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : @OSP Tn A B C P Q), and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A C)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) B P)) (and (not (@eq (@Tpoint Tn) C P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B Q)) (not (@eq (@Tpoint Tn) C Q))))))))) *) intros A B C P Q [R [HPR HQR]]. (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A C)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) B P)) (and (not (@eq (@Tpoint Tn) C P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B Q)) (not (@eq (@Tpoint Tn) C Q))))))))) *) apply tsp_distincts in HPR. (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A C)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) B P)) (and (not (@eq (@Tpoint Tn) C P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B Q)) (not (@eq (@Tpoint Tn) C Q))))))))) *) apply tsp_distincts in HQR. (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A C)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@eq (@Tpoint Tn) B P)) (and (not (@eq (@Tpoint Tn) C P)) (and (not (@eq (@Tpoint Tn) A Q)) (and (not (@eq (@Tpoint Tn) B Q)) (not (@eq (@Tpoint Tn) C Q))))))))) *) spliter; clean; repeat split; auto. Qed. Lemma tsp__ncop1 : forall A B C P Q, TSP A B C P Q -> ~ Coplanar A B C P. Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : @TSP Tn A B C P Q), not (@Coplanar Tn A B C P) *) unfold TSP; intros; spliter; assumption. Qed. Lemma tsp__ncop2 : forall A B C P Q, TSP A B C P Q -> ~ Coplanar A B C Q. Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : @TSP Tn A B C P Q), not (@Coplanar Tn A B C Q) *) unfold TSP; intros; spliter; assumption. Qed. Lemma osp__ncop1 : forall A B C P Q, OSP A B C P Q -> ~ Coplanar A B C P. Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : @OSP Tn A B C P Q), not (@Coplanar Tn A B C P) *) intros A B C P Q [R [H1 H2]]. (* Goal: not (@Coplanar Tn A B C P) *) apply tsp__ncop1 with R, H1. Qed. Lemma osp__ncop2 : forall A B C P Q, OSP A B C P Q -> ~ Coplanar A B C Q. Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : @OSP Tn A B C P Q), not (@Coplanar Tn A B C Q) *) intros A B C P Q [R [H1 H2]]. (* Goal: not (@Coplanar Tn A B C Q) *) apply tsp__ncop1 with R, H2. Qed. Lemma tsp__nosp : forall A B C P Q, TSP A B C P Q -> ~ OSP A B C P Q. Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : @TSP Tn A B C P Q), not (@OSP Tn A B C P Q) *) intros A B C P Q HTS HOS. (* Goal: False *) absurd (TSP A B C P P). (* Goal: @TSP Tn A B C P P *) (* Goal: not (@TSP Tn A B C P P) *) intro Habs; apply tsp_distincts in Habs; spliter; auto. (* Goal: @TSP Tn A B C P P *) apply l9_41_2 with Q; [apply l9_38 | apply osp_symmetry]; assumption. Qed. Lemma osp__ntsp : forall A B C P Q, OSP A B C P Q -> ~ TSP A B C P Q. Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : @OSP Tn A B C P Q), not (@TSP Tn A B C P Q) *) intros A B C P Q HOS HTS. (* Goal: False *) apply (tsp__nosp A B C P Q); assumption. Qed. Lemma osp_bet__osp : forall A B C P Q R, OSP A B C P R -> Bet P Q R -> OSP A B C P Q. Proof. (* Goal: forall (A B C P Q R : @Tpoint Tn) (_ : @OSP Tn A B C P R) (_ : @Bet Tn P Q R), @OSP Tn A B C P Q *) intros A B C P Q R [S [HPS [HR [_ [Y []]]]]] HBet. (* Goal: @OSP Tn A B C P Q *) destruct (col_dec P R S) as [|HNCol]. (* Goal: @OSP Tn A B C P Q *) (* Goal: @OSP Tn A B C P Q *) { (* Goal: @OSP Tn A B C P Q *) exists S. (* Goal: and (@TSP Tn A B C P S) (@TSP Tn A B C Q S) *) split; [assumption|]. (* Goal: @TSP Tn A B C Q S *) apply l9_39 with Y P; trivial. (* Goal: @Out Tn Y P Q *) destruct HPS as [HP [HS [X []]]]. (* Goal: @Out Tn Y P Q *) assert (P <> X /\ S <> X /\ R <> Y) by (repeat split; intro; subst; auto); spliter. (* Goal: @Out Tn Y P Q *) assert (X = Y) by (assert_diffs; apply (col2_cop2__eq A B C R S); ColR). (* Goal: @Out Tn Y P Q *) subst Y. (* Goal: @Out Tn X P Q *) apply out_bet_out_1 with R; [|assumption]. (* Goal: @Out Tn X P R *) apply l6_2 with S; auto. (* BG Goal: @OSP Tn A B C P Q *) } (* Goal: @OSP Tn A B C P Q *) destruct HPS as [HP [HS [X []]]]. (* Goal: @OSP Tn A B C P Q *) assert (HOS : OS X Y P Q). (* Goal: @OSP Tn A B C P Q *) (* Goal: @OS Tn X Y P Q *) { (* Goal: @OS Tn X Y P Q *) apply l9_17 with R; [|assumption]. (* Goal: @OS Tn X Y P R *) assert (P <> X /\ S <> X /\ R <> Y /\ S <> Y) by (repeat split; intro; subst; auto); spliter. (* Goal: @OS Tn X Y P R *) assert (~ Col S X Y) by (intro; apply HNCol; ColR). (* Goal: @OS Tn X Y P R *) exists S; repeat split; trivial; try (intro; apply HNCol; ColR). (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T X Y) (@Bet Tn R T S)) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T X Y) (@Bet Tn P T S)) *) exists X; split; Col. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T X Y) (@Bet Tn R T S)) *) exists Y; split; Col. (* BG Goal: @OSP Tn A B C P Q *) } (* Goal: @OSP Tn A B C P Q *) destruct HOS as [S' [[HNCol1 [HNCol2 [X' []]]] [HNCol3 [_ [Y' []]]]]]. (* Goal: @OSP Tn A B C P Q *) assert (Coplanar A B C X') by (assert_diffs; apply col_cop2__cop with X Y; Col). (* Goal: @OSP Tn A B C P Q *) assert (Coplanar A B C Y') by (assert_diffs; apply col_cop2__cop with X Y; Col). (* Goal: @OSP Tn A B C P Q *) assert (HS' : ~ Coplanar A B C S'). (* Goal: @OSP Tn A B C P Q *) (* Goal: not (@Coplanar Tn A B C S') *) intro; apply HP, col_cop2__cop with X' S'; Col; intro; subst; Col. (* Goal: @OSP Tn A B C P Q *) exists S'; repeat split; trivial. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn Q T S')) *) (* Goal: not (@Coplanar Tn A B C Q) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn P T S')) *) exists X'; split; assumption. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn Q T S')) *) (* Goal: not (@Coplanar Tn A B C Q) *) intro; apply HS', col_cop2__cop with Q Y'; Col; intro; subst; Col. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn Q T S')) *) exists Y'; split; assumption. Qed. Lemma l9_18_3 : forall A B C X Y P, Coplanar A B C P -> Col X Y P -> TSP A B C X Y <-> Bet X P Y /\ ~ Coplanar A B C X /\ ~ Coplanar A B C Y. Proof. (* Goal: forall (A B C X Y P : @Tpoint Tn) (_ : @Coplanar Tn A B C P) (_ : @Col Tn X Y P), iff (@TSP Tn A B C X Y) (and (@Bet Tn X P Y) (and (not (@Coplanar Tn A B C X)) (not (@Coplanar Tn A B C Y)))) *) intros A B C X Y P HP HCol. (* Goal: iff (@TSP Tn A B C X Y) (and (@Bet Tn X P Y) (and (not (@Coplanar Tn A B C X)) (not (@Coplanar Tn A B C Y)))) *) split; [|intros [HBet [HX HY]]; repeat split; trivial; exists P; split; assumption]. (* Goal: forall _ : @TSP Tn A B C X Y, and (@Bet Tn X P Y) (and (not (@Coplanar Tn A B C X)) (not (@Coplanar Tn A B C Y))) *) intros [HX [HY [T [HT HBet]]]]. (* Goal: and (@Bet Tn X P Y) (and (not (@Coplanar Tn A B C X)) (not (@Coplanar Tn A B C Y))) *) repeat split; trivial. (* Goal: @Bet Tn X P Y *) replace P with T; trivial. (* Goal: @eq (@Tpoint Tn) T P *) apply (col2_cop2__eq A B C X Y); Col. (* Goal: not (@eq (@Tpoint Tn) X Y) *) intro; treat_equalities; auto. Qed. Lemma bet_cop__tsp : forall A B C X Y P, ~ Coplanar A B C X -> P <> Y -> Coplanar A B C P -> Bet X P Y -> TSP A B C X Y. Proof. (* Goal: forall (A B C X Y P : @Tpoint Tn) (_ : not (@Coplanar Tn A B C X)) (_ : not (@eq (@Tpoint Tn) P Y)) (_ : @Coplanar Tn A B C P) (_ : @Bet Tn X P Y), @TSP Tn A B C X Y *) intros A B C X Y P HX HPY HP HBet. (* Goal: @TSP Tn A B C X Y *) apply (l9_18_3 A B C X Y P); Col. (* Goal: and (@Bet Tn X P Y) (and (not (@Coplanar Tn A B C X)) (not (@Coplanar Tn A B C Y))) *) repeat split; [assumption..|]. (* Goal: not (@Coplanar Tn A B C Y) *) intro; apply HX, col_cop2__cop with P Y; Col. Qed. Lemma cop_out__osp : forall A B C X Y P, ~ Coplanar A B C X -> Coplanar A B C P -> Out P X Y -> OSP A B C X Y. Proof. (* Goal: forall (A B C X Y P : @Tpoint Tn) (_ : not (@Coplanar Tn A B C X)) (_ : @Coplanar Tn A B C P) (_ : @Out Tn P X Y), @OSP Tn A B C X Y *) intros A B C X Y P HX HP HOut. (* Goal: @OSP Tn A B C X Y *) assert (~ Coplanar A B C Y). (* Goal: @OSP Tn A B C X Y *) (* Goal: not (@Coplanar Tn A B C Y) *) assert_diffs; intro; apply HX, col_cop2__cop with P Y; Col. (* Goal: @OSP Tn A B C X Y *) destruct (segment_construction X P P X) as [X' []]. (* Goal: @OSP Tn A B C X Y *) assert (~ Coplanar A B C X'). (* Goal: @OSP Tn A B C X Y *) (* Goal: not (@Coplanar Tn A B C X') *) assert_diffs; intro; apply HX, col_cop2__cop with P X'; Col. (* Goal: @OSP Tn A B C X Y *) exists X'; repeat split; trivial; exists P; split; trivial. (* Goal: @Bet Tn Y P X' *) apply bet_out__bet with X; assumption. Qed. Lemma l9_19_3 : forall A B C X Y P, Coplanar A B C P -> Col X Y P -> OSP A B C X Y <-> Out P X Y /\ ~ Coplanar A B C X. Proof. (* Goal: forall (A B C X Y P : @Tpoint Tn) (_ : @Coplanar Tn A B C P) (_ : @Col Tn X Y P), iff (@OSP Tn A B C X Y) (and (@Out Tn P X Y) (not (@Coplanar Tn A B C X))) *) intros A B C X Y P HP HCol. (* Goal: iff (@OSP Tn A B C X Y) (and (@Out Tn P X Y) (not (@Coplanar Tn A B C X))) *) split; [|intros []; apply cop_out__osp with P; assumption]. (* Goal: forall _ : @OSP Tn A B C X Y, and (@Out Tn P X Y) (not (@Coplanar Tn A B C X)) *) intro HOS. (* Goal: and (@Out Tn P X Y) (not (@Coplanar Tn A B C X)) *) assert (~ Coplanar A B C X /\ ~ Coplanar A B C Y). (* Goal: and (@Out Tn P X Y) (not (@Coplanar Tn A B C X)) *) (* Goal: and (not (@Coplanar Tn A B C X)) (not (@Coplanar Tn A B C Y)) *) unfold OSP, TSP in HOS; destruct HOS as [Z []]; spliter; split; assumption. (* Goal: and (@Out Tn P X Y) (not (@Coplanar Tn A B C X)) *) spliter. (* Goal: and (@Out Tn P X Y) (not (@Coplanar Tn A B C X)) *) split; [|assumption]. (* Goal: @Out Tn P X Y *) apply not_bet_out; [Col|]. (* Goal: not (@Bet Tn X P Y) *) intro HBet. (* Goal: False *) apply osp__ntsp in HOS. (* Goal: False *) apply HOS. (* Goal: @TSP Tn A B C X Y *) repeat split; trivial; exists P; split; assumption. Qed. Lemma cop2_ts__tsp : forall A B C D E X Y, ~ Coplanar A B C X -> Coplanar A B C D -> Coplanar A B C E -> TS D E X Y -> TSP A B C X Y. Proof. (* Goal: forall (A B C D E X Y : @Tpoint Tn) (_ : not (@Coplanar Tn A B C X)) (_ : @Coplanar Tn A B C D) (_ : @Coplanar Tn A B C E) (_ : @TS Tn D E X Y), @TSP Tn A B C X Y *) intros A B C D E X Y HX HD HE [HNCol [HNCol' [T []]]]. (* Goal: @TSP Tn A B C X Y *) assert (Coplanar A B C T) by (assert_diffs; apply col_cop2__cop with D E; Col). (* Goal: @TSP Tn A B C X Y *) repeat split. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn X T Y)) *) (* Goal: not (@Coplanar Tn A B C Y) *) (* Goal: not (@Coplanar Tn A B C X) *) assumption. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn X T Y)) *) (* Goal: not (@Coplanar Tn A B C Y) *) intro; apply HX, col_cop2__cop with T Y; Col; intro; subst; apply HNCol'; Col. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Coplanar Tn A B C T) (@Bet Tn X T Y)) *) exists T; split; assumption. Qed. Lemma cop2_os__osp : forall A B C D E X Y, ~ Coplanar A B C X -> Coplanar A B C D -> Coplanar A B C E -> OS D E X Y -> OSP A B C X Y. Proof. (* Goal: forall (A B C D E X Y : @Tpoint Tn) (_ : not (@Coplanar Tn A B C X)) (_ : @Coplanar Tn A B C D) (_ : @Coplanar Tn A B C E) (_ : @OS Tn D E X Y), @OSP Tn A B C X Y *) intros A B C D E X Y HX HD HE [Z [HXZ HYZ]]. (* Goal: @OSP Tn A B C X Y *) assert (HTS : TSP A B C X Z) by (apply cop2_ts__tsp with D E; assumption). (* Goal: @OSP Tn A B C X Y *) exists Z; split; [assumption|]. (* Goal: @TSP Tn A B C Y Z *) destruct HTS as [_ []]. (* Goal: @TSP Tn A B C Y Z *) apply l9_2 in HYZ. (* Goal: @TSP Tn A B C Y Z *) apply l9_38, cop2_ts__tsp with D E; assumption. Qed. Lemma cop3_tsp__ts : forall A B C D E X Y, D <> E -> Coplanar A B C D -> Coplanar A B C E -> Coplanar D E X Y -> TSP A B C X Y -> TS D E X Y. Proof. (* Goal: forall (A B C D E X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) D E)) (_ : @Coplanar Tn A B C D) (_ : @Coplanar Tn A B C E) (_ : @Coplanar Tn D E X Y) (_ : @TSP Tn A B C X Y), @TS Tn D E X Y *) intros A B C D E X Y HDE HD HE HCop HTSP. (* Goal: @TS Tn D E X Y *) assert (HX : ~ Coplanar A B C X) by (apply tsp__ncop1 with Y, HTSP). (* Goal: @TS Tn D E X Y *) assert (HY : ~ Coplanar A B C Y) by (apply tsp__ncop2 with X, HTSP). (* Goal: @TS Tn D E X Y *) apply cop__not_one_side_two_sides. (* Goal: not (@OS Tn D E X Y) *) (* Goal: not (@Col Tn Y D E) *) (* Goal: not (@Col Tn X D E) *) (* Goal: @Coplanar Tn D E X Y *) assumption. (* Goal: not (@OS Tn D E X Y) *) (* Goal: not (@Col Tn Y D E) *) (* Goal: not (@Col Tn X D E) *) intro; apply HX, col_cop2__cop with D E; Col. (* Goal: not (@OS Tn D E X Y) *) (* Goal: not (@Col Tn Y D E) *) intro; apply HY, col_cop2__cop with D E; Col. (* Goal: not (@OS Tn D E X Y) *) intro. (* Goal: False *) apply tsp__nosp in HTSP. (* Goal: False *) apply HTSP, cop2_os__osp with D E; assumption. Qed. Lemma cop3_osp__os : forall A B C D E X Y, D <> E -> Coplanar A B C D -> Coplanar A B C E -> Coplanar D E X Y -> OSP A B C X Y -> OS D E X Y. Proof. (* Goal: forall (A B C D E X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) D E)) (_ : @Coplanar Tn A B C D) (_ : @Coplanar Tn A B C E) (_ : @Coplanar Tn D E X Y) (_ : @OSP Tn A B C X Y), @OS Tn D E X Y *) intros A B C D E X Y HDE HD HE HCop HOSP. (* Goal: @OS Tn D E X Y *) assert (HX : ~ Coplanar A B C X) by (apply osp__ncop1 with Y, HOSP). (* Goal: @OS Tn D E X Y *) assert (HY : ~ Coplanar A B C Y) by (apply osp__ncop2 with X, HOSP). (* Goal: @OS Tn D E X Y *) apply cop__not_two_sides_one_side. (* Goal: not (@TS Tn D E X Y) *) (* Goal: not (@Col Tn Y D E) *) (* Goal: not (@Col Tn X D E) *) (* Goal: @Coplanar Tn D E X Y *) assumption. (* Goal: not (@TS Tn D E X Y) *) (* Goal: not (@Col Tn Y D E) *) (* Goal: not (@Col Tn X D E) *) intro; apply HX, col_cop2__cop with D E; Col. (* Goal: not (@TS Tn D E X Y) *) (* Goal: not (@Col Tn Y D E) *) intro; apply HY, col_cop2__cop with D E; Col. (* Goal: not (@TS Tn D E X Y) *) intro. (* Goal: False *) apply osp__ntsp in HOSP. (* Goal: False *) apply HOSP, cop2_ts__tsp with D E; assumption. Qed. Lemma cop_tsp__ex_cop2 : forall A B C D E P, Coplanar A B C P -> TSP A B C D E -> exists Q, Coplanar A B C Q /\ Coplanar D E P Q /\ P <> Q. Proof. (* Goal: forall (A B C D E P : @Tpoint Tn) (_ : @Coplanar Tn A B C P) (_ : @TSP Tn A B C D E), @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) intros A B C D E P HCop HTSP. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) destruct (col_dec D E P) as [|HNCol]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) { (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) apply tsp_distincts in HTSP; spliter. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) destruct (eq_dec_points P A). (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) subst; exists B; repeat split; Cop. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) exists A; repeat split; Cop. (* BG Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) } (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) destruct HTSP as [_ [_ [Q []]]]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) exists Q; repeat split; Cop. (* Goal: not (@eq (@Tpoint Tn) P Q) *) intro; subst; apply HNCol; Col. Qed. Lemma cop_osp__ex_cop2 : forall A B C D E P, Coplanar A B C P -> OSP A B C D E -> exists Q, Coplanar A B C Q /\ Coplanar D E P Q /\ P <> Q. Proof. (* Goal: forall (A B C D E P : @Tpoint Tn) (_ : @Coplanar Tn A B C P) (_ : @OSP Tn A B C D E), @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) intros A B C D E P HCop HOSP. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) destruct (col_dec D E P) as [|HNCol]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) { (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) apply osp_distincts in HOSP; spliter. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) destruct (eq_dec_points P A). (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) subst; exists B; repeat split; Cop. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) exists A; repeat split; Cop. (* BG Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) } (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) destruct (segment_construction E P P E) as [E' []]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) assert (~ Col D E' P) by (intro; apply HNCol; ColR). (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) destruct (cop_tsp__ex_cop2 A B C D E' P) as [Q [HQ1 [HQ2 HPQ]]]; [assumption|..]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) (* Goal: @TSP Tn A B C D E' *) { (* Goal: @TSP Tn A B C D E' *) apply l9_41_2 with E. (* Goal: @OSP Tn A B C E D *) (* Goal: @TSP Tn A B C E E' *) assert_diffs; destruct HOSP as [F [_ [HE]]]; apply bet_cop__tsp with P; Cop. (* Goal: @OSP Tn A B C E D *) apply osp_symmetry, HOSP. (* BG Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) } (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Coplanar Tn A B C Q) (and (@Coplanar Tn D E P Q) (not (@eq (@Tpoint Tn) P Q)))) *) exists Q; repeat split; auto. (* Goal: @Coplanar Tn D E P Q *) apply coplanar_perm_2, coplanar_trans_1 with E'; Col; Cop. Qed. End T9. Hint Resolve l9_2 invert_two_sides invert_one_side one_side_symmetry l9_9 l9_9_bis l9_38 osp_symmetry osp__ntsp tsp__nosp : side. Hint Resolve os__coplanar : cop. Ltac Side := eauto with side. Ltac not_exist_hyp_perm4 A B C D := first [not_exist_hyp_perm_ncol A B C|not_exist_hyp_perm_ncol A B D|not_exist_hyp_perm_ncol A C D|not_exist_hyp_perm_ncol B C D]. Ltac assert_ncols := repeat match goal with | H:OS ?A ?B ?X ?Y |- _ => not_exist_hyp_perm_ncol A B X;assert (~ Col A B X) by (apply(one_side_not_col123 A B X Y);finish) | H:OS ?A ?B ?X ?Y |- _ => not_exist_hyp_perm_ncol A B Y;assert (~ Col A B Y) by (apply(one_side_not_col124 A B X Y);finish) | H:TS ?A ?B ?X ?Y |- _ => not_exist_hyp_perm_ncol A B X;assert (~ Col A B X) by (apply(two_sides_not_col A B X Y);finish) | H:TS ?A ?B ?X ?Y |- _ => not_exist_hyp_perm_ncol A B Y;assert (~ Col A B Y) by (apply(two_sides_not_col A B Y X);finish) | H:~ Coplanar ?A ?B ?C ?D |- _ => let h := fresh in not_exist_hyp_perm4 A B C D; assert (h := ncop__ncols A B C D H);decompose [and] h;clear h;clean_reap_hyps end.
Set Implicit Arguments. Require Export inductive_wqo. Require Export tree. Require Export higman_aux. Section higman. Variable A : Set. Variable leA : A -> A -> Prop. Hypothesis eqA_dec : forall a a' : A, {a = a'} + {a <> a'}. Hypothesis leA_dec : forall a a', {leA a a'} + {~ leA a a'}. Hypothesis leA_trans : forall a a' a'', leA a a' -> leA a' a'' -> leA a a''. Definition embeds : list A -> list A -> Prop := (higman_aux.embeds leA). Definition sublist : list (list A) -> list (list A) -> Prop := (higman_aux.sublist (A:=A)). Definition Tree := (higman_aux.Tree A). Definition is_forest := (higman_aux.is_forest leA leA_dec). Definition is_insert_forest := (higman_aux.is_insert_forest leA). Definition is_insert_tree := (higman_aux.is_insert_tree leA). Definition sub_seq_in_lbl (ws : list (list A)) (t : Tree) : Prop := forall vs l ts, t = node (vs,l) ts -> sublist (merge_label vs l) ws. Lemma sub_seq_in_forest : forall ws f, is_forest ws f -> P_on_forest sub_seq_in_lbl ws f. Proof. (* Goal: forall (ws : list (list A)) (f : list (higman_aux.Tree A)) (_ : is_forest ws f), @P_on_forest A sub_seq_in_lbl ws f *) intros ws f Hws. (* Goal: @P_on_forest A sub_seq_in_lbl ws f *) apply P_on_is_forest with leA leA_dec; intros. (* Goal: @higman_aux.is_forest A leA leA_dec ws f *) (* Goal: sub_seq_in_lbl (@cons (list A) w ws0) t *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a (@cons (higman_aux.Tree A) t f0)) *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a f0) *) (* Goal: sub_seq_in_lbl (@cons (list A) (@cons A a w) ws0) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) w ws0) (@cons A a (@nil A))) f0) *) (* Goal: sub_seq_in_lbl (@cons (list A) (@cons A a w) ws0) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) w vs) (@cons A a l)) ts) *) unfold sub_seq_in_lbl; simpl; intros. (* Goal: @higman_aux.is_forest A leA leA_dec ws f *) (* Goal: sub_seq_in_lbl (@cons (list A) w ws0) t *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a (@cons (higman_aux.Tree A) t f0)) *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a f0) *) (* Goal: sub_seq_in_lbl (@cons (list A) (@cons A a w) ws0) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) w ws0) (@cons A a (@nil A))) f0) *) (* Goal: sublist (@merge_label A vs0 l0) (@cons (list A) (@cons A a w) ws0) *) inversion H1; subst. (* Goal: @higman_aux.is_forest A leA leA_dec ws f *) (* Goal: sub_seq_in_lbl (@cons (list A) w ws0) t *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a (@cons (higman_aux.Tree A) t f0)) *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a f0) *) (* Goal: sub_seq_in_lbl (@cons (list A) (@cons A a w) ws0) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) w ws0) (@cons A a (@nil A))) f0) *) (* Goal: sublist (@merge_label A (@cons (list A) w vs) (@cons A a l)) (@cons (list A) (@cons A a w) ws0) *) simpl. (* Goal: @higman_aux.is_forest A leA leA_dec ws f *) (* Goal: sub_seq_in_lbl (@cons (list A) w ws0) t *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a (@cons (higman_aux.Tree A) t f0)) *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a f0) *) (* Goal: sub_seq_in_lbl (@cons (list A) (@cons A a w) ws0) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) w ws0) (@cons A a (@nil A))) f0) *) (* Goal: sublist (@cons (list A) (@cons A a w) (@merge_label A vs l)) (@cons (list A) (@cons A a w) ws0) *) constructor 3; trivial. (* Goal: @higman_aux.is_forest A leA leA_dec ws f *) (* Goal: sub_seq_in_lbl (@cons (list A) w ws0) t *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a (@cons (higman_aux.Tree A) t f0)) *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a f0) *) (* Goal: sub_seq_in_lbl (@cons (list A) (@cons A a w) ws0) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) w ws0) (@cons A a (@nil A))) f0) *) (* Goal: @Embeds (list A) (@eq (list A)) (@merge_label A vs l) ws0 *) unfold sub_seq_in_lbl in H0; apply H0 with ts0; trivial. (* Goal: @higman_aux.is_forest A leA leA_dec ws f *) (* Goal: sub_seq_in_lbl (@cons (list A) w ws0) t *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a (@cons (higman_aux.Tree A) t f0)) *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a f0) *) (* Goal: sub_seq_in_lbl (@cons (list A) (@cons A a w) ws0) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) w ws0) (@cons A a (@nil A))) f0) *) unfold sub_seq_in_lbl; simpl; intros. (* Goal: @higman_aux.is_forest A leA leA_dec ws f *) (* Goal: sub_seq_in_lbl (@cons (list A) w ws0) t *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a (@cons (higman_aux.Tree A) t f0)) *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a f0) *) (* Goal: sublist (@merge_label A vs l) (@cons (list A) (@cons A a w) ws0) *) inversion H0; subst; destruct ws0; simpl; apply sublist_refl with (A:=A). (* Goal: @higman_aux.is_forest A leA leA_dec ws f *) (* Goal: sub_seq_in_lbl (@cons (list A) w ws0) t *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a (@cons (higman_aux.Tree A) t f0)) *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a f0) *) unfold sub_seq_in_lbl; simpl; intros. (* Goal: @higman_aux.is_forest A leA leA_dec ws f *) (* Goal: sub_seq_in_lbl (@cons (list A) w ws0) t *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a (@cons (higman_aux.Tree A) t f0)) *) (* Goal: sublist (@merge_label A vs l) ws0 *) inversion H1; subst. (* Goal: @higman_aux.is_forest A leA leA_dec ws f *) (* Goal: sub_seq_in_lbl (@cons (list A) w ws0) t *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a (@cons (higman_aux.Tree A) t f0)) *) (* Goal: sublist (@merge_label A vs l) ws0 *) unfold sub_seq_in_lbl in H; apply H with (t::ts); trivial. (* Goal: @higman_aux.is_forest A leA leA_dec ws f *) (* Goal: sub_seq_in_lbl (@cons (list A) w ws0) t *) (* Goal: sub_seq_in_lbl ws0 (@node (prod (list (list A)) (list A)) a (@cons (higman_aux.Tree A) t f0)) *) unfold sub_seq_in_lbl; simpl; intros. (* Goal: @higman_aux.is_forest A leA leA_dec ws f *) (* Goal: sub_seq_in_lbl (@cons (list A) w ws0) t *) (* Goal: sublist (@merge_label A vs l) ws0 *) inversion H1; subst. (* Goal: @higman_aux.is_forest A leA leA_dec ws f *) (* Goal: sub_seq_in_lbl (@cons (list A) w ws0) t *) (* Goal: sublist (@merge_label A vs l) ws0 *) unfold sub_seq_in_lbl in H; apply H with f0; trivial. (* Goal: @higman_aux.is_forest A leA leA_dec ws f *) (* Goal: sub_seq_in_lbl (@cons (list A) w ws0) t *) unfold sub_seq_in_lbl in *; simpl in *. (* Goal: @higman_aux.is_forest A leA leA_dec ws f *) (* Goal: forall (vs : list (list A)) (l : list A) (ts : list (tree (prod (list (list A)) (list A)))) (_ : @eq Tree t (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs l) ts)), sublist (@merge_label A vs l) (@cons (list A) w ws0) *) intros ws' l ts Ht; constructor 2; apply (H ws' l ts Ht). (* Goal: @higman_aux.is_forest A leA leA_dec ws f *) apply Hws. Qed. Definition sorted_in_label (t : Tree) : Prop := forall vs l ts, t = node (vs, l) ts -> sorted leA l. Lemma sorted_in_forest : forall ws f, is_forest ws f -> forall t, tree_in_forest t f -> sorted_in_label t. Definition bad_seq_in_lbl (t : Tree) : Prop := forall vs l ts, t = node (vs,l) ts -> bad embeds vs. Lemma bad_seqs_in_forest : forall ws, bad embeds ws -> forall f, is_forest ws f -> forall t, tree_in_forest t f -> bad_seq_in_lbl t. Proof. (* Goal: forall (ws : list (list A)) (_ : @bad (list A) embeds ws) (f : list (higman_aux.Tree A)) (_ : is_forest ws f) (t : tree (prod (list (list A)) (list A))) (_ : @tree_in_forest (prod (list (list A)) (list A)) t f), bad_seq_in_lbl t *) intros ws Hws f Hf t Ht vs l ts H. (* Goal: @bad (list A) embeds vs *) generalize (sorted_in_forest Hf Ht H); intro H2. (* Goal: @bad (list A) embeds vs *) assert (H' : bad embeds (merge_label vs l)). (* Goal: @bad (list A) embeds vs *) (* Goal: @bad (list A) embeds (@merge_label A vs l) *) apply (bad_sublist (leA:=leA) (sub_seq_in_forest Hf Ht H)); trivial. (* Goal: @bad (list A) embeds vs *) intro HF; apply H'. (* Goal: @good (list A) embeds (@merge_label A vs l) *) apply good_merge with (leA:=leA); trivial. Qed. Definition ltF : list Tree -> list Tree -> Prop := fun f' => fun f => exists w, exists a, is_insert_forest f w a f' /\ (forall t, tree_in_forest t f' -> bad_seq_in_lbl t) /\ f<>f'. Fact acc_ltF_nil : Acc ltF nil. Proof. (* Goal: @Acc (list Tree) ltF (@nil Tree) *) constructor; intros f Hf. (* Goal: @Acc (list Tree) ltF f *) elim Hf; clear Hf; intros w H; elim H; clear H; intros a H; elim H; clear H; intros H1 H; elim H; clear H; intros H2 H3. (* Goal: @Acc (list Tree) ltF f *) inversion H1; subst. (* Goal: @Acc (list Tree) ltF (@nil (higman_aux.Tree A)) *) elim H3; trivial. Qed. Fact acc_ltF_cons : forall f t, Acc ltF f -> Acc ltF (t::nil) -> Acc ltF (t::f). Lemma is_forest_roots_labels : forall ws f, is_forest ws f -> roots_labels f = Some (bad_subsequence leA leA_dec (firsts ws)). Proof. (* Goal: forall (ws : list (list A)) (f : list (higman_aux.Tree A)) (_ : is_forest ws f), @eq (option (list A)) (@roots_labels A f) (@Some (list A) (@bad_subsequence A leA leA_dec (@firsts A ws))) *) intros ws f Hws; induction Hws; simpl; trivial. (* Goal: @eq (option (list A)) match @roots_labels A f with | Some ts'' => @Some (list A) (@cons A a ts'') | None => @None (list A) end (@Some (list A) (if @greater_dec A leA leA_dec a (@bad_subsequence A leA leA_dec (@firsts A ws)) then @bad_subsequence A leA leA_dec (@firsts A ws) else @cons A a (@bad_subsequence A leA leA_dec (@firsts A ws)))) *) (* Goal: @eq (option (list A)) (@roots_labels A f') (@Some (list A) (if @greater_dec A leA leA_dec a (@bad_subsequence A leA leA_dec (@firsts A ws)) then @bad_subsequence A leA leA_dec (@firsts A ws) else @cons A a (@bad_subsequence A leA leA_dec (@firsts A ws)))) *) elim (greater_dec leA leA_dec a (bad_subsequence leA leA_dec (firsts ws))); intro case_ws. (* Goal: @eq (option (list A)) match @roots_labels A f with | Some ts'' => @Some (list A) (@cons A a ts'') | None => @None (list A) end (@Some (list A) (if @greater_dec A leA leA_dec a (@bad_subsequence A leA leA_dec (@firsts A ws)) then @bad_subsequence A leA leA_dec (@firsts A ws) else @cons A a (@bad_subsequence A leA leA_dec (@firsts A ws)))) *) (* Goal: @eq (option (list A)) (@roots_labels A f') (@Some (list A) (@cons A a (@bad_subsequence A leA leA_dec (@firsts A ws)))) *) (* Goal: @eq (option (list A)) (@roots_labels A f') (@Some (list A) (@bad_subsequence A leA leA_dec (@firsts A ws))) *) rewrite <- IHHws. (* Goal: @eq (option (list A)) match @roots_labels A f with | Some ts'' => @Some (list A) (@cons A a ts'') | None => @None (list A) end (@Some (list A) (if @greater_dec A leA leA_dec a (@bad_subsequence A leA leA_dec (@firsts A ws)) then @bad_subsequence A leA leA_dec (@firsts A ws) else @cons A a (@bad_subsequence A leA leA_dec (@firsts A ws)))) *) (* Goal: @eq (option (list A)) (@roots_labels A f') (@Some (list A) (@cons A a (@bad_subsequence A leA leA_dec (@firsts A ws)))) *) (* Goal: @eq (option (list A)) (@roots_labels A f') (@roots_labels A f) *) symmetry; generalize H0; apply is_insert_forest_same_roots. (* Goal: @eq (option (list A)) match @roots_labels A f with | Some ts'' => @Some (list A) (@cons A a ts'') | None => @None (list A) end (@Some (list A) (if @greater_dec A leA leA_dec a (@bad_subsequence A leA leA_dec (@firsts A ws)) then @bad_subsequence A leA leA_dec (@firsts A ws) else @cons A a (@bad_subsequence A leA leA_dec (@firsts A ws)))) *) (* Goal: @eq (option (list A)) (@roots_labels A f') (@Some (list A) (@cons A a (@bad_subsequence A leA leA_dec (@firsts A ws)))) *) elim case_ws; trivial. (* Goal: @eq (option (list A)) match @roots_labels A f with | Some ts'' => @Some (list A) (@cons A a ts'') | None => @None (list A) end (@Some (list A) (if @greater_dec A leA leA_dec a (@bad_subsequence A leA leA_dec (@firsts A ws)) then @bad_subsequence A leA leA_dec (@firsts A ws) else @cons A a (@bad_subsequence A leA leA_dec (@firsts A ws)))) *) rewrite IHHws; simpl. (* Goal: @eq (option (list A)) (@Some (list A) (@cons A a (@bad_subsequence A leA leA_dec (@firsts A ws)))) (@Some (list A) (if @greater_dec A leA leA_dec a (@bad_subsequence A leA leA_dec (@firsts A ws)) then @bad_subsequence A leA leA_dec (@firsts A ws) else @cons A a (@bad_subsequence A leA leA_dec (@firsts A ws)))) *) elim (greater_dec leA leA_dec a (bad_subsequence leA leA_dec (firsts ws))); intro case_ws. (* Goal: @eq (option (list A)) (@Some (list A) (@cons A a (@bad_subsequence A leA leA_dec (@firsts A ws)))) (@Some (list A) (@cons A a (@bad_subsequence A leA leA_dec (@firsts A ws)))) *) (* Goal: @eq (option (list A)) (@Some (list A) (@cons A a (@bad_subsequence A leA leA_dec (@firsts A ws)))) (@Some (list A) (@bad_subsequence A leA leA_dec (@firsts A ws))) *) elim H; trivial. (* Goal: @eq (option (list A)) (@Some (list A) (@cons A a (@bad_subsequence A leA leA_dec (@firsts A ws)))) (@Some (list A) (@cons A a (@bad_subsequence A leA leA_dec (@firsts A ws)))) *) trivial. Qed. Lemma acc_ltF_single : forall ws, Acc (continues embeds) ws -> forall l a bs, Acc (continues leA) bs -> forall ts, Acc ltF ts -> forall t, root t = (ws,a::l) /\ subtrees t = ts /\ Some bs = roots_labels ts -> Acc ltF (t::nil). Proof. (* Goal: forall (ws : list (list A)) (_ : @Acc (list (list A)) (@continues (list A) embeds) ws) (l : list A) (a : A) (bs : list A) (_ : @Acc (list A) (@continues A leA) bs) (ts : list Tree) (_ : @Acc (list Tree) ltF ts) (t : tree (prod (list (list A)) (list A))) (_ : and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) t) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) t) ts) (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A ts)))), @Acc (list Tree) ltF (@cons (tree (prod (list (list A)) (list A))) t (@nil (tree (prod (list (list A)) (list A))))) *) intros ws acc_ws; induction acc_ws as [ws acc_ws IHws]; intros l a. (* Goal: forall (bs : list A) (_ : @Acc (list A) (@continues A leA) bs) (ts : list Tree) (_ : @Acc (list Tree) ltF ts) (t : tree (prod (list (list A)) (list A))) (_ : and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) t) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) t) ts) (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A ts)))), @Acc (list Tree) ltF (@cons (tree (prod (list (list A)) (list A))) t (@nil (tree (prod (list (list A)) (list A))))) *) intros bs acc_bs; induction acc_bs as [bs acc_bs IHbs]. (* Goal: forall (ts : list Tree) (_ : @Acc (list Tree) ltF ts) (t : tree (prod (list (list A)) (list A))) (_ : and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) t) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) t) ts) (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A ts)))), @Acc (list Tree) ltF (@cons (tree (prod (list (list A)) (list A))) t (@nil (tree (prod (list (list A)) (list A))))) *) intros ts acc_ts; induction acc_ts as [ts acc_ts IHts]. (* Goal: forall (t : tree (prod (list (list A)) (list A))) (_ : and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) t) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) t) ts) (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A ts)))), @Acc (list Tree) ltF (@cons (tree (prod (list (list A)) (list A))) t (@nil (tree (prod (list (list A)) (list A))))) *) intros t Ht; elim Ht; clear Ht; intros H1 H2; elim H2; clear H2; intros H2 H3. (* Goal: @Acc (list Tree) ltF (@cons (tree (prod (list (list A)) (list A))) t (@nil (tree (prod (list (list A)) (list A))))) *) constructor; intros f Hf. (* Goal: @Acc (list Tree) ltF f *) elim Hf; clear Hf; intros wf Hf. (* Goal: @Acc (list Tree) ltF f *) elim Hf; clear Hf; intros af Hf. (* Goal: @Acc (list Tree) ltF f *) elim Hf; clear Hf; intros Hf1 Hf2. (* Goal: @Acc (list Tree) ltF f *) elim Hf2; clear Hf2; intros Hf2 Hf3. (* Goal: @Acc (list Tree) ltF f *) destruct f as [|t' f]. (* Goal: @Acc (list Tree) ltF (@cons Tree t' f) *) (* Goal: @Acc (list Tree) ltF (@nil Tree) *) inversion Hf1. (* Goal: @Acc (list Tree) ltF (@cons Tree t' f) *) cut (f = nil). (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: forall _ : @eq (list Tree) f (@nil Tree), @Acc (list Tree) ltF (@cons Tree t' f) *) intro; subst f. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree t' (@nil Tree)) *) inversion Hf1. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree t' (@nil Tree)) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) ts0) (@nil Tree)) *) subst f w a0 t' t f'; clear H7. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree t' (@nil Tree)) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) ts0) (@nil Tree)) *) elim Hf3; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree t' (@nil Tree)) *) subst w a0 t' t f. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree t'0 (@nil Tree)) *) inversion H8; subst. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0)) (@nil Tree)) *) apply IHbs with (y := af::bs) (ts := node (wf :: vs, af :: a' :: l) ts0 :: ts0); trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: @Acc (list Tree) ltF (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0) *) (* Goal: @continues A leA (@cons A af bs) bs *) constructor. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: @Acc (list Tree) ltF (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0) *) (* Goal: not (@greater A leA af bs) *) simpl in H3. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: @Acc (list Tree) ltF (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0) *) (* Goal: not (@greater A leA af bs) *) rewrite H10 in H3; inversion H3; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: @Acc (list Tree) ltF (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0) *) apply acc_ltF_cons; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) (@nil Tree)) *) (* Goal: @Acc (list Tree) ltF ts0 *) constructor; simpl in acc_ts; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) (@nil Tree)) *) simpl in H1; inversion H1; subst. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0) (@nil Tree)) *) apply (IHws (wf::ws)) with (ts:= ts0) (bs := bs) (a:=af) (l:=a::l); trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l)))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) ts0) (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A ts0))) *) (* Goal: @Acc (list Tree) ltF ts0 *) (* Goal: @Acc (list A) (@continues A leA) bs *) (* Goal: @continues (list A) embeds (@cons (list A) wf ws) ws *) constructor; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l)))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) ts0) (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A ts0))) *) (* Goal: @Acc (list Tree) ltF ts0 *) (* Goal: @Acc (list A) (@continues A leA) bs *) (* Goal: not (@greater (list A) embeds wf ws) *) intro HF; assert (Hbil : bad_seq_in_lbl (node (wf :: ws, af :: a :: l) ts0)). (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l)))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) ts0) (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A ts0))) *) (* Goal: @Acc (list Tree) ltF ts0 *) (* Goal: @Acc (list A) (@continues A leA) bs *) (* Goal: False *) (* Goal: bad_seq_in_lbl (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0) *) apply (Hf2 (node (wf :: ws, af :: a :: l) ts0)); simpl. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l)))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) ts0) (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A ts0))) *) (* Goal: @Acc (list Tree) ltF ts0 *) (* Goal: @Acc (list A) (@continues A leA) bs *) (* Goal: False *) (* Goal: @tree_in_forest (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0) (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) ws (@cons A a l)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0) ts0)) (@nil Tree)) *) constructor 1 with (node (ws, a :: l) (node (wf :: ws, af :: a :: l) ts0 :: ts0)); try left; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l)))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) ts0) (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A ts0))) *) (* Goal: @Acc (list Tree) ltF ts0 *) (* Goal: @Acc (list A) (@continues A leA) bs *) (* Goal: False *) (* Goal: @subtree (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) ws (@cons A a l)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0) ts0)) *) constructor 2. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l)))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) ts0) (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A ts0))) *) (* Goal: @Acc (list Tree) ltF ts0 *) (* Goal: @Acc (list A) (@continues A leA) bs *) (* Goal: False *) (* Goal: @tree_in_forest (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0) ts0) *) constructor 1 with (node (wf :: ws, af :: a :: l) ts0); constructor; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l)))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) ts0) (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A ts0))) *) (* Goal: @Acc (list Tree) ltF ts0 *) (* Goal: @Acc (list A) (@continues A leA) bs *) (* Goal: False *) apply (Hbil (wf::ws) (af::a::l) ts0); trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l)))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) ts0) (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A ts0))) *) (* Goal: @Acc (list Tree) ltF ts0 *) (* Goal: @Acc (list A) (@continues A leA) bs *) (* Goal: @good (list A) embeds (@cons (list A) wf ws) *) constructor; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l)))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) ts0) (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A ts0))) *) (* Goal: @Acc (list Tree) ltF ts0 *) (* Goal: @Acc (list A) (@continues A leA) bs *) constructor; apply acc_bs. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l)))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) ts0) (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A ts0))) *) (* Goal: @Acc (list Tree) ltF ts0 *) constructor; apply acc_ts. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l)))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0)) ts0) (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A ts0))) *) simpl in *; repeat split; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l0))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf vs) (@cons A af (@cons A a' l))) ts0) ts0)))) *) inversion H1; subst; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) ws (@cons A a l)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0) ts0))) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) ws (@cons A a l)) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0) ts0))) (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0) ts0)) (@eq (option (list A)) (@Some (list A) (@cons A af bs)) (@roots_labels A (@cons (tree (prod (list (list A)) (list A))) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) (@cons (list A) wf ws) (@cons A af (@cons A a l))) ts0) ts0)))) *) repeat split; simpl; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) (* Goal: @eq (option (list A)) (@Some (list A) (@cons A af bs)) match @roots_labels A ts0 with | Some ts'' => @Some (list A) (@cons A af ts'') | None => @None (list A) end *) simpl in H3; rewrite <- H3; simpl; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @Acc (list Tree) ltF (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) apply IHts with (y := f'); trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f')) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f')) f') (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A f'))) *) (* Goal: ltF f' (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) ts0)) *) exists wf; exists af. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f')) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f')) f') (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A f'))) *) (* Goal: and (is_insert_forest (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) ts0)) wf af f') (and (forall (t : tree (prod (list (list A)) (list A))) (_ : @tree_in_forest (prod (list (list A)) (list A)) t f'), bad_seq_in_lbl t) (not (@eq (list Tree) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) ts0)) f'))) *) repeat split; simpl; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f')) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f')) f') (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A f'))) *) (* Goal: not (@eq (list Tree) ts0 f') *) (* Goal: forall (t : tree (prod (list (list A)) (list A))) (_ : @tree_in_forest (prod (list (list A)) (list A)) t f'), bad_seq_in_lbl t *) intros u Hu; apply (Hf2 u); inversion Hu; subst. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f')) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f')) f') (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A f'))) *) (* Goal: not (@eq (list Tree) ts0 f') *) (* Goal: @tree_in_forest (prod (list (list A)) (list A)) u (@cons Tree (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') (@nil Tree)) *) constructor 1 with (node (vs, a' :: l0) f'); try left; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f')) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f')) f') (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A f'))) *) (* Goal: not (@eq (list Tree) ts0 f') *) (* Goal: @subtree (prod (list (list A)) (list A)) u (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f') *) constructor 2. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f')) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f')) f') (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A f'))) *) (* Goal: not (@eq (list Tree) ts0 f') *) (* Goal: @tree_in_forest (prod (list (list A)) (list A)) u f' *) constructor 1 with t'; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f')) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f')) f') (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A f'))) *) (* Goal: not (@eq (list Tree) ts0 f') *) intro; subst; apply Hf3; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: and (@eq (prod (list (list A)) (list A)) (@root (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f')) (@pair (list (list A)) (list A) ws (@cons A a l))) (and (@eq (list (tree (prod (list (list A)) (list A)))) (@subtrees (prod (list (list A)) (list A)) (@node (prod (list (list A)) (list A)) (@pair (list (list A)) (list A) vs (@cons A a' l0)) f')) f') (@eq (option (list A)) (@Some (list A) bs) (@roots_labels A f'))) *) repeat split; simpl; trivial. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @eq (option (list A)) (@Some (list A) bs) (@roots_labels A f') *) simpl in H3; rewrite H3. (* Goal: @eq (list Tree) f (@nil Tree) *) (* Goal: @eq (option (list A)) (@roots_labels A ts0) (@roots_labels A f') *) generalize H11; apply is_insert_forest_same_roots. (* Goal: @eq (list Tree) f (@nil Tree) *) destruct f; trivial. (* Goal: @eq (list Tree) (@cons Tree t0 f) (@nil Tree) *) inversion Hf1; subst. (* Goal: @eq (list Tree) (@cons Tree t0 f) (@nil Tree) *) inversion H7. Qed. Lemma higman_aux : forall bs, Acc (continues leA) bs -> forall f, Acc ltF f -> forall ws, bs = bad_subsequence leA leA_dec (firsts ws) /\ is_forest ws f -> bad embeds ws -> Acc (continues embeds) ws. Theorem Higman : Acc (continues leA) nil -> Acc (continues embeds) nil. Proof. (* Goal: forall _ : @Acc (list A) (@continues A leA) (@nil A), @Acc (list (list A)) (@continues (list A) embeds) (@nil (list A)) *) intro wqo_leA; apply (higman_aux wqo_leA) with (f:=nil (A := Tree)). (* Goal: @bad (list A) embeds (@nil (list A)) *) (* Goal: and (@eq (list A) (@nil A) (@bad_subsequence A leA leA_dec (@firsts A (@nil (list A))))) (is_forest (@nil (list A)) (@nil Tree)) *) (* Goal: @Acc (list Tree) ltF (@nil Tree) *) apply acc_ltF_nil. (* Goal: @bad (list A) embeds (@nil (list A)) *) (* Goal: and (@eq (list A) (@nil A) (@bad_subsequence A leA leA_dec (@firsts A (@nil (list A))))) (is_forest (@nil (list A)) (@nil Tree)) *) split; simpl; trivial. (* Goal: @bad (list A) embeds (@nil (list A)) *) (* Goal: is_forest (@nil (list A)) (@nil Tree) *) unfold is_forest; constructor 1 with (leA := leA) (leA_dec := leA_dec). (* Goal: @bad (list A) embeds (@nil (list A)) *) intro HF; inversion HF; trivial. Qed. End higman.
Require Export GeoCoq.Elements.OriginalProofs.lemma_crisscross. Section Euclid. Context `{Ax1:euclidean_neutral_ruler_compass}. Lemma lemma_30helper : forall A B E F G H, Par A B E F -> BetS A G B -> BetS E H F -> ~ CR A F G H -> CR A E G H. Proof. (* Goal: forall (A B E F G H : @Point Ax) (_ : @Par Ax A B E F) (_ : @BetS Ax A G B) (_ : @BetS Ax E H F) (_ : not (@CR Ax A F G H)), @CR Ax A E G H *) intros. (* Goal: @CR Ax A E G H *) assert (Col A G B) by (conclude_def Col ). (* Goal: @CR Ax A E G H *) assert (Col E H F) by (conclude_def Col ). (* Goal: @CR Ax A E G H *) assert (Col B A G) by (forward_using lemma_collinearorder). (* Goal: @CR Ax A E G H *) assert (Col E F H) by (forward_using lemma_collinearorder). (* Goal: @CR Ax A E G H *) assert (neq H F) by (forward_using lemma_betweennotequal). (* Goal: @CR Ax A E G H *) assert (neq E H) by (forward_using lemma_betweennotequal). (* Goal: @CR Ax A E G H *) assert (neq H E) by (conclude lemma_inequalitysymmetric). (* Goal: @CR Ax A E G H *) assert (neq F H) by (conclude lemma_inequalitysymmetric). (* Goal: @CR Ax A E G H *) assert (neq A G) by (forward_using lemma_betweennotequal). (* Goal: @CR Ax A E G H *) assert (neq G A) by (conclude lemma_inequalitysymmetric). (* Goal: @CR Ax A E G H *) assert (Par A B F E) by (forward_using lemma_parallelflip). (* Goal: @CR Ax A E G H *) assert (Col F E H) by (forward_using lemma_collinearorder). (* Goal: @CR Ax A E G H *) assert (Par A B H E) by (conclude lemma_collinearparallel). (* Goal: @CR Ax A E G H *) assert (Par A B H F) by (conclude lemma_collinearparallel). (* Goal: @CR Ax A E G H *) assert (Par H F A B) by (conclude lemma_parallelsymmetric). (* Goal: @CR Ax A E G H *) assert (Par H F B A) by (forward_using lemma_parallelflip). (* Goal: @CR Ax A E G H *) assert (Par H F G A) by (conclude lemma_collinearparallel). (* Goal: @CR Ax A E G H *) assert (Par H F A G) by (forward_using lemma_parallelflip). (* Goal: @CR Ax A E G H *) assert (Par A G H F) by (conclude lemma_parallelsymmetric). (* Goal: @CR Ax A E G H *) assert (Par A G F H) by (forward_using lemma_parallelflip). (* Goal: @CR Ax A E G H *) assert (CR A H F G) by (conclude lemma_crisscross). (* Goal: @CR Ax A E G H *) let Tf:=fresh in assert (Tf:exists M, (BetS A M H /\ BetS F M G)) by (conclude_def CR );destruct Tf as [M];spliter. (* Goal: @CR Ax A E G H *) assert (neq A H) by (forward_using lemma_betweennotequal). (* Goal: @CR Ax A E G H *) assert (neq F G) by (forward_using lemma_betweennotequal). (* Goal: @CR Ax A E G H *) assert (BetS G M F) by (conclude axiom_betweennesssymmetry). (* Goal: @CR Ax A E G H *) assert (nCol A E F) by (forward_using lemma_parallelNC). (* Goal: @CR Ax A E G H *) assert (nCol F E A) by (forward_using lemma_NCorder). (* Goal: @CR Ax A E G H *) assert (BetS F H E) by (conclude axiom_betweennesssymmetry). (* Goal: @CR Ax A E G H *) let Tf:=fresh in assert (Tf:exists p, (BetS A p E /\ BetS F M p)) by (conclude postulate_Pasch_outer);destruct Tf as [p];spliter. (* Goal: @CR Ax A E G H *) assert (nCol A G H) by (forward_using lemma_parallelNC). (* Goal: @CR Ax A E G H *) assert (nCol A H G) by (forward_using lemma_NCorder). (* Goal: @CR Ax A E G H *) assert (Col F M G) by (conclude_def Col ). (* Goal: @CR Ax A E G H *) assert (Col F M p) by (conclude_def Col ). (* Goal: @CR Ax A E G H *) assert (neq F M) by (forward_using lemma_betweennotequal). (* Goal: @CR Ax A E G H *) assert (Col M G p) by (conclude lemma_collinear4). (* Goal: @CR Ax A E G H *) assert (Col M p G) by (forward_using lemma_collinearorder). (* Goal: @CR Ax A E G H *) assert (Col M p F) by (forward_using lemma_collinearorder). (* Goal: @CR Ax A E G H *) assert (neq M p) by (forward_using lemma_betweennotequal). (* Goal: @CR Ax A E G H *) assert (Col p G F) by (conclude lemma_collinear4). (* Goal: @CR Ax A E G H *) assert (Col G F p) by (forward_using lemma_collinearorder). (* Goal: @CR Ax A E G H *) assert (Col H F E) by (forward_using lemma_collinearorder). (* Goal: @CR Ax A E G H *) assert (neq A B) by (forward_using lemma_betweennotequal). (* Goal: @CR Ax A E G H *) assert (neq A G) by (forward_using lemma_betweennotequal). (* Goal: @CR Ax A E G H *) assert (neq E F) by (forward_using lemma_betweennotequal). (* Goal: @CR Ax A E G H *) assert (neq F E) by (conclude lemma_inequalitysymmetric). (* Goal: @CR Ax A E G H *) assert (~ Meet A B H E) by (conclude_def Par ). (* Goal: @CR Ax A E G H *) assert (BetS G p F) by (conclude lemma_collinearbetween). (* Goal: @CR Ax A E G H *) assert (BetS F p G) by (conclude axiom_betweennesssymmetry). (* Goal: @CR Ax A E G H *) assert (BetS M p G) by (conclude lemma_3_6a). (* Goal: @CR Ax A E G H *) assert (BetS G p M) by (conclude axiom_betweennesssymmetry). (* Goal: @CR Ax A E G H *) assert (nCol A G H) by (forward_using lemma_parallelNC). (* Goal: @CR Ax A E G H *) assert (nCol A H G) by (forward_using lemma_NCorder). (* Goal: @CR Ax A E G H *) let Tf:=fresh in assert (Tf:exists m, (BetS G m H /\ BetS A p m)) by (conclude postulate_Pasch_outer);destruct Tf as [m];spliter. (* Goal: @CR Ax A E G H *) assert (Col A p m) by (conclude_def Col ). (* Goal: @CR Ax A E G H *) assert (Col A p E) by (conclude_def Col ). (* Goal: @CR Ax A E G H *) assert (neq A p) by (forward_using lemma_betweennotequal). (* Goal: @CR Ax A E G H *) assert (Col p m E) by (conclude lemma_collinear4). (* Goal: @CR Ax A E G H *) assert (Col p m A) by (forward_using lemma_collinearorder). (* Goal: @CR Ax A E G H *) assert (neq p m) by (forward_using lemma_betweennotequal). (* Goal: @CR Ax A E G H *) assert (Col m E A) by (conclude lemma_collinear4). (* Goal: @CR Ax A E G H *) assert (Col A E m) by (forward_using lemma_collinearorder). (* Goal: @CR Ax A E G H *) assert (neq A E) by (forward_using lemma_NCdistinct). (* Goal: @CR Ax A E G H *) assert (neq G H) by (forward_using lemma_NCdistinct). (* Goal: @CR Ax A E G H *) assert (neq G B) by (forward_using lemma_betweennotequal). (* Goal: @CR Ax A E G H *) assert (neq B G) by (conclude lemma_inequalitysymmetric). (* Goal: @CR Ax A E G H *) assert (Par H F B G) by (conclude lemma_collinearparallel). (* Goal: @CR Ax A E G H *) assert (Par B G H F) by (conclude lemma_parallelsymmetric). (* Goal: @CR Ax A E G H *) assert (Par G B F H) by (forward_using lemma_parallelflip). (* Goal: @CR Ax A E G H *) assert (~ Meet G B F H) by (conclude_def Par ). (* Goal: @CR Ax A E G H *) assert (Col G A B) by (forward_using lemma_collinearorder). (* Goal: @CR Ax A E G H *) assert (BetS A m E) by (conclude lemma_collinearbetween). (* Goal: @CR Ax A E G H *) assert (CR A E G H) by (conclude_def CR ). (* Goal: @CR Ax A E G H *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.lemma_diagonalsmeet. Require Export GeoCoq.Elements.OriginalProofs.proposition_29B. Require Export GeoCoq.Elements.OriginalProofs.proposition_26A. Section Euclid. Context `{Ax:euclidean_euclidean}. Lemma proposition_34 : forall A B C D, PG A C D B -> Cong A B C D /\ Cong A C B D /\ CongA C A B B D C /\ CongA A B D D C A /\ Cong_3 C A B B D C. Proof. (* Goal: forall (A B C D : @Point Ax0) (_ : @PG Ax0 A C D B), and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) intros. (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert ((Par A C D B /\ Par A B C D)) by (conclude_def PG ). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Par A C B D) by (forward_using lemma_parallelflip). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) let Tf:=fresh in assert (Tf:exists M, (BetS A M D /\ BetS C M B)) by (conclude lemma_diagonalsmeet);destruct Tf as [M];spliter. (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (BetS B M C) by (conclude axiom_betweennesssymmetry). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Col B M C) by (conclude_def Col ). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Col B C M) by (forward_using lemma_collinearorder). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (~ Meet A B C D) by (conclude_def Par ). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (neq A B) by (conclude_def Par ). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (neq C D) by (conclude_def Par ). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (~ Col B C A). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) (* 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 (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) } (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (TS A B C D) by (conclude_def TS ). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (CongA A B C B C D) by (conclude proposition_29B). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (~ Col B C D). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) (* 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 *) assert (~ Meet A B C D) by (conclude_def Par ). (* Goal: False *) contradict. (* BG Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) } (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (CongA B C D D C B) by (conclude lemma_ABCequalsCBA). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (CongA A B C D C B) by (conclude lemma_equalanglestransitive). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Col C B M) by (forward_using lemma_collinearorder). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (nCol C B A). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) (* Goal: @nCol Ax0 C B A *) { (* Goal: @nCol Ax0 C B A *) assert (nCol B C A) by auto. (* Goal: @nCol Ax0 C B A *) forward_using lemma_NCorder. (* BG Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) } (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (TS A C B D) by (conclude_def TS ). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (CongA A C B C B D) by (conclude proposition_29B). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (nCol A B C) by (forward_using lemma_NCorder). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (CongA B C A A C B) by (conclude lemma_ABCequalsCBA). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (CongA B C A C B D) by (conclude lemma_equalanglestransitive). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Triangle A B C) by (conclude_def Triangle ). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (nCol D C B) by (conclude lemma_equalanglesNC). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Triangle D C B) by (conclude_def Triangle ). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Cong B C C B) by (conclude cn_equalityreverse). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert ((Cong A B D C /\ Cong A C D B /\ CongA B A C C D B)) by (conclude proposition_26A). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Cong A B C D) by (forward_using lemma_congruenceflip). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Cong A C B D) by (forward_using lemma_congruenceflip). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Cong C A B D) by (forward_using lemma_congruenceflip). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Cong C B B C) by (conclude cn_equalityreverse). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Cong_3 C A B B D C) by (conclude_def Cong_3 ). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (CongA C A B B D C) by (conclude lemma_equalanglesflip). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Cong A D D A) by (conclude cn_equalityreverse). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (eq A A) by (conclude cn_equalityreflexive). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (eq D D) by (conclude cn_equalityreflexive). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (neq A C) by (forward_using lemma_angledistinct). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (neq C A) by (conclude lemma_inequalitysymmetric). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (neq C D) by (forward_using lemma_angledistinct). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (neq B A) by (forward_using lemma_angledistinct). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (neq D B) by (forward_using lemma_angledistinct). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (neq B D) by (conclude lemma_inequalitysymmetric). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Out C A A) by (conclude lemma_ray4). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Out C D D) by (conclude lemma_ray4). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Out B A A) by (conclude lemma_ray4). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Out B D D) by (conclude lemma_ray4). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Cong B A C D) by (forward_using lemma_congruenceflip). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Cong C A B D) by (forward_using lemma_congruenceflip). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (Cong B D C A) by (conclude lemma_congruencesymmetric). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (~ Col A B D). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) (* Goal: not (@Col Ax0 A B D) *) { (* Goal: not (@Col Ax0 A B D) *) intro. (* Goal: False *) assert (eq D D) by (conclude cn_equalityreflexive). (* Goal: False *) assert (Col C D D) by (conclude_def Col ). (* Goal: False *) assert (Meet A B C D) by (conclude_def Meet ). (* Goal: False *) contradict. (* BG Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) } (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) assert (CongA A B D D C A) by (conclude_def CongA ). (* Goal: and (@Cong Ax0 A B C D) (and (@Cong Ax0 A C B D) (and (@CongA Ax0 C A B B D C) (and (@CongA Ax0 A B D D C A) (@Cong_3 Ax0 C A B B D C)))) *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.lemma_equalanglestransitive. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_RTcongruence : forall A B C D E F P Q R, RT A B C D E F -> CongA A B C P Q R -> RT P Q R D E F. Proof. (* Goal: forall (A B C D E F P Q R : @Point Ax0) (_ : @RT Ax0 A B C D E F) (_ : @CongA Ax0 A B C P Q R), @RT Ax0 P Q R D E F *) intros. (* Goal: @RT Ax0 P Q R D E F *) let Tf:=fresh in assert (Tf:exists a b c d e, (Supp a b c d e /\ CongA A B C a b c /\ CongA D E F d b e)) by (conclude_def RT );destruct Tf as [a[b[c[d[e]]]]];spliter. (* Goal: @RT Ax0 P Q R D E F *) assert (CongA P Q R A B C) by (conclude lemma_equalanglessymmetric). (* Goal: @RT Ax0 P Q R D E F *) assert (CongA P Q R a b c) by (conclude lemma_equalanglestransitive). (* Goal: @RT Ax0 P Q R D E F *) assert (RT P Q R D E F) by (conclude_def RT ). (* Goal: @RT Ax0 P Q R D E F *) close. Qed. End Euclid.
Require Import List. Import ListNotations. Require Import StructTact.StructTactics. Set Implicit Arguments. Fixpoint before {A: Type} (x : A) y l : Prop := match l with | [] => False | a :: l' => a = x \/ (a <> y /\ before x y l') end. Section before. Variable A : Type. Lemma before_In : forall x y l, before (A:=A) x y l -> In x l. Proof. (* Goal: forall (x y : A) (l : list A) (_ : @before A x y l), @In A x l *) induction l; intros; simpl in *; intuition. Qed. Lemma before_split : forall l (x y : A), before x y l -> x <> y -> In x l -> In y l -> exists xs ys zs, l = xs ++ x :: ys ++ y :: zs. Proof. (* Goal: forall (l : list A) (x y : A) (_ : @before A x y l) (_ : not (@eq A x y)) (_ : @In A x l) (_ : @In A y l), @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) l (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) induction l; intros; simpl in *; intuition; subst; try congruence. (* Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A a l) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) (* Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) (* Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) (* Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) - (* Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) exists nil. (* Goal: @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@app A (@nil A) (@cons A x (@app A ys (@cons A y zs)))))) *) simpl. (* Goal: @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@cons A x (@app A ys (@cons A y zs))))) *) find_apply_lem_hyp in_split. (* Goal: @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@cons A x (@app A ys (@cons A y zs))))) *) break_exists. (* Goal: @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@cons A x (@app A ys (@cons A y zs))))) *) subst. (* Goal: @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x (@app A x0 (@cons A y x1))) (@cons A x (@app A ys (@cons A y zs))))) *) eauto. (* BG Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A a l) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) (* BG Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) (* BG Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) - (* Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) exists nil. (* Goal: @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@app A (@nil A) (@cons A x (@app A ys (@cons A y zs)))))) *) simpl. (* Goal: @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@cons A x (@app A ys (@cons A y zs))))) *) find_apply_lem_hyp in_split. (* Goal: @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@cons A x (@app A ys (@cons A y zs))))) *) break_exists. (* Goal: @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@cons A x (@app A ys (@cons A y zs))))) *) subst. (* Goal: @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x (@app A x0 (@cons A y x1))) (@cons A x (@app A ys (@cons A y zs))))) *) eauto. (* BG Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A a l) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) (* BG Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) - (* Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) exists nil. (* Goal: @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@app A (@nil A) (@cons A x (@app A ys (@cons A y zs)))))) *) simpl. (* Goal: @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@cons A x (@app A ys (@cons A y zs))))) *) find_apply_lem_hyp in_split. (* Goal: @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@cons A x (@app A ys (@cons A y zs))))) *) break_exists. (* Goal: @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x l) (@cons A x (@app A ys (@cons A y zs))))) *) subst. (* Goal: @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A x (@app A x0 (@cons A y x1))) (@cons A x (@app A ys (@cons A y zs))))) *) eauto. (* BG Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A a l) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) - (* Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A a l) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) eapply_prop_hyp In In; eauto. (* Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A a l) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) break_exists. (* Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A a l) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) subst. (* Goal: @ex (list A) (fun xs : list A => @ex (list A) (fun ys : list A => @ex (list A) (fun zs : list A => @eq (list A) (@cons A a (@app A x0 (@cons A x (@app A x1 (@cons A y x2))))) (@app A xs (@cons A x (@app A ys (@cons A y zs))))))) *) exists (a :: x0), x1, x2. (* Goal: @eq (list A) (@cons A a (@app A x0 (@cons A x (@app A x1 (@cons A y x2))))) (@app A (@cons A a x0) (@cons A x (@app A x1 (@cons A y x2)))) *) auto. Qed. Lemma In_app_before : forall xs ys x y, In(A:=A) x xs -> (~ In y xs) -> before x y (xs ++ y :: ys). Proof. (* Goal: forall (xs ys : list A) (x y : A) (_ : @In A x xs) (_ : not (@In A y xs)), @before A x y (@app A xs (@cons A y ys)) *) induction xs; intros; simpl in *; intuition. Qed. Lemma before_2_3_insert : forall xs ys zs x y a b, before(A:=A) a b (xs ++ ys ++ zs) -> b <> x -> b <> y -> before a b (xs ++ x :: ys ++ y :: zs). Proof. (* Goal: forall (xs ys zs : list A) (x y a b : A) (_ : @before A a b (@app A xs (@app A ys zs))) (_ : not (@eq A b x)) (_ : not (@eq A b y)), @before A a b (@app A xs (@cons A x (@app A ys (@cons A y zs)))) *) induction xs; intros; simpl in *; intuition. (* Goal: or (@eq A x a) (and (forall _ : @eq A x b, False) (@before A a b (@app A ys (@cons A y zs)))) *) induction ys; intros; simpl in *; intuition. Qed. Lemma before_middle_insert : forall xs y zs a b, before(A:=A) a b (xs ++ zs) -> b <> y -> before a b (xs ++ y :: zs). Proof. (* Goal: forall (xs : list A) (y : A) (zs : list A) (a b : A) (_ : @before A a b (@app A xs zs)) (_ : not (@eq A b y)), @before A a b (@app A xs (@cons A y zs)) *) intros. (* Goal: @before A a b (@app A xs (@cons A y zs)) *) induction xs; intros; simpl in *; intuition. Qed. Lemma before_2_3_reduce : forall xs ys zs x y a b, before(A:=A) a b (xs ++ x :: ys ++ y :: zs) -> a <> x -> a <> y -> before a b (xs ++ ys ++ zs). Proof. (* Goal: forall (xs ys zs : list A) (x y a b : A) (_ : @before A a b (@app A xs (@cons A x (@app A ys (@cons A y zs))))) (_ : not (@eq A a x)) (_ : not (@eq A a y)), @before A a b (@app A xs (@app A ys zs)) *) induction xs; intros; simpl in *; intuition; try congruence; eauto. (* Goal: @before A a b (@app A ys zs) *) induction ys; intros; simpl in *; intuition; try congruence. Qed. Lemma before_middle_reduce : forall xs zs a b y, before(A:=A) a b (xs ++ y :: zs) -> a <> y -> before a b (xs ++ zs). Proof. (* Goal: forall (xs zs : list A) (a b y : A) (_ : @before A a b (@app A xs (@cons A y zs))) (_ : not (@eq A a y)), @before A a b (@app A xs zs) *) induction xs; intros; simpl in *; intuition; try congruence; eauto. Qed. Lemma before_remove : forall x y l y' dec, before (A := A) x y (remove dec y' l) -> y <> y' -> before x y l. Proof. (* Goal: forall (x y : A) (l : list A) (y' : A) (dec : forall x0 y0 : A, sumbool (@eq A x0 y0) (not (@eq A x0 y0))) (_ : @before A x y (@remove A dec y' l)) (_ : not (@eq A y y')), @before A x y l *) induction l; intros; simpl in *; intuition. (* Goal: or (@eq A a x) (and (forall _ : @eq A a y, False) (@before A x y l)) *) break_if; subst; simpl in *; intuition eauto. Qed. Lemma before_remove_if : forall (x : A) y l x' dec, before x y l -> x <> x' -> before x y (remove dec x' l). Proof. (* Goal: forall (x y : A) (l : list A) (x' : A) (dec : forall x0 y0 : A, sumbool (@eq A x0 y0) (not (@eq A x0 y0))) (_ : @before A x y l) (_ : not (@eq A x x')), @before A x y (@remove A dec x' l) *) induction l; intros; simpl in *; intuition; break_if; subst; simpl in *; intuition eauto. Qed. Lemma before_app : forall x y l' l, before (A := A) x y (l' ++ l) -> ~ In x l' -> before (A := A) x y l. Proof. (* Goal: forall (x y : A) (l' l : list A) (_ : @before A x y (@app A l' l)) (_ : not (@In A x l')), @before A x y l *) induction l'; intros; simpl in *; intuition. Qed. Lemma before_app_if : forall x y l' l, before (A := A) x y l -> ~ In y l' -> before (A := A) x y (l' ++ l). Proof. (* Goal: forall (x y : A) (l' l : list A) (_ : @before A x y l) (_ : not (@In A y l')), @before A x y (@app A l' l) *) induction l'; intros; simpl in *; intuition. Qed. Lemma before_antisymmetric : forall x y l, before (A := A) x y l -> before y x l -> x = y. Proof. (* Goal: forall (x y : A) (l : list A) (_ : @before A x y l) (_ : @before A y x l), @eq A x y *) intros. (* Goal: @eq A x y *) induction l; simpl in *; intuition; congruence. Qed. End before.
Require Import abp_base. Require Import abp_defs. Require Import abp_lem1. Require Import abp_lem2. Require Import abp_lem25. Require Import abp_lem3. Require Import abp_lem1. Parameter X' Y' : proc. Parameter X1' X2' Y1' Y2' : D -> proc. Axiom Lin2' : forall d : D, alt (seq (ia one int i) (seq (ia D s4 d) (hide I' (X2 d)))) (seq (ia one int i) (seq (ia one int i) (X1' d))) = X1' d. Axiom Lin3' : forall d : D, alt (seq (ia one int i) (seq (ia one int i) (X2' d))) (seq (ia one int i) (hide I' Y)) = X2' d. Axiom Lin5' : forall d : D, alt (seq (ia one int i) (seq (ia D s4 d) (hide I' (Y2 d)))) (seq (ia one int i) (seq (ia one int i) (Y1' d))) = Y1' d. Axiom Lin6' : forall d : D, alt (seq (ia one int i) (seq (ia one int i) (Y2' d))) (seq (ia one int i) (hide I' X)) = Y2' d. Goal forall d : D, seq (ia one tau i) (X1' d) = hide I' (X1 d). intros. apply (RSP D (fun d : D => seq (ia one tau i) (X1' d)) (fun d : D => hide I' (X1 d)) (fun (X : D -> proc) (d : D) => seq (ia one tau i) (alt (seq (ia one int i) (seq (ia D s4 d) (hide I' (X2 d)))) (seq (ia one int i) (seq (ia one int i) (X d)))))). auto. intros. pattern (X1' d0) at 1 in |- *. elim Lin2'. elim T1'. apply refl_equal. intros. pattern (X1 d0) at 1 in |- *. elim Lem12. elim TI5. elim TI4. elim TI2. elim TI5. elim TI1. elim TI5. elim TI2. elim TI5. elim TI1. elim TI5. elim TI1. elim TI5. elim TI2. elim TI5. elim TI2. elim TI5. elim TI4. elim TI5. elim TI1. elim TI2. elim TI5. elim TI1. elim TI2. elim A3. repeat elim T1'. elim T1. apply refl_equal. exact Inc6I. exact InintI. exact Inc6I. exact InintI. exact Inc5I. exact Inc3I. exact InintI. exact Ins4I. exact Inc3I. exact InintI. exact Inc2I. Save LemLin2. Goal forall d : D, seq (ia one tau i) (X2' d) = hide I' (X2 d). intros. apply (RSP D (fun d : D => seq (ia one tau i) (X2' d)) (fun d : D => hide I' (X2 d)) (fun (X : D -> proc) (d : D) => seq (ia one tau i) (alt (seq (ia one int i) (seq (ia one int i) (X d))) (seq (ia one int i) (hide I' Y))))). auto. intro. pattern (X2' d0) at 1 in |- *. elim Lin3'. elim T1'. apply refl_equal. intro. pattern (X2 d0) at 1 in |- *. elim Lem31. elim TI5. elim TI2. elim TI4. elim TI5. elim TI1. elim TI5. elim TI2. elim TI5. elim TI2. elim TI5. elim TI4. elim TI5. elim TI1. elim TI2. elim TI5. elim TI1. elim TI2. elim TI5. elim TI1. elim TI5. elim TI2. repeat elim T1'. repeat elim T1. elim A3. apply refl_equal. exact Inc6I. exact InintI. exact Inc3I. exact InintI. exact Inc3I. exact InintI. exact Inc2I. exact Inc6I. exact InintI. exact Inc5I. Save LemLin3. Goal forall d : D, seq (ia one tau i) (Y1' d) = hide I' (Y1 d). intros. apply (RSP D (fun d : D => seq (ia one tau i) (Y1' d)) (fun d : D => hide I' (Y1 d)) (fun (Y : D -> proc) (d : D) => seq (ia one tau i) (alt (seq (ia one int i) (seq (ia D s4 d) (hide I' (Y2 d)))) (seq (ia one int i) (seq (ia one int i) (Y d)))))). auto. intros. pattern (Y1' d0) at 1 in |- *. elim Lin5'. elim T1'. apply refl_equal. intros. pattern (Y1 d0) at 1 in |- *. elim Lem22. elim TI5. elim TI4. elim TI2. elim TI5. elim TI1. elim TI5. elim TI2. elim TI5. elim TI1. elim TI5. elim TI1. elim TI5. elim TI2. elim TI5. elim TI2. elim TI5. elim TI4. elim TI5. elim TI1. elim TI2. elim TI5. elim TI1. elim TI2. elim A3. repeat elim T1'. elim T1. apply refl_equal. exact Inc6I. exact InintI. exact Inc6I. exact InintI. exact Inc5I. exact Inc3I. exact InintI. exact Ins4I. exact Inc3I. exact InintI. exact Inc2I. Save LemLin5. Goal forall d : D, seq (ia one tau i) (Y2' d) = hide I' (Y2 d). intros. apply (RSP D (fun d : D => seq (ia one tau i) (Y2' d)) (fun d : D => hide I' (Y2 d)) (fun (Y : D -> proc) (d : D) => seq (ia one tau i) (alt (seq (ia one int i) (seq (ia one int i) (Y d))) (seq (ia one int i) (hide I' X))))). auto. intro. pattern (Y2' d0) at 1 in |- *. elim Lin6'. elim T1'. apply refl_equal. intro. pattern (Y2 d0) at 1 in |- *. elim Lem41. elim TI5. elim TI2. elim TI4. elim TI5. elim TI1. elim TI5. elim TI2. elim TI5. elim TI2. elim TI5. elim TI4. elim TI5. elim TI1. elim TI2. elim TI5. elim TI1. elim TI2. elim TI5. elim TI1. elim TI5. elim TI2. repeat elim T1'. repeat elim T1. elim A3. apply refl_equal. exact Inc6I. exact InintI. exact Inc3I. exact InintI. exact Inc3I. exact InintI. exact Inc2I. exact Inc6I. exact InintI. exact Inc5I. Save LemLin6. Goal forall d : D, seq (ia one tau i) (seq (ia D s4 d) (hide I'' (hide I' (X2 d)))) = seq (ia one tau i) (hide I'' (X1' d)). intro. apply sym_equal. elimtype (seq (ia one tau i) (hide I'' (seq (ia one int i) (seq (ia D s4 d) (hide I' (X2 d))))) = seq (ia one tau i) (seq (ia D s4 d) (hide I'' (hide I' (X2 d))))). apply (KFAR2 one i int). exact InintI''. pattern (X1' d) at 1 in |- *. elim Lin2'. elim A1. apply refl_equal. elim TI5. elim TI2. elim TI5. elim TI1. elim T1'. apply refl_equal. exact Ins4I''. exact InintI''. Save KFlin2. Goal forall d : D, seq (ia one tau i) (hide I'' (hide I' Y)) = seq (ia one tau i) (hide I'' (X2' d)). intros. apply sym_equal. elimtype (seq (ia one tau i) (hide I'' (seq (ia one int i) (hide I' Y))) = seq (ia one tau i) (hide I'' (hide I' Y))). apply (KFAR2 one i int). exact InintI''. pattern (X2' d) at 1 in |- *. elim Lin3'. apply refl_equal. elim TI5. elim TI2. elim T1'. apply refl_equal. exact InintI''. Save KFlin3. Goal forall d : D, seq (ia one tau i) (seq (ia D s4 d) (hide I'' (hide I' (Y2 d)))) = seq (ia one tau i) (hide I'' (Y1' d)). intro. apply sym_equal. elimtype (seq (ia one tau i) (hide I'' (seq (ia one int i) (seq (ia D s4 d) (hide I' (Y2 d))))) = seq (ia one tau i) (seq (ia D s4 d) (hide I'' (hide I' (Y2 d))))). apply (KFAR2 one i int). exact InintI''. pattern (Y1' d) at 1 in |- *. elim Lin5'. elim A1. apply refl_equal. elim TI5. elim TI2. elim TI5. elim TI1. elim T1'. apply refl_equal. exact Ins4I''. exact InintI''. Save KFlin5. Goal forall d : D, seq (ia one tau i) (hide I'' (hide I' X)) = seq (ia one tau i) (hide I'' (Y2' d)). intros. apply sym_equal. elimtype (seq (ia one tau i) (hide I'' (seq (ia one int i) (hide I' X))) = seq (ia one tau i) (hide I'' (hide I' X))). apply (KFAR2 one i int). exact InintI''. pattern (Y2' d) at 1 in |- *. elim Lin6'. apply refl_equal. elim TI5. elim TI2. elim T1'. apply refl_equal. exact InintI''. Save KFlin6. Parameter B : proc. Axiom Specificat : D + (fun d : D => seq (ia D r1 d) (seq (ia D s4 d) B)) = B. Goal B = hide I'' (hide I' ABP). apply (RSP one (fun d : one => B) (fun d : one => hide I'' (hide I' X)) (fun (Z : one -> proc) (d' : one) => D + (fun d : D => seq (ia D r1 d) (seq (ia D s4 d) (D + (fun d : D => seq (ia D r1 d) (seq (ia D s4 d) (Z d')))))))). auto. 3: exact i. intro. pattern B at 1 in |- *. elim Specificat. pattern B at 1 in |- *. elim Specificat. apply refl_equal. intro. pattern X at 1 in |- *. elim Lem1. elim (SUM8 D (fun d : D => seq (ia D r1 d) (X1 d)) I'). elim (SUM8 D (fun d : D => hide I' (seq (ia D r1 d) (X1 d))) I''). elimtype ((fun d : D => seq (ia D r1 d) (seq (ia D s4 d) (D + (fun d0 : D => seq (ia D r1 d0) (seq (ia D s4 d0) (hide I'' (hide I' X))))))) = (fun d : D => hide I'' (hide I' (seq (ia D r1 d) (X1 d))))). apply refl_equal. apply EXTE. intro. elim TI5. elim TI1. elim LemLin2. elim T1'. elim TI5. elim TI1. elimtype (seq (ia D r1 d0) (seq (ia one tau i) (hide I'' (X1' d0))) = seq (ia D r1 d0) (hide I'' (X1' d0))). 2: apply sym_equal. 2: apply T1'. elim KFlin2. elim T1'. elim LemLin3. elim TI5. elim TI1. elim KFlin3. elim T1'. elim Lem2. elim (SUM8 D (fun d : D => seq (ia D r1 d) (Y1 d)) I'). elim (SUM8 D (fun d : D => hide I' (seq (ia D r1 d) (Y1 d))) I''). elimtype ((fun d0 : D => seq (ia D r1 d0) (seq (ia D s4 d0) (hide I'' (hide I' X)))) = (fun d : D => hide I'' (hide I' (seq (ia D r1 d) (Y1 d))))). apply refl_equal. apply EXTE. intro. elim TI5. elim TI1. elim LemLin5. elim T1'. elim TI5. elim TI1. elimtype (seq (ia D r1 d1) (seq (ia one tau i) (hide I'' (Y1' d1))) = seq (ia D r1 d1) (hide I'' (Y1' d1))). 2: apply sym_equal. 2: apply T1'. elim KFlin5. elim T1'. elim LemLin6. elim TI5. elim TI1. elim KFlin6. elim T1'. apply refl_equal. exact IntauI''. exact Inr1I''. exact Inr1I. exact IntauI''. exact Inr1I''. exact Inr1I. Save Hurrah.
Require Export GeoCoq.Elements.OriginalProofs.lemma_TGsymmetric. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_TTorder : forall A B C D E F G H, TT A B C D E F G H -> TT C D A B E F G H. Proof. (* Goal: forall (A B C D E F G H : @Point Ax0) (_ : @TT Ax0 A B C D E F G H), @TT Ax0 C D A B E F G H *) intros. (* Goal: @TT Ax0 C D A B E F G H *) let Tf:=fresh in assert (Tf:exists J, (BetS E F J /\ Cong F J G H /\ TG A B C D E J)) by (conclude_def TT );destruct Tf as [J];spliter. (* Goal: @TT Ax0 C D A B E F G H *) assert (TG C D A B E J) by (conclude lemma_TGsymmetric). (* Goal: @TT Ax0 C D A B E F G H *) assert (TT C D A B E F G H) by (conclude_def TT ). (* Goal: @TT Ax0 C D A B E F G H *) close. Qed. End Euclid.
Require Export Lib_Eq_Le_Lt. Require Export Lib_Prop. Lemma pred_diff_O : forall n : nat, n <> 0 -> n <> 1 -> pred n <> 0. Proof. (* Goal: forall (n : nat) (_ : not (@eq nat n O)) (_ : not (@eq nat n (S O))), not (@eq nat (Init.Nat.pred n) O) *) simple induction n; auto with arith. Qed. Hint Resolve pred_diff_O. Lemma S_pred_n : forall n : nat, 1 <= n -> S (pred n) = n. Proof. (* Goal: forall (n : nat) (_ : le (S O) n), @eq nat (S (Init.Nat.pred n)) n *) simple induction n; auto with arith. Qed. Hint Resolve S_pred_n. Lemma eq_pred : forall n m : nat, n = m -> pred n = pred m. Proof. (* Goal: forall (n m : nat) (_ : @eq nat n m), @eq nat (Init.Nat.pred n) (Init.Nat.pred m) *) intros n m H. (* Goal: @eq nat (Init.Nat.pred n) (Init.Nat.pred m) *) rewrite H; auto with arith. Qed. Hint Resolve eq_pred. Lemma pred_diff_lt : forall n : nat, n <> 0 -> n <> 1 -> 0 < pred n. Proof. (* Goal: forall (n : nat) (_ : not (@eq nat n O)) (_ : not (@eq nat n (S O))), lt O (Init.Nat.pred n) *) intros; apply neq_O_lt. (* Goal: not (@eq nat O (Init.Nat.pred n)) *) apply sym_not_equal; auto with arith. Qed. Hint Resolve pred_diff_lt. Lemma pred_n_O : forall n : nat, pred n = 0 -> n = 0 \/ n = 1. Proof. (* Goal: forall (n : nat) (_ : @eq nat (Init.Nat.pred n) O), or (@eq nat n O) (@eq nat n (S O)) *) simple induction n; auto with arith. Qed. Hint Resolve pred_n_O. Lemma pred_O : forall n : nat, n = 0 -> pred n = 0. Proof. (* Goal: forall (n : nat) (_ : @eq nat n O), @eq nat (Init.Nat.pred n) O *) intros. (* Goal: @eq nat (Init.Nat.pred n) O *) rewrite H; auto with arith. Qed. Hint Resolve pred_O. Lemma pred_no_O : forall n : nat, pred n <> 0 -> n <> 0. Proof. (* Goal: forall (n : nat) (_ : not (@eq nat (Init.Nat.pred n) O)), not (@eq nat n O) *) simple induction n; auto with arith. Qed. Hint Resolve pred_no_O. Lemma lt_pred : forall n : nat, 0 < n -> pred n < n. Proof. (* Goal: forall (n : nat) (_ : lt O n), lt (Init.Nat.pred n) n *) simple induction n; auto with arith. Qed. Hint Resolve lt_pred. Lemma dif_0_pred_eq_0_eq_1 : forall n : nat, n <> 0 -> pred n = 0 -> n = 1. Proof. (* Goal: forall (n : nat) (_ : not (@eq nat n O)) (_ : @eq nat (Init.Nat.pred n) O), @eq nat n (S O) *) intros n H0 H1. (* Goal: @eq nat n (S O) *) cut (n = 0 \/ n = 1). (* Goal: or (@eq nat n O) (@eq nat n (S O)) *) (* Goal: forall _ : or (@eq nat n O) (@eq nat n (S O)), @eq nat n (S O) *) intros H_Cut. (* Goal: or (@eq nat n O) (@eq nat n (S O)) *) (* Goal: @eq nat n (S O) *) apply no_or_r with (n = 0); try trivial with arith. (* Goal: or (@eq nat n O) (@eq nat n (S O)) *) apply pred_n_O; try trivial with arith. Qed. Lemma lt_le_pred : forall n m : nat, n < m -> n <= pred m. Proof. (* Goal: forall (n m : nat) (_ : lt n m), le n (Init.Nat.pred m) *) simple induction n; simple induction m; auto with arith. Qed. Hint Resolve lt_le_pred.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrbool ssrfun eqtype ssrnat seq div choice fintype. From mathcomp Require Import bigop finset prime binomial fingroup morphism perm automorphism. From mathcomp Require Import presentation quotient action commutator gproduct gfunctor. From mathcomp Require Import ssralg finalg zmodp cyclic pgroup center gseries. From mathcomp Require Import nilpotent sylow abelian finmodule matrix maximal. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Local Open Scope ring_scope. Import GroupScope GRing.Theory. Reserved Notation "''Mod_' m" (at level 8, m at level 2, format "''Mod_' m"). Reserved Notation "''D_' m" (at level 8, m at level 2, format "''D_' m"). Reserved Notation "''SD_' m" (at level 8, m at level 2, format "''SD_' m"). Reserved Notation "''Q_' m" (at level 8, m at level 2, format "''Q_' m"). Module Extremal. Section Construction. Variables q p e : nat. Let a : 'Z_p := Zp1. Let b : 'Z_q := Zp1. Local Notation B := <[b]>. Definition aut_of := odflt 1 [pick s in Aut B | p > 1 & (#[s] %| p) && (s b == b ^+ e)]. Lemma aut_dvdn : #[aut_of] %| #[a]. Proof. (* Goal: is_true (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) aut_of) (@order (Zp_finGroupType (S (Zp_trunc p))) a)) *) rewrite order_Zp1 /aut_of; case: pickP => [s | _]; last by rewrite order1. (* Goal: forall _ : is_true (andb (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) s (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@cycle (Zp_finGroupType (S (Zp_trunc q))) b))))) (andb (leq (S (S O)) p) (andb (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s) p) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) s b) (@expgn (Zp_baseFinGroupType (S (Zp_trunc q))) b e))))), is_true (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Option.default (FinGroup.sort (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (oneg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@Some (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) s))) (S (S (Zp_trunc p)))) *) by case/and4P=> _ p_gt1 p_s _; rewrite Zp_cast. Qed. Definition act_morphism := eltm_morphism aut_dvdn. Definition base_act := ([Aut B] \o act_morphism)%gact. Lemma act_dom : <[a]> \subset act_dom base_act. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc p))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc p)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc p))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc p))))) (@cycle (Zp_finGroupType (S (Zp_trunc p))) a))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc p)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc p))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc p))))) (@act_dom (Zp_finGroupType (S (Zp_trunc p))) (@morphpre (Zp_finGroupType (S (Zp_trunc p))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@gval (Zp_finGroupType (S (Zp_trunc p))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a)) act_morphism (@MorPhantom (Zp_finGroupType (S (Zp_trunc p))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@mfun (Zp_finGroupType (S (Zp_trunc p))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@gval (Zp_finGroupType (S (Zp_trunc p))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a)) act_morphism)) (@gval (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut_group (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b)))) (FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gact (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@morphpre (Zp_finGroupType (S (Zp_trunc p))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@gval (Zp_finGroupType (S (Zp_trunc p))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a)) act_morphism (@MorPhantom (Zp_finGroupType (S (Zp_trunc p))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@mfun (Zp_finGroupType (S (Zp_trunc p))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@gval (Zp_finGroupType (S (Zp_trunc p))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a)) act_morphism)) (@gval (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut_group (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b)))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b)) base_act))))) *) rewrite cycle_subG 2!inE cycle_id /= eltm_id /aut_of. (* Goal: is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (@Option.default (FinGroup.sort (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (oneg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@pick (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (fun s : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => andb (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) s (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@cycle (Zp_finGroupType (S (Zp_trunc q))) b))))) (andb (leq (S (S O)) p) (andb (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s) p) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) s b) (@expgn (Zp_baseFinGroupType (S (Zp_trunc q))) b e))))))) (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@cycle (Zp_finGroupType (S (Zp_trunc q))) b))))) *) by case: pickP => [op /andP[] | _] //=; rewrite group1. Qed. Definition gact := (base_act \ act_dom)%gact. Definition gtype := locked_with gtype_key (sdprod_groupType gact). Hypotheses (p_gt1 : p > 1) (q_gt1 : q > 1). Lemma card : #|[set: gtype]| = (p * q)%N. Proof. (* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base gtype)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gtype))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gtype)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gtype)) (@setTfor (FinGroup.arg_finType (FinGroup.base gtype)) (Phant (FinGroup.arg_sort (FinGroup.base gtype))))))) (muln p q) *) rewrite [gtype]unlock -(sdprod_card (sdprod_sdpair _)). (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b) gact))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b) gact)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b) gact))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b) gact))) (@morphim (Zp_finGroupType (S (Zp_trunc q))) (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b) gact) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b)) (@sdpair1_morphism (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b) gact) (@MorPhantom (Zp_finGroupType (S (Zp_trunc q))) (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b) gact) (@sdpair1 (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b) gact)) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b)))))) (@card (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b) gact))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b) gact)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b) gact))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b) gact))) (@morphim (Zp_finGroupType (S (Zp_trunc p))) (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b) gact) (@gval (Zp_finGroupType (S (Zp_trunc p))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a)) (@sdpair2_morphism (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b) gact) (@MorPhantom (Zp_finGroupType (S (Zp_trunc p))) (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b) gact) (@sdpair2 (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b) gact)) (@gval (Zp_finGroupType (S (Zp_trunc p))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a))))))) (muln p q) *) rewrite !card_injm ?injm_sdpair1 ?injm_sdpair2 //. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) b))))) (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc p))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc p)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc p))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc p))))) (@gval (Zp_finGroupType (S (Zp_trunc p))) (@cycle_group (Zp_finGroupType (S (Zp_trunc p))) a)))))) (muln p q) *) by rewrite mulnC -!orderE !order_Zp1 !Zp_cast. Qed. Lemma Grp : (exists s, [/\ s \in Aut B, #[s] %| p & s b = b ^+ e]) -> [set: gtype] \isog Grp (x : y : (x ^+ q, y ^+ p, x ^ y = x ^+ e)). End Construction. End Extremal. Section SpecializeExtremals. Import Extremal. Variable m : nat. Let p := pdiv m. Let q := m %/ p. Definition modular_gtype := gtype q p (q %/ p).+1. Definition dihedral_gtype := gtype q 2 q.-1. Definition semidihedral_gtype := gtype q 2 (q %/ p).-1. Definition quaternion_kernel := <<[set u | u ^+ 2 == 1] :\: [set u ^+ 2 | u in [set: gtype q 4 q.-1]]>>. Definition quaternion_gtype := locked_with gtype_key (coset_groupType quaternion_kernel). End SpecializeExtremals. Notation "''Mod_' m" := (modular_gtype m) : type_scope. Notation "''Mod_' m" := [set: gsort 'Mod_m] : group_scope. Notation "''Mod_' m" := [set: gsort 'Mod_m]%G : Group_scope. Notation "''D_' m" := (dihedral_gtype m) : type_scope. Notation "''D_' m" := [set: gsort 'D_m] : group_scope. Notation "''D_' m" := [set: gsort 'D_m]%G : Group_scope. Notation "''SD_' m" := (semidihedral_gtype m) : type_scope. Notation "''SD_' m" := [set: gsort 'SD_m] : group_scope. Notation "''SD_' m" := [set: gsort 'SD_m]%G : Group_scope. Notation "''Q_' m" := (quaternion_gtype m) : type_scope. Notation "''Q_' m" := [set: gsort 'Q_m] : group_scope. Notation "''Q_' m" := [set: gsort 'Q_m]%G : Group_scope. Section ExtremalTheory. Implicit Types (gT : finGroupType) (p q m n : nat). Lemma cyclic_pgroup_Aut_structure gT p (G : {group gT}) : p.-group G -> cyclic G -> G :!=: 1 -> Definition extremal_generators gT (A : {set gT}) p n xy := let: (x, y) := xy in [/\ #|A| = (p ^ n)%N, x \in A, #[x] = (p ^ n.-1)%N & y \in A :\: <[x]>]. Lemma extremal_generators_facts gT (G : {group gT}) p n x y : prime p -> extremal_generators G p n (x, y) -> [/\ p.-group G, maximal <[x]> G, <[x]> <| G, Proof. (* Goal: forall (_ : is_true (prime p)) (_ : @extremal_generators gT (@gval gT G) p n (@pair (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x y)), and5 (is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (is_true (@maximal gT (@cycle gT x) (@gval gT G))) (is_true (@normal gT (@cycle gT x) (@gval gT G))) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) (@cycle gT y)) (@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)) (@cycle 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)) (@normaliser gT (@cycle gT x)))))) *) move=> p_pr [oG Gx ox] /setDP[Gy notXy]. (* Goal: and5 (is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (is_true (@maximal gT (@cycle gT x) (@gval gT G))) (is_true (@normal gT (@cycle gT x) (@gval gT G))) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) (@cycle gT y)) (@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)) (@cycle 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)) (@normaliser gT (@cycle gT x)))))) *) have pG: p.-group G by rewrite /pgroup oG pnat_exp pnat_id. (* Goal: and5 (is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (is_true (@maximal gT (@cycle gT x) (@gval gT G))) (is_true (@normal gT (@cycle gT x) (@gval gT G))) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) (@cycle gT y)) (@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)) (@cycle 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)) (@normaliser gT (@cycle gT x)))))) *) have maxX: maximal <[x]> G. (* Goal: and5 (is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (is_true (@maximal gT (@cycle gT x) (@gval gT G))) (is_true (@normal gT (@cycle gT x) (@gval gT G))) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) (@cycle gT y)) (@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)) (@cycle 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)) (@normaliser gT (@cycle gT x)))))) *) (* Goal: is_true (@maximal gT (@cycle gT x) (@gval gT G)) *) rewrite p_index_maximal -?divgS ?cycle_subG // -orderE oG ox. (* Goal: and5 (is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (is_true (@maximal gT (@cycle gT x) (@gval gT G))) (is_true (@normal gT (@cycle gT x) (@gval gT G))) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) (@cycle gT y)) (@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)) (@cycle 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)) (@normaliser gT (@cycle gT x)))))) *) (* Goal: is_true (prime (divn (expn p n) (expn p (Nat.pred n)))) *) case: (n) oG => [|n' _]; last by rewrite -expnB ?subSnn ?leqnSn ?prime_gt0. (* Goal: and5 (is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (is_true (@maximal gT (@cycle gT x) (@gval gT G))) (is_true (@normal gT (@cycle gT x) (@gval gT G))) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) (@cycle gT y)) (@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)) (@cycle 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)) (@normaliser gT (@cycle gT x)))))) *) (* Goal: forall _ : @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 p O), is_true (prime (divn (expn p O) (expn p (Nat.pred O)))) *) move/eqP; rewrite -trivg_card1; case/trivgPn. (* Goal: and5 (is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (is_true (@maximal gT (@cycle gT x) (@gval gT G))) (is_true (@normal gT (@cycle gT x) (@gval gT G))) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) (@cycle gT y)) (@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)) (@cycle 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)) (@normaliser gT (@cycle gT x)))))) *) (* 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 (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) x (oneg (FinGroup.base gT))))) *) by exists y; rewrite // (group1_contra notXy). (* Goal: and5 (is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (is_true (@maximal gT (@cycle gT x) (@gval gT G))) (is_true (@normal gT (@cycle gT x) (@gval gT G))) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) (@cycle gT y)) (@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)) (@cycle 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)) (@normaliser gT (@cycle gT x)))))) *) have nsXG := p_maximal_normal pG maxX; split=> //. (* 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 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)) (@normaliser gT (@cycle gT x))))) *) (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) (@cycle gT y)) (@gval gT G) *) by apply: mulg_normal_maximal; rewrite ?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)) (@cycle 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)) (@normaliser gT (@cycle gT x))))) *) by rewrite cycle_subG (subsetP (normal_norm nsXG)). Qed. Section ModularGroup. Variables p n : nat. Let m := (p ^ n)%N. Let q := (p ^ n.-1)%N. Let r := (p ^ n.-2)%N. Hypotheses (p_pr : prime p) (n_gt2 : n > 2). Let p_gt1 := prime_gt1 p_pr. Let p_gt0 := ltnW p_gt1. Let def_n := esym (subnKC n_gt2). Let def_q : m %/ p = q. Proof. by rewrite /m /q def_n expnS mulKn. Qed. Proof. (* Goal: @eq nat (divn m p) q *) by rewrite /m /q def_n expnS mulKn. Qed. Let ltqm : q < m. Proof. by rewrite ltn_exp2l // def_n. Qed. Proof. (* Goal: is_true (leq (S q) m) *) by rewrite ltn_exp2l // def_n. Qed. Let r_gt0 : 0 < r. Proof. by rewrite expn_gt0 ?p_gt0. Qed. Proof. (* Goal: is_true (leq (S O) r) *) by rewrite expn_gt0 ?p_gt0. Qed. Lemma card_modular_group : #|'Mod_(p ^ n)| = (p ^ n)%N. Proof. (* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn p n)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn p n))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn p n)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn p n)))) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn p n)))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn p n))))))))) (expn p n) *) by rewrite Extremal.card def_p ?def_q // -expnS def_n. Qed. Lemma Grp_modular_group : 'Mod_(p ^ n) \isog Grp (x : y : (x ^+ q, y ^+ p, x ^ y = x ^+ r.+1)). Definition modular_group_generators gT (xy : gT * gT) := let: (x, y) := xy in #[y] = p /\ x ^ y = x ^+ r.+1. Lemma generators_modular_group gT (G : {group gT}) : G \isog 'Mod_m -> exists2 xy, extremal_generators G p n xy & modular_group_generators xy. Proof. (* Goal: forall _ : is_true (@isog gT (modular_gtype m) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype m))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype m)))))), @ex2 (prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (fun xy : prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) => @extremal_generators gT (@gval gT G) p n xy) (fun xy : prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) => @modular_group_generators gT xy) *) case/(isoGrpP _ Grp_modular_group); rewrite card_modular_group // -/m => oG. (* Goal: forall _ : is_true (@Presentation.hom gT (@gval gT G) (fun x : Presentation.term => Presentation.Cast (Presentation.Generator (fun y : Presentation.term => Presentation.Cast (Presentation.Formula (Presentation.And (Presentation.And (Presentation.Eq1 (Presentation.Exp x q)) (Presentation.Eq1 (Presentation.Exp y p))) (Presentation.Eq2 (Presentation.Conj x y) (Presentation.Exp x (S r))))))))), @ex2 (prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (fun xy : prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) => @extremal_generators gT (@gval gT G) p n xy) (fun xy : prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) => @modular_group_generators gT xy) *) case/existsP=> -[x y] /= /eqP[defG xq yp xy]. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) p n xy) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @modular_group_generators gT xy) *) rewrite norm_joinEr ?norms_cycle ?xy ?mem_cycle // in defG. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) p n xy) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @modular_group_generators gT xy) *) have [Gx Gy]: x \in G /\ y \in G. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) p n xy) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @modular_group_generators gT xy) *) (* Goal: and (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))) 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))))) *) by apply/andP; rewrite -!cycle_subG -mulG_subG defG. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) p n xy) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @modular_group_generators gT xy) *) have notXy: y \notin <[x]>. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) p n xy) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @modular_group_generators gT xy) *) (* Goal: is_true (negb (@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)) (@cycle gT x))))) *) apply: contraL ltqm; rewrite -cycle_subG -oG -defG; move/mulGidPl->. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) p n xy) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @modular_group_generators gT xy) *) (* Goal: is_true (negb (leq (S 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 (@cycle_group gT x))))))) *) by rewrite -leqNgt dvdn_leq ?(ltnW q_gt1) // order_dvdn xq. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) p n xy) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @modular_group_generators gT xy) *) have oy: #[y] = p by apply: nt_prime_order (group1_contra notXy). (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) p n xy) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @modular_group_generators gT xy) *) exists (x, y) => //=; split; rewrite ?inE ?notXy //. (* Goal: @eq nat (@order gT x) (expn p (Nat.pred n)) *) apply/eqP; rewrite -(eqn_pmul2r p_gt0) -expnSr -{1}oy (ltn_predK n_gt2) -/m. (* Goal: is_true (@eq_op nat_eqType (muln (@order gT x) (@order gT y)) m) *) by rewrite -TI_cardMg ?defG ?oG // setIC prime_TIg ?cycle_subG // -orderE oy. Qed. Lemma modular_group_structure gT (G : {group gT}) x y : extremal_generators G p n (x, y) -> G \isog 'Mod_m -> modular_group_generators (x, y) -> let X := <[x]> in [/\ [/\ X ><| <[y]> = G, ~~ abelian G & {in X, forall z j, z ^ (y ^+ j) = z ^+ (j * r).+1}], End ModularGroup. Section DihedralGroup. Variable q : nat. Hypothesis q_gt1 : q > 1. Let m := q.*2. Let def2 : pdiv m = 2. Proof. (* Goal: @eq nat (pdiv m) (S (S O)) *) apply/eqP; rewrite /m -mul2n eqn_leq pdiv_min_dvd ?dvdn_mulr //. (* Goal: is_true (andb true (leq (S (S O)) (pdiv (muln (S (S O)) q)))) *) by rewrite prime_gt1 // pdiv_prime // (@leq_pmul2l 2 1) ltnW. Qed. Section Dihedral_extension. Variable p : nat. Hypotheses (p_gt1 : p > 1) (even_p : 2 %| p). Local Notation ED := [set: gsort (Extremal.gtype q p q.-1)]. Lemma card_ext_dihedral : #|ED| = (p./2 * m)%N. Proof. (* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (Extremal.gtype q p (Nat.pred q)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Extremal.gtype q p (Nat.pred q))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Extremal.gtype q p (Nat.pred q)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Extremal.gtype q p (Nat.pred q)))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Extremal.gtype q p (Nat.pred q)))) (Phant (FinGroup.arg_sort (FinGroup.base (Extremal.gtype q p (Nat.pred q))))))))) (muln (half p) m) *) by rewrite Extremal.card // /m -mul2n -divn2 mulnA divnK. Qed. Lemma Grp_ext_dihedral : ED \isog Grp (x : y : (x ^+ q, y ^+ p, x ^ y = x^-1)). End Dihedral_extension. Lemma card_dihedral : #|'D_m| = m. Proof. (* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (dihedral_gtype m))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (dihedral_gtype m)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (dihedral_gtype m))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (dihedral_gtype m))) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype m))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype m)))))))) m *) by rewrite /('D_m)%type def_q card_ext_dihedral ?mul1n. Qed. Lemma Grp_dihedral : 'D_m \isog Grp (x : y : (x ^+ q, y ^+ 2, x ^ y = x^-1)). Proof. (* Goal: @Presentation.iso (dihedral_gtype m) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype m))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype m))))) (fun x : Presentation.term => Presentation.Cast (Presentation.Generator (fun y : Presentation.term => Presentation.Cast (Presentation.Formula (Presentation.And (Presentation.And (Presentation.Eq1 (Presentation.Exp x q)) (Presentation.Eq1 (Presentation.Exp y (S (S O))))) (Presentation.Eq2 (Presentation.Conj x y) (Presentation.Inv x))))))) *) by rewrite /('D_m)%type def_q; apply: Grp_ext_dihedral. Qed. Lemma Grp'_dihedral : 'D_m \isog Grp (x : y : (x ^+ 2, y ^+ 2, (x * y) ^+ q)). Proof. (* Goal: @Presentation.iso (dihedral_gtype m) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype m))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype m))))) (fun x : Presentation.term => Presentation.Cast (Presentation.Generator (fun y : Presentation.term => Presentation.Cast (Presentation.Formula (Presentation.And (Presentation.And (Presentation.Eq1 (Presentation.Exp x (S (S O)))) (Presentation.Eq1 (Presentation.Exp y (S (S O))))) (Presentation.Eq1 (Presentation.Exp (Presentation.Mul x y) q))))))) *) move=> gT G; rewrite Grp_dihedral; apply/existsP/existsP=> [] [[x y]] /=. (* Goal: forall _ : is_true (@eq_op (Finite.eqType (prod_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@cycle gT x) (@cycle gT y)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (@expgn (FinGroup.base gT) x (S (S O))) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) q)))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (oneg (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (FinGroup.base gT)) (oneg (FinGroup.base gT)))))), @ex (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun x : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => is_true (@eq_op (Finite.eqType (prod_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@cycle gT (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x)) (@cycle gT (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x))) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (@expgn (FinGroup.base gT) (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) q) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) (S (S O))) (@conjg gT (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (oneg (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (FinGroup.base gT)) (@invg (FinGroup.base gT) (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x))))))) *) (* Goal: forall _ : is_true (@eq_op (Finite.eqType (prod_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@cycle gT x) (@cycle gT y)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (@expgn (FinGroup.base gT) x q) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@conjg gT x y)))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (oneg (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (FinGroup.base gT)) (@invg (FinGroup.base gT) x))))), @ex (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun x : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => is_true (@eq_op (Finite.eqType (prod_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@cycle gT (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x)) (@cycle gT (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x))) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (@expgn (FinGroup.base gT) (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) (S (S O))) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) (S (S O))) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x)) q)))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (oneg (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (FinGroup.base gT)) (oneg (FinGroup.base gT))))))) *) case/eqP=> <- xq1 y2 xy; exists (x * y, y); rewrite !xpair_eqE /= eqEsubset. (* Goal: forall _ : is_true (@eq_op (Finite.eqType (prod_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@cycle gT x) (@cycle gT y)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (@expgn (FinGroup.base gT) x (S (S O))) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) q)))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (oneg (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (FinGroup.base gT)) (oneg (FinGroup.base gT)))))), @ex (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun x : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => is_true (@eq_op (Finite.eqType (prod_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@cycle gT (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x)) (@cycle gT (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x))) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (@expgn (FinGroup.base gT) (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) q) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) (S (S O))) (@conjg gT (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (oneg (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (FinGroup.base gT)) (@invg (FinGroup.base gT) (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x))))))) *) (* 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)) (@joing gT (@cycle gT (@mulg (FinGroup.base gT) x y)) (@cycle 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)) (@joing gT (@cycle gT x) (@cycle gT y))))) (@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 (@cycle gT x) (@cycle 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)) (@joing gT (@cycle gT (@mulg (FinGroup.base gT) x y)) (@cycle gT y)))))) (andb (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) (S (S O))) (oneg (FinGroup.base gT))) (andb (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) y (S (S O))) (oneg (FinGroup.base gT))) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) y) q) (oneg (FinGroup.base gT)))))) *) rewrite !join_subG !joing_subr !cycle_subG -{3}(mulgK y x) /=. (* Goal: forall _ : is_true (@eq_op (Finite.eqType (prod_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@cycle gT x) (@cycle gT y)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (@expgn (FinGroup.base gT) x (S (S O))) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) q)))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (oneg (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (FinGroup.base gT)) (oneg (FinGroup.base gT)))))), @ex (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun x : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => is_true (@eq_op (Finite.eqType (prod_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@cycle gT (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x)) (@cycle gT (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x))) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (@expgn (FinGroup.base gT) (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) q) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) (S (S O))) (@conjg gT (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (oneg (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (FinGroup.base gT)) (@invg (FinGroup.base gT) (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x))))))) *) (* Goal: is_true (andb (andb (andb (@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)) (@joing gT (@cycle gT x) (@cycle gT y))))) true) (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) (@invg (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)) (@joing gT (@cycle gT (@mulg (FinGroup.base gT) x y)) (@cycle gT y))))) true)) (andb (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) (S (S O))) (oneg (FinGroup.base gT))) (andb (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) y (S (S O))) (oneg (FinGroup.base gT))) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) y) q) (oneg (FinGroup.base gT)))))) *) rewrite 2?groupM ?groupV ?mem_gen ?inE ?cycle_id ?orbT //= -mulgA expgS. (* Goal: forall _ : is_true (@eq_op (Finite.eqType (prod_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@cycle gT x) (@cycle gT y)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (@expgn (FinGroup.base gT) x (S (S O))) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) q)))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (oneg (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (FinGroup.base gT)) (oneg (FinGroup.base gT)))))), @ex (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun x : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => is_true (@eq_op (Finite.eqType (prod_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@cycle gT (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x)) (@cycle gT (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x))) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (@expgn (FinGroup.base gT) (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) q) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) (S (S O))) (@conjg gT (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (oneg (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (FinGroup.base gT)) (@invg (FinGroup.base gT) (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x))))))) *) (* Goal: is_true (andb (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) (S O))) (oneg (FinGroup.base gT))) (andb (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) y (S (S O))) (oneg (FinGroup.base gT))) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x (@mulg (FinGroup.base gT) y y)) q) (oneg (FinGroup.base gT))))) *) by rewrite {1}(conjgC x) xy -mulgA mulKg -(expgS y 1) y2 mulg1 xq1 !eqxx. (* Goal: forall _ : is_true (@eq_op (Finite.eqType (prod_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@cycle gT x) (@cycle gT y)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (@expgn (FinGroup.base gT) x (S (S O))) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) q)))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (oneg (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (FinGroup.base gT)) (oneg (FinGroup.base gT)))))), @ex (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun x : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => is_true (@eq_op (Finite.eqType (prod_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@cycle gT (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x)) (@cycle gT (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x))) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (@expgn (FinGroup.base gT) (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) q) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) (S (S O))) (@conjg gT (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x) (@snd (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (oneg (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (FinGroup.base gT)) (@invg (FinGroup.base gT) (@fst (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x))))))) *) case/eqP=> <- x2 y2 xyq; exists (x * y, y); rewrite !xpair_eqE /= eqEsubset. (* 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)) (@joing gT (@cycle gT (@mulg (FinGroup.base gT) x y)) (@cycle 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)) (@joing gT (@cycle gT x) (@cycle gT y))))) (@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 (@cycle gT x) (@cycle 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)) (@joing gT (@cycle gT (@mulg (FinGroup.base gT) x y)) (@cycle gT y)))))) (andb (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) q) (oneg (FinGroup.base gT))) (andb (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) y (S (S O))) (oneg (FinGroup.base gT))) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (@conjg gT (@mulg (FinGroup.base gT) x y) y) (@invg (FinGroup.base gT) (@mulg (FinGroup.base gT) x y)))))) *) rewrite !join_subG !joing_subr !cycle_subG -{3}(mulgK y x) /=. (* Goal: is_true (andb (andb (andb (@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)) (@joing gT (@cycle gT x) (@cycle gT y))))) true) (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) (@invg (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)) (@joing gT (@cycle gT (@mulg (FinGroup.base gT) x y)) (@cycle gT y))))) true)) (andb (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) q) (oneg (FinGroup.base gT))) (andb (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) y (S (S O))) (oneg (FinGroup.base gT))) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (@conjg gT (@mulg (FinGroup.base gT) x y) y) (@invg (FinGroup.base gT) (@mulg (FinGroup.base gT) x y)))))) *) rewrite 2?groupM ?groupV ?mem_gen ?inE ?cycle_id ?orbT //= xyq y2 !eqxx /=. (* Goal: is_true (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (@conjg gT (@mulg (FinGroup.base gT) x y) y) (@invg (FinGroup.base gT) (@mulg (FinGroup.base gT) x y))) *) by rewrite eq_sym eq_invg_mul !mulgA mulgK -mulgA -!(expgS _ 1) x2 y2 mulg1. Qed. End DihedralGroup. Lemma involutions_gen_dihedral gT (x y : gT) : let G := <<[set x; y]>> in #[x] = 2 -> #[y] = 2 -> x != y -> G \isog 'D_#|G|. Lemma Grp_2dihedral n : n > 1 -> 'D_(2 ^ n) \isog Grp (x : y : (x ^+ (2 ^ n.-1), y ^+ 2, x ^ y = x^-1)). Proof. (* Goal: forall _ : is_true (leq (S (S O)) n), @Presentation.iso (dihedral_gtype (expn (S (S O)) n)) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) n)))))) (fun x : Presentation.term => Presentation.Cast (Presentation.Generator (fun y : Presentation.term => Presentation.Cast (Presentation.Formula (Presentation.And (Presentation.And (Presentation.Eq1 (Presentation.Exp x (expn (S (S O)) (Nat.pred n)))) (Presentation.Eq1 (Presentation.Exp y (S (S O))))) (Presentation.Eq2 (Presentation.Conj x y) (Presentation.Inv x))))))) *) move=> n_gt1; rewrite -(ltn_predK n_gt1) expnS mul2n /=. (* Goal: @Presentation.iso (dihedral_gtype (double (expn (S (S O)) (Nat.pred n)))) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (double (expn (S (S O)) (Nat.pred n)))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (double (expn (S (S O)) (Nat.pred n)))))))) (fun x : Presentation.term => Presentation.Cast (Presentation.Generator (fun y : Presentation.term => Presentation.Cast (Presentation.Formula (Presentation.And (Presentation.And (Presentation.Eq1 (Presentation.Exp x (expn (S (S O)) (Nat.pred n)))) (Presentation.Eq1 (Presentation.Exp y (S (S O))))) (Presentation.Eq2 (Presentation.Conj x y) (Presentation.Inv x))))))) *) by apply: Grp_dihedral; rewrite (ltn_exp2l 0) // -(subnKC n_gt1). Qed. Lemma card_2dihedral n : n > 1 -> #|'D_(2 ^ n)| = (2 ^ n)%N. Proof. (* Goal: forall _ : is_true (leq (S (S O)) n), @eq nat (@card (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) n)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) n))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) n)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) n)))) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) n))))))))) (expn (S (S O)) n) *) move=> n_gt1; rewrite -(ltn_predK n_gt1) expnS mul2n /= card_dihedral //. (* Goal: is_true (leq (S (S O)) (expn (S (S O)) (Nat.pred n))) *) by rewrite (ltn_exp2l 0) // -(subnKC n_gt1). Qed. Lemma card_semidihedral n : n > 3 -> #|'SD_(2 ^ n)| = (2 ^ n)%N. Proof. (* Goal: forall _ : is_true (leq (S (S (S (S O)))) n), @eq nat (@card (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) n))))))))) (expn (S (S O)) n) *) move=> n_gt3. (* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) n))))))))) (expn (S (S O)) n) *) rewrite /('SD__)%type -(subnKC (ltnW (ltnW n_gt3))) pdiv_pfactor //. (* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (Extremal.gtype (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O)) (Nat.pred (divn (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Extremal.gtype (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O)) (Nat.pred (divn (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O)))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Extremal.gtype (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O)) (Nat.pred (divn (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Extremal.gtype (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O)) (Nat.pred (divn (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Extremal.gtype (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O)) (Nat.pred (divn (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O))))))) (Phant (FinGroup.arg_sort (FinGroup.base (Extremal.gtype (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O)) (Nat.pred (divn (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O)))))))))))) (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) *) by rewrite // !expnS !mulKn -?expnS ?Extremal.card //= (ltn_exp2l 0). Qed. Lemma Grp_semidihedral n : n > 3 -> 'SD_(2 ^ n) \isog Grp (x : y : (x ^+ (2 ^ n.-1), y ^+ 2, x ^ y = x ^+ (2 ^ n.-2).-1)). Proof. (* Goal: forall _ : is_true (leq (S (S (S (S O)))) n), @Presentation.iso (semidihedral_gtype (expn (S (S O)) n)) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))))) (fun x : Presentation.term => Presentation.Cast (Presentation.Generator (fun y : Presentation.term => Presentation.Cast (Presentation.Formula (Presentation.And (Presentation.And (Presentation.Eq1 (Presentation.Exp x (expn (S (S O)) (Nat.pred n)))) (Presentation.Eq1 (Presentation.Exp y (S (S O))))) (Presentation.Eq2 (Presentation.Conj x y) (Presentation.Exp x (Nat.pred (expn (S (S O)) (Nat.pred (Nat.pred n))))))))))) *) move=> n_gt3. (* Goal: @Presentation.iso (semidihedral_gtype (expn (S (S O)) n)) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))))) (fun x : Presentation.term => Presentation.Cast (Presentation.Generator (fun y : Presentation.term => Presentation.Cast (Presentation.Formula (Presentation.And (Presentation.And (Presentation.Eq1 (Presentation.Exp x (expn (S (S O)) (Nat.pred n)))) (Presentation.Eq1 (Presentation.Exp y (S (S O))))) (Presentation.Eq2 (Presentation.Conj x y) (Presentation.Exp x (Nat.pred (expn (S (S O)) (Nat.pred (Nat.pred n))))))))))) *) rewrite /('SD__)%type -(subnKC (ltnW (ltnW n_gt3))) pdiv_pfactor //. (* Goal: @Presentation.iso (Extremal.gtype (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O)) (Nat.pred (divn (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Extremal.gtype (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O)) (Nat.pred (divn (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O))))))) (Phant (FinGroup.arg_sort (FinGroup.base (Extremal.gtype (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O)) (Nat.pred (divn (divn (expn (S (S O)) (addn (S (S O)) (subn n (S (S O))))) (S (S O))) (S (S O))))))))) (fun x : Presentation.term => Presentation.Cast (Presentation.Generator (fun y : Presentation.term => Presentation.Cast (Presentation.Formula (Presentation.And (Presentation.And (Presentation.Eq1 (Presentation.Exp x (expn (S (S O)) (Nat.pred (addn (S (S O)) (subn n (S (S O)))))))) (Presentation.Eq1 (Presentation.Exp y (S (S O))))) (Presentation.Eq2 (Presentation.Conj x y) (Presentation.Exp x (Nat.pred (expn (S (S O)) (Nat.pred (Nat.pred (addn (S (S O)) (subn n (S (S O))))))))))))))) *) rewrite !expnS !mulKn // -!expnS /=; set q := (2 ^ _)%N. (* Goal: @Presentation.iso (Extremal.gtype q (S (S O)) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Extremal.gtype q (S (S O)) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))) (Phant (FinGroup.arg_sort (FinGroup.base (Extremal.gtype q (S (S O)) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))))) (fun x : Presentation.term => Presentation.Cast (Presentation.Generator (fun y : Presentation.term => Presentation.Cast (Presentation.Formula (Presentation.And (Presentation.And (Presentation.Eq1 (Presentation.Exp x q)) (Presentation.Eq1 (Presentation.Exp y (S (S O))))) (Presentation.Eq2 (Presentation.Conj x y) (Presentation.Exp x (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))))))) *) have q_gt1: q > 1 by rewrite (ltn_exp2l 0). (* Goal: @Presentation.iso (Extremal.gtype q (S (S O)) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Extremal.gtype q (S (S O)) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))) (Phant (FinGroup.arg_sort (FinGroup.base (Extremal.gtype q (S (S O)) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))))) (fun x : Presentation.term => Presentation.Cast (Presentation.Generator (fun y : Presentation.term => Presentation.Cast (Presentation.Formula (Presentation.And (Presentation.And (Presentation.Eq1 (Presentation.Exp x q)) (Presentation.Eq1 (Presentation.Exp y (S (S O))))) (Presentation.Eq2 (Presentation.Conj x y) (Presentation.Exp x (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))))))) *) apply: Extremal.Grp => //; set B := <[_]>. (* Goal: @ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (fun s : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => and3 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) s (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (is_true (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s) (S (S O)))) (@eq (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) s (@Zp1 (S (Zp_trunc q)))) (@expgn (Zp_baseFinGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))) *) have oB: #|B| = q by rewrite -orderE order_Zp1 Zp_cast. (* Goal: @ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (fun s : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => and3 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) s (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (is_true (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s) (S (S O)))) (@eq (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) s (@Zp1 (S (Zp_trunc q)))) (@expgn (Zp_baseFinGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))) *) have pB: 2.-group B by rewrite /pgroup oB pnat_exp. (* Goal: @ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (fun s : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => and3 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) s (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (is_true (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s) (S (S O)))) (@eq (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) s (@Zp1 (S (Zp_trunc q)))) (@expgn (Zp_baseFinGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))) *) have ntB: B != 1 by rewrite -cardG_gt1 oB. (* Goal: @ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (fun s : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => and3 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) s (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (is_true (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s) (S (S O)))) (@eq (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) s (@Zp1 (S (Zp_trunc q)))) (@expgn (Zp_baseFinGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))) *) have [] := cyclic_pgroup_Aut_structure pB (cycle_cyclic _) ntB. (* Goal: forall (x : forall _ : @perm_of (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (Phant (FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))), ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) (_ : and3 (and5 (@prop_in11 (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))) (fun (a : @perm_of (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (Phant (FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (x0 : FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) => @eq (FinGroup.sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@expgn (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))) x0 (@nat_of_ord (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) (x a))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) a x0)) (inPhantom (forall (a : @perm_of (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (Phant (FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (x0 : FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))), @eq (FinGroup.sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@expgn (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))) x0 (@nat_of_ord (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) (x a))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) a x0)))) (and (@eq (ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) (x (oneg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (GRing.one (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) (@prop_in2 (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))) (fun x0 y : @perm_of (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (Phant (FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => @eq (ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) (x (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) x0 y)) (@GRing.mul (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))) (x x0) (x y))) (inPhantom (@morphism_2 (@perm_of (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (Phant (FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) x (fun a b : @perm_of (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (Phant (FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => @mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) a b) (fun a b : ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) => @GRing.mul (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))) a b))))) (and (@prop_in2 (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))) (fun x1 x2 : @perm_of (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (Phant (FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => forall _ : @eq (ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) (x x1) (x x2), @eq (@perm_of (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (Phant (FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) x1 x2) (inPhantom (@injective (ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) (@perm_of (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (Phant (FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) x))) (@eq_mem (Equality.sort (ordinal_eqType (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))))) (@mem (Equality.sort (ordinal_eqType (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))))) (seq_predType (ordinal_eqType (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))))) (@image_mem (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) x (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))) (@mem (GRing.UnitRing.sort (Zp_unitRingType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) (predPredType (GRing.UnitRing.sort (Zp_unitRingType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) (@has_quality (S O) (GRing.UnitRing.sort (Zp_unitRingType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) (@GRing.unit (Zp_unitRingType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))))))) (forall k : nat, @prop_in1 (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))) (fun x0 : @perm_of (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (Phant (FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => @eq (ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) (x (@expgn (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) x0 k)) (@GRing.exp (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))) (x x0) k)) (inPhantom (@morphism_1 (@perm_of (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (Phant (FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) x (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (Phant (FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => @expgn (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) a k) (fun a : ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) => @GRing.exp (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))) a k)))) (@prop_in1 (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))) (fun x0 : @perm_of (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (Phant (FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => @eq (ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) (x (@invg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) x0)) (@GRing.inv (Zp_unitRingType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))) (x x0))) (inPhantom (@morphism_1 (@perm_of (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (Phant (FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) x (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (Phant (FinGroup.arg_sort (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => @invg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) a) (fun a : ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) => @GRing.inv (Zp_unitRingType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))) a))))) (and4 (is_true (@abelian (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))) (is_true (@cyclic (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@pcore (negn (nat_pred_of_nat (S (S O)))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))) (@eq nat (@card (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@pcore (negn (nat_pred_of_nat (S (S O)))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))) (Nat.pred (S (S O)))) (is_true (@faithful (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))) (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@pcore (negn (nat_pred_of_nat (S (S O)))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))) (@Ohm (S O) (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))) (@aut_action (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))) (if @eq_op nat_eqType (Nat.pred (logn (S (S O)) (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))) O then @eq (@set_of (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (Phant (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))) (@pcore (negn (nat_pred_of_nat (S (S O)))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))) else @ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (fun t : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => and4 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) t (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) t) (S (S O))) (@eq (ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) (x t) (@GRing.opp (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) (GRing.one (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))))) (if odd (S (S O)) then and3 (and (is_true (@cyclic (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))) (is_true (@cyclic (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@pcore (nat_pred_of_nat (S (S O))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))) (@ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (fun s : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => and4 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) s (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s) (expn (S (S O)) (Nat.pred (logn (S (S O)) (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) (@eq (ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) (x s) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) (GRing.one (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) (S (S (S O))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))))))) (@pcore (nat_pred_of_nat (S (S O))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s)))) (@ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (fun s0 : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => and4 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) s0 (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s0) (S (S O))) (@eq (ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) (x s0) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) (GRing.one (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) (S (expn (S (S O)) (Nat.pred (logn (S (S O)) (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))))))) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@pcore (nat_pred_of_nat (S (S O))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s0)))) else if @eq_op nat_eqType (Nat.pred (logn (S (S O)) (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))) (S O) then @eq (@set_of (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (Phant (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) t) else @ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (fun s : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => and5 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) s (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s) (expn (S (S O)) (Nat.pred (Nat.pred (logn (S (S O)) (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))))) (@eq (ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) (x s) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) (GRing.one (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) (S (S (S (S (S O))))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (Phant (FinGroup.arg_sort (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))))) (direct_product (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) t)) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))) (@ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (fun s0 : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => and5 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) s0 (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s0) (S (S O))) (@eq (ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) (x s0) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) (GRing.one (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) (S (expn (S (S O)) (Nat.pred (logn (S (S O)) (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))))) (@eq (ordinal (S (S (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))) (x (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s0 t)) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) (GRing.one (Zp_ringType (Zp_trunc (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))))))))))) (Nat.pred (expn (S (S O)) (Nat.pred (logn (S (S O)) (@card (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) (@gval (Zp_finGroupType (S (Zp_trunc q))) (@cycle_group (Zp_finGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q)))))))))))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))))))) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s)) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s0))))))))), @ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (fun s : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) => and3 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) s (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (is_true (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) s) (S (S O)))) (@eq (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))) s (@Zp1 (S (Zp_trunc q)))) (@expgn (Zp_baseFinGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))) *) rewrite oB /= pfactorK //= -/B => m [[def_m _ _ _ _] _]. (* Goal: forall _ : if @eq_op nat_eqType (subn n (S (S O))) O then @eq (@set_of (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (Phant (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B) (@pcore (negn (nat_pred_of_nat (S (S O)))) (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B)) else @ex (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (fun t : @perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))) => and4 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) t (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) t) (S (S O))) (@eq (ordinal (S (S (Zp_trunc q)))) (m t) (@GRing.opp (GRing.Ring.zmodType (Zp_ringType (Zp_trunc q))) (GRing.one (Zp_ringType (Zp_trunc q))))) (if @eq_op nat_eqType (subn n (S (S O))) (S O) then @eq (@set_of (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (Phant (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) t) else @ex (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (fun s : @perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) s (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s) (expn (S (S O)) (Nat.pred (subn n (S (S O)))))) (@eq (ordinal (S (S (Zp_trunc q)))) (m s) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc q))) (GRing.one (Zp_ringType (Zp_trunc q))) (S (S (S (S (S O))))))) (@eq (@set_of (FinGroup.arg_finType (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))))) (Phant (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))))) (direct_product (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) t)) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B)) (@ex (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (fun s0 : @perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) s0 (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0) (S (S O))) (@eq (ordinal (S (S (Zp_trunc q)))) (m s0) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc q))) (GRing.one (Zp_ringType (Zp_trunc q))) (S (expn (S (S O)) (subn n (S (S O))))))) (@eq (ordinal (S (S (Zp_trunc q)))) (m (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0 t)) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc q))) (GRing.one (Zp_ringType (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O))))))) (@eq (@set_of (FinGroup.arg_finType (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))))) (Phant (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))))) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s)) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0))))))), @ex (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (fun s : @perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))) => and3 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) s (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (is_true (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s) (S (S O)))) (@eq (ordinal (S (S (Zp_trunc q)))) (@PermDef.fun_of_perm (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) s (@Zp1 (S (Zp_trunc q)))) (@expgn (Zp_baseFinGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))) *) rewrite -{1 2}(subnKC n_gt3) => [[t [At ot _ [s [_ _ _ defA]]]]]. (* Goal: forall _ : @ex (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (fun s0 : @perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) s0 (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0) (S (S O))) (@eq (ordinal (S (S (Zp_trunc q)))) (m s0) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc q))) (GRing.one (Zp_ringType (Zp_trunc q))) (S (expn (S (S O)) (subn n (S (S O))))))) (@eq (ordinal (S (S (Zp_trunc q)))) (m (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0 t)) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc q))) (GRing.one (Zp_ringType (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O))))))) (@eq (@set_of (FinGroup.arg_finType (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))))) (Phant (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))))) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s)) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0))), @ex (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (fun s : @perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))) => and3 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) s (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (is_true (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s) (S (S O)))) (@eq (ordinal (S (S (Zp_trunc q)))) (@PermDef.fun_of_perm (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) s (@Zp1 (S (Zp_trunc q)))) (@expgn (Zp_baseFinGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))) *) case/dprodP: defA => _ defA cst _. (* Goal: forall _ : @ex (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (fun s0 : @perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) s0 (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0) (S (S O))) (@eq (ordinal (S (S (Zp_trunc q)))) (m s0) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc q))) (GRing.one (Zp_ringType (Zp_trunc q))) (S (expn (S (S O)) (subn n (S (S O))))))) (@eq (ordinal (S (S (Zp_trunc q)))) (m (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0 t)) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc q))) (GRing.one (Zp_ringType (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O))))))) (@eq (@set_of (FinGroup.arg_finType (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))))) (Phant (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))))) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s)) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0))), @ex (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (fun s : @perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))) => and3 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) s (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (is_true (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s) (S (S O)))) (@eq (ordinal (S (S (Zp_trunc q)))) (@PermDef.fun_of_perm (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) s (@Zp1 (S (Zp_trunc q)))) (@expgn (Zp_baseFinGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))) *) have{cst defA} cAt: t \in 'C(Aut B). (* Goal: forall _ : @ex (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (fun s0 : @perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) s0 (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0) (S (S O))) (@eq (ordinal (S (S (Zp_trunc q)))) (m s0) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc q))) (GRing.one (Zp_ringType (Zp_trunc q))) (S (expn (S (S O)) (subn n (S (S O))))))) (@eq (ordinal (S (S (Zp_trunc q)))) (m (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0 t)) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc q))) (GRing.one (Zp_ringType (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O))))))) (@eq (@set_of (FinGroup.arg_finType (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))))) (Phant (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))))) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s)) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0))), @ex (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (fun s : @perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))) => and3 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) s (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (is_true (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s) (S (S O)))) (@eq (ordinal (S (S (Zp_trunc q)))) (@PermDef.fun_of_perm (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) s (@Zp1 (S (Zp_trunc q)))) (@expgn (Zp_baseFinGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))) *) (* Goal: is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) t (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q))))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))))) (@centraliser (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base (Zp_finGroupType (S (Zp_trunc q)))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) *) rewrite -defA centM inE -sub_cent1 -cent_cycle centsC cst /=. (* Goal: forall _ : @ex (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (fun s0 : @perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) s0 (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0) (S (S O))) (@eq (ordinal (S (S (Zp_trunc q)))) (m s0) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc q))) (GRing.one (Zp_ringType (Zp_trunc q))) (S (expn (S (S O)) (subn n (S (S O))))))) (@eq (ordinal (S (S (Zp_trunc q)))) (m (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0 t)) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc q))) (GRing.one (Zp_ringType (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O))))))) (@eq (@set_of (FinGroup.arg_finType (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))))) (Phant (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))))) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s)) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0))), @ex (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (fun s : @perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))) => and3 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) s (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (is_true (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s) (S (S O)))) (@eq (ordinal (S (S (Zp_trunc q)))) (@PermDef.fun_of_perm (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) s (@Zp1 (S (Zp_trunc q)))) (@expgn (Zp_baseFinGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))) *) (* Goal: is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) t (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))))) (@centraliser (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) t))))) *) by rewrite cent_cycle cent1id. (* Goal: forall _ : @ex (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (fun s0 : @perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) s0 (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0) (S (S O))) (@eq (ordinal (S (S (Zp_trunc q)))) (m s0) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc q))) (GRing.one (Zp_ringType (Zp_trunc q))) (S (expn (S (S O)) (subn n (S (S O))))))) (@eq (ordinal (S (S (Zp_trunc q)))) (m (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0 t)) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc q))) (GRing.one (Zp_ringType (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O))))))) (@eq (@set_of (FinGroup.arg_finType (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))))) (Phant (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))))) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s)) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0))), @ex (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (fun s : @perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))) => and3 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) s (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (is_true (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s) (S (S O)))) (@eq (ordinal (S (S (Zp_trunc q)))) (@PermDef.fun_of_perm (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) s (@Zp1 (S (Zp_trunc q)))) (@expgn (Zp_baseFinGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))))) *) case=> s0 [As0 os0 _ def_s0t _]; exists (s0 * t). (* Goal: and3 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0 t) (@mem (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q)))))) (predPredType (@perm_of (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (Phant (ordinal (S (S (Zp_trunc q))))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@Aut (Zp_finGroupType (S (Zp_trunc q))) B))))) (is_true (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0 t)) (S (S O)))) (@eq (ordinal (S (S (Zp_trunc q)))) (@PermDef.fun_of_perm (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))) (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0 t) (@Zp1 (S (Zp_trunc q)))) (@expgn (Zp_baseFinGroupType (S (Zp_trunc q))) (@Zp1 (S (Zp_trunc q))) (Nat.pred (expn (S (S O)) (subn n (S (S O))))))) *) rewrite -def_m ?groupM ?cycle_id // def_s0t !Zp_expg !mul1n valZpK Zp_nat. (* Goal: and3 (is_true true) (is_true (dvdn (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0 t)) (S (S O)))) (@eq (ordinal (S (S (Zp_trunc q)))) (@inZp (S (Zp_trunc q)) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))) (@inZp (S (Zp_trunc q)) (Nat.pred (expn (S (S O)) (subn n (S (S O))))))) *) rewrite order_dvdn expgMn /commute 1?(centP cAt) // -{1}os0 -{1}ot. (* Goal: and3 (is_true true) (is_true (@eq_op (FinGroup.eqType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))))) (@mulg (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))))) (@expgn (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))))) s0 (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) s0)) (@expgn (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q)))))) t (@order (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))) t))) (oneg (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (Zp_baseFinGroupType (S (Zp_trunc q))))))))) (@eq (ordinal (S (S (Zp_trunc q)))) (@inZp (S (Zp_trunc q)) (Nat.pred (expn (S (S O)) (subn n (S (S O)))))) (@inZp (S (Zp_trunc q)) (Nat.pred (expn (S (S O)) (subn n (S (S O))))))) *) by rewrite !expg_order mul1g. Qed. Section Quaternion. Variable n : nat. Hypothesis n_gt2 : n > 2. Let m := (2 ^ n)%N. Let q := (2 ^ n.-1)%N. Let r := (2 ^ n.-2)%N. Let GrpQ := 'Q_m \isog Grp (x : y : (x ^+ q, y ^+ 2 = x ^+ r, x ^ y = x^-1)). Let defQ : #|'Q_m| = m /\ GrpQ. Lemma Grp_quaternion : GrpQ. Proof. by case defQ. Qed. Proof. (* Goal: GrpQ *) by case defQ. Qed. Section ExtremalStructure. Variables (gT : finGroupType) (G : {group gT}) (n : nat). Implicit Type H : {group gT}. Let m := (2 ^ n)%N. Let q := (2 ^ n.-1)%N. Let r := (2 ^ n.-2)%N. Let def2qr : n > 1 -> [/\ 2 * q = m, 2 * r = q, q < m & r < q]%N. Proof. (* Goal: forall _ : is_true (leq (S (S O)) n), and4 (@eq nat (muln (S (S O)) q) m) (@eq nat (muln (S (S O)) r) q) (is_true (leq (S q) m)) (is_true (leq (S r) q)) *) by rewrite /q /m /r; move/subnKC=> <-; rewrite !ltn_exp2l ?expnS. Qed. Lemma generators_2dihedral : n > 1 -> G \isog 'D_m -> exists2 xy, extremal_generators G 2 n xy & let: (x, y) := xy in #[y] = 2 /\ x ^ y = x^-1. Proof. (* Goal: forall (_ : is_true (leq (S (S O)) n)) (_ : is_true (@isog gT (dihedral_gtype m) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype m))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype m))))))), @ex2 (prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (fun xy : prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) move=> n_gt1; have [def2q _ ltqm _] := def2qr n_gt1. (* Goal: forall _ : is_true (@isog gT (dihedral_gtype m) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype m))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype m)))))), @ex2 (prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (fun xy : prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) case/(isoGrpP _ (Grp_2dihedral n_gt1)); rewrite card_2dihedral // -/ m => oG. (* Goal: forall _ : is_true (@Presentation.hom gT (@gval gT G) (fun x : Presentation.term => Presentation.Cast (Presentation.Generator (fun y : Presentation.term => Presentation.Cast (Presentation.Formula (Presentation.And (Presentation.And (Presentation.Eq1 (Presentation.Exp x (expn (S (S O)) (Nat.pred n)))) (Presentation.Eq1 (Presentation.Exp y (S (S O))))) (Presentation.Eq2 (Presentation.Conj x y) (Presentation.Inv x)))))))), @ex2 (prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (fun xy : prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) case/existsP=> -[x y] /=; rewrite -/q => /eqP[defG xq y2 xy]. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) have{defG} defG: <[x]> * <[y]> = G. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) (@cycle gT y)) (@gval gT G) *) by rewrite -norm_joinEr // norms_cycle xy groupV cycle_id. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) have notXy: y \notin <[x]>. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) (* Goal: is_true (negb (@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)) (@cycle gT x))))) *) apply: contraL ltqm => Xy; rewrite -leqNgt -oG -defG mulGSid ?cycle_subG //. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) (* 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 (@cycle_group gT x))))) q) *) by rewrite dvdn_leq // order_dvdn xq. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) have oy: #[y] = 2 by apply: nt_prime_order (group1_contra notXy). (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) have ox: #[x] = q. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) (* Goal: @eq nat (@order gT x) q *) apply: double_inj; rewrite -muln2 -oy -mul2n def2q -oG -defG TI_cardMg //. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) (* 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 (@cycle_group gT x)) (@gval gT (@cycle_group gT y))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) by rewrite setIC prime_TIg ?cycle_subG // -orderE oy. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) exists (x, y) => //=. (* Goal: and4 (@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)) (@gval gT G)))) (expn (S (S O)) n)) (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))))) (@eq nat (@order gT x) (expn (S (S O)) (Nat.pred n))) (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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@cycle gT x)))))) *) by rewrite oG ox !inE notXy -!cycle_subG /= -defG mulG_subl mulG_subr. Qed. Lemma generators_semidihedral : n > 3 -> G \isog 'SD_m -> exists2 xy, extremal_generators G 2 n xy & let: (x, y) := xy in #[y] = 2 /\ x ^ y = x ^+ r.-1. Proof. (* Goal: forall (_ : is_true (leq (S (S (S (S O)))) n)) (_ : is_true (@isog gT (semidihedral_gtype m) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype m))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype m))))))), @ex2 (prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (fun xy : prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@expgn (FinGroup.base gT) x (Nat.pred r)))) *) move=> n_gt3; have [def2q _ ltqm _] := def2qr (ltnW (ltnW n_gt3)). (* Goal: forall _ : is_true (@isog gT (semidihedral_gtype m) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype m))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype m)))))), @ex2 (prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (fun xy : prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@expgn (FinGroup.base gT) x (Nat.pred r)))) *) case/(isoGrpP _ (Grp_semidihedral n_gt3)). (* Goal: forall (_ : @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 (semidihedral_gtype (expn (S (S O)) n)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (@gval (semidihedral_gtype (expn (S (S O)) n)) (@setT_group (semidihedral_gtype (expn (S (S O)) n)) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) n))))))))))) (_ : is_true (@Presentation.hom gT (@gval gT G) (fun x : Presentation.term => Presentation.Cast (Presentation.Generator (fun y : Presentation.term => Presentation.Cast (Presentation.Formula (Presentation.And (Presentation.And (Presentation.Eq1 (Presentation.Exp x (expn (S (S O)) (Nat.pred n)))) (Presentation.Eq1 (Presentation.Exp y (S (S O))))) (Presentation.Eq2 (Presentation.Conj x y) (Presentation.Exp x (Nat.pred (expn (S (S O)) (Nat.pred (Nat.pred n))))))))))))), @ex2 (prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (fun xy : prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@expgn (FinGroup.base gT) x (Nat.pred r)))) *) rewrite card_semidihedral // -/m => oG. (* Goal: forall _ : is_true (@Presentation.hom gT (@gval gT G) (fun x : Presentation.term => Presentation.Cast (Presentation.Generator (fun y : Presentation.term => Presentation.Cast (Presentation.Formula (Presentation.And (Presentation.And (Presentation.Eq1 (Presentation.Exp x (expn (S (S O)) (Nat.pred n)))) (Presentation.Eq1 (Presentation.Exp y (S (S O))))) (Presentation.Eq2 (Presentation.Conj x y) (Presentation.Exp x (Nat.pred (expn (S (S O)) (Nat.pred (Nat.pred n)))))))))))), @ex2 (prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (fun xy : prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@expgn (FinGroup.base gT) x (Nat.pred r)))) *) case/existsP=> -[x y] /=; rewrite -/q -/r => /eqP[defG xq y2 xy]. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@expgn (FinGroup.base gT) x (Nat.pred r)))) *) have{defG} defG: <[x]> * <[y]> = G. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@expgn (FinGroup.base gT) x (Nat.pred r)))) *) (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) (@cycle gT y)) (@gval gT G) *) by rewrite -norm_joinEr // norms_cycle xy mem_cycle. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@expgn (FinGroup.base gT) x (Nat.pred r)))) *) have notXy: y \notin <[x]>. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@expgn (FinGroup.base gT) x (Nat.pred r)))) *) (* Goal: is_true (negb (@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)) (@cycle gT x))))) *) apply: contraL ltqm => Xy; rewrite -leqNgt -oG -defG mulGSid ?cycle_subG //. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@expgn (FinGroup.base gT) x (Nat.pred r)))) *) (* 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 (@cycle_group gT x))))) q) *) by rewrite dvdn_leq // order_dvdn xq. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@expgn (FinGroup.base gT) x (Nat.pred r)))) *) have oy: #[y] = 2 by apply: nt_prime_order (group1_contra notXy). (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@expgn (FinGroup.base gT) x (Nat.pred r)))) *) have ox: #[x] = q. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@expgn (FinGroup.base gT) x (Nat.pred r)))) *) (* Goal: @eq nat (@order gT x) q *) apply: double_inj; rewrite -muln2 -oy -mul2n def2q -oG -defG TI_cardMg //. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@expgn (FinGroup.base gT) x (Nat.pred r)))) *) (* 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 (@cycle_group gT x)) (@gval gT (@cycle_group gT y))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) by rewrite setIC prime_TIg ?cycle_subG // -orderE oy. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and (@eq nat (@order gT y) (S (S O))) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@expgn (FinGroup.base gT) x (Nat.pred r)))) *) exists (x, y) => //=. (* Goal: and4 (@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)) (@gval gT G)))) (expn (S (S O)) n)) (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))))) (@eq nat (@order gT x) (expn (S (S O)) (Nat.pred n))) (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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@cycle gT x)))))) *) by rewrite oG ox !inE notXy -!cycle_subG /= -defG mulG_subl mulG_subr. Qed. Lemma generators_quaternion : n > 2 -> G \isog 'Q_m -> exists2 xy, extremal_generators G 2 n xy & let: (x, y) := xy in [/\ #[y] = 4, y ^+ 2 = x ^+ r & x ^ y = x^-1]. Proof. (* Goal: forall (_ : is_true (leq (S (S (S O))) n)) (_ : is_true (@isog gT (quaternion_gtype m) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype m))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype m))))))), @ex2 (prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (fun xy : prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and3 (@eq nat (@order gT y) (S (S (S (S O))))) (@eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) x r)) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) move=> n_gt2; have [def2q def2r ltqm _] := def2qr (ltnW n_gt2). (* Goal: forall _ : is_true (@isog gT (quaternion_gtype m) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype m))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype m)))))), @ex2 (prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (fun xy : prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and3 (@eq nat (@order gT y) (S (S (S (S O))))) (@eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) x r)) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) case/(isoGrpP _ (Grp_quaternion n_gt2)); rewrite card_quaternion // -/m => oG. (* Goal: forall _ : is_true (@Presentation.hom gT (@gval gT G) (fun x : Presentation.term => Presentation.Cast (Presentation.Generator (fun y : Presentation.term => Presentation.Cast (Presentation.Formula (Presentation.And (Presentation.And (Presentation.Eq1 (Presentation.Exp x (expn (S (S O)) (Nat.pred n)))) (Presentation.Eq2 (Presentation.Exp y (S (S O))) (Presentation.Exp x (expn (S (S O)) (Nat.pred (Nat.pred n)))))) (Presentation.Eq2 (Presentation.Conj x y) (Presentation.Inv x)))))))), @ex2 (prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (fun xy : prod (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and3 (@eq nat (@order gT y) (S (S (S (S O))))) (@eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) x r)) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) case/existsP=> -[x y] /=; rewrite -/q -/r => /eqP[defG xq y2 xy]. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and3 (@eq nat (@order gT y) (S (S (S (S O))))) (@eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) x r)) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) have{defG} defG: <[x]> * <[y]> = G. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and3 (@eq nat (@order gT y) (S (S (S (S O))))) (@eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) x r)) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) (@cycle gT y)) (@gval gT G) *) by rewrite -norm_joinEr // norms_cycle xy groupV cycle_id. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and3 (@eq nat (@order gT y) (S (S (S (S O))))) (@eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) x r)) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) have notXy: y \notin <[x]>. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and3 (@eq nat (@order gT y) (S (S (S (S O))))) (@eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) x r)) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) (* Goal: is_true (negb (@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)) (@cycle gT x))))) *) apply: contraL ltqm => Xy; rewrite -leqNgt -oG -defG mulGSid ?cycle_subG //. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and3 (@eq nat (@order gT y) (S (S (S (S O))))) (@eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) x r)) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) (* 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 (@cycle_group gT x))))) q) *) by rewrite dvdn_leq // order_dvdn xq. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and3 (@eq nat (@order gT y) (S (S (S (S O))))) (@eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) x r)) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) have ox: #[x] = q. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and3 (@eq nat (@order gT y) (S (S (S (S O))))) (@eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) x r)) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) (* Goal: @eq nat (@order gT x) q *) apply/eqP; rewrite eqn_leq dvdn_leq ?order_dvdn ?xq //=. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and3 (@eq nat (@order gT y) (S (S (S (S O))))) (@eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) x r)) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) (* Goal: is_true (leq q (@order gT x)) *) rewrite -(leq_pmul2r (order_gt0 y)) mul_cardG defG oG -def2q mulnAC mulnC. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and3 (@eq nat (@order gT y) (S (S (S (S O))))) (@eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) x r)) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) (* Goal: is_true (leq (muln (@order gT y) q) (muln (muln (S (S O)) (@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 (@cycle_group gT x)) (@gval gT (@cycle_group gT y))))))) q)) *) rewrite leq_pmul2r // dvdn_leq ?muln_gt0 ?cardG_gt0 // order_dvdn expgM. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and3 (@eq nat (@order gT y) (S (S (S (S O))))) (@eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) x r)) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) (* Goal: is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@expgn (FinGroup.base gT) y (S (S O))) (@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 (@cycle_group gT x)) (@gval gT (@cycle_group gT y))))))) (oneg (FinGroup.base gT))) *) by rewrite -order_dvdn order_dvdG //= inE {1}y2 !mem_cycle. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and3 (@eq nat (@order gT y) (S (S (S (S O))))) (@eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) x r)) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) have oy2: #[y ^+ 2] = 2 by rewrite y2 orderXdiv ox -def2r ?dvdn_mull ?mulnK. (* Goal: @ex2 (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (fun xy : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @extremal_generators gT (@gval gT G) (S (S O)) n xy) (fun '(pair x y) => and3 (@eq nat (@order gT y) (S (S (S (S O))))) (@eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (S (S O))) (@expgn (FinGroup.base gT) x r)) (@eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@invg (FinGroup.base gT) x))) *) exists (x, y) => /=; last by rewrite (orderXprime oy2). (* Goal: and4 (@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)) (@gval gT G)))) (expn (S (S O)) n)) (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))))) (@eq nat (@order gT x) (expn (S (S O)) (Nat.pred n))) (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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@cycle gT x)))))) *) by rewrite oG !inE notXy -!cycle_subG /= -defG mulG_subl mulG_subr. Qed. Variables x y : gT. Implicit Type M : {group gT}. Let X := <[x]>. Let Y := <[y]>. Let yG := y ^: G. Let xyG := (x * y) ^: G. Let My := <<yG>>. Let Mxy := <<xyG>>. Theorem dihedral2_structure : n > 1 -> extremal_generators G 2 n (x, y) -> G \isog 'D_m -> [/\ [/\ X ><| Y = G, {in G :\: X, forall t, #[t] = 2} & {in X & G :\: X, forall z t, z ^ t = z^-1}], [/\ G ^`(1) = <[x ^+ 2]>, 'Phi(G) = G ^`(1), #|G^`(1)| = r & nil_class G = n.-1], Theorem quaternion_structure : n > 2 -> extremal_generators G 2 n (x, y) -> G \isog 'Q_m -> [/\ [/\ pprod X Y = G, {in G :\: X, forall t, #[t] = 4} & {in X & G :\: X, forall z t, z ^ t = z^-1}], [/\ G ^`(1) = <[x ^+ 2]>, 'Phi(G) = G ^`(1), #|G^`(1)| = r & nil_class G = n.-1], Theorem semidihedral_structure : n > 3 -> extremal_generators G 2 n (x, y) -> G \isog 'SD_m -> #[y] = 2 -> [/\ [/\ X ><| Y = G, #[x * y] = 4 & {in X & G :\: X, forall z t, z ^ t = z ^+ r.-1}], End ExtremalStructure. Section ExtremalClass. Variables (gT : finGroupType) (G : {group gT}). Inductive extremal_group_type := ModularGroup | Dihedral | SemiDihedral | Quaternion | NotExtremal. Definition index_extremal_group_type c := match c with | ModularGroup => 0 | Dihedral => 1 | SemiDihedral => 2 | Quaternion => 3 | NotExtremal => 4 end%N. Definition enum_extremal_groups := [:: ModularGroup; Dihedral; SemiDihedral; Quaternion]. Lemma cancel_index_extremal_groups : cancel index_extremal_group_type (nth NotExtremal enum_extremal_groups). Proof. (* Goal: @cancel nat extremal_group_type index_extremal_group_type (@nth extremal_group_type NotExtremal enum_extremal_groups) *) by case. Qed. Local Notation extgK := cancel_index_extremal_groups. Import choice. Definition extremal_group_eqMixin := CanEqMixin extgK. Canonical extremal_group_eqType := EqType _ extremal_group_eqMixin. Definition extremal_group_choiceMixin := CanChoiceMixin extgK. Canonical extremal_group_choiceType := ChoiceType _ extremal_group_choiceMixin. Definition extremal_group_countMixin := CanCountMixin extgK. Canonical extremal_group_countType := CountType _ extremal_group_countMixin. Lemma bound_extremal_groups (c : extremal_group_type) : pickle c < 6. Proof. (* Goal: is_true (leq (S (@pickle extremal_group_countType c)) (S (S (S (S (S (S O))))))) *) by case: c. Qed. Definition extremal_group_finMixin := Finite.CountMixin bound_extremal_groups. Canonical extremal_group_finType := FinType _ extremal_group_finMixin. Definition extremal_class (A : {set gT}) := let m := #|A| in let p := pdiv m in let n := logn p m in if (n > 1) && (A \isog 'D_(2 ^ n)) then Dihedral else if (n > 2) && (A \isog 'Q_(2 ^ n)) then Quaternion else if (n > 3) && (A \isog 'SD_(2 ^ n)) then SemiDihedral else if (n > 2) && (A \isog 'Mod_(p ^ n)) then ModularGroup else NotExtremal. Definition extremal2 A := extremal_class A \in behead enum_extremal_groups. Lemma dihedral_classP : extremal_class G = Dihedral <-> (exists2 n, n > 1 & G \isog 'D_(2 ^ n)). Proof. (* Goal: iff (@eq extremal_group_type (extremal_class (@gval gT G)) Dihedral) (@ex2 nat (fun n : nat => is_true (leq (S (S O)) n)) (fun n : nat => is_true (@isog gT (dihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) n))))))))) *) rewrite /extremal_class; split=> [ | [n n_gt1 isoG]]. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) (logn (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))))) (@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)))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (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))))) (@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)))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (modular_gtype (expn (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))))) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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)))))))))))) then ModularGroup else NotExtremal) Dihedral *) (* Goal: forall _ : @eq extremal_group_type (if andb (leq (S (S O)) (logn (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))))) (@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)))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (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))))) (@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)))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (modular_gtype (expn (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))))) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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)))))))))))) then ModularGroup else NotExtremal) Dihedral, @ex2 nat (fun n : nat => is_true (leq (S (S O)) n)) (fun n : nat => is_true (@isog gT (dihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) n)))))))) *) by move: (logn _ _) => n; do 4?case: ifP => //; case/andP; exists n. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) (logn (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))))) (@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)))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (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))))) (@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)))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (modular_gtype (expn (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))))) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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)))))))))))) then ModularGroup else NotExtremal) Dihedral *) rewrite (card_isog isoG) card_2dihedral // -(ltn_predK n_gt1) pdiv_pfactor //. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n)))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n)))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n)))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n)))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n)))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n)))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n))))) (@isog gT (modular_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n)))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n)))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n))))))))))) then ModularGroup else NotExtremal) Dihedral *) by rewrite pfactorK // (ltn_predK n_gt1) n_gt1 isoG. Qed. Lemma quaternion_classP : extremal_class G = Quaternion <-> (exists2 n, n > 2 & G \isog 'Q_(2 ^ n)). Proof. (* Goal: iff (@eq extremal_group_type (extremal_class (@gval gT G)) Quaternion) (@ex2 nat (fun n : nat => is_true (leq (S (S (S O))) n)) (fun n : nat => is_true (@isog gT (quaternion_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) n))))))))) *) rewrite /extremal_class; split=> [ | [n n_gt2 isoG]]. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) (logn (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))))) (@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)))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (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))))) (@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)))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (modular_gtype (expn (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))))) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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)))))))))))) then ModularGroup else NotExtremal) Quaternion *) (* Goal: forall _ : @eq extremal_group_type (if andb (leq (S (S O)) (logn (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))))) (@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)))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (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))))) (@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)))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (modular_gtype (expn (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))))) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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)))))))))))) then ModularGroup else NotExtremal) Quaternion, @ex2 nat (fun n : nat => is_true (leq (S (S (S O))) n)) (fun n : nat => is_true (@isog gT (quaternion_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) n)))))))) *) by move: (logn _ _) => n; do 4?case: ifP => //; case/andP; exists n. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) (logn (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))))) (@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)))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (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))))) (@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)))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (modular_gtype (expn (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))))) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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)))))))))))) then ModularGroup else NotExtremal) Quaternion *) rewrite (card_isog isoG) card_quaternion // -(ltn_predK n_gt2) pdiv_pfactor //. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n)))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n)))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n)))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n)))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n)))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n)))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n))))) (@isog gT (modular_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n)))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n)))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (S (S O)) (logn (S (S O)) (expn (S (S O)) (S (Nat.pred n))))))))))) then ModularGroup else NotExtremal) Quaternion *) rewrite pfactorK // (ltn_predK n_gt2) n_gt2 isoG. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) n) (@isog gT (dihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) n))))))) then Dihedral else if andb true true then Quaternion else if andb (leq (S (S (S (S O)))) n) (@isog gT (semidihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) n))))))) then SemiDihedral else if andb true (@isog gT (modular_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (S (S O)) n))))))) then ModularGroup else NotExtremal) Quaternion *) case: andP => // [[n_gt1 isoGD]]. (* Goal: @eq extremal_group_type Dihedral Quaternion *) have [[x y] genG [oy _ _]]:= generators_quaternion n_gt2 isoG. (* Goal: @eq extremal_group_type Dihedral Quaternion *) have [_ _ _ X'y] := genG. (* Goal: @eq extremal_group_type Dihedral Quaternion *) by case/dihedral2_structure: genG oy => // [[_ ->]]. Qed. Lemma semidihedral_classP : extremal_class G = SemiDihedral <-> (exists2 n, n > 3 & G \isog 'SD_(2 ^ n)). Proof. (* Goal: iff (@eq extremal_group_type (extremal_class (@gval gT G)) SemiDihedral) (@ex2 nat (fun n : nat => is_true (leq (S (S (S (S O)))) n)) (fun n : nat => is_true (@isog gT (semidihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) n))))))))) *) rewrite /extremal_class; split=> [ | [n n_gt3 isoG]]. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) (logn (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))))) (@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)))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (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))))) (@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)))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (modular_gtype (expn (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))))) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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)))))))))))) then ModularGroup else NotExtremal) SemiDihedral *) (* Goal: forall _ : @eq extremal_group_type (if andb (leq (S (S O)) (logn (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))))) (@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)))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (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))))) (@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)))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (modular_gtype (expn (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))))) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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)))))))))))) then ModularGroup else NotExtremal) SemiDihedral, @ex2 nat (fun n : nat => is_true (leq (S (S (S (S O)))) n)) (fun n : nat => is_true (@isog gT (semidihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))))))) *) by move: (logn _ _) => n; do 4?case: ifP => //; case/andP; exists n. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) (logn (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))))) (@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)))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (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))))) (@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)))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (modular_gtype (expn (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))))) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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)))))))))))) then ModularGroup else NotExtremal) SemiDihedral *) rewrite (card_isog isoG) card_semidihedral //. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) (logn (pdiv (expn (S (S O)) n)) (expn (S (S O)) n))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (pdiv (expn (S (S O)) n)) (expn (S (S O)) n)))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (pdiv (expn (S (S O)) n)) (expn (S (S O)) n)))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (pdiv (expn (S (S O)) n)) (expn (S (S O)) n))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (pdiv (expn (S (S O)) n)) (expn (S (S O)) n))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (pdiv (expn (S (S O)) n)) (expn (S (S O)) n)))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (pdiv (expn (S (S O)) n)) (expn (S (S O)) n)))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (pdiv (expn (S (S O)) n)) (expn (S (S O)) n))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (pdiv (expn (S (S O)) n)) (expn (S (S O)) n))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (pdiv (expn (S (S O)) n)) (expn (S (S O)) n)))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (pdiv (expn (S (S O)) n)) (expn (S (S O)) n)))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (pdiv (expn (S (S O)) n)) (expn (S (S O)) n))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (pdiv (expn (S (S O)) n)) (expn (S (S O)) n))) (@isog gT (modular_gtype (expn (pdiv (expn (S (S O)) n)) (logn (pdiv (expn (S (S O)) n)) (expn (S (S O)) n)))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (pdiv (expn (S (S O)) n)) (logn (pdiv (expn (S (S O)) n)) (expn (S (S O)) n)))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (pdiv (expn (S (S O)) n)) (logn (pdiv (expn (S (S O)) n)) (expn (S (S O)) n))))))))) then ModularGroup else NotExtremal) SemiDihedral *) rewrite -(ltn_predK n_gt3) pdiv_pfactor // pfactorK // (ltn_predK n_gt3) n_gt3. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) n) (@isog gT (dihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) n))))))) then Dihedral else if andb (leq (S (S (S O))) n) (@isog gT (quaternion_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) n))))))) then Quaternion else if andb true (@isog gT (semidihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) n))))))) then SemiDihedral else if andb (leq (S (S (S O))) n) (@isog gT (modular_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (S (S O)) n))))))) then ModularGroup else NotExtremal) SemiDihedral *) have [[x y] genG [oy _]]:= generators_semidihedral n_gt3 isoG. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) n) (@isog gT (dihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) n))))))) then Dihedral else if andb (leq (S (S (S O))) n) (@isog gT (quaternion_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) n))))))) then Quaternion else if andb true (@isog gT (semidihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) n))))))) then SemiDihedral else if andb (leq (S (S (S O))) n) (@isog gT (modular_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (S (S O)) n))))))) then ModularGroup else NotExtremal) SemiDihedral *) have [_ Gx _ X'y]:= genG. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) n) (@isog gT (dihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) n))))))) then Dihedral else if andb (leq (S (S (S O))) n) (@isog gT (quaternion_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) n))))))) then Quaternion else if andb true (@isog gT (semidihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) n))))))) then SemiDihedral else if andb (leq (S (S (S O))) n) (@isog gT (modular_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (S (S O)) n))))))) then ModularGroup else NotExtremal) SemiDihedral *) case: andP => [[n_gt1 isoGD]|_]. (* Goal: @eq extremal_group_type (if andb (leq (S (S (S O))) n) (@isog gT (quaternion_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) n))))))) then Quaternion else if andb true (@isog gT (semidihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) n))))))) then SemiDihedral else if andb (leq (S (S (S O))) n) (@isog gT (modular_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (S (S O)) n))))))) then ModularGroup else NotExtremal) SemiDihedral *) (* Goal: @eq extremal_group_type Dihedral SemiDihedral *) have [[_ oxy _ _] _ _ _]:= semidihedral_structure n_gt3 genG isoG oy. (* Goal: @eq extremal_group_type (if andb (leq (S (S (S O))) n) (@isog gT (quaternion_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) n))))))) then Quaternion else if andb true (@isog gT (semidihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) n))))))) then SemiDihedral else if andb (leq (S (S (S O))) n) (@isog gT (modular_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (S (S O)) n))))))) then ModularGroup else NotExtremal) SemiDihedral *) (* Goal: @eq extremal_group_type Dihedral SemiDihedral *) case: (dihedral2_structure n_gt1 genG isoGD) oxy => [[_ ->]] //. (* Goal: @eq extremal_group_type (if andb (leq (S (S (S O))) n) (@isog gT (quaternion_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) n))))))) then Quaternion else if andb true (@isog gT (semidihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) n))))))) then SemiDihedral else if andb (leq (S (S (S O))) n) (@isog gT (modular_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (S (S O)) n))))))) then ModularGroup else NotExtremal) SemiDihedral *) (* 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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@cycle gT x))))) *) by rewrite !inE !groupMl ?cycle_id in X'y *. case: andP => // [[n_gt2 isoGQ]|]; last by rewrite isoG. by case: (quaternion_structure n_gt2 genG isoGQ) oy => [[_ ->]]. Qed. Qed. Lemma odd_not_extremal2 : odd #|G| -> ~~ extremal2 G. Proof. (* Goal: forall _ : is_true (odd (@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 (negb (extremal2 (@gval gT G))) *) rewrite /extremal2 /extremal_class; case: logn => // n'. (* Goal: forall _ : is_true (odd (@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 (negb (@in_mem extremal_group_type (if andb (leq (S (S O)) (S n')) (@isog gT (dihedral_gtype (expn (S (S O)) (S n'))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (S n'))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (S n')))))))) then Dihedral else if andb (leq (S (S (S O))) (S n')) (@isog gT (quaternion_gtype (expn (S (S O)) (S n'))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (S n'))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (S n')))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (S n')) (@isog gT (semidihedral_gtype (expn (S (S O)) (S n'))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (S n'))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (S n')))))))) then SemiDihedral else if andb (leq (S (S (S O))) (S n')) (@isog gT (modular_gtype (expn (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))))) (S n'))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (S n'))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (S n')))))))) then ModularGroup else NotExtremal) (@mem (Equality.sort extremal_group_eqType) (seq_predType extremal_group_eqType) (@behead extremal_group_type enum_extremal_groups)))) *) case: andP => [[n_gt1 isoG] | _]. (* Goal: forall _ : is_true (odd (@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 (negb (@in_mem extremal_group_type (if andb (leq (S (S (S O))) (S n')) (@isog gT (quaternion_gtype (expn (S (S O)) (S n'))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (S n'))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (S n')))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (S n')) (@isog gT (semidihedral_gtype (expn (S (S O)) (S n'))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (S n'))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (S n')))))))) then SemiDihedral else if andb (leq (S (S (S O))) (S n')) (@isog gT (modular_gtype (expn (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))))) (S n'))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (S n'))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (S n')))))))) then ModularGroup else NotExtremal) (@mem (Equality.sort extremal_group_eqType) (seq_predType extremal_group_eqType) (@behead extremal_group_type enum_extremal_groups)))) *) (* Goal: forall _ : is_true (odd (@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 (negb (@in_mem extremal_group_type Dihedral (@mem (Equality.sort extremal_group_eqType) (seq_predType extremal_group_eqType) (@behead extremal_group_type enum_extremal_groups)))) *) by rewrite (card_isog isoG) card_2dihedral ?odd_exp. (* Goal: forall _ : is_true (odd (@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 (negb (@in_mem extremal_group_type (if andb (leq (S (S (S O))) (S n')) (@isog gT (quaternion_gtype (expn (S (S O)) (S n'))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (S n'))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (S n')))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (S n')) (@isog gT (semidihedral_gtype (expn (S (S O)) (S n'))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (S n'))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (S n')))))))) then SemiDihedral else if andb (leq (S (S (S O))) (S n')) (@isog gT (modular_gtype (expn (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))))) (S n'))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (S n'))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (S n')))))))) then ModularGroup else NotExtremal) (@mem (Equality.sort extremal_group_eqType) (seq_predType extremal_group_eqType) (@behead extremal_group_type enum_extremal_groups)))) *) case: andP => [[n_gt2 isoG] | _]. (* Goal: forall _ : is_true (odd (@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 (negb (@in_mem extremal_group_type (if andb (leq (S (S (S (S O)))) (S n')) (@isog gT (semidihedral_gtype (expn (S (S O)) (S n'))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (S n'))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (S n')))))))) then SemiDihedral else if andb (leq (S (S (S O))) (S n')) (@isog gT (modular_gtype (expn (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))))) (S n'))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (S n'))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (S n')))))))) then ModularGroup else NotExtremal) (@mem (Equality.sort extremal_group_eqType) (seq_predType extremal_group_eqType) (@behead extremal_group_type enum_extremal_groups)))) *) (* Goal: forall _ : is_true (odd (@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 (negb (@in_mem extremal_group_type Quaternion (@mem (Equality.sort extremal_group_eqType) (seq_predType extremal_group_eqType) (@behead extremal_group_type enum_extremal_groups)))) *) by rewrite (card_isog isoG) card_quaternion ?odd_exp. (* Goal: forall _ : is_true (odd (@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 (negb (@in_mem extremal_group_type (if andb (leq (S (S (S (S O)))) (S n')) (@isog gT (semidihedral_gtype (expn (S (S O)) (S n'))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (S n'))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (S n')))))))) then SemiDihedral else if andb (leq (S (S (S O))) (S n')) (@isog gT (modular_gtype (expn (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))))) (S n'))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (S n'))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (S n')))))))) then ModularGroup else NotExtremal) (@mem (Equality.sort extremal_group_eqType) (seq_predType extremal_group_eqType) (@behead extremal_group_type enum_extremal_groups)))) *) case: andP => [[n_gt3 isoG] | _]. (* Goal: forall _ : is_true (odd (@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 (negb (@in_mem extremal_group_type (if andb (leq (S (S (S O))) (S n')) (@isog gT (modular_gtype (expn (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))))) (S n'))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (S n'))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (S n')))))))) then ModularGroup else NotExtremal) (@mem (Equality.sort extremal_group_eqType) (seq_predType extremal_group_eqType) (@behead extremal_group_type enum_extremal_groups)))) *) (* Goal: forall _ : is_true (odd (@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 (negb (@in_mem extremal_group_type SemiDihedral (@mem (Equality.sort extremal_group_eqType) (seq_predType extremal_group_eqType) (@behead extremal_group_type enum_extremal_groups)))) *) by rewrite (card_isog isoG) card_semidihedral ?odd_exp. (* Goal: forall _ : is_true (odd (@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 (negb (@in_mem extremal_group_type (if andb (leq (S (S (S O))) (S n')) (@isog gT (modular_gtype (expn (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))))) (S n'))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (S n'))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (S n')))))))) then ModularGroup else NotExtremal) (@mem (Equality.sort extremal_group_eqType) (seq_predType extremal_group_eqType) (@behead extremal_group_type enum_extremal_groups)))) *) by case: ifP. Qed. Lemma modular_group_classP : extremal_class G = ModularGroup <-> (exists2 p, prime p & exists2 n, n >= (p == 2) + 3 & G \isog 'Mod_(p ^ n)). Proof. (* Goal: iff (@eq extremal_group_type (extremal_class (@gval gT G)) ModularGroup) (@ex2 nat (fun p : nat => is_true (prime p)) (fun p : nat => @ex2 nat (fun n : nat => is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S (S (S O)))) n)) (fun n : nat => is_true (@isog gT (modular_gtype (expn p n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn p n)))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn p n)))))))))) *) rewrite /extremal_class; split=> [ | [p p_pr [n n_gt23 isoG]]]. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) (logn (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))))) (@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)))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (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))))) (@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)))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (modular_gtype (expn (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))))) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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)))))))))))) then ModularGroup else NotExtremal) ModularGroup *) (* Goal: forall _ : @eq extremal_group_type (if andb (leq (S (S O)) (logn (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))))) (@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)))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (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))))) (@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)))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (modular_gtype (expn (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))))) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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)))))))))))) then ModularGroup else NotExtremal) ModularGroup, @ex2 nat (fun p : nat => is_true (prime p)) (fun p : nat => @ex2 nat (fun n : nat => is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S (S (S O)))) n)) (fun n : nat => is_true (@isog gT (modular_gtype (expn p n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn p n)))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn p n))))))))) *) move: (pdiv _) => p; set n := logn p _; do 4?case: ifP => //. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) (logn (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))))) (@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)))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (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))))) (@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)))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (modular_gtype (expn (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))))) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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)))))))))))) then ModularGroup else NotExtremal) ModularGroup *) (* Goal: forall (_ : is_true (andb (leq (S (S (S O))) n) (@isog gT (modular_gtype (expn p n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn p n)))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn p n))))))))) (_ : @eq bool (andb (leq (S (S (S (S O)))) n) (@isog gT (semidihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) n)))))))) false) (_ : @eq bool (andb (leq (S (S (S O))) n) (@isog gT (quaternion_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) n)))))))) false) (_ : @eq bool (andb (leq (S (S O)) n) (@isog gT (dihedral_gtype (expn (S (S O)) n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) n)))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) n)))))))) false) (_ : @eq extremal_group_type ModularGroup ModularGroup), @ex2 nat (fun p : nat => is_true (prime p)) (fun p : nat => @ex2 nat (fun n2 : nat => is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S (S (S O)))) n2)) (fun n2 : nat => is_true (@isog gT (modular_gtype (expn p n2)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn p n2)))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn p n2))))))))) *) case/andP=> n_gt2 isoG _ _; rewrite ltnW //= => not_isoG _. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) (logn (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))))) (@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)))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (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))))) (@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)))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (modular_gtype (expn (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))))) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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)))))))))))) then ModularGroup else NotExtremal) ModularGroup *) (* Goal: @ex2 nat (fun p : nat => is_true (prime p)) (fun p : nat => @ex2 nat (fun n : nat => is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S (S (S O)))) n)) (fun n : nat => is_true (@isog gT (modular_gtype (expn p n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn p n)))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn p n))))))))) *) exists p; first by move: n_gt2; rewrite /n lognE; case (prime p). (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) (logn (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))))) (@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)))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (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))))) (@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)))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (modular_gtype (expn (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))))) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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)))))))))))) then ModularGroup else NotExtremal) ModularGroup *) (* Goal: @ex2 nat (fun n : nat => is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S (S (S O)))) n)) (fun n : nat => is_true (@isog gT (modular_gtype (expn p n)) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn p n)))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn p n)))))))) *) exists n => //; case: eqP => // p2; rewrite ltn_neqAle; case: eqP => // n3. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) (logn (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))))) (@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)))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (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))))) (@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)))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (modular_gtype (expn (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))))) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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)))))))))))) then ModularGroup else NotExtremal) ModularGroup *) (* Goal: is_true (andb (negb true) (leq (S (S (S O))) n)) *) by case/idP: not_isoG; rewrite p2 -n3 in isoG *. have n_gt2 := leq_trans (leq_addl _ _) n_gt23; have n_gt1 := ltnW n_gt2. have n_gt0 := ltnW n_gt1; have def_n := prednK n_gt0. have [[x y] genG mod_xy] := generators_modular_group p_pr n_gt2 isoG. case/modular_group_structure: (genG) => // _ _ [_ _ nil2G] _ _. have [oG _ _ _] := genG; have [oy _] := mod_xy. rewrite oG -def_n pdiv_pfactor // def_n pfactorK // n_gt1 n_gt2 {}isoG /=. case: (ltngtP p 2) => [|p_gt2|p2]; first by rewrite ltnNge prime_gt1. rewrite !(isog_sym G) !isogEcard card_2dihedral ?card_quaternion //= oG. rewrite leq_exp2r // leqNgt p_gt2 !andbF; case: and3P=> // [[n_gt3 _]]. by rewrite card_semidihedral // leq_exp2r // leqNgt p_gt2. rewrite p2 in genG oy n_gt23; rewrite n_gt23. have: nil_class G <> n.-1. (* Goal: @eq extremal_group_type (if andb (leq (S (S O)) (logn (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))))) (@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)))))) (@isog gT (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Dihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then Quaternion else if andb (leq (S (S (S (S O)))) (logn (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))))) (@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)))))) (@isog gT (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (semidihedral_gtype (expn (S (S O)) (logn (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))))) (@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)))))))))))) then SemiDihedral else if andb (leq (S (S (S O))) (logn (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))))) (@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)))))) (@isog gT (modular_gtype (expn (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))))) (logn (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))))) (@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) (@setTfor (FinGroup.arg_finType (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (modular_gtype (expn (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))))) (logn (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))))) (@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)))))))))))) then ModularGroup else NotExtremal) ModularGroup *) (* Goal: forall _ : not (@eq nat (@nil_class gT (@gval gT G)) (Nat.pred n)), is_true (andb (negb true) (leq (S (S (S O))) n)) *) (* Goal: not (@eq nat (@nil_class gT (@gval gT G)) (Nat.pred n)) *) by apply/eqP; rewrite neq_ltn -ltnS nil2G def_n n_gt23. case: ifP => [isoG | _]; first by case/dihedral2_structure: genG => // _ []. case: ifP => [isoG | _]; first by case/quaternion_structure: genG => // _ []. by case: ifP => // isoG; case/semidihedral_structure: genG => // _ []. Qed. Qed. End ExtremalClass. Theorem extremal2_structure (gT : finGroupType) (G : {group gT}) n x y : let cG := extremal_class G in let m := (2 ^ n)%N in let q := (2 ^ n.-1)%N in let r := (2 ^ n.-2)%N in Proof. (* Goal: let cG := @extremal_class gT (@gval gT G) in let m := expn (S (S O)) n in let q := expn (S (S O)) (Nat.pred n) in let r := expn (S (S O)) (Nat.pred (Nat.pred n)) in let X := @cycle gT x in let yG := @class gT y (@gval gT G) in let xyG := @class gT (@mulg (FinGroup.base gT) x y) (@gval gT G) in let My := @generated gT yG in let Mxy := @generated gT xyG in forall (_ : @extremal_generators gT (@gval gT G) (S (S O)) n (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (_ : is_true (@extremal2 gT (@gval gT G))) (_ : is_true (implb (@eq_op extremal_group_eqType cG SemiDihedral) (@eq_op nat_eqType (@order gT y) (S (S O))))), and5 (and4 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @eq_op extremal_group_eqType cG Quaternion then partial_product gT X (@cycle gT y) else semidirect_product gT X (@cycle gT y)) (@gval gT G)) (if @eq_op extremal_group_eqType cG SemiDihedral then @eq nat (@order gT (@mulg (FinGroup.base gT) x y)) (S (S (S (S O)))) else @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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X))) (fun z : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT z) (if @eq_op extremal_group_eqType cG Dihedral then S (S O) else S (S (S (S O))))) (inPhantom (forall z : FinGroup.arg_sort (FinGroup.base gT), @eq nat (@order gT z) (if @eq_op extremal_group_eqType cG Dihedral then S (S O) else S (S (S (S O))))))) (if negb (@eq_op extremal_group_eqType cG Quaternion) then True else @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 z : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq nat (@order gT z) (S (S O)), @eq (FinGroup.arg_sort (FinGroup.base gT)) z (@expgn (FinGroup.base gT) x r)) (inPhantom (forall (z : FinGroup.arg_sort (FinGroup.base gT)) (_ : @eq nat (@order gT z) (S (S O))), @eq (FinGroup.arg_sort (FinGroup.base gT)) z (@expgn (FinGroup.base gT) x r)))) (@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)) 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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X))) (fun t z : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT t z) (if @eq_op extremal_group_eqType cG SemiDihedral then @expgn (FinGroup.base gT) t (Nat.pred r) else @invg (FinGroup.base gT) t)) (inPhantom (forall t z : FinGroup.arg_sort (FinGroup.base gT), @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT t z) (if @eq_op extremal_group_eqType cG SemiDihedral then @expgn (FinGroup.base gT) t (Nat.pred r) else @invg (FinGroup.base gT) t))))) (and4 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@derived_at (S O) gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x (S (S O))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Frattini gT (@gval gT G)) (@derived_at (S O) gT (@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)) (@derived_at (S O) gT (@gval gT G))))) r) (@eq nat (@nil_class gT (@gval gT G)) (Nat.pred n))) (and4 (if leq (S (S (S O))) n then and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x r))) (@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)) (@center gT (@gval gT G))))) (S (S O))) else is_true (@abelem gT (S (S O)) (@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)) (if @eq_op extremal_group_eqType cG Quaternion then @cycle gT (@expgn (FinGroup.base gT) x r) else if @eq_op extremal_group_eqType cG SemiDihedral then My else @gval gT G)) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S (S O)) gT (@gval gT G)) (@gval gT G)) (forall (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 (S (S O)) k))))) (and3 (@eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@setU (FinGroup.finType (FinGroup.base gT)) yG xyG) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X)) (is_true (@disjoint (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)) yG)) (@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)) xyG)))) (forall H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))), @eq bool (@maximal gT (@gval gT H) (@gval gT G)) (@in_mem (GroupSet.sort (FinGroup.base gT)) (@gval gT H) (@mem (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT)))) (simplPredType (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))))) (@pred3 (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) X My Mxy))))) (if leq n (addn (nat_of_bool (@eq_op extremal_group_eqType cG Quaternion)) (S (S O))) then True else and5 (forall (U : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@cyclic gT U)) (_ : 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)) 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 G))))) (_ : @eq nat (@indexg gT (@gval gT G) U) (S (S O))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) U X) (is_true (if @eq_op extremal_group_eqType cG Quaternion then @isog gT (quaternion_gtype q) My (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype q))))) else @isog gT (dihedral_gtype q) My (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype q))))))) (@eq extremal_group_type (@extremal_class gT My) (if @eq_op extremal_group_eqType cG Quaternion then cG else Dihedral)) (is_true (if @eq_op extremal_group_eqType cG Dihedral then @isog gT (dihedral_gtype q) Mxy (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype q))))) else @isog gT (quaternion_gtype q) Mxy (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype q))))))) (@eq extremal_group_type (@extremal_class gT Mxy) (if @eq_op extremal_group_eqType cG Dihedral then cG else Quaternion))) *) move=> cG m q r X yG xyG My Mxy genG; have [oG _ _ _] := genG. (* Goal: forall (_ : is_true (@extremal2 gT (@gval gT G))) (_ : is_true (implb (@eq_op extremal_group_eqType cG SemiDihedral) (@eq_op nat_eqType (@order gT y) (S (S O))))), and5 (and4 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @eq_op extremal_group_eqType cG Quaternion then partial_product gT X (@cycle gT y) else semidirect_product gT X (@cycle gT y)) (@gval gT G)) (if @eq_op extremal_group_eqType cG SemiDihedral then @eq nat (@order gT (@mulg (FinGroup.base gT) x y)) (S (S (S (S O)))) else @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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X))) (fun z : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT z) (if @eq_op extremal_group_eqType cG Dihedral then S (S O) else S (S (S (S O))))) (inPhantom (forall z : FinGroup.arg_sort (FinGroup.base gT), @eq nat (@order gT z) (if @eq_op extremal_group_eqType cG Dihedral then S (S O) else S (S (S (S O))))))) (if negb (@eq_op extremal_group_eqType cG Quaternion) then True else @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 z : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq nat (@order gT z) (S (S O)), @eq (FinGroup.arg_sort (FinGroup.base gT)) z (@expgn (FinGroup.base gT) x r)) (inPhantom (forall (z : FinGroup.arg_sort (FinGroup.base gT)) (_ : @eq nat (@order gT z) (S (S O))), @eq (FinGroup.arg_sort (FinGroup.base gT)) z (@expgn (FinGroup.base gT) x r)))) (@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)) 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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X))) (fun t z : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT t z) (if @eq_op extremal_group_eqType cG SemiDihedral then @expgn (FinGroup.base gT) t (Nat.pred r) else @invg (FinGroup.base gT) t)) (inPhantom (forall t z : FinGroup.arg_sort (FinGroup.base gT), @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT t z) (if @eq_op extremal_group_eqType cG SemiDihedral then @expgn (FinGroup.base gT) t (Nat.pred r) else @invg (FinGroup.base gT) t))))) (and4 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@derived_at (S O) gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x (S (S O))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Frattini gT (@gval gT G)) (@derived_at (S O) gT (@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)) (@derived_at (S O) gT (@gval gT G))))) r) (@eq nat (@nil_class gT (@gval gT G)) (Nat.pred n))) (and4 (if leq (S (S (S O))) n then and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x r))) (@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)) (@center gT (@gval gT G))))) (S (S O))) else is_true (@abelem gT (S (S O)) (@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)) (if @eq_op extremal_group_eqType cG Quaternion then @cycle gT (@expgn (FinGroup.base gT) x r) else if @eq_op extremal_group_eqType cG SemiDihedral then My else @gval gT G)) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S (S O)) gT (@gval gT G)) (@gval gT G)) (forall (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 (S (S O)) k))))) (and3 (@eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@setU (FinGroup.finType (FinGroup.base gT)) yG xyG) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X)) (is_true (@disjoint (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)) yG)) (@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)) xyG)))) (forall H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))), @eq bool (@maximal gT (@gval gT H) (@gval gT G)) (@in_mem (GroupSet.sort (FinGroup.base gT)) (@gval gT H) (@mem (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT)))) (simplPredType (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))))) (@pred3 (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) X My Mxy))))) (if leq n (addn (nat_of_bool (@eq_op extremal_group_eqType cG Quaternion)) (S (S O))) then True else and5 (forall (U : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@cyclic gT U)) (_ : 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)) 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 G))))) (_ : @eq nat (@indexg gT (@gval gT G) U) (S (S O))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) U X) (is_true (if @eq_op extremal_group_eqType cG Quaternion then @isog gT (quaternion_gtype q) My (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype q))))) else @isog gT (dihedral_gtype q) My (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype q))))))) (@eq extremal_group_type (@extremal_class gT My) (if @eq_op extremal_group_eqType cG Quaternion then cG else Dihedral)) (is_true (if @eq_op extremal_group_eqType cG Dihedral then @isog gT (dihedral_gtype q) Mxy (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype q))))) else @isog gT (quaternion_gtype q) Mxy (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype q))))))) (@eq extremal_group_type (@extremal_class gT Mxy) (if @eq_op extremal_group_eqType cG Dihedral then cG else Quaternion))) *) have logG: logn (pdiv #|G|) #|G| = n by rewrite oG pfactorKpdiv. (* Goal: forall (_ : is_true (@extremal2 gT (@gval gT G))) (_ : is_true (implb (@eq_op extremal_group_eqType cG SemiDihedral) (@eq_op nat_eqType (@order gT y) (S (S O))))), and5 (and4 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @eq_op extremal_group_eqType cG Quaternion then partial_product gT X (@cycle gT y) else semidirect_product gT X (@cycle gT y)) (@gval gT G)) (if @eq_op extremal_group_eqType cG SemiDihedral then @eq nat (@order gT (@mulg (FinGroup.base gT) x y)) (S (S (S (S O)))) else @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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X))) (fun z : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT z) (if @eq_op extremal_group_eqType cG Dihedral then S (S O) else S (S (S (S O))))) (inPhantom (forall z : FinGroup.arg_sort (FinGroup.base gT), @eq nat (@order gT z) (if @eq_op extremal_group_eqType cG Dihedral then S (S O) else S (S (S (S O))))))) (if negb (@eq_op extremal_group_eqType cG Quaternion) then True else @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 z : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq nat (@order gT z) (S (S O)), @eq (FinGroup.arg_sort (FinGroup.base gT)) z (@expgn (FinGroup.base gT) x r)) (inPhantom (forall (z : FinGroup.arg_sort (FinGroup.base gT)) (_ : @eq nat (@order gT z) (S (S O))), @eq (FinGroup.arg_sort (FinGroup.base gT)) z (@expgn (FinGroup.base gT) x r)))) (@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)) 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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X))) (fun t z : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT t z) (if @eq_op extremal_group_eqType cG SemiDihedral then @expgn (FinGroup.base gT) t (Nat.pred r) else @invg (FinGroup.base gT) t)) (inPhantom (forall t z : FinGroup.arg_sort (FinGroup.base gT), @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT t z) (if @eq_op extremal_group_eqType cG SemiDihedral then @expgn (FinGroup.base gT) t (Nat.pred r) else @invg (FinGroup.base gT) t))))) (and4 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@derived_at (S O) gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x (S (S O))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Frattini gT (@gval gT G)) (@derived_at (S O) gT (@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)) (@derived_at (S O) gT (@gval gT G))))) r) (@eq nat (@nil_class gT (@gval gT G)) (Nat.pred n))) (and4 (if leq (S (S (S O))) n then and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x r))) (@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)) (@center gT (@gval gT G))))) (S (S O))) else is_true (@abelem gT (S (S O)) (@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)) (if @eq_op extremal_group_eqType cG Quaternion then @cycle gT (@expgn (FinGroup.base gT) x r) else if @eq_op extremal_group_eqType cG SemiDihedral then My else @gval gT G)) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S (S O)) gT (@gval gT G)) (@gval gT G)) (forall (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 (S (S O)) k))))) (and3 (@eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@setU (FinGroup.finType (FinGroup.base gT)) yG xyG) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X)) (is_true (@disjoint (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)) yG)) (@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)) xyG)))) (forall H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))), @eq bool (@maximal gT (@gval gT H) (@gval gT G)) (@in_mem (GroupSet.sort (FinGroup.base gT)) (@gval gT H) (@mem (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT)))) (simplPredType (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))))) (@pred3 (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) X My Mxy))))) (if leq n (addn (nat_of_bool (@eq_op extremal_group_eqType cG Quaternion)) (S (S O))) then True else and5 (forall (U : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@cyclic gT U)) (_ : 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)) 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 G))))) (_ : @eq nat (@indexg gT (@gval gT G) U) (S (S O))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) U X) (is_true (if @eq_op extremal_group_eqType cG Quaternion then @isog gT (quaternion_gtype q) My (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype q))))) else @isog gT (dihedral_gtype q) My (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype q))))))) (@eq extremal_group_type (@extremal_class gT My) (if @eq_op extremal_group_eqType cG Quaternion then cG else Dihedral)) (is_true (if @eq_op extremal_group_eqType cG Dihedral then @isog gT (dihedral_gtype q) Mxy (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype q))))) else @isog gT (quaternion_gtype q) Mxy (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype q))))))) (@eq extremal_group_type (@extremal_class gT Mxy) (if @eq_op extremal_group_eqType cG Dihedral then cG else Quaternion))) *) rewrite /extremal2 -/cG; do [rewrite {1}/extremal_class /= {}logG] in cG *. case: ifP => [isoG | _] in cG * => [_ _ /=|]. (* Goal: forall (_ : is_true (@extremal2 gT (@gval gT G))) (_ : is_true (implb (@eq_op extremal_group_eqType cG SemiDihedral) (@eq_op nat_eqType (@order gT y) (S (S O))))), and5 (and4 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @eq_op extremal_group_eqType cG Quaternion then partial_product gT X (@cycle gT y) else semidirect_product gT X (@cycle gT y)) (@gval gT G)) (if @eq_op extremal_group_eqType cG SemiDihedral then @eq nat (@order gT (@mulg (FinGroup.base gT) x y)) (S (S (S (S O)))) else @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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X))) (fun z : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT z) (if @eq_op extremal_group_eqType cG Dihedral then S (S O) else S (S (S (S O))))) (inPhantom (forall z : FinGroup.arg_sort (FinGroup.base gT), @eq nat (@order gT z) (if @eq_op extremal_group_eqType cG Dihedral then S (S O) else S (S (S (S O))))))) (if negb (@eq_op extremal_group_eqType cG Quaternion) then True else @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 z : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq nat (@order gT z) (S (S O)), @eq (FinGroup.arg_sort (FinGroup.base gT)) z (@expgn (FinGroup.base gT) x r)) (inPhantom (forall (z : FinGroup.arg_sort (FinGroup.base gT)) (_ : @eq nat (@order gT z) (S (S O))), @eq (FinGroup.arg_sort (FinGroup.base gT)) z (@expgn (FinGroup.base gT) x r)))) (@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)) 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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X))) (fun t z : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT t z) (if @eq_op extremal_group_eqType cG SemiDihedral then @expgn (FinGroup.base gT) t (Nat.pred r) else @invg (FinGroup.base gT) t)) (inPhantom (forall t z : FinGroup.arg_sort (FinGroup.base gT), @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT t z) (if @eq_op extremal_group_eqType cG SemiDihedral then @expgn (FinGroup.base gT) t (Nat.pred r) else @invg (FinGroup.base gT) t))))) (and4 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@derived_at (S O) gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x (S (S O))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Frattini gT (@gval gT G)) (@derived_at (S O) gT (@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)) (@derived_at (S O) gT (@gval gT G))))) r) (@eq nat (@nil_class gT (@gval gT G)) (Nat.pred n))) (and4 (is_true (@abelem gT (S (S O)) (@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)) (if @eq_op extremal_group_eqType cG Quaternion then @cycle gT (@expgn (FinGroup.base gT) x r) else if @eq_op extremal_group_eqType cG SemiDihedral then My else @gval gT G)) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S (S O)) gT (@gval gT G)) (@gval gT G)) (forall (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 (S (S O)) k))))) (and3 (@eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@setU (FinGroup.finType (FinGroup.base gT)) yG xyG) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X)) (is_true (@disjoint (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)) yG)) (@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)) xyG)))) (forall H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))), @eq bool (@maximal gT (@gval gT H) (@gval gT G)) (@in_mem (GroupSet.sort (FinGroup.base gT)) (@gval gT H) (@mem (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT)))) (simplPredType (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))))) (@pred3 (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) X My Mxy))))) (if leq n (addn (nat_of_bool (@eq_op extremal_group_eqType cG Quaternion)) (S (S O))) then True else and5 (forall (U : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@cyclic gT U)) (_ : 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)) 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 G))))) (_ : @eq nat (@indexg gT (@gval gT G) U) (S (S O))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) U X) (is_true (if @eq_op extremal_group_eqType cG Quaternion then @isog gT (quaternion_gtype q) My (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype q))))) else @isog gT (dihedral_gtype q) My (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype q))))))) (@eq extremal_group_type (@extremal_class gT My) (if @eq_op extremal_group_eqType cG Quaternion then cG else Dihedral)) (is_true (if @eq_op extremal_group_eqType cG Dihedral then @isog gT (dihedral_gtype q) Mxy (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype q))))) else @isog gT (quaternion_gtype q) Mxy (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype q))))))) (@eq extremal_group_type (@extremal_class gT Mxy) (if @eq_op extremal_group_eqType cG Dihedral then cG else Quaternion))) *) (* Goal: and5 (and4 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @eq_op extremal_group_eqType cG Quaternion then partial_product gT X (@cycle gT y) else semidirect_product gT X (@cycle gT y)) (@gval gT G)) (if @eq_op extremal_group_eqType cG SemiDihedral then @eq nat (@order gT (@mulg (FinGroup.base gT) x y)) (S (S (S (S O)))) else @prop_in1 (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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X))) (fun z : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT z) (if @eq_op extremal_group_eqType cG Dihedral then S (S O) else S (S (S (S O))))) (inPhantom (forall z : FinGroup.arg_sort (FinGroup.base gT), @eq nat (@order gT z) (if @eq_op extremal_group_eqType cG Dihedral then S (S O) else S (S (S (S O))))))) (if negb (@eq_op extremal_group_eqType cG Quaternion) then True else @prop_in1 (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 G))) (fun z : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq nat (@order gT z) (S (S O)), @eq (FinGroup.arg_sort (FinGroup.base gT)) z (@expgn (FinGroup.base gT) x r)) (inPhantom (forall (z : FinGroup.arg_sort (FinGroup.base gT)) (_ : @eq nat (@order gT z) (S (S O))), @eq (FinGroup.arg_sort (FinGroup.base gT)) z (@expgn (FinGroup.base gT) x r)))) (@prop_in11 (FinGroup.arg_sort (FinGroup.base gT)) (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)) 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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X))) (fun t z : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT t z) (if @eq_op extremal_group_eqType cG SemiDihedral then @expgn (FinGroup.base gT) t (Nat.pred r) else @invg (FinGroup.base gT) t)) (inPhantom (forall t z : FinGroup.arg_sort (FinGroup.base gT), @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT t z) (if @eq_op extremal_group_eqType cG SemiDihedral then @expgn (FinGroup.base gT) t (Nat.pred r) else @invg (FinGroup.base gT) t))))) (and4 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@derived_at (S O) gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x (S (S O))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Frattini gT (@gval gT G)) (@derived_at (S O) gT (@gval gT G))) (@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)) (@derived_at (S O) gT (@gval gT G))))) r) (@eq nat (@nil_class gT (@gval gT G)) (Nat.pred n))) (and4 (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@center gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x r))) (@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)) (@center gT (@gval gT G))))) (S (S O)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm (S O) gT (@gval gT G)) (if @eq_op extremal_group_eqType cG Quaternion then @cycle gT (@expgn (FinGroup.base gT) x r) else if @eq_op extremal_group_eqType cG SemiDihedral then My else @gval gT G)) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm (S (S O)) gT (@gval gT G)) (@gval gT G)) (forall (k : nat) (_ : is_true (leq (S O) k)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Mho k gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x (expn (S (S O)) k))))) (and3 (@eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (@setU (FinGroup.finType (FinGroup.base gT)) yG xyG) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X)) (is_true (@disjoint (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)) yG)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xyG)))) (forall H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))), @eq bool (@maximal gT (@gval gT H) (@gval gT G)) (@in_mem (GroupSet.sort (FinGroup.base gT)) (@gval gT H) (@mem (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (simplPredType (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@pred3 (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) X My Mxy))))) (if leq n (addn (nat_of_bool (@eq_op extremal_group_eqType cG Quaternion)) (S (S O))) then True else and5 (forall (U : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@cyclic gT U)) (_ : 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)) U)) (@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 nat (@indexg gT (@gval gT G) U) (S (S O))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) U X) (is_true (if @eq_op extremal_group_eqType cG Quaternion then @isog gT (quaternion_gtype q) My (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype q))))) else @isog gT (dihedral_gtype q) My (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype q))))))) (@eq extremal_group_type (@extremal_class gT My) (if @eq_op extremal_group_eqType cG Quaternion then cG else Dihedral)) (is_true (if @eq_op extremal_group_eqType cG Dihedral then @isog gT (dihedral_gtype q) Mxy (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype q))))) else @isog gT (quaternion_gtype q) Mxy (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype q))))))) (@eq extremal_group_type (@extremal_class gT Mxy) (if @eq_op extremal_group_eqType cG Dihedral then cG else Quaternion))) *) case/andP: isoG => n_gt1 isoG. have:= dihedral2_structure n_gt1 genG isoG; rewrite -/X -/q -/r -/yG -/xyG. case=> [[defG oX' invXX'] nilG [defOhm defMho] maxG defZ]. rewrite eqn_leq n_gt1 andbT add0n in defZ *; split=> //. split=> //; first by case: leqP defZ => // _ []. by apply/eqP; rewrite eqEsubset Ohm_sub -{1}defOhm Ohm_leq. case: leqP defZ => // n_gt2 [_ _ isoMy isoMxy defX]. have n1_gt1: n.-1 > 1 by rewrite -(subnKC n_gt2). by split=> //; apply/dihedral_classP; exists n.-1. case: ifP => [isoG | _] in cG * => [_ _ /=|]. case/andP: isoG => n_gt2 isoG; rewrite n_gt2 add1n. have:= quaternion_structure n_gt2 genG isoG; rewrite -/X -/q -/r -/yG -/xyG. case=> [[defG oX' invXX'] nilG [defZ oZ def2 [-> ->] defMho]]. case=> [[-> ->] maxG] isoM; split=> //. case: leqP isoM => // n_gt3 [//|isoMy isoMxy defX]. have n1_gt2: n.-1 > 2 by rewrite -(subnKC n_gt3). by split=> //; apply/quaternion_classP; exists n.-1. do [case: ifP => [isoG | _]; last by case: ifP] in cG * => /= _; move/eqnP=> oy. case/andP: isoG => n_gt3 isoG; rewrite (leqNgt n) (ltnW n_gt3) /=. have n1_gt2: n.-1 > 2 by rewrite -(subnKC n_gt3). have:= semidihedral_structure n_gt3 genG isoG oy. rewrite -/X -/q -/r -/yG -/xyG -/My -/Mxy. (* Goal: forall (_ : is_true (@extremal2 gT (@gval gT G))) (_ : is_true (implb (@eq_op extremal_group_eqType cG SemiDihedral) (@eq_op nat_eqType (@order gT y) (S (S O))))), and5 (and4 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @eq_op extremal_group_eqType cG Quaternion then partial_product gT X (@cycle gT y) else semidirect_product gT X (@cycle gT y)) (@gval gT G)) (if @eq_op extremal_group_eqType cG SemiDihedral then @eq nat (@order gT (@mulg (FinGroup.base gT) x y)) (S (S (S (S O)))) else @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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X))) (fun z : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT z) (if @eq_op extremal_group_eqType cG Dihedral then S (S O) else S (S (S (S O))))) (inPhantom (forall z : FinGroup.arg_sort (FinGroup.base gT), @eq nat (@order gT z) (if @eq_op extremal_group_eqType cG Dihedral then S (S O) else S (S (S (S O))))))) (if negb (@eq_op extremal_group_eqType cG Quaternion) then True else @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 z : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq nat (@order gT z) (S (S O)), @eq (FinGroup.arg_sort (FinGroup.base gT)) z (@expgn (FinGroup.base gT) x r)) (inPhantom (forall (z : FinGroup.arg_sort (FinGroup.base gT)) (_ : @eq nat (@order gT z) (S (S O))), @eq (FinGroup.arg_sort (FinGroup.base gT)) z (@expgn (FinGroup.base gT) x r)))) (@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)) 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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X))) (fun t z : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT t z) (if @eq_op extremal_group_eqType cG SemiDihedral then @expgn (FinGroup.base gT) t (Nat.pred r) else @invg (FinGroup.base gT) t)) (inPhantom (forall t z : FinGroup.arg_sort (FinGroup.base gT), @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT t z) (if @eq_op extremal_group_eqType cG SemiDihedral then @expgn (FinGroup.base gT) t (Nat.pred r) else @invg (FinGroup.base gT) t))))) (and4 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@derived_at (S O) gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x (S (S O))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Frattini gT (@gval gT G)) (@derived_at (S O) gT (@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)) (@derived_at (S O) gT (@gval gT G))))) r) (@eq nat (@nil_class gT (@gval gT G)) (Nat.pred n))) (and4 (is_true (@abelem gT (S (S O)) (@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)) (if @eq_op extremal_group_eqType cG Quaternion then @cycle gT (@expgn (FinGroup.base gT) x r) else if @eq_op extremal_group_eqType cG SemiDihedral then My else @gval gT G)) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S (S O)) gT (@gval gT G)) (@gval gT G)) (forall (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 (S (S O)) k))))) (and3 (@eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@setU (FinGroup.finType (FinGroup.base gT)) yG xyG) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X)) (is_true (@disjoint (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)) yG)) (@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)) xyG)))) (forall H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))), @eq bool (@maximal gT (@gval gT H) (@gval gT G)) (@in_mem (GroupSet.sort (FinGroup.base gT)) (@gval gT H) (@mem (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT)))) (simplPredType (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))))) (@pred3 (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) X My Mxy))))) (if leq n (addn (nat_of_bool (@eq_op extremal_group_eqType cG Quaternion)) (S (S O))) then True else and5 (forall (U : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@cyclic gT U)) (_ : 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)) 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 G))))) (_ : @eq nat (@indexg gT (@gval gT G) U) (S (S O))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) U X) (is_true (if @eq_op extremal_group_eqType cG Quaternion then @isog gT (quaternion_gtype q) My (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype q))))) else @isog gT (dihedral_gtype q) My (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype q))))))) (@eq extremal_group_type (@extremal_class gT My) (if @eq_op extremal_group_eqType cG Quaternion then cG else Dihedral)) (is_true (if @eq_op extremal_group_eqType cG Dihedral then @isog gT (dihedral_gtype q) Mxy (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype q))))) else @isog gT (quaternion_gtype q) Mxy (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype q))))))) (@eq extremal_group_type (@extremal_class gT Mxy) (if @eq_op extremal_group_eqType cG Dihedral then cG else Quaternion))) *) (* Goal: and5 (and4 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @eq_op extremal_group_eqType cG Quaternion then partial_product gT X (@cycle gT y) else semidirect_product gT X (@cycle gT y)) (@gval gT G)) (if @eq_op extremal_group_eqType cG SemiDihedral then @eq nat (@order gT (@mulg (FinGroup.base gT) x y)) (S (S (S (S O)))) else @prop_in1 (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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X))) (fun z : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT z) (if @eq_op extremal_group_eqType cG Dihedral then S (S O) else S (S (S (S O))))) (inPhantom (forall z : FinGroup.arg_sort (FinGroup.base gT), @eq nat (@order gT z) (if @eq_op extremal_group_eqType cG Dihedral then S (S O) else S (S (S (S O))))))) (if negb (@eq_op extremal_group_eqType cG Quaternion) then True else @prop_in1 (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 G))) (fun z : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq nat (@order gT z) (S (S O)), @eq (FinGroup.arg_sort (FinGroup.base gT)) z (@expgn (FinGroup.base gT) x r)) (inPhantom (forall (z : FinGroup.arg_sort (FinGroup.base gT)) (_ : @eq nat (@order gT z) (S (S O))), @eq (FinGroup.arg_sort (FinGroup.base gT)) z (@expgn (FinGroup.base gT) x r)))) (@prop_in11 (FinGroup.arg_sort (FinGroup.base gT)) (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)) 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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X))) (fun t z : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT t z) (if @eq_op extremal_group_eqType cG SemiDihedral then @expgn (FinGroup.base gT) t (Nat.pred r) else @invg (FinGroup.base gT) t)) (inPhantom (forall t z : FinGroup.arg_sort (FinGroup.base gT), @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT t z) (if @eq_op extremal_group_eqType cG SemiDihedral then @expgn (FinGroup.base gT) t (Nat.pred r) else @invg (FinGroup.base gT) t))))) (and4 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@derived_at (S O) gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x (S (S O))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Frattini gT (@gval gT G)) (@derived_at (S O) gT (@gval gT G))) (@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)) (@derived_at (S O) gT (@gval gT G))))) r) (@eq nat (@nil_class gT (@gval gT G)) (Nat.pred n))) (and4 (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@center gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x r))) (@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)) (@center gT (@gval gT G))))) (S (S O)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm (S O) gT (@gval gT G)) (if @eq_op extremal_group_eqType cG Quaternion then @cycle gT (@expgn (FinGroup.base gT) x r) else if @eq_op extremal_group_eqType cG SemiDihedral then My else @gval gT G)) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm (S (S O)) gT (@gval gT G)) (@gval gT G)) (forall (k : nat) (_ : is_true (leq (S O) k)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Mho k gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x (expn (S (S O)) k))))) (and3 (@eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (@setU (FinGroup.finType (FinGroup.base gT)) yG xyG) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) X)) (is_true (@disjoint (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)) yG)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xyG)))) (forall H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))), @eq bool (@maximal gT (@gval gT H) (@gval gT G)) (@in_mem (GroupSet.sort (FinGroup.base gT)) (@gval gT H) (@mem (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (simplPredType (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@pred3 (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) X My Mxy))))) (if leq n (addn (nat_of_bool (@eq_op extremal_group_eqType cG Quaternion)) (S (S O))) then True else and5 (forall (U : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@cyclic gT U)) (_ : 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)) U)) (@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 nat (@indexg gT (@gval gT G) U) (S (S O))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) U X) (is_true (if @eq_op extremal_group_eqType cG Quaternion then @isog gT (quaternion_gtype q) My (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype q))))) else @isog gT (dihedral_gtype q) My (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype q))))))) (@eq extremal_group_type (@extremal_class gT My) (if @eq_op extremal_group_eqType cG Quaternion then cG else Dihedral)) (is_true (if @eq_op extremal_group_eqType cG Dihedral then @isog gT (dihedral_gtype q) Mxy (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype q))))) else @isog gT (quaternion_gtype q) Mxy (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype q))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype q))))))) (@eq extremal_group_type (@extremal_class gT Mxy) (if @eq_op extremal_group_eqType cG Dihedral then cG else Quaternion))) *) case=> [[defG oxy invXX'] nilG [defZ oZ [-> ->] defMho] [[defX' tiX'] maxG]]. case=> isoMy isoMxy defX; do 2!split=> //. by apply/dihedral_classP; exists n.-1; first apply: ltnW. by apply/quaternion_classP; exists n.-1. Qed. Qed. Lemma maximal_cycle_extremal gT p (G X : {group gT}) : p.-group G -> ~~ abelian G -> cyclic X -> X \subset G -> #|G : X| = p -> Lemma cyclic_SCN gT p (G U : {group gT}) : p.-group G -> U \in 'SCN(G) -> ~~ abelian G -> cyclic U -> Proof. (* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) U (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@SCN gT (@gval gT G)))))) (_ : is_true (negb (@abelian gT (@gval gT G)))) (_ : is_true (@cyclic gT (@gval gT U))), or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) move=> pG /SCN_P[nsUG scUG] not_cGG cycU; have [sUG nUG] := andP nsUG. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) have [cUU pU] := (cyclic_abelian cycU, pgroupS sUG pG). (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) have ltUG: ~~ (G \subset U). (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: 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 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 U))))) *) by apply: contra not_cGG => sGU; apply: abelianS cUU. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) have ntU: U :!=: 1. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT U) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) *) by apply: contraNneq ltUG => U1; rewrite -scUG subsetIidl U1 cents1. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) have [p_pr _ [n oU]] := pgroup_pdiv pU ntU. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) have p_gt1 := prime_gt1 p_pr; have p_gt0 := ltnW p_gt1. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) have [u defU] := cyclicP cycU; have Uu: u \in U by rewrite defU cycle_id. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) have Gu := subsetP sUG u Uu; have p_u := mem_p_elt pG Gu. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) have defU1: 'Mho^1(U) = <[u ^+ p]> by rewrite defU (Mho_p_cycle _ p_u). (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) have modM1 (M : {group gT}): [/\ U \subset M, #|M : U| = p & extremal_class M = ModularGroup] -> M :=: 'C_M('Mho^1(U)) /\ 'Ohm_1(M)%G \in 'E_p^2(M). (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: forall _ : 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 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 M))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup), and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) - (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: forall _ : 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 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 M))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup), and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) case=> sUM iUM /modular_group_classP[q q_pr {n oU}[n n_gt23 isoM]]. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) have n_gt2: n > 2 by apply: leq_trans (leq_addl _ _) n_gt23. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) have def_n: n = (n - 3).+3 by rewrite -{1}(subnKC n_gt2). (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) have oM: #|M| = (q ^ n)%N by rewrite (card_isog isoM) card_modular_group. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) have pM: q.-group M by rewrite /pgroup oM pnat_exp pnat_id. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) have def_q: q = p; last rewrite {q q_pr}def_q in oM pM isoM n_gt23. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) (* Goal: @eq nat q p *) by apply/eqP; rewrite eq_sym [p == q](pgroupP pM) // -iUM dvdn_indexg. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) have [[x y] genM modM] := generators_modular_group p_pr n_gt2 isoM. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) case/modular_group_structure: genM => // _ [defZ _ oZ] _ defMho. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: forall _ : if @eq_op (prod_eqType nat_eqType nat_eqType) (@pair nat nat p n) (@pair nat nat (S (S O)) (S (S (S O)))) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@gval gT M)) (@gval gT M) else forall (k : nat) (_ : is_true (andb (leq (S O) k) (leq (S k) (Nat.pred n)))), and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT (@expgn (FinGroup.base gT) x (expn p (subn n (S k))))) (@cycle gT y)) (@Ohm k gT (@gval gT M))) (@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 k gT (@gval gT M))))) (expn p (S k))), and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) have ->: 'Mho^1(U) = 'Z(M). (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: forall _ : if @eq_op (prod_eqType nat_eqType nat_eqType) (@pair nat nat p n) (@pair nat nat (S (S O)) (S (S (S O)))) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@gval gT M)) (@gval gT M) else forall (k : nat) (_ : is_true (andb (leq (S O) k) (leq (S k) (Nat.pred n)))), and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT (@expgn (FinGroup.base gT) x (expn p (subn n (S k))))) (@cycle gT y)) (@Ohm k gT (@gval gT M))) (@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 k gT (@gval gT M))))) (expn p (S k))), and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@center gT (@gval gT M))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Mho (S O) gT (@gval gT U)) (@center gT (@gval gT M)) *) apply/eqP; rewrite eqEcard oZ defZ -(defMho 1%N) ?MhoS //= defU1 -orderE. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: forall _ : if @eq_op (prod_eqType nat_eqType nat_eqType) (@pair nat nat p n) (@pair nat nat (S (S O)) (S (S (S O)))) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@gval gT M)) (@gval gT M) else forall (k : nat) (_ : is_true (andb (leq (S O) k) (leq (S k) (Nat.pred n)))), and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT (@expgn (FinGroup.base gT) x (expn p (subn n (S k))))) (@cycle gT y)) (@Ohm k gT (@gval gT M))) (@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 k gT (@gval gT M))))) (expn p (S k))), and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@center gT (@gval gT M))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) (* Goal: is_true (leq (expn p (Nat.pred (Nat.pred n))) (@order gT (@expgn (FinGroup.base gT) u p))) *) suff ou: #[u] = (p * p ^ n.-2)%N by rewrite orderXdiv ou ?dvdn_mulr ?mulKn. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: forall _ : if @eq_op (prod_eqType nat_eqType nat_eqType) (@pair nat nat p n) (@pair nat nat (S (S O)) (S (S (S O)))) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@gval gT M)) (@gval gT M) else forall (k : nat) (_ : is_true (andb (leq (S O) k) (leq (S k) (Nat.pred n)))), and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT (@expgn (FinGroup.base gT) x (expn p (subn n (S k))))) (@cycle gT y)) (@Ohm k gT (@gval gT M))) (@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 k gT (@gval gT M))))) (expn p (S k))), and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@center gT (@gval gT M))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) (* Goal: @eq nat (@order gT u) (muln p (expn p (Nat.pred (Nat.pred n)))) *) by rewrite orderE -defU -(divg_indexS sUM) iUM oM def_n mulKn. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: forall _ : if @eq_op (prod_eqType nat_eqType nat_eqType) (@pair nat nat p n) (@pair nat nat (S (S O)) (S (S (S O)))) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@gval gT M)) (@gval gT M) else forall (k : nat) (_ : is_true (andb (leq (S O) k) (leq (S k) (Nat.pred n)))), and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT (@expgn (FinGroup.base gT) x (expn p (subn n (S k))))) (@cycle gT y)) (@Ohm k gT (@gval gT M))) (@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 k gT (@gval gT M))))) (expn p (S k))), and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@center gT (@gval gT M))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) case: eqP => [[p2 n3] | _ defOhm]; first by rewrite p2 n3 in n_gt23. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@center gT (@gval gT M))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) have{defOhm} [|defM1 oM1] := defOhm 1%N; first by rewrite def_n. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M) (@centraliser gT (@center gT (@gval gT M))))) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M)))))) *) split; rewrite ?(setIidPl _) //; first by rewrite centsC subsetIr. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT M))))) *) rewrite inE oM1 pfactorK // andbT inE Ohm_sub abelem_Ohm1 //. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: is_true (andb true (@abelian gT (@Ohm (S O) gT (@gval gT M)))) *) exact: (card_p2group_abelian p_pr oM1). (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) have ou: #[u] = (p ^ n.+1)%N by rewrite defU in oU. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) pose Gs := G / U; have pGs: p.-group Gs by rewrite quotient_pgroup. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) have ntGs: Gs != 1 by rewrite -subG1 quotient_sub1. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) have [_ _ [[|k] oGs]] := pgroup_pdiv pGs ntGs. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) have iUG: #|G : U| = p by rewrite -card_quotient ?oGs. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) case: (predU1P (maximal_cycle_extremal _ _ _ _ iUG)) => // [modG | ext2G]. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) by right; exists G; case: (modM1 G) => // <- ->; rewrite Ohm_char. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) by left; case: eqP ext2G => // <-. (* Goal: or (and3 (@eq nat p (S (S O))) (@eq nat (@indexg gT (@gval gT G) (@gval gT U)) (S (S O))) (is_true (@extremal2 gT (@gval gT G)))) (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun M : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT M) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT M) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT M)) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))))) *) pose M := 'C_G('Mho^1(U)); right; exists [group of M]. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) have sMG: M \subset G by apply: subsetIl. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) have [pM nUM] := (pgroupS sMG pG, subset_trans sMG nUG). (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) have sUM: U \subset M by rewrite subsetI sUG sub_abelian_cent ?Mho_sub. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) pose A := Aut U; have cAA: abelian A by rewrite Aut_cyclic_abelian. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) have sylAp: p.-Sylow(A) 'O_p(A) by rewrite nilpotent_pcore_Hall ?abelian_nil. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) have [f [injf sfGsA fG]]: exists f : {morphism Gs >-> {perm gT}}, [/\ 'injm f, f @* Gs \subset A & {in G, forall y, f (coset U y) u = u ^ y}]. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@morphism_for (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs (Phant (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))))) (fun f : @morphism_for (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs (Phant (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) => and3 (is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))) (@ker (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType gT (@gval gT U))))))))) (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 (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))) (@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))) A)))) (@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 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)) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@coset gT (@gval gT U) y)) u) (@conjg gT u y)) (inPhantom (forall 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)) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@coset gT (@gval gT U) y)) u) (@conjg gT u y))))) *) - (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@morphism_for (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs (Phant (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))))) (fun f : @morphism_for (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs (Phant (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) => and3 (is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))) (@ker (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType gT (@gval gT U))))))))) (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 (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))) (@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))) A)))) (@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 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)) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@coset gT (@gval gT U) y)) u) (@conjg gT u y)) (inPhantom (forall 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)) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@coset gT (@gval gT U) y)) u) (@conjg gT u y))))) *) have [] := first_isom_loc [morphism of conj_aut U] nUG. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: forall (x : @morphism_for (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@quotient gT (@gval gT G) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))) (Phant (FinGroup.arg_sort (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))))))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))))) (@ker (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@quotient gT (@gval gT G) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))) x (@MorPhantom (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@quotient gT (@gval gT G) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))) x))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))))))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))))))))))))))) (_ : forall (A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (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)) 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 (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))))) (@morphim (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@quotient gT (@gval gT G) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))) x (@MorPhantom (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@quotient gT (@gval gT G) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U)))))))) x)) (@quotient gT A (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))))))))) (@morphim gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))) (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@normaliser_group gT (@gval gT U))) (@clone_morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut_morphism gT U) (@Morphism gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT U)) (@conj_aut gT U))))) A)), @ex (@morphism_for (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs (Phant (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))))) (fun f : @morphism_for (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs (Phant (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) => and3 (is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))) (@ker (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))) (oneg (group_set_baseGroupType (FinGroup.base (@coset_groupType gT (@gval gT U))))))))) (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 (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))) (@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))) A)))) (@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 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)) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@coset gT (@gval gT U) y)) u) (@conjg gT u y)) (inPhantom (forall 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)) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@coset gT (@gval gT U) y)) u) (@conjg gT u y))))) *) rewrite ker_conj_aut scUG /= -/Gs => f injf im_f. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@morphism_for (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs (Phant (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))))) (fun f : @morphism_for (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs (Phant (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) => and3 (is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT U))) (@mem (@coset_of gT (@gval gT U)) (predPredType (@coset_of gT (@gval gT U))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT U))) (@ker (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f))))) (@mem (@coset_of gT (@gval gT U)) (predPredType (@coset_of gT (@gval gT U))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT U))) (oneg (group_set_baseGroupType (@coset_baseGroupType gT (@gval gT U)))))))) (is_true (@subset (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))) (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) A)))) (@prop_in1 (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 G))) (fun y : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@coset gT (@gval gT U) y)) u) (@conjg gT u y)) (inPhantom (forall y : FinGroup.arg_sort (FinGroup.base gT), @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@coset gT (@gval gT U) y)) u) (@conjg gT u y))))) *) exists f; rewrite im_f ?Aut_conj_aut //. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: and3 (is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT U))) (@mem (@coset_of gT (@gval gT U)) (predPredType (@coset_of gT (@gval gT U))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT U))) (@ker (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f))))) (@mem (@coset_of gT (@gval gT U)) (predPredType (@coset_of gT (@gval gT U))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT U))) (oneg (group_set_baseGroupType (@coset_baseGroupType gT (@gval gT U)))))))) (is_true true) (@prop_in1 (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 G))) (fun y : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@coset gT (@gval gT U) y)) u) (@conjg gT u y)) (inPhantom (forall y : FinGroup.arg_sort (FinGroup.base gT), @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@coset gT (@gval gT U) y)) u) (@conjg gT u y)))) *) split=> // y Gy; have nUy := subsetP nUG y Gy. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@coset gT (@gval gT U) y)) u) (@conjg gT u y) *) suffices ->: f (coset U y) = conj_aut U y by rewrite norm_conj_autE. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @eq (FinGroup.sort (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@coset gT (@gval gT U) y)) (@conj_aut gT U y) *) by apply: set1_inj; rewrite -!morphim_set1 ?mem_quotient // im_f ?sub1set. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) have cGsGs: abelian Gs by rewrite -(injm_abelian injf) // (abelianS sfGsA). (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) have p_fGs: p.-group (f @* Gs) by rewrite morphim_pgroup. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) have sfGsAp: f @* Gs \subset 'O_p(A) by rewrite (sub_Hall_pcore sylAp). (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) have [a [fGa oa au n_gt01 cycGs]]: exists a, [/\ a \in f @* Gs, #[a] = p, a u = u ^+ (p ^ n).+1, (p == 2) + 1 <= n & cyclic Gs \/ p = 2 /\ (exists2 c, c \in f @* Gs & c u = u^-1)]. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (fun a : Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) => and5 (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.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (fun c : Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) => is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) c (@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 (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (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)) c u) (@invg (FinGroup.base gT) u)))))) *) - (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (fun a : Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) => and5 (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.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (fun c : Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) => is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) c (@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 (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (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)) c u) (@invg (FinGroup.base gT) u)))))) *) have [m [[def_m _ _ _ _] _]] := cyclic_pgroup_Aut_structure pU cycU ntU. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: forall _ : if @eq_op nat_eqType (Nat.pred (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 U)))))) O then @eq (@set_of (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (Phant (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))))) (@Aut gT (@gval gT U)) (@pcore (negn (nat_pred_of_nat p)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT U))) else @ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun t : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => and4 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) t (@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 U)))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) t) (S (S O))) (@eq (ordinal (S (S (Zp_trunc (@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 U)))))))) (m t) (@GRing.opp (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@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 U))))))) (GRing.one (Zp_ringType (Zp_trunc (@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 U))))))))) (if odd p then and3 (and (is_true (@cyclic (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT U)))) (is_true (@cyclic (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@pcore (nat_pred_of_nat p) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT U)))))) (@ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun s : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => and4 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) s (@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 U)))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s) (expn p (Nat.pred (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 U)))))))) (@eq (ordinal (S (S (Zp_trunc (@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 U)))))))) (m s) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@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 U))))))) (GRing.one (Zp_ringType (Zp_trunc (@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 U))))))) (S p))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))))) (@pcore (nat_pred_of_nat p) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT U))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s)))) (@ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun s0 : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => and4 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) s0 (@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 U)))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s0) p) (@eq (ordinal (S (S (Zp_trunc (@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 U)))))))) (m s0) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@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 U))))))) (GRing.one (Zp_ringType (Zp_trunc (@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 U))))))) (S (expn p (Nat.pred (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 U)))))))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))))) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@pcore (nat_pred_of_nat p) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT U)))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s0)))) else if @eq_op nat_eqType (Nat.pred (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 U)))))) (S O) then @eq (@set_of (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (Phant (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))))) (@Aut gT (@gval gT U)) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) t) else @ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun s : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => and5 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) s (@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 U)))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s) (expn (S (S O)) (Nat.pred (Nat.pred (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 U))))))))) (@eq (ordinal (S (S (Zp_trunc (@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 U)))))))) (m s) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@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 U))))))) (GRing.one (Zp_ringType (Zp_trunc (@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 U))))))) (S (S (S (S (S O))))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Phant (FinGroup.arg_sort (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (direct_product (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) t)) (@Aut gT (@gval gT U))) (@ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun s0 : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => and5 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) s0 (@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 U)))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s0) (S (S O))) (@eq (ordinal (S (S (Zp_trunc (@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 U)))))))) (m s0) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@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 U))))))) (GRing.one (Zp_ringType (Zp_trunc (@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 U))))))) (S (expn (S (S O)) (Nat.pred (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 U)))))))))) (@eq (ordinal (S (S (Zp_trunc (@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 U)))))))) (m (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT))) s0 t)) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@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 U))))))) (GRing.one (Zp_ringType (Zp_trunc (@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 U))))))) (Nat.pred (expn (S (S O)) (Nat.pred (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 U)))))))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))))) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s)) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s0))))))), @ex (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (fun a : Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) => and5 (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.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (fun c : Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) => is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) c (@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 (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (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)) c u) (@invg (FinGroup.base gT) u)))))) *) have ->: logn p #|U| = n.+1 by rewrite oU pfactorK. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: forall _ : if @eq_op nat_eqType (Nat.pred (S n)) O then @eq (@set_of (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (Phant (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))))) (@Aut gT (@gval gT U)) (@pcore (negn (nat_pred_of_nat p)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT U))) else @ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun t : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => and4 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) t (@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 U)))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) t) (S (S O))) (@eq (ordinal (S (S (Zp_trunc (@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 U)))))))) (m t) (@GRing.opp (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@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 U))))))) (GRing.one (Zp_ringType (Zp_trunc (@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 U))))))))) (if odd p then and3 (and (is_true (@cyclic (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT U)))) (is_true (@cyclic (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@pcore (nat_pred_of_nat p) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT U)))))) (@ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun s : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => and4 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) s (@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 U)))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s) (expn p (Nat.pred (S n)))) (@eq (ordinal (S (S (Zp_trunc (@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 U)))))))) (m s) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@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 U))))))) (GRing.one (Zp_ringType (Zp_trunc (@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 U))))))) (S p))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))))) (@pcore (nat_pred_of_nat p) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT U))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s)))) (@ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun s0 : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => and4 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) s0 (@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 U)))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s0) p) (@eq (ordinal (S (S (Zp_trunc (@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 U)))))))) (m s0) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@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 U))))))) (GRing.one (Zp_ringType (Zp_trunc (@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 U))))))) (S (expn p (Nat.pred (S n)))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))))) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@pcore (nat_pred_of_nat p) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT U)))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s0)))) else if @eq_op nat_eqType (Nat.pred (S n)) (S O) then @eq (@set_of (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (Phant (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))))) (@Aut gT (@gval gT U)) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) t) else @ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun s : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => and5 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) s (@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 U)))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s) (expn (S (S O)) (Nat.pred (Nat.pred (S n))))) (@eq (ordinal (S (S (Zp_trunc (@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 U)))))))) (m s) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@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 U))))))) (GRing.one (Zp_ringType (Zp_trunc (@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 U))))))) (S (S (S (S (S O))))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Phant (FinGroup.arg_sort (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (direct_product (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) t)) (@Aut gT (@gval gT U))) (@ex (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun s0 : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => and5 (is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) s0 (@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 U)))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s0) (S (S O))) (@eq (ordinal (S (S (Zp_trunc (@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 U)))))))) (m s0) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@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 U))))))) (GRing.one (Zp_ringType (Zp_trunc (@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 U))))))) (S (expn (S (S O)) (Nat.pred (S n)))))) (@eq (ordinal (S (S (Zp_trunc (@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 U)))))))) (m (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT))) s0 t)) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (@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 U))))))) (GRing.one (Zp_ringType (Zp_trunc (@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 U))))))) (Nat.pred (expn (S (S O)) (Nat.pred (S n)))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))))) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s)) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s0))))))), @ex (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (fun a : Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) => and5 (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.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (fun c : Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) => is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) c (@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 (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (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)) c u) (@invg (FinGroup.base gT) u)))))) *) rewrite /= -/A; case: posnP => [_ defA | n_gt0 [c [Ac oc m_c defA]]]. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) have:= cardSg sfGsAp; rewrite (card_Hall sylAp) /= -/A defA card_injm //. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) (* Goal: forall _ : is_true (dvdn (@card (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))) (@quotient gT (@gval gT G) (@gval gT U))))) (partn (@card (FinGroup.arg_finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.arg_finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@pcore (negn (nat_pred_of_nat p)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) A)))) (nat_pred_of_nat p))), @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) by rewrite oGs (part_p'nat (pcore_pgroup _ _)) pfactor_dvdn // logn1. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) have [p2 | odd_p] := even_prime p_pr; last first. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) case: eqP => [-> // | _] in odd_p *; rewrite odd_p in defA. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool false) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) have [[cycA _] _ [a [Aa oa m_a defA1]]] := defA. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool false) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) exists a; rewrite -def_m // oa m_a expg_znat //. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) (* Goal: and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat p p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) u (S (expn p n))) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool false) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u))))) *) split=> //; last by left; rewrite -(injm_cyclic injf) ?(cyclicS sfGsA). (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) (* Goal: is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs)))) *) have: f @* Gs != 1 by rewrite morphim_injm_eq1. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) (* Goal: forall _ : is_true (negb (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs) (oneg (group_set_of_baseGroupType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))))), is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs)))) *) rewrite -cycle_subG; apply: contraR => not_sfGs_a. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) (* Goal: is_true (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs) (oneg (group_set_of_baseGroupType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) *) by rewrite -(setIidPl sfGsAp) TI_Ohm1 // defA1 setIC prime_TIg -?orderE ?oa. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) do [rewrite {1}p2 /= eqn_leq n_gt0; case: leqP => /= [_ | n_gt1]] in defA. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) have:= cardSg sfGsAp; rewrite (card_Hall sylAp) /= -/A defA -orderE oc p2. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) (* Goal: forall _ : is_true (dvdn (@card (FinGroup.arg_finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.arg_finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@quotient gT (@gval gT G) (@gval gT U)) f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) (@quotient gT (@gval gT G) (@gval gT U)))))) (partn (S (S O)) (nat_pred_of_nat (S (S O))))), @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) (S (S O))) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn (S (S O)) n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType (S (S O)) (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat (S (S O)) (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) by rewrite card_injm // oGs p2 pfactor_dvdn // p_part. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @ex (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun a : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))))) *) have{defA} [s [As os _ defA [a [Aa oa m_a _ defA1]]]] := defA; exists a. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u))))) *) have fGs_a: a \in f @* Gs. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u))))) *) (* Goal: is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (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.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs)))) *) suffices: f @* Gs :&: <[s]> != 1. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u))))) *) (* Goal: is_true (negb (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (@setI (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s)) (oneg (group_set_of_baseGroupType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))))) *) (* Goal: forall _ : is_true (negb (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (@setI (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s)) (oneg (group_set_of_baseGroupType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))))), is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (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.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs)))) *) apply: contraR => not_fGs_a; rewrite TI_Ohm1 // defA1 setIC. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u))))) *) (* Goal: is_true (negb (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (@setI (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s)) (oneg (group_set_of_baseGroupType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))))) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base (perm_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))))) (@setI (FinGroup.arg_finType (FinGroup.base (perm_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) (@gval (perm_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@morphim_group (@coset_groupType gT (@gval gT U)) (perm_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@quotient_group gT G (@gval gT U)) f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) (@quotient_group gT G (@gval gT U))))) (oneg (group_set_of_baseGroupType (FinGroup.base (perm_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) *) by rewrite prime_TIg -?orderE ?oa // cycle_subG. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u))))) *) (* Goal: is_true (negb (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (@setI (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s)) (oneg (group_set_of_baseGroupType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))))) *) have: (f @* Gs) * <[s]> \subset A by rewrite mulG_subG cycle_subG sfGsA. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u))))) *) (* Goal: forall _ : 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))))) (@mulg (group_set_of_baseGroupType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s)))) (@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))) A))), is_true (negb (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (@setI (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s)) (oneg (group_set_of_baseGroupType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))))) *) move/subset_leq_card; apply: contraL; move/eqP; move/TI_cardMg->. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u))))) *) (* Goal: is_true (negb (leq (muln (@card (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))))) (@gval (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@morphim_group (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@quotient_group gT G (@gval gT U)) f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) (@quotient_group gT G (@gval gT U))))))) (@card (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))))) (@gval (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@cycle_group (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) s)))))) (@card (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 (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) A))))) *) rewrite -(dprod_card defA) -ltnNge mulnC -!orderE ltn_pmul2r // oc. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u))))) *) (* Goal: is_true (leq (S (S (S O))) (@card (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))))) (@gval (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@morphim_group (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@quotient_group gT G (@gval gT U)) f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) (@quotient_group gT G (@gval gT U)))))))) *) by rewrite card_injm // oGs p2 (ltn_exp2l 1%N). (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: and5 (is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (@eq nat (@order (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) p) (@eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a u) (@expgn (FinGroup.base gT) u (S (expn p n)))) (is_true (leq (addn (nat_of_bool (@eq_op nat_eqType p (S (S O)))) (S O)) n)) (or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat p (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u))))) *) rewrite -def_m // oa m_a expg_znat // p2; split=> //. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: or (is_true (@cyclic (@coset_groupType gT (@gval gT U)) Gs)) (and (@eq nat (S (S O)) (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))) *) rewrite abelian_rank1_cyclic // (rank_pgroup pGs) //. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: or (is_true (leq (@p_rank (@coset_groupType gT (@gval gT U)) p (@gval (@coset_groupType gT (@gval gT U)) (@quotient_group gT G (@gval gT U)))) (S O))) (and (@eq nat (S (S O)) (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))) *) rewrite -(injm_p_rank injf) // p_rank_abelian 1?morphim_abelian //= p2 -/Gs. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: or (is_true (leq (logn (S (S O)) (@card (FinGroup.arg_finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.arg_finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs)))))) (S O))) (and (@eq nat (S (S O)) (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u)))) *) case: leqP => [|fGs1_gt1]; [by left | right]. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: and (@eq nat (S (S O)) (S (S O))) (@ex2 (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))) (fun c : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c u) (@invg (FinGroup.base gT) u))) *) split=> //; exists c; last by rewrite -def_m // m_c expg_zneg. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs)))) *) have{defA1} defA1: <[a]> \x <[c]> = 'Ohm_1(Aut U). (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs)))) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Phant (FinGroup.arg_sort (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (direct_product (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) (@cycle (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) c)) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT U))) *) by rewrite -(Ohm_dprod 1 defA) defA1 (@Ohm_p_cycle 1 _ 2) /p_elt oc. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs)))) *) have def_fGs1: 'Ohm_1(f @* Gs) = 'Ohm_1(A). (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs)))) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))))) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs)) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) A) *) apply/eqP; rewrite eqEcard OhmS // -(dprod_card defA1) -!orderE oa oc. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs)))) *) (* Goal: is_true (andb true (leq (muln (S (S O)) (S (S O))) (@card (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))))) (@Ohm (S O) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs))))))) *) by rewrite dvdn_leq ?(@pfactor_dvdn 2 2) ?cardG_gt0. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) c (@mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (predPredType (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) (@morphim (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f (@MorPhantom (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (@coset_groupType gT (@gval gT U)) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) Gs f)) Gs)))) *) rewrite (subsetP (Ohm_sub 1 _)) // def_fGs1 -cycle_subG. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base (perm_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@cycle (perm_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) c))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@gval (perm_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@Ohm_group (S O) (perm_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) A))))) *) by case/dprodP: defA1 => _ <- _ _; rewrite mulG_subr. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) have n_gt0: n > 0 := leq_trans (leq_addl _ _) n_gt01. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) have [ys Gys _ def_a] := morphimP fGa. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) have oys: #[ys] = p by rewrite -(order_injm injf) // -def_a oa. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) have defMs: M / U = <[ys]>. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @eq (@set_of (@coset_finType gT (@gval gT U)) (Phant (@coset_of gT (@gval gT U)))) (@quotient gT M (@gval gT U)) (@cycle (@coset_groupType gT (@gval gT U)) ys) *) apply/eqP; rewrite eq_sym eqEcard -orderE oys cycle_subG; apply/andP; split. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (leq (@card (@coset_finType gT (@gval gT U)) (@mem (Finite.sort (@coset_finType gT (@gval gT U))) (predPredType (Finite.sort (@coset_finType gT (@gval gT U)))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT U)) (@quotient gT M (@gval gT U))))) p) *) (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base (@coset_groupType gT (@gval gT U)))) ys (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))) (@gval (@coset_groupType gT (@gval gT U)) (@quotient_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@gval gT U)))))) *) have [y nUy Gy /= def_ys] := morphimP Gys. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (leq (@card (@coset_finType gT (@gval gT U)) (@mem (Finite.sort (@coset_finType gT (@gval gT U))) (predPredType (Finite.sort (@coset_finType gT (@gval gT U)))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT U)) (@quotient gT M (@gval gT U))))) p) *) (* Goal: is_true (@in_mem (@coset_of gT (@gval gT U)) ys (@mem (@coset_of gT (@gval gT U)) (predPredType (@coset_of gT (@gval gT U))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT U))) (@quotient gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U)))) (@gval gT U))))) *) rewrite def_ys mem_quotient //= inE Gy defU1 cent_cycle cent1C. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (leq (@card (@coset_finType gT (@gval gT U)) (@mem (Finite.sort (@coset_finType gT (@gval gT U))) (predPredType (Finite.sort (@coset_finType gT (@gval gT U)))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT U)) (@quotient gT M (@gval gT U))))) p) *) (* Goal: is_true (andb true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) u 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)) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y)))))) *) rewrite (sameP cent1P commgP) commgEl conjXg -fG //= -def_ys -def_a au. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (leq (@card (@coset_finType gT (@gval gT U)) (@mem (Finite.sort (@coset_finType gT (@gval gT U))) (predPredType (Finite.sort (@coset_finType gT (@gval gT U)))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT U)) (@quotient gT M (@gval gT U))))) p) *) (* Goal: is_true (@eq_op (FinGroup.arg_eqType (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@invg (FinGroup.base gT) (@expgn (FinGroup.base gT) u p)) (@expgn (FinGroup.base gT) (@expgn (FinGroup.base gT) u (S (expn p n))) p)) (oneg (FinGroup.base gT))) *) by rewrite -expgM mulSn expgD mulKg -expnSr -ou expg_order. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (leq (@card (@coset_finType gT (@gval gT U)) (@mem (Finite.sort (@coset_finType gT (@gval gT U))) (predPredType (Finite.sort (@coset_finType gT (@gval gT U)))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT U)) (@quotient gT M (@gval gT U))))) p) *) rewrite card_quotient // -(setIidPr sUM) -scUG setIA (setIidPl sMG). (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (leq (@indexg gT M (@setI (FinGroup.arg_finType (FinGroup.base gT)) M (@centraliser gT (@gval gT U)))) p) *) rewrite defU cent_cycle index_cent1 -(card_imset _ (mulgI u^-1)) -imset_comp. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (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)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@funcomp (Finite.sort (FinGroup.finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) tt (@mulg (FinGroup.base gT) (@invg (FinGroup.base gT) u)) (@conjg gT 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 (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U))))))))))) p) *) have <-: #|'Ohm_1(U)| = p. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (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)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@funcomp (Finite.sort (FinGroup.finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) tt (@mulg (FinGroup.base gT) (@invg (FinGroup.base gT) u)) (@conjg gT 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 (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U))))))))))) (@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 U)))))) *) (* 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)) (@Ohm (S O) gT (@gval gT U))))) p *) rewrite defU (Ohm_p_cycle 1 p_u) -orderE (orderXexp _ ou) ou pfactorK //. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (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)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@funcomp (Finite.sort (FinGroup.finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) tt (@mulg (FinGroup.base gT) (@invg (FinGroup.base gT) u)) (@conjg gT 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 (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U))))))))))) (@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 U)))))) *) (* Goal: @eq nat (expn p (subn (S n) (subn (S n) (S O)))) p *) by rewrite subKn. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (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)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@funcomp (Finite.sort (FinGroup.finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) tt (@mulg (FinGroup.base gT) (@invg (FinGroup.base gT) u)) (@conjg gT 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 (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U))))))))))) (@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 U)))))) *) rewrite (OhmE 1 pU) subset_leq_card ?sub_gen //. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT 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)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@funcomp (Finite.sort (FinGroup.finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) tt (@mulg (FinGroup.base gT) (@invg (FinGroup.base gT) u)) (@conjg gT 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 (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT U) (Ldiv gT (expn p (S O))))))) *) apply/subsetP=> _ /imsetP[z /setIP[/(subsetP nUG) nUz cU1z] ->]. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@funcomp (Finite.sort (FinGroup.finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) tt (@mulg (FinGroup.base gT) (@invg (FinGroup.base gT) u)) (@conjg gT u) 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT U) (Ldiv gT (expn p (S O))))))) *) have Uv' := groupVr Uu; have Uuz: u ^ z \in U by rewrite memJ_norm. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@funcomp (Finite.sort (FinGroup.finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) tt (@mulg (FinGroup.base gT) (@invg (FinGroup.base gT) u)) (@conjg gT u) 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT U) (Ldiv gT (expn p (S O))))))) *) rewrite !inE groupM // expgMn /commute 1?(centsP cUU u^-1) //= expgVn -conjXg. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@invg (FinGroup.base gT) (@expgn (FinGroup.base gT) u (expn p (S O)))) (@conjg gT (@expgn (FinGroup.base gT) u (expn p (S O))) z)) (oneg (FinGroup.base gT))) *) by rewrite (sameP commgP cent1P) cent1C -cent_cycle -defU1. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) have iUM: #|M : U| = p by rewrite -card_quotient ?defMs. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) have not_cMM: ~~ abelian M. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (negb (@abelian gT M)) *) apply: contraL p_pr => cMM; rewrite -iUM -indexgI /= -/M. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: is_true (negb (prime (@indexg gT M (@setI (FinGroup.arg_finType (FinGroup.base gT)) M (@gval gT U))))) *) by rewrite (setIidPl _) ?indexgg // -scUG subsetI sMG sub_abelian_cent. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) have modM: extremal_class M = ModularGroup. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @eq extremal_group_type (@extremal_class gT M) ModularGroup *) have sU1Z: 'Mho^1(U) \subset 'Z(M). (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @eq extremal_group_type (@extremal_class gT M) ModularGroup *) (* 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 O) gT (@gval gT 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)) (@center gT M)))) *) by rewrite subsetI gFsub_trans // centsC subsetIr. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @eq extremal_group_type (@extremal_class gT M) ModularGroup *) have /maximal_cycle_extremal/predU1P[] //= := iUM; rewrite -/M. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: forall _ : is_true (andb (@eq_op nat_eqType p (S (S O))) (@extremal2 gT M)), @eq extremal_group_type (@extremal_class gT M) ModularGroup *) case/andP=> /eqP-p2 ext2M; rewrite p2 add1n in n_gt01. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: @eq extremal_group_type (@extremal_class gT M) ModularGroup *) suffices{sU1Z}: #|'Z(M)| = 2. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT 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)) (@center gT M)))) (S (S O)) *) (* Goal: forall _ : @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)) (@center gT M)))) (S (S O)), @eq extremal_group_type (@extremal_class gT M) ModularGroup *) move/eqP; rewrite eqn_leq leqNgt (leq_trans _ (subset_leq_card sU1Z)) //. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT 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)) (@center gT M)))) (S (S O)) *) (* Goal: is_true (leq (S (S (S O))) (@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 (S O) gT (@gval gT U)))))) *) by rewrite defU1 -orderE (orderXexp 1 ou) subn1 p2 (ltn_exp2l 1). (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT 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)) (@center gT M)))) (S (S O)) *) move: ext2M; rewrite /extremal2 !inE orbC -orbA; case/or3P; move/eqP. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) Dihedral, @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)) (@center gT M)))) (S (S O)) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) Quaternion, @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)) (@center gT M)))) (S (S O)) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) SemiDihedral, @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)) (@center gT M)))) (S (S O)) *) - (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) Dihedral, @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)) (@center gT M)))) (S (S O)) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) Quaternion, @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)) (@center gT M)))) (S (S O)) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) SemiDihedral, @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)) (@center gT M)))) (S (S O)) *) case/semidihedral_classP=> m m_gt3 isoM. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) Dihedral, @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)) (@center gT M)))) (S (S O)) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) Quaternion, @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)) (@center gT M)))) (S (S O)) *) (* 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)) (@center gT M)))) (S (S O)) *) have [[x z] genM [oz _]] := generators_semidihedral m_gt3 isoM. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) Dihedral, @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)) (@center gT M)))) (S (S O)) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) Quaternion, @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)) (@center gT M)))) (S (S O)) *) (* 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)) (@center gT M)))) (S (S O)) *) by case/semidihedral_structure: genM => // _ _ []. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) Dihedral, @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)) (@center gT M)))) (S (S O)) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) Quaternion, @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)) (@center gT M)))) (S (S O)) *) - (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) Dihedral, @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)) (@center gT M)))) (S (S O)) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) Quaternion, @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)) (@center gT M)))) (S (S O)) *) case/quaternion_classP=> m m_gt2 isoM. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) Dihedral, @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)) (@center gT M)))) (S (S O)) *) (* 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)) (@center gT M)))) (S (S O)) *) have [[x z] genM _] := generators_quaternion m_gt2 isoM. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) Dihedral, @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)) (@center gT M)))) (S (S O)) *) (* 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)) (@center gT M)))) (S (S O)) *) by case/quaternion_structure: genM => // _ _ []. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: forall _ : @eq (Equality.sort extremal_group_eqType) (@extremal_class gT M) Dihedral, @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)) (@center gT M)))) (S (S O)) *) case/dihedral_classP=> m m_gt1 isoM. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT 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)) (@center gT M)))) (S (S O)) *) have [[x z] genM _] := generators_2dihedral m_gt1 isoM. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT 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)) (@center gT M)))) (S (S O)) *) case/dihedral2_structure: genM not_cMM => // _ _ _ _. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) (* Goal: forall (_ : if @eq_op nat_eqType m (S (S O)) then is_true (@abelem gT (S (S O)) (@gval gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))))) else and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))))) (@cycle gT (@expgn (FinGroup.base gT) x (expn (S (S O)) (Nat.pred (Nat.pred m)))))) (@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)) (@center gT (@gval gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U))))))))) (S (S O))) (is_true (@isog gT (dihedral_gtype (expn (S (S O)) (Nat.pred m))) (@generated gT (@class gT z (@gval gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (Nat.pred m))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (Nat.pred m))))))))) (is_true (@isog gT (dihedral_gtype (expn (S (S O)) (Nat.pred m))) (@generated gT (@class gT (@mulg (FinGroup.base gT) x z) (@gval gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (expn (S (S O)) (Nat.pred m))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (expn (S (S O)) (Nat.pred m))))))))) (forall (U0 : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@cyclic gT U0)) (_ : 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)) U0)) (@mem (Finite.sort (FinGroup.arg_finType (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 (@centraliser_group gT (@Mho (S O) gT (@gval gT U))))))))) (_ : @eq nat (@indexg gT (@gval gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U))))) U0) (S (S O))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) U0 (@cycle gT x))) (_ : is_true (negb (@abelian gT M))), @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)) (@center gT M)))) (S (S O)) *) by case: (m == 2) => [|[]//]; move/abelem_abelian->. (* Goal: and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Mho (S O) gT (@gval gT U))))) (@eq nat (@indexg gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M))) (@gval gT U)) p) (@eq extremal_group_type (@extremal_class gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) ModularGroup) (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G)))))) (is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G))) *) split=> //. (* Goal: is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G)) *) (* Goal: is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@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)) (@gval gT G))))) *) have [//|_] := modM1 [group of M]; rewrite !inE -andbA /=. (* Goal: is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G)) *) (* Goal: forall _ : is_true (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 (S O) gT M))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) M))) (andb (@abelem gT p (@Ohm (S O) gT M)) (@eq_op nat_eqType (logn 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)) (@Ohm (S O) gT M))))) (S (S O))))), 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 (S O) gT M))) (@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)))) (@abelem gT p (@Ohm (S O) gT M))) (@eq_op nat_eqType (logn 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)) (@Ohm (S O) gT M))))) (S (S O)))) *) by case/andP=> /subset_trans->. (* Goal: is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G)) *) have{cycGs} [cycGs | [p2 [c fGs_c u_c]]] := cycGs. (* Goal: is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G)) *) (* Goal: is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G)) *) suffices ->: 'Ohm_1(M) = 'Ohm_1(G) by apply: Ohm_char. (* Goal: is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G)) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT M) (@Ohm (S O) gT (@gval gT G)) *) suffices sG1M: 'Ohm_1(G) \subset M. (* Goal: is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT 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)) (@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)) M))) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT M) (@Ohm (S O) gT (@gval gT G)) *) by apply/eqP; rewrite eqEsubset -{2}(Ohm_id 1 G) !OhmS. (* Goal: is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT 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)) (@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)) M))) *) rewrite -(quotientSGK _ sUM) ?(subset_trans (Ohm_sub _ G)) //= defMs. (* Goal: is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G)) *) (* Goal: is_true (@subset (@coset_finType gT (@gval gT U)) (@mem (@coset_of gT (@gval gT U)) (predPredType (@coset_of gT (@gval gT U))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT U)) (@quotient gT (@Ohm (S O) gT (@gval gT G)) (@gval gT U)))) (@mem (@coset_of gT (@gval gT U)) (predPredType (@coset_of gT (@gval gT U))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT U)) (@cycle (@coset_groupType gT (@gval gT U)) ys)))) *) suffices ->: <[ys]> = 'Ohm_1(Gs) by rewrite morphim_Ohm. (* Goal: is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G)) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U))))))) (@cycle (@coset_groupType gT (@gval gT U)) ys) (@Ohm (S O) (@coset_groupType gT (@gval gT U)) Gs) *) apply/eqP; rewrite eqEcard -orderE cycle_subG /= {1}(OhmE 1 pGs) /=. (* Goal: is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G)) *) (* Goal: is_true (andb (@in_mem (@coset_of gT (@gval gT U)) ys (@mem (@coset_of gT (@gval gT U)) (predPredType (@coset_of gT (@gval gT U))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT U))) (@generated (@coset_groupType gT (@gval gT U)) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT U))) (@quotient gT (@gval gT G) (@gval gT U)) (Ldiv (@coset_groupType gT (@gval gT U)) (expn p (S O)))))))) (leq (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT U))) (@mem (@coset_of gT (@gval gT U)) (predPredType (@coset_of gT (@gval gT U))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT U))) (@Ohm (S O) (@coset_groupType gT (@gval gT U)) Gs)))) (@order (@coset_groupType gT (@gval gT U)) ys))) *) rewrite mem_gen ?inE ?Gys -?order_dvdn oys //=. (* Goal: is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G)) *) (* Goal: is_true (leq (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT U))) (@mem (@coset_of gT (@gval gT U)) (predPredType (@coset_of gT (@gval gT U))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT U))) (@Ohm (S O) (@coset_groupType gT (@gval gT U)) Gs)))) p) *) rewrite -(part_pnat_id (pgroupS (Ohm_sub _ _) pGs)) p_part (leq_exp2l _ 1) //. (* Goal: is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G)) *) (* Goal: is_true (leq (logn p (@card (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT U)))) (@gval (@coset_groupType gT (@gval gT U)) (@Ohm_group (S O) (@coset_groupType gT (@gval gT U)) (@gval (@coset_groupType gT (@gval gT U)) (@quotient_group gT G (@gval gT U))))))))) (S O)) *) by rewrite -p_rank_abelian -?rank_pgroup -?abelian_rank1_cyclic. (* Goal: is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G)) *) suffices charU1: 'Mho^1(U) \char G^`(1). (* Goal: is_true (@characteristic gT (@Mho (S O) gT (@gval gT U)) (@derived_at (S O) gT (@gval gT G))) *) (* Goal: is_true (@characteristic gT (@Ohm (S O) gT (@gval gT (@clone_group gT (@setI_group gT G (@centraliser_group gT (@Mho (S O) gT (@gval gT U)))) (@group gT M)))) (@gval gT G)) *) by rewrite gFchar_trans // subcent_char ?(char_trans charU1) ?gFchar. (* Goal: is_true (@characteristic gT (@Mho (S O) gT (@gval gT U)) (@derived_at (S O) gT (@gval gT G))) *) suffices sUiG': 'Mho^1(U) \subset G^`(1). (* 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 O) gT (@gval gT 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)) (@derived_at (S O) gT (@gval gT G))))) *) (* Goal: is_true (@characteristic gT (@Mho (S O) gT (@gval gT U)) (@derived_at (S O) gT (@gval gT G))) *) have /cyclicP[zs cycG']: cyclic G^`(1) by rewrite (cyclicS _ cycU) ?der1_min. (* 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 O) gT (@gval gT 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)) (@derived_at (S O) gT (@gval gT G))))) *) (* Goal: is_true (@characteristic gT (@Mho (S O) gT (@gval gT U)) (@derived_at (S O) gT (@gval gT G))) *) by rewrite cycG' in sUiG' *; apply: cycle_subgroup_char. (* 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 O) gT (@gval gT 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)) (@derived_at (S O) gT (@gval gT G))))) *) rewrite defU1 cycle_subG p2 -groupV invMg -{2}u_c. (* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@invg (FinGroup.base gT) u) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) c 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 (@derived_at_group gT G (S O)))))) *) by have [_ _ /morphimP[z _ Gz ->] ->] := morphimP fGs_c; rewrite fG ?mem_commg. Qed. Lemma normal_rank1_structure gT p (G : {group gT}) : p.-group G -> (forall X : {group gT}, X <| G -> abelian X -> cyclic X) -> Proof. (* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : forall (X : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@normal gT (@gval gT X) (@gval gT G))) (_ : is_true (@abelian gT (@gval gT X))), is_true (@cyclic gT (@gval gT X))), or (is_true (@cyclic gT (@gval gT G))) (is_true (andb (@eq_op nat_eqType p (S (S O))) (andb (@extremal2 gT (@gval gT G)) (orb (leq (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S O)))))))))))))))) (@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))))) (@isog gT (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))))))) *) move=> pG dn_G_1. (* Goal: or (is_true (@cyclic gT (@gval gT G))) (is_true (andb (@eq_op nat_eqType p (S (S O))) (andb (@extremal2 gT (@gval gT G)) (orb (leq (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S O)))))))))))))))) (@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))))) (@isog gT (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))))))) *) have [cGG | not_cGG] := boolP (abelian G); first by left; rewrite dn_G_1. (* Goal: or (is_true (@cyclic gT (@gval gT G))) (is_true (andb (@eq_op nat_eqType p (S (S O))) (andb (@extremal2 gT (@gval gT G)) (orb (leq (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S O)))))))))))))))) (@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))))) (@isog gT (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))))))) *) have [X maxX]: {X | [max X | X <| G & abelian X]}. (* Goal: or (is_true (@cyclic gT (@gval gT G))) (is_true (andb (@eq_op nat_eqType p (S (S O))) (andb (@extremal2 gT (@gval gT G)) (orb (leq (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S O)))))))))))))))) (@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))))) (@isog gT (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))))))) *) (* Goal: @sig (group_type gT) (fun X : group_type gT => is_true (@maxgroup gT (@gval gT X) (fun X0 : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@normal gT (@gval gT X0) (@gval gT G)) (@abelian gT (@gval gT X0))))) *) by apply: ex_maxgroup; exists 1%G; rewrite normal1 abelian1. (* Goal: or (is_true (@cyclic gT (@gval gT G))) (is_true (andb (@eq_op nat_eqType p (S (S O))) (andb (@extremal2 gT (@gval gT G)) (orb (leq (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S O)))))))))))))))) (@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))))) (@isog gT (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))))))) *) have cycX: cyclic X by rewrite dn_G_1; case/andP: (maxgroupp maxX). (* Goal: or (is_true (@cyclic gT (@gval gT G))) (is_true (andb (@eq_op nat_eqType p (S (S O))) (andb (@extremal2 gT (@gval gT G)) (orb (leq (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S O)))))))))))))))) (@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))))) (@isog gT (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))))))) *) have scX: X \in 'SCN(G) := max_SCN pG maxX. (* Goal: or (is_true (@cyclic gT (@gval gT G))) (is_true (andb (@eq_op nat_eqType p (S (S O))) (andb (@extremal2 gT (@gval gT G)) (orb (leq (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S O)))))))))))))))) (@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))))) (@isog gT (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))))))) *) have [[p2 _ cG] | [M [_ _ _]]] := cyclic_SCN pG scX not_cGG cycX; last first. (* Goal: or (is_true (@cyclic gT (@gval gT G))) (is_true (andb (@eq_op nat_eqType p (S (S O))) (andb (@extremal2 gT (@gval gT G)) (orb (leq (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S O)))))))))))))))) (@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))))) (@isog gT (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))))))) *) (* Goal: forall (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@Ohm_group (S O) gT (@gval gT M)) (@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)) (@gval gT G)))))) (_ : is_true (@characteristic gT (@Ohm (S O) gT (@gval gT M)) (@gval gT G))), or (is_true (@cyclic gT (@gval gT G))) (is_true (andb (@eq_op nat_eqType p (S (S O))) (andb (@extremal2 gT (@gval gT G)) (orb (leq (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S O)))))))))))))))) (@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))))) (@isog gT (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))))))) *) rewrite 2!inE -andbA => /and3P[sEG abelE dimE_2] charE. (* Goal: or (is_true (@cyclic gT (@gval gT G))) (is_true (andb (@eq_op nat_eqType p (S (S O))) (andb (@extremal2 gT (@gval gT G)) (orb (leq (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S O)))))))))))))))) (@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))))) (@isog gT (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))))))) *) (* Goal: or (is_true (@cyclic gT (@gval gT G))) (is_true (andb (@eq_op nat_eqType p (S (S O))) (andb (@extremal2 gT (@gval gT G)) (orb (leq (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S O)))))))))))))))) (@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))))) (@isog gT (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))))))) *) have:= dn_G_1 _ (char_normal charE) (abelem_abelian abelE). (* Goal: or (is_true (@cyclic gT (@gval gT G))) (is_true (andb (@eq_op nat_eqType p (S (S O))) (andb (@extremal2 gT (@gval gT G)) (orb (leq (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S O)))))))))))))))) (@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))))) (@isog gT (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))))))) *) (* Goal: forall _ : is_true (@cyclic gT (@gval gT (@Ohm_group (S O) gT (@gval gT M)))), or (is_true (@cyclic gT (@gval gT G))) (is_true (andb (@eq_op nat_eqType p (S (S O))) (andb (@extremal2 gT (@gval gT G)) (orb (leq (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S O)))))))))))))))) (@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))))) (@isog gT (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))))))) *) by rewrite (abelem_cyclic abelE) (eqP dimE_2). (* Goal: or (is_true (@cyclic gT (@gval gT G))) (is_true (andb (@eq_op nat_eqType p (S (S O))) (andb (@extremal2 gT (@gval gT G)) (orb (leq (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S O)))))))))))))))) (@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))))) (@isog gT (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))))))) *) have [n oG] := p_natP pG; right; rewrite p2 cG /= in oG *. rewrite oG (@leq_exp2l 2 4) //. rewrite /extremal2 /extremal_class oG pfactorKpdiv // in cG. case: andP cG => [[n_gt1 isoG] _ | _]; last first. (* Goal: or (is_true (@cyclic gT (@gval gT G))) (is_true true) *) (* Goal: forall _ : is_true (@extremal2 gT (@gval gT G)), or (is_true (@cyclic gT (@gval gT G))) (is_true false) *) by rewrite leq_eqVlt; case: (3 < n); case: eqP => //= <-; do 2?case: ifP. have [[x y] genG _] := generators_2dihedral n_gt1 isoG. have [_ _ _ [_ _ maxG]] := dihedral2_structure n_gt1 genG isoG. rewrite 2!ltn_neqAle n_gt1 !(eq_sym _ n). case: eqP => [_ abelG| _]; first by rewrite (abelem_abelian abelG) in not_cGG. case: eqP => // -> [_ _ isoY _ _]; set Y := <<_>> in isoY. have nxYG: Y <| G by rewrite (p_maximal_normal pG) // maxG !inE eqxx orbT. have [// | [u v] genY _] := generators_2dihedral _ isoY. case/dihedral2_structure: (genY) => //= _ _ _ _ abelY. have:= dn_G_1 _ nxYG (abelem_abelian abelY). by rewrite (abelem_cyclic abelY); case: genY => ->. Qed. Qed. Lemma odd_pgroup_rank1_cyclic gT p (G : {group gT}) : p.-group G -> odd #|G| -> cyclic G = ('r_p(G) <= 1). Proof. (* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : is_true (odd (@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 bool (@cyclic gT (@gval gT G)) (leq (@p_rank gT p (@gval gT G)) (S O)) *) move=> pG oddG; rewrite -rank_pgroup //; apply/idP/idP=> [cycG | dimG1]. (* Goal: is_true (@cyclic gT (@gval gT G)) *) (* Goal: is_true (leq (@rank gT (@gval gT G)) (S O)) *) by rewrite -abelian_rank1_cyclic ?cyclic_abelian. (* Goal: is_true (@cyclic gT (@gval gT G)) *) have [X nsXG cXX|//|] := normal_rank1_structure pG; last first. (* Goal: is_true (@cyclic gT (@gval gT X)) *) (* Goal: forall _ : is_true (andb (@eq_op nat_eqType p (S (S O))) (andb (@extremal2 gT (@gval gT G)) (orb (leq (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S O)))))))))))))))) (@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))))) (@isog gT (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))))))))), is_true (@cyclic gT (@gval gT G)) *) by rewrite (negPf (odd_not_extremal2 oddG)) andbF. (* Goal: is_true (@cyclic gT (@gval gT X)) *) by rewrite abelian_rank1_cyclic // (leq_trans (rankS (normal_sub nsXG))). Qed. Lemma prime_Ohm1P gT p (G : {group gT}) : p.-group G -> G :!=: 1 -> Theorem symplectic_type_group_structure gT p (G : {group gT}) : p.-group G -> (forall X : {group gT}, X \char G -> abelian X -> cyclic X) -> End ExtremalTheory.
Require Export GeoCoq.Elements.OriginalProofs.lemma_PGflip. Require Export GeoCoq.Elements.OriginalProofs.proposition_34. Section Euclid. Context `{Ax:area}. Lemma proposition_43 : 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 -> BetS A K C -> PG E A H K -> PG G K F C -> EF K G B E D F K H. 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) (_ : @BetS Ax0 A K C) (_ : @PG Ax0 E A H K) (_ : @PG Ax0 G K F C), @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) intros. (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (PG B A D C) by (conclude lemma_PGflip). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (Cong_3 A B C C D A) by (conclude proposition_34). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (ET A B C C D A) by (conclude axiom_congruentequal). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (Cong_3 A E K K H A) by (conclude proposition_34). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (ET A E K K H A) by (conclude axiom_congruentequal). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (Cong_3 K G C C F K) by (conclude proposition_34). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (ET K G C C F K) by (conclude axiom_congruentequal). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (ET K G C K C F) by (forward_using axiom_ETpermutation). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (ET K C F K G C) by (conclude axiom_ETsymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (ET K C F K C G) by (forward_using axiom_ETpermutation). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (ET K C G K C F) by (conclude axiom_ETsymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (ET A B C A C D) by (forward_using axiom_ETpermutation). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (ET A C D A B C) by (conclude axiom_ETsymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (ET A C D A C B) by (forward_using axiom_ETpermutation). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (ET A C B A C D) by (conclude axiom_ETsymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (EF A K G B A K F D) by (conclude axiom_cutoff1). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (BetS B E A) by (conclude axiom_betweennesssymmetry). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (BetS D H A) by (conclude axiom_betweennesssymmetry). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (ET A E K H A K) by (forward_using axiom_ETpermutation). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (ET H A K A E K) by (conclude axiom_ETsymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (ET H A K E A K) by (forward_using axiom_ETpermutation). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (ET E A K H A K) by (conclude axiom_ETsymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (EF A K G B F D A K) by (forward_using axiom_EFpermutation). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (EF F D A K A K G B) by (conclude axiom_EFsymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (EF F D A K G B A K) by (forward_using axiom_EFpermutation). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (EF G B A K F D A K) by (conclude axiom_EFsymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (EF G B E K F D H K) by (conclude axiom_cutoff2). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (EF G B E K D F K H) by (forward_using axiom_EFpermutation). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (EF D F K H G B E K) by (conclude axiom_EFsymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (EF D F K H K G B E) by (forward_using axiom_EFpermutation). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) assert (EF K G B E D F K H) by (conclude axiom_EFsymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax K G B E D F K H *) close. Qed. End Euclid.
Require Import Arith. Require Import Terms. Require Import Reduction. Require Import Redexes. Require Import Test. Fixpoint lift_rec_r (L : redexes) : nat -> nat -> redexes := fun k n : nat => match L with | Var i => Var (relocate i k n) | Fun M => Fun (lift_rec_r M (S k) n) | Ap b M N => Ap b (lift_rec_r M k n) (lift_rec_r N k n) end. Definition lift_r (n : nat) (N : redexes) := lift_rec_r N 0 n. Definition insert_Var (N : redexes) (i k : nat) := match compare k i with | inleft (left _) => Var (pred i) | inleft _ => lift_r k N | _ => Var i end. Fixpoint subst_rec_r (L : redexes) : redexes -> nat -> redexes := fun (N : redexes) (k : nat) => match L with | Var i => insert_Var N i k | Fun M => Fun (subst_rec_r M N (S k)) | Ap b M M' => Ap b (subst_rec_r M N k) (subst_rec_r M' N k) end. Definition subst_r (N M : redexes) := subst_rec_r M N 0. Lemma lift_le : forall n i k : nat, k <= i -> lift_rec_r (Var i) k n = Var (n + i). Proof. (* Goal: forall (n i k : nat) (_ : le k i), @eq redexes (lift_rec_r (Var i) k n) (Var (Init.Nat.add n i)) *) simpl in |- *; unfold relocate in |- *. (* Goal: forall (n i k : nat) (_ : le k i), @eq redexes (Var (if test k i then Init.Nat.add n i else i)) (Var (Init.Nat.add n i)) *) intros; elim (test k i); intro P; trivial with arith. (* Goal: @eq redexes (Var i) (Var (Init.Nat.add n i)) *) absurd (k > i); trivial with arith. (* Goal: not (gt k i) *) apply le_not_gt; trivial with arith. Qed. Lemma lift_gt : forall n i k : nat, k > i -> lift_rec_r (Var i) k n = Var i. Proof. (* Goal: forall (n i k : nat) (_ : gt k i), @eq redexes (lift_rec_r (Var i) k n) (Var i) *) simpl in |- *; unfold relocate in |- *. (* Goal: forall (n i k : nat) (_ : gt k i), @eq redexes (Var (if test k i then Init.Nat.add n i else i)) (Var i) *) intros; elim (test k i); intro P; trivial with arith. (* Goal: @eq redexes (Var (Init.Nat.add n i)) (Var i) *) absurd (k > i); trivial with arith. (* Goal: not (gt k i) *) apply le_not_gt; trivial with arith. Qed. Lemma lift1 : forall (U : redexes) (j i k : nat), lift_rec_r (lift_rec_r U i j) (j + i) k = lift_rec_r U i (j + k). Proof. (* Goal: forall (U : redexes) (j i k : nat), @eq redexes (lift_rec_r (lift_rec_r U i j) (Init.Nat.add j i) k) (lift_rec_r U i (Init.Nat.add j k)) *) simple induction U; simpl in |- *; intros. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i j) (Init.Nat.add j i) k) (lift_rec_r (lift_rec_r r0 i j) (Init.Nat.add j i) k)) (Ap b (lift_rec_r r i (Init.Nat.add j k)) (lift_rec_r r0 i (Init.Nat.add j k))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) j) (S (Init.Nat.add j i)) k)) (Fun (lift_rec_r r (S i) (Init.Nat.add j k))) *) (* Goal: @eq redexes (Var (relocate (relocate n i j) (Init.Nat.add j i) k)) (Var (relocate n i (Init.Nat.add j k))) *) unfold relocate in |- *; elim (test i n); simpl in |- *. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i j) (Init.Nat.add j i) k) (lift_rec_r (lift_rec_r r0 i j) (Init.Nat.add j i) k)) (Ap b (lift_rec_r r i (Init.Nat.add j k)) (lift_rec_r r0 i (Init.Nat.add j k))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) j) (S (Init.Nat.add j i)) k)) (Fun (lift_rec_r r (S i) (Init.Nat.add j k))) *) (* Goal: forall _ : gt i n, @eq redexes (Var (if test (Init.Nat.add j i) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: forall _ : le i n, @eq redexes (Var (if test (Init.Nat.add j i) (Init.Nat.add j n) then Init.Nat.add k (Init.Nat.add j n) else Init.Nat.add j n)) (Var (Init.Nat.add (Init.Nat.add j k) n)) *) elim (test (j + i) (j + n)); simpl in |- *; intros. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i j) (Init.Nat.add j i) k) (lift_rec_r (lift_rec_r r0 i j) (Init.Nat.add j i) k)) (Ap b (lift_rec_r r i (Init.Nat.add j k)) (lift_rec_r r0 i (Init.Nat.add j k))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) j) (S (Init.Nat.add j i)) k)) (Fun (lift_rec_r r (S i) (Init.Nat.add j k))) *) (* Goal: forall _ : gt i n, @eq redexes (Var (if test (Init.Nat.add j i) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: @eq redexes (Var (Init.Nat.add j n)) (Var (Init.Nat.add (Init.Nat.add j k) n)) *) (* Goal: @eq redexes (Var (Init.Nat.add k (Init.Nat.add j n))) (Var (Init.Nat.add (Init.Nat.add j k) n)) *) elim plus_permute; elim plus_assoc; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i j) (Init.Nat.add j i) k) (lift_rec_r (lift_rec_r r0 i j) (Init.Nat.add j i) k)) (Ap b (lift_rec_r r i (Init.Nat.add j k)) (lift_rec_r r0 i (Init.Nat.add j k))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) j) (S (Init.Nat.add j i)) k)) (Fun (lift_rec_r r (S i) (Init.Nat.add j k))) *) (* Goal: forall _ : gt i n, @eq redexes (Var (if test (Init.Nat.add j i) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: @eq redexes (Var (Init.Nat.add j n)) (Var (Init.Nat.add (Init.Nat.add j k) n)) *) absurd (i > n); auto with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i j) (Init.Nat.add j i) k) (lift_rec_r (lift_rec_r r0 i j) (Init.Nat.add j i) k)) (Ap b (lift_rec_r r i (Init.Nat.add j k)) (lift_rec_r r0 i (Init.Nat.add j k))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) j) (S (Init.Nat.add j i)) k)) (Fun (lift_rec_r r (S i) (Init.Nat.add j k))) *) (* Goal: forall _ : gt i n, @eq redexes (Var (if test (Init.Nat.add j i) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: gt i n *) apply plus_gt_reg_l with j; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i j) (Init.Nat.add j i) k) (lift_rec_r (lift_rec_r r0 i j) (Init.Nat.add j i) k)) (Ap b (lift_rec_r r i (Init.Nat.add j k)) (lift_rec_r r0 i (Init.Nat.add j k))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) j) (S (Init.Nat.add j i)) k)) (Fun (lift_rec_r r (S i) (Init.Nat.add j k))) *) (* Goal: forall _ : gt i n, @eq redexes (Var (if test (Init.Nat.add j i) n then Init.Nat.add k n else n)) (Var n) *) elim (test (j + i) n); simpl in |- *; intros; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i j) (Init.Nat.add j i) k) (lift_rec_r (lift_rec_r r0 i j) (Init.Nat.add j i) k)) (Ap b (lift_rec_r r i (Init.Nat.add j k)) (lift_rec_r r0 i (Init.Nat.add j k))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) j) (S (Init.Nat.add j i)) k)) (Fun (lift_rec_r r (S i) (Init.Nat.add j k))) *) (* Goal: @eq redexes (Var (Init.Nat.add k n)) (Var n) *) absurd (i <= n); auto with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i j) (Init.Nat.add j i) k) (lift_rec_r (lift_rec_r r0 i j) (Init.Nat.add j i) k)) (Ap b (lift_rec_r r i (Init.Nat.add j k)) (lift_rec_r r0 i (Init.Nat.add j k))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) j) (S (Init.Nat.add j i)) k)) (Fun (lift_rec_r r (S i) (Init.Nat.add j k))) *) (* Goal: le i n *) apply le_trans with (j + i); trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i j) (Init.Nat.add j i) k) (lift_rec_r (lift_rec_r r0 i j) (Init.Nat.add j i) k)) (Ap b (lift_rec_r r i (Init.Nat.add j k)) (lift_rec_r r0 i (Init.Nat.add j k))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) j) (S (Init.Nat.add j i)) k)) (Fun (lift_rec_r r (S i) (Init.Nat.add j k))) *) rewrite (plus_n_Sm j i); elim H; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i j) (Init.Nat.add j i) k) (lift_rec_r (lift_rec_r r0 i j) (Init.Nat.add j i) k)) (Ap b (lift_rec_r r i (Init.Nat.add j k)) (lift_rec_r r0 i (Init.Nat.add j k))) *) elim H; elim H0; trivial with arith. Qed. Lemma lift_lift_rec : forall (U : redexes) (k p n i : nat), i <= n -> lift_rec_r (lift_rec_r U i p) (p + n) k = lift_rec_r (lift_rec_r U n k) i p. Proof. (* Goal: forall (U : redexes) (k p n i : nat) (_ : le i n), @eq redexes (lift_rec_r (lift_rec_r U i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r U n k) i p) *) simple induction U; simpl in |- *; intros. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: @eq redexes (Var (relocate (relocate n i p) (Init.Nat.add p n0) k)) (Var (relocate (relocate n n0 k) i p)) *) unfold relocate in |- *. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: @eq redexes (Var (if test (Init.Nat.add p n0) (if test i n then Init.Nat.add p n else n) then Init.Nat.add k (if test i n then Init.Nat.add p n else n) else if test i n then Init.Nat.add p n else n)) (Var (if test i (if test n0 n then Init.Nat.add k n else n) then Init.Nat.add p (if test n0 n then Init.Nat.add k n else n) else if test n0 n then Init.Nat.add k n else n)) *) elim (test n0 n); elim (test i n); simpl in |- *. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: forall (_ : gt i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: forall (_ : le i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) (Init.Nat.add p n) then Init.Nat.add k (Init.Nat.add p n) else Init.Nat.add p n)) (Var (Init.Nat.add p n)) *) (* Goal: forall (_ : gt i n) (_ : le n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var (if test i (Init.Nat.add k n) then Init.Nat.add p (Init.Nat.add k n) else Init.Nat.add k n)) *) (* Goal: forall (_ : le i n) (_ : le n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) (Init.Nat.add p n) then Init.Nat.add k (Init.Nat.add p n) else Init.Nat.add p n)) (Var (if test i (Init.Nat.add k n) then Init.Nat.add p (Init.Nat.add k n) else Init.Nat.add k n)) *) elim (test (p + n0) (p + n)); elim (test i (k + n)); simpl in |- *; intros. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: forall (_ : gt i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: forall (_ : le i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) (Init.Nat.add p n) then Init.Nat.add k (Init.Nat.add p n) else Init.Nat.add p n)) (Var (Init.Nat.add p n)) *) (* Goal: forall (_ : gt i n) (_ : le n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var (if test i (Init.Nat.add k n) then Init.Nat.add p (Init.Nat.add k n) else Init.Nat.add k n)) *) (* Goal: @eq redexes (Var (Init.Nat.add p n)) (Var (Init.Nat.add k n)) *) (* Goal: @eq redexes (Var (Init.Nat.add p n)) (Var (Init.Nat.add p (Init.Nat.add k n))) *) (* Goal: @eq redexes (Var (Init.Nat.add k (Init.Nat.add p n))) (Var (Init.Nat.add k n)) *) (* Goal: @eq redexes (Var (Init.Nat.add k (Init.Nat.add p n))) (Var (Init.Nat.add p (Init.Nat.add k n))) *) rewrite plus_permute; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: forall (_ : gt i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: forall (_ : le i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) (Init.Nat.add p n) then Init.Nat.add k (Init.Nat.add p n) else Init.Nat.add p n)) (Var (Init.Nat.add p n)) *) (* Goal: forall (_ : gt i n) (_ : le n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var (if test i (Init.Nat.add k n) then Init.Nat.add p (Init.Nat.add k n) else Init.Nat.add k n)) *) (* Goal: @eq redexes (Var (Init.Nat.add p n)) (Var (Init.Nat.add k n)) *) (* Goal: @eq redexes (Var (Init.Nat.add p n)) (Var (Init.Nat.add p (Init.Nat.add k n))) *) (* Goal: @eq redexes (Var (Init.Nat.add k (Init.Nat.add p n))) (Var (Init.Nat.add k n)) *) absurd (i > n); auto with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: forall (_ : gt i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: forall (_ : le i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) (Init.Nat.add p n) then Init.Nat.add k (Init.Nat.add p n) else Init.Nat.add p n)) (Var (Init.Nat.add p n)) *) (* Goal: forall (_ : gt i n) (_ : le n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var (if test i (Init.Nat.add k n) then Init.Nat.add p (Init.Nat.add k n) else Init.Nat.add k n)) *) (* Goal: @eq redexes (Var (Init.Nat.add p n)) (Var (Init.Nat.add k n)) *) (* Goal: @eq redexes (Var (Init.Nat.add p n)) (Var (Init.Nat.add p (Init.Nat.add k n))) *) (* Goal: gt i n *) apply gt_le_trans with (k + n); trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: forall (_ : gt i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: forall (_ : le i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) (Init.Nat.add p n) then Init.Nat.add k (Init.Nat.add p n) else Init.Nat.add p n)) (Var (Init.Nat.add p n)) *) (* Goal: forall (_ : gt i n) (_ : le n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var (if test i (Init.Nat.add k n) then Init.Nat.add p (Init.Nat.add k n) else Init.Nat.add k n)) *) (* Goal: @eq redexes (Var (Init.Nat.add p n)) (Var (Init.Nat.add k n)) *) (* Goal: @eq redexes (Var (Init.Nat.add p n)) (Var (Init.Nat.add p (Init.Nat.add k n))) *) absurd (n0 > n); auto with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: forall (_ : gt i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: forall (_ : le i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) (Init.Nat.add p n) then Init.Nat.add k (Init.Nat.add p n) else Init.Nat.add p n)) (Var (Init.Nat.add p n)) *) (* Goal: forall (_ : gt i n) (_ : le n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var (if test i (Init.Nat.add k n) then Init.Nat.add p (Init.Nat.add k n) else Init.Nat.add k n)) *) (* Goal: @eq redexes (Var (Init.Nat.add p n)) (Var (Init.Nat.add k n)) *) (* Goal: gt n0 n *) apply plus_gt_reg_l with p; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: forall (_ : gt i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: forall (_ : le i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) (Init.Nat.add p n) then Init.Nat.add k (Init.Nat.add p n) else Init.Nat.add p n)) (Var (Init.Nat.add p n)) *) (* Goal: forall (_ : gt i n) (_ : le n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var (if test i (Init.Nat.add k n) then Init.Nat.add p (Init.Nat.add k n) else Init.Nat.add k n)) *) (* Goal: @eq redexes (Var (Init.Nat.add p n)) (Var (Init.Nat.add k n)) *) absurd (n0 > n); auto with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: forall (_ : gt i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: forall (_ : le i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) (Init.Nat.add p n) then Init.Nat.add k (Init.Nat.add p n) else Init.Nat.add p n)) (Var (Init.Nat.add p n)) *) (* Goal: forall (_ : gt i n) (_ : le n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var (if test i (Init.Nat.add k n) then Init.Nat.add p (Init.Nat.add k n) else Init.Nat.add k n)) *) (* Goal: gt n0 n *) apply plus_gt_reg_l with p; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: forall (_ : gt i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: forall (_ : le i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) (Init.Nat.add p n) then Init.Nat.add k (Init.Nat.add p n) else Init.Nat.add p n)) (Var (Init.Nat.add p n)) *) (* Goal: forall (_ : gt i n) (_ : le n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var (if test i (Init.Nat.add k n) then Init.Nat.add p (Init.Nat.add k n) else Init.Nat.add k n)) *) intros; absurd (i > n); trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: forall (_ : gt i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: forall (_ : le i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) (Init.Nat.add p n) then Init.Nat.add k (Init.Nat.add p n) else Init.Nat.add p n)) (Var (Init.Nat.add p n)) *) (* Goal: not (gt i n) *) apply le_not_gt; apply le_trans with n0; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: forall (_ : gt i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: forall (_ : le i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) (Init.Nat.add p n) then Init.Nat.add k (Init.Nat.add p n) else Init.Nat.add p n)) (Var (Init.Nat.add p n)) *) intros; elim (test (p + n0) (p + n)); simpl in |- *; intros; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: forall (_ : gt i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: @eq redexes (Var (Init.Nat.add k (Init.Nat.add p n))) (Var (Init.Nat.add p n)) *) absurd (n0 > n); trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: forall (_ : gt i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var n) *) (* Goal: not (gt n0 n) *) apply le_not_gt; apply (fun p n m : nat => plus_le_reg_l n m p) with p; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: forall (_ : gt i n) (_ : gt n0 n), @eq redexes (Var (if test (Init.Nat.add p n0) n then Init.Nat.add k n else n)) (Var n) *) intros; elim (test (p + n0) n); simpl in |- *; intros; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: @eq redexes (Var (Init.Nat.add k n)) (Var n) *) absurd (n0 > n); trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) (* Goal: not (gt n0 n) *) apply le_not_gt; apply le_trans with (p + n0); trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) p) (S (Init.Nat.add p n)) k)) (Fun (lift_rec_r (lift_rec_r r (S n) k) (S i) p)) *) rewrite (plus_n_Sm p n); rewrite H; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) (* Goal: le (S i) (S n) *) elim (plus_n_Sm k n); auto with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i p) (Init.Nat.add p n) k) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) rewrite H; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 i p) (Init.Nat.add p n) k)) (Ap b (lift_rec_r (lift_rec_r r n k) i p) (lift_rec_r (lift_rec_r r0 n k) i p)) *) rewrite H0; trivial with arith. Qed. Lemma lift_lift : forall (U : redexes) (k p n : nat), lift_rec_r (lift_r p U) (p + n) k = lift_r p (lift_rec_r U n k). Proof. (* Goal: forall (U : redexes) (k p n : nat), @eq redexes (lift_rec_r (lift_r p U) (Init.Nat.add p n) k) (lift_r p (lift_rec_r U n k)) *) unfold lift_r in |- *; intros; apply lift_lift_rec; trivial with arith. Qed. Lemma liftrecO : forall (U : redexes) (n : nat), lift_rec_r U n 0 = U. Proof. (* Goal: forall (U : redexes) (n : nat), @eq redexes (lift_rec_r U n O) U *) simple induction U; simpl in |- *; intros. (* Goal: @eq redexes (Ap b (lift_rec_r r n O) (lift_rec_r r0 n O)) (Ap b r r0) *) (* Goal: @eq redexes (Fun (lift_rec_r r (S n) O)) (Fun r) *) (* Goal: @eq redexes (Var (relocate n n0 O)) (Var n) *) unfold relocate in |- *; elim (test n0 n); trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r r n O) (lift_rec_r r0 n O)) (Ap b r r0) *) (* Goal: @eq redexes (Fun (lift_rec_r r (S n) O)) (Fun r) *) rewrite H; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r r n O) (lift_rec_r r0 n O)) (Ap b r r0) *) rewrite H; rewrite H0; trivial with arith. Qed. Lemma liftO : forall U : redexes, lift_r 0 U = U. Proof. (* Goal: forall U : redexes, @eq redexes (lift_r O U) U *) unfold lift_r in |- *; intro U; apply liftrecO. Qed. Lemma lift_rec_lift_rec : forall (U : redexes) (n p k i : nat), k <= i + n -> i <= k -> lift_rec_r (lift_rec_r U i n) k p = lift_rec_r U i (p + n). Proof. (* Goal: forall (U : redexes) (n p k i : nat) (_ : le k (Init.Nat.add i n)) (_ : le i k), @eq redexes (lift_rec_r (lift_rec_r U i n) k p) (lift_rec_r U i (Init.Nat.add p n)) *) simple induction U; simpl in |- *; intros. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i n) k p) (lift_rec_r (lift_rec_r r0 i n) k p)) (Ap b (lift_rec_r r i (Init.Nat.add p n)) (lift_rec_r r0 i (Init.Nat.add p n))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) n) (S k) p)) (Fun (lift_rec_r r (S i) (Init.Nat.add p n))) *) (* Goal: @eq redexes (Var (relocate (relocate n i n0) k p)) (Var (relocate n i (Init.Nat.add p n0))) *) unfold relocate in |- *; elim (test i n); intro P. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i n) k p) (lift_rec_r (lift_rec_r r0 i n) k p)) (Ap b (lift_rec_r r i (Init.Nat.add p n)) (lift_rec_r r0 i (Init.Nat.add p n))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) n) (S k) p)) (Fun (lift_rec_r r (S i) (Init.Nat.add p n))) *) (* Goal: @eq redexes (Var (if test k n then Init.Nat.add p n else n)) (Var n) *) (* Goal: @eq redexes (Var (if test k (Init.Nat.add n0 n) then Init.Nat.add p (Init.Nat.add n0 n) else Init.Nat.add n0 n)) (Var (Init.Nat.add (Init.Nat.add p n0) n)) *) elim (test k (n0 + n)); intro Q. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i n) k p) (lift_rec_r (lift_rec_r r0 i n) k p)) (Ap b (lift_rec_r r i (Init.Nat.add p n)) (lift_rec_r r0 i (Init.Nat.add p n))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) n) (S k) p)) (Fun (lift_rec_r r (S i) (Init.Nat.add p n))) *) (* Goal: @eq redexes (Var (if test k n then Init.Nat.add p n else n)) (Var n) *) (* Goal: @eq redexes (Var (Init.Nat.add n0 n)) (Var (Init.Nat.add (Init.Nat.add p n0) n)) *) (* Goal: @eq redexes (Var (Init.Nat.add p (Init.Nat.add n0 n))) (Var (Init.Nat.add (Init.Nat.add p n0) n)) *) rewrite plus_assoc_reverse; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i n) k p) (lift_rec_r (lift_rec_r r0 i n) k p)) (Ap b (lift_rec_r r i (Init.Nat.add p n)) (lift_rec_r r0 i (Init.Nat.add p n))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) n) (S k) p)) (Fun (lift_rec_r r (S i) (Init.Nat.add p n))) *) (* Goal: @eq redexes (Var (if test k n then Init.Nat.add p n else n)) (Var n) *) (* Goal: @eq redexes (Var (Init.Nat.add n0 n)) (Var (Init.Nat.add (Init.Nat.add p n0) n)) *) absurd (k > n0 + n); trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i n) k p) (lift_rec_r (lift_rec_r r0 i n) k p)) (Ap b (lift_rec_r r i (Init.Nat.add p n)) (lift_rec_r r0 i (Init.Nat.add p n))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) n) (S k) p)) (Fun (lift_rec_r r (S i) (Init.Nat.add p n))) *) (* Goal: @eq redexes (Var (if test k n then Init.Nat.add p n else n)) (Var n) *) (* Goal: not (gt k (Init.Nat.add n0 n)) *) apply le_not_gt; apply le_trans with (i + n0); trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i n) k p) (lift_rec_r (lift_rec_r r0 i n) k p)) (Ap b (lift_rec_r r i (Init.Nat.add p n)) (lift_rec_r r0 i (Init.Nat.add p n))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) n) (S k) p)) (Fun (lift_rec_r r (S i) (Init.Nat.add p n))) *) (* Goal: @eq redexes (Var (if test k n then Init.Nat.add p n else n)) (Var n) *) (* Goal: le (Init.Nat.add i n0) (Init.Nat.add n0 n) *) replace (i + n0) with (n0 + i); auto with arith; apply plus_le_compat_l; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i n) k p) (lift_rec_r (lift_rec_r r0 i n) k p)) (Ap b (lift_rec_r r i (Init.Nat.add p n)) (lift_rec_r r0 i (Init.Nat.add p n))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) n) (S k) p)) (Fun (lift_rec_r r (S i) (Init.Nat.add p n))) *) (* Goal: @eq redexes (Var (if test k n then Init.Nat.add p n else n)) (Var n) *) elim (test k n); intro Q; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i n) k p) (lift_rec_r (lift_rec_r r0 i n) k p)) (Ap b (lift_rec_r r i (Init.Nat.add p n)) (lift_rec_r r0 i (Init.Nat.add p n))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) n) (S k) p)) (Fun (lift_rec_r r (S i) (Init.Nat.add p n))) *) (* Goal: @eq redexes (Var (Init.Nat.add p n)) (Var n) *) absurd (i > k). (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i n) k p) (lift_rec_r (lift_rec_r r0 i n) k p)) (Ap b (lift_rec_r r i (Init.Nat.add p n)) (lift_rec_r r0 i (Init.Nat.add p n))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) n) (S k) p)) (Fun (lift_rec_r r (S i) (Init.Nat.add p n))) *) (* Goal: gt i k *) (* Goal: not (gt i k) *) apply le_not_gt; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i n) k p) (lift_rec_r (lift_rec_r r0 i n) k p)) (Ap b (lift_rec_r r i (Init.Nat.add p n)) (lift_rec_r r0 i (Init.Nat.add p n))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) n) (S k) p)) (Fun (lift_rec_r r (S i) (Init.Nat.add p n))) *) (* Goal: gt i k *) apply gt_le_trans with n; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i n) k p) (lift_rec_r (lift_rec_r r0 i n) k p)) (Ap b (lift_rec_r r i (Init.Nat.add p n)) (lift_rec_r r0 i (Init.Nat.add p n))) *) (* Goal: @eq redexes (Fun (lift_rec_r (lift_rec_r r (S i) n) (S k) p)) (Fun (lift_rec_r r (S i) (Init.Nat.add p n))) *) rewrite H; trivial with arith; simpl in |- *; apply le_n_S; trivial with arith. (* Goal: @eq redexes (Ap b (lift_rec_r (lift_rec_r r i n) k p) (lift_rec_r (lift_rec_r r0 i n) k p)) (Ap b (lift_rec_r r i (Init.Nat.add p n)) (lift_rec_r r0 i (Init.Nat.add p n))) *) rewrite H; trivial with arith; rewrite H0; trivial with arith. Qed. Lemma lift_rec_lift : forall (U : redexes) (n p k i : nat), k <= n -> lift_rec_r (lift_r n U) k p = lift_r (p + n) U. Proof. (* Goal: forall (U : redexes) (n p k _ : nat) (_ : le k n), @eq redexes (lift_rec_r (lift_r n U) k p) (lift_r (Init.Nat.add p n) U) *) unfold lift_r in |- *; intros; rewrite lift_rec_lift_rec; trivial with arith. Qed. Lemma subst_eq : forall (U : redexes) (n : nat), subst_rec_r (Var n) U n = lift_r n U. Proof. (* Goal: forall (U : redexes) (n : nat), @eq redexes (subst_rec_r (Var n) U n) (lift_r n U) *) simpl in |- *; unfold insert_Var in |- *. (* Goal: forall (U : redexes) (n : nat), @eq redexes match compare n n with | inleft (left l as s) => Var (Init.Nat.pred n) | inleft (right e as s) => lift_r n U | inright g => Var n end (lift_r n U) *) intros; elim (compare n n); intro P. (* Goal: @eq redexes (Var n) (lift_r n U) *) (* Goal: @eq redexes (if P then Var (Init.Nat.pred n) else lift_r n U) (lift_r n U) *) elim P; intro Q; simpl in |- *; trivial with arith. (* Goal: @eq redexes (Var n) (lift_r n U) *) (* Goal: @eq redexes (Var (Init.Nat.pred n)) (lift_r n U) *) absurd (n > n); trivial with arith. (* Goal: @eq redexes (Var n) (lift_r n U) *) absurd (n > n); trivial with arith. Qed. Lemma subst_gt : forall (U : redexes) (n p : nat), n > p -> subst_rec_r (Var n) U p = Var (pred n). Proof. (* Goal: forall (U : redexes) (n p : nat) (_ : gt n p), @eq redexes (subst_rec_r (Var n) U p) (Var (Init.Nat.pred n)) *) simpl in |- *; unfold insert_Var in |- *. (* Goal: forall (U : redexes) (n p : nat) (_ : gt n p), @eq redexes match compare p n with | inleft (left l as s) => Var (Init.Nat.pred n) | inleft (right e as s) => lift_r p U | inright g => Var n end (Var (Init.Nat.pred n)) *) intros; elim (compare p n); intro P. (* Goal: @eq redexes (Var n) (Var (Init.Nat.pred n)) *) (* Goal: @eq redexes (if P then Var (Init.Nat.pred n) else lift_r p U) (Var (Init.Nat.pred n)) *) elim P; intro Q; trivial with arith. (* Goal: @eq redexes (Var n) (Var (Init.Nat.pred n)) *) (* Goal: @eq redexes (lift_r p U) (Var (Init.Nat.pred n)) *) absurd (n > p); trivial with arith; rewrite Q; trivial with arith. (* Goal: @eq redexes (Var n) (Var (Init.Nat.pred n)) *) absurd (n > p); auto with arith. Qed. Lemma subst_lt : forall (U : redexes) (n p : nat), p > n -> subst_rec_r (Var n) U p = Var n. Proof. (* Goal: forall (U : redexes) (n p : nat) (_ : gt p n), @eq redexes (subst_rec_r (Var n) U p) (Var n) *) simpl in |- *; unfold insert_Var in |- *. (* Goal: forall (U : redexes) (n p : nat) (_ : gt p n), @eq redexes match compare p n with | inleft (left l as s) => Var (Init.Nat.pred n) | inleft (right e as s) => lift_r p U | inright g => Var n end (Var n) *) intros; elim (compare p n); intro P; trivial with arith. (* Goal: @eq redexes (if P then Var (Init.Nat.pred n) else lift_r p U) (Var n) *) absurd (p > n); trivial with arith; elim P; intro Q; auto with arith. (* Goal: not (gt p n) *) rewrite Q; trivial with arith. Qed. Lemma lift_rec_subst_rec : forall (U V : redexes) (k p n : nat), lift_rec_r (subst_rec_r V U p) (p + n) k = subst_rec_r (lift_rec_r V (S (p + n)) k) (lift_rec_r U n k) p. Lemma lift_subst : forall (U V : redexes) (k n : nat), lift_rec_r (subst_r U V) n k = subst_r (lift_rec_r U n k) (lift_rec_r V (S n) k). Proof. (* Goal: forall (U V : redexes) (k n : nat), @eq redexes (lift_rec_r (subst_r U V) n k) (subst_r (lift_rec_r U n k) (lift_rec_r V (S n) k)) *) unfold subst_r in |- *; intros. (* Goal: @eq redexes (lift_rec_r (subst_rec_r V U O) n k) (subst_rec_r (lift_rec_r V (S n) k) (lift_rec_r U n k) O) *) replace (S n) with (S (0 + n)). (* Goal: @eq nat (S (Init.Nat.add O n)) (S n) *) (* Goal: @eq redexes (lift_rec_r (subst_rec_r V U O) n k) (subst_rec_r (lift_rec_r V (S (Init.Nat.add O n)) k) (lift_rec_r U n k) O) *) elim lift_rec_subst_rec; trivial with arith. (* Goal: @eq nat (S (Init.Nat.add O n)) (S n) *) simpl in |- *; trivial with arith. Qed. Lemma subst_rec_lift_rec1 : forall (U V : redexes) (n p k : nat), k <= n -> subst_rec_r (lift_rec_r U k p) V (p + n) = lift_rec_r (subst_rec_r U V n) k p. Lemma subst_rec_lift1 : forall (U V : redexes) (n p : nat), subst_rec_r (lift_r p U) V (p + n) = lift_r p (subst_rec_r U V n). Proof. (* Goal: forall (U V : redexes) (n p : nat), @eq redexes (subst_rec_r (lift_r p U) V (Init.Nat.add p n)) (lift_r p (subst_rec_r U V n)) *) unfold lift_r in |- *; intros; rewrite subst_rec_lift_rec1; trivial with arith. Qed. Lemma subst_rec_lift_rec : forall (U V : redexes) (p q n : nat), q <= p + n -> n <= q -> subst_rec_r (lift_rec_r U n (S p)) V q = lift_rec_r U n p. Lemma subst_rec_lift : forall (U V : redexes) (p q : nat), q <= p -> subst_rec_r (lift_r (S p) U) V q = lift_r p U. Proof. (* Goal: forall (U V : redexes) (p q : nat) (_ : le q p), @eq redexes (subst_rec_r (lift_r (S p) U) V q) (lift_r p U) *) unfold lift_r in |- *; intros; rewrite subst_rec_lift_rec; trivial with arith. (* Goal: le q (Init.Nat.add p O) *) elim plus_n_O; trivial with arith. Qed. Lemma subst_rec_subst_rec : forall (U V W : redexes) (n p : nat), subst_rec_r (subst_rec_r V U p) W (p + n) = subst_rec_r (subst_rec_r V W (S (p + n))) (subst_rec_r U W n) p. Lemma subst_rec_subst_0 : forall (U V W : redexes) (n : nat), subst_rec_r (subst_rec_r V U 0) W n = subst_rec_r (subst_rec_r V W (S n)) (subst_rec_r U W n) 0. Proof. (* Goal: forall (U V W : redexes) (n : nat), @eq redexes (subst_rec_r (subst_rec_r V U O) W n) (subst_rec_r (subst_rec_r V W (S n)) (subst_rec_r U W n) O) *) intros; pattern n at 1 3 in |- *. (* Goal: (fun n0 : nat => @eq redexes (subst_rec_r (subst_rec_r V U O) W n0) (subst_rec_r (subst_rec_r V W (S n)) (subst_rec_r U W n0) O)) n *) replace n with (0 + n). (* Goal: @eq nat (Init.Nat.add O n) n *) (* Goal: @eq redexes (subst_rec_r (subst_rec_r V U O) W (Init.Nat.add O n)) (subst_rec_r (subst_rec_r V W (S n)) (subst_rec_r U W (Init.Nat.add O n)) O) *) rewrite (subst_rec_subst_rec U V W n 0); trivial with arith. (* Goal: @eq nat (Init.Nat.add O n) n *) simpl in |- *; trivial with arith. Qed. Lemma substitution : forall (U V W : redexes) (n : nat), subst_rec_r (subst_r U V) W n = subst_r (subst_rec_r U W n) (subst_rec_r V W (S n)). Proof. (* Goal: forall (U V W : redexes) (n : nat), @eq redexes (subst_rec_r (subst_r U V) W n) (subst_r (subst_rec_r U W n) (subst_rec_r V W (S n))) *) unfold subst_r in |- *; intros; apply subst_rec_subst_0; trivial with arith. Qed. Lemma lift_rec_preserve_comp : forall U1 V1 : redexes, comp U1 V1 -> forall n m : nat, comp (lift_rec_r U1 m n) (lift_rec_r V1 m n). Proof. (* Goal: forall (U1 V1 : redexes) (_ : comp U1 V1) (n m : nat), comp (lift_rec_r U1 m n) (lift_rec_r V1 m n) *) simple induction 1; simpl in |- *; auto with arith. Qed. Lemma subst_rec_preserve_comp : forall U1 V1 U2 V2 : redexes, comp U1 V1 -> comp U2 V2 -> forall n : nat, comp (subst_rec_r U1 U2 n) (subst_rec_r V1 V2 n). Proof. (* Goal: forall (U1 V1 U2 V2 : redexes) (_ : comp U1 V1) (_ : comp U2 V2) (n : nat), comp (subst_rec_r U1 U2 n) (subst_rec_r V1 V2 n) *) simple induction 1; simpl in |- *; auto with arith. (* Goal: forall (n : nat) (_ : comp U2 V2) (n0 : nat), comp (insert_Var U2 n n0) (insert_Var V2 n n0) *) intros n C n0; unfold insert_Var in |- *; elim (compare n0 n); trivial with arith. (* Goal: forall a : sumbool (lt n0 n) (@eq nat n0 n), comp (if a then Var (Init.Nat.pred n) else lift_r n0 U2) (if a then Var (Init.Nat.pred n) else lift_r n0 V2) *) simple induction a; trivial with arith. (* Goal: forall _ : @eq nat n0 n, comp (lift_r n0 U2) (lift_r n0 V2) *) intro; unfold lift_r in |- *; apply lift_rec_preserve_comp; trivial with arith. Qed. Lemma subst_preserve_comp : forall U1 V1 U2 V2 : redexes, comp U1 V1 -> comp U2 V2 -> comp (subst_r U2 U1) (subst_r V2 V1). Proof. (* Goal: forall (U1 V1 U2 V2 : redexes) (_ : comp U1 V1) (_ : comp U2 V2), comp (subst_r U2 U1) (subst_r V2 V1) *) intros; unfold subst_r in |- *; apply subst_rec_preserve_comp; trivial with arith. Qed. Lemma lift_rec_preserve_regular : forall U : redexes, regular U -> forall n m : nat, regular (lift_rec_r U m n). Proof. (* Goal: forall (U : redexes) (_ : regular U) (n m : nat), regular (lift_rec_r U m n) *) simple induction U; simpl in |- *; auto with arith. (* Goal: forall (b : bool) (r : redexes) (_ : forall (_ : regular r) (n m : nat), regular (lift_rec_r r m n)) (r0 : redexes) (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (_ : if b then match r with | Var n => False | Fun r1 => and (regular r) (regular r0) | Ap b0 r1 r2 => False end else and (regular r) (regular r0)) (n m : nat), if b then match lift_rec_r r m n with | Var n0 => False | Fun r1 => and (regular (lift_rec_r r m n)) (regular (lift_rec_r r0 m n)) | Ap b0 r1 r2 => False end else and (regular (lift_rec_r r m n)) (regular (lift_rec_r r0 m n)) *) simple induction b; simple induction r; try contradiction. (* Goal: forall (b : bool) (r : redexes) (_ : forall (_ : forall (_ : regular r) (n m : nat), regular (lift_rec_r r m n)) (r0 : redexes) (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (_ : and (regular r) (regular r0)) (n m : nat), and (regular (lift_rec_r r m n)) (regular (lift_rec_r r0 m n))) (r0 : redexes) (_ : forall (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (r1 : redexes) (_ : forall (_ : regular r1) (n m : nat), regular (lift_rec_r r1 m n)) (_ : and (regular r0) (regular r1)) (n m : nat), and (regular (lift_rec_r r0 m n)) (regular (lift_rec_r r1 m n))) (_ : forall (_ : regular (Ap b r r0)) (n m : nat), regular (lift_rec_r (Ap b r r0) m n)) (r1 : redexes) (_ : forall (_ : regular r1) (n m : nat), regular (lift_rec_r r1 m n)) (_ : and (regular (Ap b r r0)) (regular r1)) (n m : nat), and (regular (lift_rec_r (Ap b r r0) m n)) (regular (lift_rec_r r1 m n)) *) (* Goal: forall (r : redexes) (_ : forall (_ : forall (_ : regular r) (n m : nat), regular (lift_rec_r r m n)) (r0 : redexes) (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (_ : and (regular r) (regular r0)) (n m : nat), and (regular (lift_rec_r r m n)) (regular (lift_rec_r r0 m n))) (_ : forall (_ : regular (Fun r)) (n m : nat), regular (lift_rec_r (Fun r) m n)) (r0 : redexes) (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (_ : and (regular (Fun r)) (regular r0)) (n m : nat), and (regular (lift_rec_r (Fun r) m n)) (regular (lift_rec_r r0 m n)) *) (* Goal: forall (n : nat) (_ : forall (_ : regular (Var n)) (n0 m : nat), regular (lift_rec_r (Var n) m n0)) (r : redexes) (_ : forall (_ : regular r) (n0 m : nat), regular (lift_rec_r r m n0)) (_ : and (regular (Var n)) (regular r)) (n0 m : nat), and (regular (lift_rec_r (Var n) m n0)) (regular (lift_rec_r r m n0)) *) (* Goal: forall (r : redexes) (_ : forall (_ : forall (_ : regular r) (n m : nat), regular (lift_rec_r r m n)) (r0 : redexes) (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (_ : match r with | Var n => False | Fun r1 => and (regular r) (regular r0) | Ap b r1 r2 => False end) (n m : nat), match lift_rec_r r m n with | Var n0 => False | Fun r1 => and (regular (lift_rec_r r m n)) (regular (lift_rec_r r0 m n)) | Ap b r1 r2 => False end) (_ : forall (_ : regular (Fun r)) (n m : nat), regular (lift_rec_r (Fun r) m n)) (r0 : redexes) (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (_ : and (regular (Fun r)) (regular r0)) (n m : nat), match lift_rec_r (Fun r) m n with | Var n0 => False | Fun r1 => and (regular (lift_rec_r (Fun r) m n)) (regular (lift_rec_r r0 m n)) | Ap b r1 r2 => False end *) simpl in |- *; intros; elim H2; auto with arith. (* Goal: forall (b : bool) (r : redexes) (_ : forall (_ : forall (_ : regular r) (n m : nat), regular (lift_rec_r r m n)) (r0 : redexes) (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (_ : and (regular r) (regular r0)) (n m : nat), and (regular (lift_rec_r r m n)) (regular (lift_rec_r r0 m n))) (r0 : redexes) (_ : forall (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (r1 : redexes) (_ : forall (_ : regular r1) (n m : nat), regular (lift_rec_r r1 m n)) (_ : and (regular r0) (regular r1)) (n m : nat), and (regular (lift_rec_r r0 m n)) (regular (lift_rec_r r1 m n))) (_ : forall (_ : regular (Ap b r r0)) (n m : nat), regular (lift_rec_r (Ap b r r0) m n)) (r1 : redexes) (_ : forall (_ : regular r1) (n m : nat), regular (lift_rec_r r1 m n)) (_ : and (regular (Ap b r r0)) (regular r1)) (n m : nat), and (regular (lift_rec_r (Ap b r r0) m n)) (regular (lift_rec_r r1 m n)) *) (* Goal: forall (r : redexes) (_ : forall (_ : forall (_ : regular r) (n m : nat), regular (lift_rec_r r m n)) (r0 : redexes) (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (_ : and (regular r) (regular r0)) (n m : nat), and (regular (lift_rec_r r m n)) (regular (lift_rec_r r0 m n))) (_ : forall (_ : regular (Fun r)) (n m : nat), regular (lift_rec_r (Fun r) m n)) (r0 : redexes) (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (_ : and (regular (Fun r)) (regular r0)) (n m : nat), and (regular (lift_rec_r (Fun r) m n)) (regular (lift_rec_r r0 m n)) *) (* Goal: forall (n : nat) (_ : forall (_ : regular (Var n)) (n0 m : nat), regular (lift_rec_r (Var n) m n0)) (r : redexes) (_ : forall (_ : regular r) (n0 m : nat), regular (lift_rec_r r m n0)) (_ : and (regular (Var n)) (regular r)) (n0 m : nat), and (regular (lift_rec_r (Var n) m n0)) (regular (lift_rec_r r m n0)) *) intros; elim H1; auto with arith. (* Goal: forall (b : bool) (r : redexes) (_ : forall (_ : forall (_ : regular r) (n m : nat), regular (lift_rec_r r m n)) (r0 : redexes) (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (_ : and (regular r) (regular r0)) (n m : nat), and (regular (lift_rec_r r m n)) (regular (lift_rec_r r0 m n))) (r0 : redexes) (_ : forall (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (r1 : redexes) (_ : forall (_ : regular r1) (n m : nat), regular (lift_rec_r r1 m n)) (_ : and (regular r0) (regular r1)) (n m : nat), and (regular (lift_rec_r r0 m n)) (regular (lift_rec_r r1 m n))) (_ : forall (_ : regular (Ap b r r0)) (n m : nat), regular (lift_rec_r (Ap b r r0) m n)) (r1 : redexes) (_ : forall (_ : regular r1) (n m : nat), regular (lift_rec_r r1 m n)) (_ : and (regular (Ap b r r0)) (regular r1)) (n m : nat), and (regular (lift_rec_r (Ap b r r0) m n)) (regular (lift_rec_r r1 m n)) *) (* Goal: forall (r : redexes) (_ : forall (_ : forall (_ : regular r) (n m : nat), regular (lift_rec_r r m n)) (r0 : redexes) (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (_ : and (regular r) (regular r0)) (n m : nat), and (regular (lift_rec_r r m n)) (regular (lift_rec_r r0 m n))) (_ : forall (_ : regular (Fun r)) (n m : nat), regular (lift_rec_r (Fun r) m n)) (r0 : redexes) (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (_ : and (regular (Fun r)) (regular r0)) (n m : nat), and (regular (lift_rec_r (Fun r) m n)) (regular (lift_rec_r r0 m n)) *) intros; elim H2; auto with arith. (* Goal: forall (b : bool) (r : redexes) (_ : forall (_ : forall (_ : regular r) (n m : nat), regular (lift_rec_r r m n)) (r0 : redexes) (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (_ : and (regular r) (regular r0)) (n m : nat), and (regular (lift_rec_r r m n)) (regular (lift_rec_r r0 m n))) (r0 : redexes) (_ : forall (_ : forall (_ : regular r0) (n m : nat), regular (lift_rec_r r0 m n)) (r1 : redexes) (_ : forall (_ : regular r1) (n m : nat), regular (lift_rec_r r1 m n)) (_ : and (regular r0) (regular r1)) (n m : nat), and (regular (lift_rec_r r0 m n)) (regular (lift_rec_r r1 m n))) (_ : forall (_ : regular (Ap b r r0)) (n m : nat), regular (lift_rec_r (Ap b r r0) m n)) (r1 : redexes) (_ : forall (_ : regular r1) (n m : nat), regular (lift_rec_r r1 m n)) (_ : and (regular (Ap b r r0)) (regular r1)) (n m : nat), and (regular (lift_rec_r (Ap b r r0) m n)) (regular (lift_rec_r r1 m n)) *) intros; elim H3; auto with arith. Qed. Lemma subst_rec_preserve_regular : forall U V : redexes, regular U -> regular V -> forall n : nat, regular (subst_rec_r U V n). Proof. (* Goal: forall (U V : redexes) (_ : regular U) (_ : regular V) (n : nat), regular (subst_rec_r U V n) *) intros U V; elim U; simpl in |- *; auto with arith. (* Goal: forall (b : bool) (r : redexes) (_ : forall (_ : regular r) (_ : regular V) (n : nat), regular (subst_rec_r r V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : if b then match r with | Var n => False | Fun r1 => and (regular r) (regular r0) | Ap b0 r1 r2 => False end else and (regular r) (regular r0)) (_ : regular V) (n : nat), if b then match subst_rec_r r V n with | Var n0 => False | Fun r1 => and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n)) | Ap b0 r1 r2 => False end else and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n)) *) (* Goal: forall (n : nat) (_ : True) (_ : regular V) (n0 : nat), regular (insert_Var V n n0) *) intros; unfold insert_Var in |- *; elim (compare n0 n). (* Goal: forall (b : bool) (r : redexes) (_ : forall (_ : regular r) (_ : regular V) (n : nat), regular (subst_rec_r r V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : if b then match r with | Var n => False | Fun r1 => and (regular r) (regular r0) | Ap b0 r1 r2 => False end else and (regular r) (regular r0)) (_ : regular V) (n : nat), if b then match subst_rec_r r V n with | Var n0 => False | Fun r1 => and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n)) | Ap b0 r1 r2 => False end else and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n)) *) (* Goal: forall _ : gt n0 n, regular (Var n) *) (* Goal: forall a : sumbool (lt n0 n) (@eq nat n0 n), regular (if a then Var (Init.Nat.pred n) else lift_r n0 V) *) simple induction a; simpl in |- *; trivial with arith. (* Goal: forall (b : bool) (r : redexes) (_ : forall (_ : regular r) (_ : regular V) (n : nat), regular (subst_rec_r r V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : if b then match r with | Var n => False | Fun r1 => and (regular r) (regular r0) | Ap b0 r1 r2 => False end else and (regular r) (regular r0)) (_ : regular V) (n : nat), if b then match subst_rec_r r V n with | Var n0 => False | Fun r1 => and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n)) | Ap b0 r1 r2 => False end else and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n)) *) (* Goal: forall _ : gt n0 n, regular (Var n) *) (* Goal: forall _ : @eq nat n0 n, regular (lift_r n0 V) *) intro; unfold lift_r in |- *; apply lift_rec_preserve_regular; trivial with arith. (* Goal: forall (b : bool) (r : redexes) (_ : forall (_ : regular r) (_ : regular V) (n : nat), regular (subst_rec_r r V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : if b then match r with | Var n => False | Fun r1 => and (regular r) (regular r0) | Ap b0 r1 r2 => False end else and (regular r) (regular r0)) (_ : regular V) (n : nat), if b then match subst_rec_r r V n with | Var n0 => False | Fun r1 => and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n)) | Ap b0 r1 r2 => False end else and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n)) *) (* Goal: forall _ : gt n0 n, regular (Var n) *) simpl in |- *; trivial with arith. (* Goal: forall (b : bool) (r : redexes) (_ : forall (_ : regular r) (_ : regular V) (n : nat), regular (subst_rec_r r V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : if b then match r with | Var n => False | Fun r1 => and (regular r) (regular r0) | Ap b0 r1 r2 => False end else and (regular r) (regular r0)) (_ : regular V) (n : nat), if b then match subst_rec_r r V n with | Var n0 => False | Fun r1 => and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n)) | Ap b0 r1 r2 => False end else and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n)) *) simple induction b; simple induction r; try contradiction. (* Goal: forall (b : bool) (r : redexes) (_ : forall (_ : forall (_ : regular r) (_ : regular V) (n : nat), regular (subst_rec_r r V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : and (regular r) (regular r0)) (_ : regular V) (n : nat), and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n))) (r0 : redexes) (_ : forall (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (r1 : redexes) (_ : forall (_ : regular r1) (_ : regular V) (n : nat), regular (subst_rec_r r1 V n)) (_ : and (regular r0) (regular r1)) (_ : regular V) (n : nat), and (regular (subst_rec_r r0 V n)) (regular (subst_rec_r r1 V n))) (_ : forall (_ : regular (Ap b r r0)) (_ : regular V) (n : nat), regular (subst_rec_r (Ap b r r0) V n)) (r1 : redexes) (_ : forall (_ : regular r1) (_ : regular V) (n : nat), regular (subst_rec_r r1 V n)) (_ : and (regular (Ap b r r0)) (regular r1)) (_ : regular V) (n : nat), and (regular (subst_rec_r (Ap b r r0) V n)) (regular (subst_rec_r r1 V n)) *) (* Goal: forall (r : redexes) (_ : forall (_ : forall (_ : regular r) (_ : regular V) (n : nat), regular (subst_rec_r r V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : and (regular r) (regular r0)) (_ : regular V) (n : nat), and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n))) (_ : forall (_ : regular (Fun r)) (_ : regular V) (n : nat), regular (subst_rec_r (Fun r) V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : and (regular (Fun r)) (regular r0)) (_ : regular V) (n : nat), and (regular (subst_rec_r (Fun r) V n)) (regular (subst_rec_r r0 V n)) *) (* Goal: forall (n : nat) (_ : forall (_ : regular (Var n)) (_ : regular V) (n0 : nat), regular (subst_rec_r (Var n) V n0)) (r : redexes) (_ : forall (_ : regular r) (_ : regular V) (n0 : nat), regular (subst_rec_r r V n0)) (_ : and (regular (Var n)) (regular r)) (_ : regular V) (n0 : nat), and (regular (subst_rec_r (Var n) V n0)) (regular (subst_rec_r r V n0)) *) (* Goal: forall (r : redexes) (_ : forall (_ : forall (_ : regular r) (_ : regular V) (n : nat), regular (subst_rec_r r V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : match r with | Var n => False | Fun r1 => and (regular r) (regular r0) | Ap b r1 r2 => False end) (_ : regular V) (n : nat), match subst_rec_r r V n with | Var n0 => False | Fun r1 => and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n)) | Ap b r1 r2 => False end) (_ : forall (_ : regular (Fun r)) (_ : regular V) (n : nat), regular (subst_rec_r (Fun r) V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : and (regular (Fun r)) (regular r0)) (_ : regular V) (n : nat), match subst_rec_r (Fun r) V n with | Var n0 => False | Fun r1 => and (regular (subst_rec_r (Fun r) V n)) (regular (subst_rec_r r0 V n)) | Ap b r1 r2 => False end *) simpl in |- *; intros; elim H2; auto with arith. (* Goal: forall (b : bool) (r : redexes) (_ : forall (_ : forall (_ : regular r) (_ : regular V) (n : nat), regular (subst_rec_r r V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : and (regular r) (regular r0)) (_ : regular V) (n : nat), and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n))) (r0 : redexes) (_ : forall (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (r1 : redexes) (_ : forall (_ : regular r1) (_ : regular V) (n : nat), regular (subst_rec_r r1 V n)) (_ : and (regular r0) (regular r1)) (_ : regular V) (n : nat), and (regular (subst_rec_r r0 V n)) (regular (subst_rec_r r1 V n))) (_ : forall (_ : regular (Ap b r r0)) (_ : regular V) (n : nat), regular (subst_rec_r (Ap b r r0) V n)) (r1 : redexes) (_ : forall (_ : regular r1) (_ : regular V) (n : nat), regular (subst_rec_r r1 V n)) (_ : and (regular (Ap b r r0)) (regular r1)) (_ : regular V) (n : nat), and (regular (subst_rec_r (Ap b r r0) V n)) (regular (subst_rec_r r1 V n)) *) (* Goal: forall (r : redexes) (_ : forall (_ : forall (_ : regular r) (_ : regular V) (n : nat), regular (subst_rec_r r V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : and (regular r) (regular r0)) (_ : regular V) (n : nat), and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n))) (_ : forall (_ : regular (Fun r)) (_ : regular V) (n : nat), regular (subst_rec_r (Fun r) V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : and (regular (Fun r)) (regular r0)) (_ : regular V) (n : nat), and (regular (subst_rec_r (Fun r) V n)) (regular (subst_rec_r r0 V n)) *) (* Goal: forall (n : nat) (_ : forall (_ : regular (Var n)) (_ : regular V) (n0 : nat), regular (subst_rec_r (Var n) V n0)) (r : redexes) (_ : forall (_ : regular r) (_ : regular V) (n0 : nat), regular (subst_rec_r r V n0)) (_ : and (regular (Var n)) (regular r)) (_ : regular V) (n0 : nat), and (regular (subst_rec_r (Var n) V n0)) (regular (subst_rec_r r V n0)) *) intros; elim H1; auto with arith. (* Goal: forall (b : bool) (r : redexes) (_ : forall (_ : forall (_ : regular r) (_ : regular V) (n : nat), regular (subst_rec_r r V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : and (regular r) (regular r0)) (_ : regular V) (n : nat), and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n))) (r0 : redexes) (_ : forall (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (r1 : redexes) (_ : forall (_ : regular r1) (_ : regular V) (n : nat), regular (subst_rec_r r1 V n)) (_ : and (regular r0) (regular r1)) (_ : regular V) (n : nat), and (regular (subst_rec_r r0 V n)) (regular (subst_rec_r r1 V n))) (_ : forall (_ : regular (Ap b r r0)) (_ : regular V) (n : nat), regular (subst_rec_r (Ap b r r0) V n)) (r1 : redexes) (_ : forall (_ : regular r1) (_ : regular V) (n : nat), regular (subst_rec_r r1 V n)) (_ : and (regular (Ap b r r0)) (regular r1)) (_ : regular V) (n : nat), and (regular (subst_rec_r (Ap b r r0) V n)) (regular (subst_rec_r r1 V n)) *) (* Goal: forall (r : redexes) (_ : forall (_ : forall (_ : regular r) (_ : regular V) (n : nat), regular (subst_rec_r r V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : and (regular r) (regular r0)) (_ : regular V) (n : nat), and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n))) (_ : forall (_ : regular (Fun r)) (_ : regular V) (n : nat), regular (subst_rec_r (Fun r) V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : and (regular (Fun r)) (regular r0)) (_ : regular V) (n : nat), and (regular (subst_rec_r (Fun r) V n)) (regular (subst_rec_r r0 V n)) *) intros; elim H2; auto with arith. (* Goal: forall (b : bool) (r : redexes) (_ : forall (_ : forall (_ : regular r) (_ : regular V) (n : nat), regular (subst_rec_r r V n)) (r0 : redexes) (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (_ : and (regular r) (regular r0)) (_ : regular V) (n : nat), and (regular (subst_rec_r r V n)) (regular (subst_rec_r r0 V n))) (r0 : redexes) (_ : forall (_ : forall (_ : regular r0) (_ : regular V) (n : nat), regular (subst_rec_r r0 V n)) (r1 : redexes) (_ : forall (_ : regular r1) (_ : regular V) (n : nat), regular (subst_rec_r r1 V n)) (_ : and (regular r0) (regular r1)) (_ : regular V) (n : nat), and (regular (subst_rec_r r0 V n)) (regular (subst_rec_r r1 V n))) (_ : forall (_ : regular (Ap b r r0)) (_ : regular V) (n : nat), regular (subst_rec_r (Ap b r r0) V n)) (r1 : redexes) (_ : forall (_ : regular r1) (_ : regular V) (n : nat), regular (subst_rec_r r1 V n)) (_ : and (regular (Ap b r r0)) (regular r1)) (_ : regular V) (n : nat), and (regular (subst_rec_r (Ap b r r0) V n)) (regular (subst_rec_r r1 V n)) *) intros; elim H3; auto with arith. Qed. Lemma subst_preserve_regular : forall U V : redexes, regular U -> regular V -> regular (subst_r U V). Proof. (* Goal: forall (U V : redexes) (_ : regular U) (_ : regular V), regular (subst_r U V) *) unfold subst_r in |- *; intros; apply subst_rec_preserve_regular; trivial with arith. Qed.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrfun ssrbool eqtype ssrnat seq choice fintype tuple. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Section Def. Variables (aT : finType) (rT : Type). Inductive finfun_type : predArgType := Finfun of #|aT|.-tuple rT. Definition finfun_of of phant (aT -> rT) := finfun_type. Identity Coercion type_of_finfun : finfun_of >-> finfun_type. Definition fgraph f := let: Finfun t := f in t. Canonical finfun_subType := Eval hnf in [newType for fgraph]. End Def. Notation "{ 'ffun' fT }" := (finfun_of (Phant fT)) (at level 0, format "{ 'ffun' '[hv' fT ']' }") : type_scope. Definition exp_finIndexType n := ordinal_finType n. Notation "T ^ n" := (@finfun_of (exp_finIndexType n) T (Phant _)) : type_scope. Local Notation fun_of_fin_def := (fun aT rT f x => tnth (@fgraph aT rT f) (enum_rank x)). Local Notation finfun_def := (fun aT rT f => @Finfun aT rT (codom_tuple f)). Module Type FunFinfunSig. Parameter fun_of_fin : forall aT rT, finfun_type aT rT -> aT -> rT. Parameter finfun : forall (aT : finType) rT, (aT -> rT) -> {ffun aT -> rT}. Axiom fun_of_finE : fun_of_fin = fun_of_fin_def. Axiom finfunE : finfun = finfun_def. End FunFinfunSig. Module FunFinfun : FunFinfunSig. Definition fun_of_fin := fun_of_fin_def. Definition finfun := finfun_def. Lemma fun_of_finE : fun_of_fin = fun_of_fin_def. Proof. by []. Qed. Proof. (* Goal: @eq (forall (aT : Finite.type) (rT : Type) (_ : finfun_type aT rT) (_ : Finite.sort aT), rT) fun_of_fin (fun (aT : Finite.type) (rT : Type) (f : finfun_type aT rT) (x : Finite.sort aT) => @tnth (@card aT (@mem (Equality.sort (Finite.eqType aT)) (predPredType (Equality.sort (Finite.eqType aT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT)))))) rT (@fgraph aT rT f) (@enum_rank aT x)) *) by []. Qed. End FunFinfun. Notation fun_of_fin := FunFinfun.fun_of_fin. Notation finfun := FunFinfun.finfun. Coercion fun_of_fin : finfun_type >-> Funclass. Canonical fun_of_fin_unlock := Unlockable FunFinfun.fun_of_finE. Canonical finfun_unlock := Unlockable FunFinfun.finfunE. Notation "[ 'ffun' x : aT => F ]" := (finfun (fun x : aT => F)) (at level 0, x ident, only parsing) : fun_scope. Notation "[ 'ffun' : aT => F ]" := (finfun (fun _ : aT => F)) (at level 0, only parsing) : fun_scope. Notation "[ 'ffun' x => F ]" := [ffun x : _ => F] (at level 0, x ident, format "[ 'ffun' x => F ]") : fun_scope. Notation "[ 'ffun' => F ]" := [ffun : _ => F] (at level 0, format "[ 'ffun' => F ]") : fun_scope. Definition fmem aT rT (pT : predType rT) (f : aT -> pT) := [fun x => mem (f x)]. Section PlainTheory. Variables (aT : finType) (rT : Type). Notation fT := {ffun aT -> rT}. Implicit Types (f : fT) (R : pred rT). Canonical finfun_of_subType := Eval hnf in [subType of fT]. Lemma tnth_fgraph f i : tnth (fgraph f) i = f (enum_val i). Proof. (* Goal: @eq rT (@tnth (@card aT (@mem (Equality.sort (Finite.eqType aT)) (predPredType (Equality.sort (Finite.eqType aT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT)))))) rT (@fgraph aT rT f) i) (@FunFinfun.fun_of_fin aT rT f (@enum_val aT (fun _ : Equality.sort (Finite.eqType aT) => true) i)) *) by rewrite [@fun_of_fin]unlock enum_valK. Qed. Lemma ffunE (g : aT -> rT) : finfun g =1 g. Proof. (* Goal: @eqfun rT (Finite.sort aT) (@FunFinfun.fun_of_fin aT rT (@FunFinfun.finfun aT rT g)) g *) move=> x; rewrite [@finfun]unlock unlock tnth_map. (* Goal: @eq rT (g (@tnth (@card aT (@mem (Equality.sort (Finite.eqType aT)) (predPredType (Equality.sort (Finite.eqType aT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT)))))) (Finite.sort aT) (@enum_tuple aT (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT))))) (@enum_rank aT x))) (g x) *) by rewrite -[tnth _ _]enum_val_nth enum_rankK. Qed. Lemma fgraph_codom f : fgraph f = codom_tuple f. Proof. (* Goal: @eq (tuple_of (@card aT (@mem (Equality.sort (Finite.eqType aT)) (predPredType (Equality.sort (Finite.eqType aT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT)))))) rT) (@fgraph aT rT f) (@codom_tuple aT rT (@FunFinfun.fun_of_fin aT rT f)) *) apply: eq_from_tnth => i; rewrite [@fun_of_fin]unlock tnth_map. (* Goal: @eq rT (@tnth (@card aT (@mem (Equality.sort (Finite.eqType aT)) (predPredType (Equality.sort (Finite.eqType aT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT)))))) rT (@fgraph aT rT f) i) (@tnth (@card aT (@mem (Equality.sort (Finite.eqType aT)) (predPredType (Equality.sort (Finite.eqType aT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT)))))) rT (@fgraph aT rT f) (@enum_rank aT (@tnth (@card aT (@mem (Equality.sort (Finite.eqType aT)) (predPredType (Equality.sort (Finite.eqType aT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT)))))) (Finite.sort aT) (@enum_tuple aT (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT))))) i))) *) by congr tnth; rewrite -[tnth _ _]enum_val_nth enum_valK. Qed. Lemma codom_ffun f : codom f = val f. Proof. (* Goal: @eq (list rT) (@codom aT rT (@FunFinfun.fun_of_fin aT rT f)) (@tval (@card aT (@mem (Equality.sort (Finite.eqType aT)) (predPredType (Equality.sort (Finite.eqType aT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT)))))) rT (@val (tuple_of (@card aT (@mem (Equality.sort (Finite.eqType aT)) (predPredType (Equality.sort (Finite.eqType aT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT)))))) rT) (fun _ : tuple_of (@card aT (@mem (Equality.sort (Finite.eqType aT)) (predPredType (Equality.sort (Finite.eqType aT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT)))))) rT => true) finfun_of_subType f)) *) by rewrite /= fgraph_codom. Qed. Lemma ffunP f1 f2 : f1 =1 f2 <-> f1 = f2. Proof. (* Goal: iff (@eqfun rT (Finite.sort aT) (@FunFinfun.fun_of_fin aT rT f1) (@FunFinfun.fun_of_fin aT rT f2)) (@eq (@finfun_of aT rT (Phant (forall _ : Finite.sort aT, rT))) f1 f2) *) split=> [eq_f12 | -> //]; do 2!apply: val_inj => /=. (* Goal: @eq (list rT) (@tval (@card aT (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) (@sort_of_simpl_pred (Finite.sort aT) (pred_of_argType (Finite.sort aT))))) rT (@fgraph aT rT f1)) (@tval (@card aT (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) (@sort_of_simpl_pred (Finite.sort aT) (pred_of_argType (Finite.sort aT))))) rT (@fgraph aT rT f2)) *) by rewrite !fgraph_codom /= (eq_codom eq_f12). Qed. Lemma ffunK : cancel (@fun_of_fin aT rT) (@finfun aT rT). Proof. (* Goal: @cancel (forall _ : Finite.sort aT, rT) (finfun_type aT rT) (@FunFinfun.fun_of_fin aT rT) (@FunFinfun.finfun aT rT) *) by move=> f; apply/ffunP/ffunE. Qed. Definition family_mem mF := [pred f : fT | [forall x, in_mem (f x) (mF x)]]. Lemma familyP (pT : predType rT) (F : aT -> pT) f : reflect (forall x, f x \in F x) (f \in family_mem (fmem F)). Proof. (* Goal: Bool.reflect (forall x : Finite.sort aT, is_true (@in_mem rT (@FunFinfun.fun_of_fin aT rT f x) (@mem rT pT (F x)))) (@in_mem (@finfun_of aT rT (Phant (forall _ : Finite.sort aT, rT))) f (@mem (@finfun_of aT rT (Phant (forall _ : Finite.sort aT, rT))) (simplPredType (@finfun_of aT rT (Phant (forall _ : Finite.sort aT, rT)))) (family_mem (@fun_of_simpl (Finite.sort aT) (mem_pred rT) (@fmem (Finite.sort aT) rT pT F))))) *) exact: forallP. Qed. Definition ffun_on_mem mR := family_mem (fun _ => mR). Lemma ffun_onP R f : reflect (forall x, f x \in R) (f \in ffun_on_mem (mem R)). Proof. (* Goal: Bool.reflect (forall x : Finite.sort aT, is_true (@in_mem rT (@FunFinfun.fun_of_fin aT rT f x) (@mem rT (predPredType rT) R))) (@in_mem (@finfun_of aT rT (Phant (forall _ : Finite.sort aT, rT))) f (@mem (@finfun_of aT rT (Phant (forall _ : Finite.sort aT, rT))) (simplPredType (@finfun_of aT rT (Phant (forall _ : Finite.sort aT, rT)))) (ffun_on_mem (@mem rT (predPredType rT) R)))) *) exact: forallP. Qed. End PlainTheory. Notation family F := (family_mem (fun_of_simpl (fmem F))). Notation ffun_on R := (ffun_on_mem _ (mem R)). Arguments ffunK {aT rT}. Arguments familyP {aT rT pT F f}. Arguments ffun_onP {aT rT R f}. Lemma nth_fgraph_ord T n (x0 : T) (i : 'I_n) f : nth x0 (fgraph f) i = f i. Proof. (* Goal: @eq T (@nth T x0 (@tval (@card (ordinal_finType n) (@mem (Equality.sort (Finite.eqType (ordinal_finType n))) (predPredType (Equality.sort (Finite.eqType (ordinal_finType n)))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType (ordinal_finType n))) (pred_of_argType (Equality.sort (Finite.eqType (ordinal_finType n))))))) T (@fgraph (ordinal_finType n) T f)) (@nat_of_ord n i)) (@FunFinfun.fun_of_fin (ordinal_finType n) T f i) *) by rewrite -{2}(enum_rankK i) -tnth_fgraph (tnth_nth x0) enum_rank_ord. Qed. Section Support. Variables (aT : Type) (rT : eqType). Definition support_for y (f : aT -> rT) := [pred x | f x != y]. End Support. Notation "y .-support" := (support_for y) (at level 2, format "y .-support") : fun_scope. Section EqTheory. Variables (aT : finType) (rT : eqType). Notation fT := {ffun aT -> rT}. Implicit Types (y : rT) (D : pred aT) (R : pred rT) (f : fT). Lemma supportP y D g : reflect (forall x, x \notin D -> g x = y) (y.-support g \subset D). Proof. (* Goal: Bool.reflect (forall (x : Finite.sort aT) (_ : is_true (negb (@in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D)))), @eq (Equality.sort rT) (g x) y) (@subset aT (@mem (Finite.sort aT) (simplPredType (Finite.sort aT)) (@support_for (Finite.sort aT) rT y g)) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D)) *) by apply: (iffP subsetP) => Dg x; [apply: contraNeq | apply: contraR] => /Dg->. Qed. Definition finfun_eqMixin := Eval hnf in [eqMixin of finfun_type aT rT by <:]. Canonical finfun_eqType := Eval hnf in EqType _ finfun_eqMixin. Canonical finfun_of_eqType := Eval hnf in [eqType of fT]. Definition pfamily_mem y mD (mF : aT -> mem_pred rT) := family (fun i : aT => if in_mem i mD then pred_of_simpl (mF i) else pred1 y). Lemma pfamilyP (pT : predType rT) y D (F : aT -> pT) f : reflect (y.-support f \subset D /\ {in D, forall x, f x \in F x}) Proof. (* Goal: Bool.reflect (and (is_true (@subset aT (@mem (Finite.sort aT) (simplPredType (Finite.sort aT)) (@support_for (Finite.sort aT) rT y (@FunFinfun.fun_of_fin aT (Equality.sort rT) f))) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (@prop_in1 (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) (fun x : Finite.sort aT => is_true (@in_mem (Equality.sort rT) (@FunFinfun.fun_of_fin aT (Equality.sort rT) f x) (@mem (Equality.sort rT) pT (F x)))) (inPhantom (forall x : Finite.sort aT, is_true (@in_mem (Equality.sort rT) (@FunFinfun.fun_of_fin aT (Equality.sort rT) f x) (@mem (Equality.sort rT) pT (F x))))))) (@in_mem (@finfun_of aT (Equality.sort rT) (Phant (forall _ : Finite.sort aT, Equality.sort rT))) f (@mem (@finfun_of aT (Equality.sort rT) (Phant (forall _ : Finite.sort aT, Equality.sort rT))) (simplPredType (@finfun_of aT (Equality.sort rT) (Phant (forall _ : Finite.sort aT, Equality.sort rT)))) (pfamily_mem y (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) (@fun_of_simpl (Finite.sort aT) (mem_pred (Equality.sort rT)) (@fmem (Finite.sort aT) (Equality.sort rT) pT F))))) *) apply: (iffP familyP) => [/= f_pfam | [/supportP f_supp f_fam] x]. (* Goal: is_true (@in_mem (Equality.sort rT) (@FunFinfun.fun_of_fin aT (Equality.sort rT) f x) (@mem (Equality.sort rT) (predPredType (Equality.sort rT)) (if @in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) then @pred_of_simpl (Equality.sort rT) (@pred_of_mem_pred (Equality.sort rT) (@fun_of_simpl (Finite.sort aT) (mem_pred (Equality.sort rT)) (@fmem (Finite.sort aT) (Equality.sort rT) pT F) x)) else @pred_of_simpl (Equality.sort rT) (@pred1 rT y)))) *) (* Goal: and (is_true (@subset aT (@mem (Finite.sort aT) (simplPredType (Finite.sort aT)) (@support_for (Finite.sort aT) rT y (@FunFinfun.fun_of_fin aT (Equality.sort rT) f))) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (@prop_in1 (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) (fun x : Finite.sort aT => is_true (@in_mem (Equality.sort rT) (@FunFinfun.fun_of_fin aT (Equality.sort rT) f x) (@mem (Equality.sort rT) pT (F x)))) (inPhantom (forall x : Finite.sort aT, is_true (@in_mem (Equality.sort rT) (@FunFinfun.fun_of_fin aT (Equality.sort rT) f x) (@mem (Equality.sort rT) pT (F x)))))) *) split=> [|x Ax]; last by have:= f_pfam x; rewrite Ax. (* Goal: is_true (@in_mem (Equality.sort rT) (@FunFinfun.fun_of_fin aT (Equality.sort rT) f x) (@mem (Equality.sort rT) (predPredType (Equality.sort rT)) (if @in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) then @pred_of_simpl (Equality.sort rT) (@pred_of_mem_pred (Equality.sort rT) (@fun_of_simpl (Finite.sort aT) (mem_pred (Equality.sort rT)) (@fmem (Finite.sort aT) (Equality.sort rT) pT F) x)) else @pred_of_simpl (Equality.sort rT) (@pred1 rT y)))) *) (* Goal: is_true (@subset aT (@mem (Finite.sort aT) (simplPredType (Finite.sort aT)) (@support_for (Finite.sort aT) rT y (@FunFinfun.fun_of_fin aT (Equality.sort rT) f))) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D)) *) by apply/subsetP=> x; case: ifP (f_pfam x) => //= _ fx0 /negP[]. (* Goal: is_true (@in_mem (Equality.sort rT) (@FunFinfun.fun_of_fin aT (Equality.sort rT) f x) (@mem (Equality.sort rT) (predPredType (Equality.sort rT)) (if @in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) then @pred_of_simpl (Equality.sort rT) (@pred_of_mem_pred (Equality.sort rT) (@fun_of_simpl (Finite.sort aT) (mem_pred (Equality.sort rT)) (@fmem (Finite.sort aT) (Equality.sort rT) pT F) x)) else @pred_of_simpl (Equality.sort rT) (@pred1 rT y)))) *) by case: ifPn => Ax /=; rewrite inE /= (f_fam, f_supp). Qed. Definition pffun_on_mem y mD mR := pfamily_mem y mD (fun _ => mR). Lemma pffun_onP y D R f : reflect (y.-support f \subset D /\ {subset image f D <= R}) Proof. (* Goal: Bool.reflect (and (is_true (@subset aT (@mem (Finite.sort aT) (simplPredType (Finite.sort aT)) (@support_for (Finite.sort aT) rT y (@FunFinfun.fun_of_fin aT (Equality.sort rT) f))) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (@sub_mem (Equality.sort rT) (@mem (Equality.sort rT) (seq_predType rT) (@image_mem aT (Equality.sort rT) (@FunFinfun.fun_of_fin aT (Equality.sort rT) f) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (@mem (Equality.sort rT) (predPredType (Equality.sort rT)) R))) (@in_mem (@finfun_of aT (Equality.sort rT) (Phant (forall _ : Finite.sort aT, Equality.sort rT))) f (@mem (@finfun_of aT (Equality.sort rT) (Phant (forall _ : Finite.sort aT, Equality.sort rT))) (simplPredType (@finfun_of aT (Equality.sort rT) (Phant (forall _ : Finite.sort aT, Equality.sort rT)))) (pffun_on_mem y (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) (@mem (Equality.sort rT) (predPredType (Equality.sort rT)) R)))) *) apply: (iffP (pfamilyP y D (fun _ => R) f)) => [] [-> f_fam]; split=> //. (* Goal: @prop_in1 (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) (fun x : Finite.sort aT => is_true (@in_mem (Equality.sort rT) (@FunFinfun.fun_of_fin aT (Equality.sort rT) f x) (@mem (Equality.sort rT) (predPredType (Equality.sort rT)) R))) (inPhantom (forall x : Finite.sort aT, is_true (@in_mem (Equality.sort rT) (@FunFinfun.fun_of_fin aT (Equality.sort rT) f x) (@mem (Equality.sort rT) (predPredType (Equality.sort rT)) R)))) *) (* Goal: @sub_mem (Equality.sort rT) (@mem (Equality.sort rT) (seq_predType rT) (@image_mem aT (Equality.sort rT) (@FunFinfun.fun_of_fin aT (Equality.sort rT) f) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (@mem (Equality.sort rT) (predPredType (Equality.sort rT)) R) *) by move=> _ /imageP[x Ax ->]; apply: f_fam. (* Goal: @prop_in1 (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) (fun x : Finite.sort aT => is_true (@in_mem (Equality.sort rT) (@FunFinfun.fun_of_fin aT (Equality.sort rT) f x) (@mem (Equality.sort rT) (predPredType (Equality.sort rT)) R))) (inPhantom (forall x : Finite.sort aT, is_true (@in_mem (Equality.sort rT) (@FunFinfun.fun_of_fin aT (Equality.sort rT) f x) (@mem (Equality.sort rT) (predPredType (Equality.sort rT)) R)))) *) by move=> x Ax; apply: f_fam; apply/imageP; exists x. Qed. End EqTheory. Arguments supportP {aT rT y D g}. Notation pfamily y D F := (pfamily_mem y (mem D) (fun_of_simpl (fmem F))). Notation pffun_on y D R := (pffun_on_mem y (mem D) (mem R)). Definition finfun_choiceMixin aT (rT : choiceType) := [choiceMixin of finfun_type aT rT by <:]. Canonical finfun_choiceType aT rT := Eval hnf in ChoiceType _ (finfun_choiceMixin aT rT). Canonical finfun_of_choiceType (aT : finType) (rT : choiceType) := Eval hnf in [choiceType of {ffun aT -> rT}]. Definition finfun_countMixin aT (rT : countType) := [countMixin of finfun_type aT rT by <:]. Canonical finfun_countType aT (rT : countType) := Eval hnf in CountType _ (finfun_countMixin aT rT). Canonical finfun_of_countType (aT : finType) (rT : countType) := Eval hnf in [countType of {ffun aT -> rT}]. Canonical finfun_subCountType aT (rT : countType) := Eval hnf in [subCountType of finfun_type aT rT]. Canonical finfun_of_subCountType (aT : finType) (rT : countType) := Eval hnf in [subCountType of {ffun aT -> rT}]. Section FinTheory. Variables aT rT : finType. Notation fT := {ffun aT -> rT}. Notation ffT := (finfun_type aT rT). Implicit Types (D : pred aT) (R : pred rT) (F : aT -> pred rT). Definition finfun_finMixin := [finMixin of ffT by <:]. Canonical finfun_finType := Eval hnf in FinType ffT finfun_finMixin. Canonical finfun_subFinType := Eval hnf in [subFinType of ffT]. Canonical finfun_of_finType := Eval hnf in [finType of fT for finfun_finType]. Canonical finfun_of_subFinType := Eval hnf in [subFinType of fT]. Lemma card_pfamily y0 D F : #|pfamily y0 D F| = foldr muln 1 [seq #|F x| | x in D]. Proof. (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Equality.sort (Finite.eqType rT)) (Phant (forall _ : Finite.sort aT, Equality.sort (Finite.eqType rT)))) (simplPredType (@finfun_of aT (Equality.sort (Finite.eqType rT)) (Phant (forall _ : Finite.sort aT, Equality.sort (Finite.eqType rT))))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (@foldr nat nat muln (S O) (@image_mem aT nat (fun x : Finite.sort aT => @card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x))) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) *) rewrite /image_mem; transitivity #|pfamily y0 (enum D) F|. (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Equality.sort (Finite.eqType rT)) (Phant (forall _ : Finite.sort aT, Equality.sort (Finite.eqType rT)))) (simplPredType (@finfun_of aT (Equality.sort (Finite.eqType rT)) (Phant (forall _ : Finite.sort aT, Equality.sort (Finite.eqType rT))))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Equality.sort (Finite.eqType aT)) (seq_predType (Finite.eqType aT)) (@enum_mem aT (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (@foldr nat nat muln (S O) (@map (Finite.sort aT) nat (fun x : Finite.sort aT => @card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x))) (@enum_mem aT (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D)))) *) (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Equality.sort (Finite.eqType rT)) (Phant (forall _ : Finite.sort aT, Equality.sort (Finite.eqType rT)))) (simplPredType (@finfun_of aT (Equality.sort (Finite.eqType rT)) (Phant (forall _ : Finite.sort aT, Equality.sort (Finite.eqType rT))))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (@card finfun_of_finType (@mem (@finfun_of aT (Equality.sort (Finite.eqType rT)) (Phant (forall _ : Finite.sort aT, Equality.sort (Finite.eqType rT)))) (simplPredType (@finfun_of aT (Equality.sort (Finite.eqType rT)) (Phant (forall _ : Finite.sort aT, Equality.sort (Finite.eqType rT))))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Equality.sort (Finite.eqType aT)) (seq_predType (Finite.eqType aT)) (@enum_mem aT (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) *) by apply/eq_card=> f; apply/eq_forallb=> x /=; rewrite mem_enum. (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Equality.sort (Finite.eqType rT)) (Phant (forall _ : Finite.sort aT, Equality.sort (Finite.eqType rT)))) (simplPredType (@finfun_of aT (Equality.sort (Finite.eqType rT)) (Phant (forall _ : Finite.sort aT, Equality.sort (Finite.eqType rT))))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Equality.sort (Finite.eqType aT)) (seq_predType (Finite.eqType aT)) (@enum_mem aT (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (@foldr nat nat muln (S O) (@map (Finite.sort aT) nat (fun x : Finite.sort aT => @card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x))) (@enum_mem aT (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D)))) *) elim: {D}(enum D) (enum_uniq D) => /= [_|x0 s IHs /andP[s'x0 /IHs<-{IHs}]]. (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) (@cons (Finite.sort aT) x0 s)) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (muln (@card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x0))) (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) s) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F)))))) *) (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) (@nil (Finite.sort aT))) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (S O) *) apply: eq_card1 [ffun=> y0] _ _ => f. (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) (@cons (Finite.sort aT) x0 s)) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (muln (@card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x0))) (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) s) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F)))))) *) (* Goal: @eq bool (@in_mem (Finite.sort finfun_of_finType) f (@mem (Finite.sort finfun_of_finType) (predPredType (Finite.sort finfun_of_finType)) (@pred_of_simpl (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) (@nil (Finite.sort aT))) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F)))))) (@in_mem (Finite.sort finfun_of_finType) f (@mem (Equality.sort (Finite.eqType finfun_of_finType)) (simplPredType (Equality.sort (Finite.eqType finfun_of_finType))) (@pred1 (Finite.eqType finfun_of_finType) (@FunFinfun.finfun aT (Equality.sort (Finite.eqType rT)) (fun _ : Finite.sort aT => y0))))) *) apply/familyP/eqP=> [y0_f|-> x]; last by rewrite ffunE inE. (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) (@cons (Finite.sort aT) x0 s)) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (muln (@card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x0))) (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) s) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F)))))) *) (* Goal: @eq (Equality.sort (Finite.eqType finfun_of_finType)) f (@FunFinfun.finfun aT (Equality.sort (Finite.eqType rT)) (fun _ : Finite.sort aT => y0)) *) by apply/ffunP=> x; rewrite ffunE (eqP (y0_f x)). (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) (@cons (Finite.sort aT) x0 s)) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (muln (@card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x0))) (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) s) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F)))))) *) pose g (xf : rT * fT) := finfun [eta xf.2 with x0 |-> xf.1]. (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) (@cons (Finite.sort aT) x0 s)) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (muln (@card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x0))) (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) s) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F)))))) *) have gK: cancel (fun f : fT => (f x0, g (y0, f))) g. (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) (@cons (Finite.sort aT) x0 s)) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (muln (@card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x0))) (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) s) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F)))))) *) (* Goal: @cancel (prod (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (fun f : @finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)) => @pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@FunFinfun.fun_of_fin aT (Finite.sort rT) f x0) (g (@pair (Equality.sort (Finite.eqType rT)) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y0 f))) g *) by move=> f; apply/ffunP=> x; do !rewrite ffunE /=; case: eqP => // ->. (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) (@cons (Finite.sort aT) x0 s)) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (muln (@card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x0))) (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) s) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F)))))) *) rewrite -cardX -(card_image (can_inj gK)); apply: eq_card => [] [y f] /=. (* Goal: @eq bool (@in_mem (prod (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y f) (@mem (prod (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (predPredType (prod (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))))) (@pred_of_eq_seq (Finite.eqType (prod_finType rT finfun_of_finType)) (@image_mem finfun_of_finType (prod (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (fun f : @finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)) => @pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@FunFinfun.fun_of_fin aT (Finite.sort rT) f x0) (g (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y0 f))) (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (predPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pred_of_simpl (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) (@cons (Finite.sort aT) x0 s)) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))))))) (@in_mem (prod (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y f) (@mem (prod (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (predPredType (prod (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))))) (@pred_of_simpl (prod (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@predX (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@pred_of_simpl (Finite.sort rT) (@pred_of_mem_pred (Finite.sort rT) (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x0)))) (@pred_of_simpl (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@pred_of_mem_pred (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (predPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pred_of_simpl (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) s) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))))))))) *) apply/imageP/andP=> [[f0 /familyP/=Ff0] [{f}-> ->]| [Fy /familyP/=Ff]]. (* Goal: @ex2 (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (fun x : @finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)) => is_true (@in_mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) x (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (predPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pred_of_simpl (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) (@cons (Finite.sort aT) x0 s)) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))))) (fun x : @finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)) => @eq (prod (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y f) (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@FunFinfun.fun_of_fin aT (Finite.sort rT) x x0) (g (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y0 x)))) *) (* Goal: and (is_true (@in_mem (Finite.sort rT) (@FunFinfun.fun_of_fin aT (Finite.sort rT) f0 x0) (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x0)))) (is_true (@in_mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (g (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y0 f0)) (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (predPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pred_of_simpl (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) s) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))))) *) split; first by have:= Ff0 x0; rewrite /= mem_head. (* Goal: @ex2 (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (fun x : @finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)) => is_true (@in_mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) x (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (predPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pred_of_simpl (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) (@cons (Finite.sort aT) x0 s)) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))))) (fun x : @finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)) => @eq (prod (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y f) (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@FunFinfun.fun_of_fin aT (Finite.sort rT) x x0) (g (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y0 x)))) *) (* Goal: is_true (@in_mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (g (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y0 f0)) (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (predPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pred_of_simpl (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) s) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F)))))) *) apply/familyP=> x; have:= Ff0 x; rewrite ffunE inE /=. (* Goal: @ex2 (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (fun x : @finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)) => is_true (@in_mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) x (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (predPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pred_of_simpl (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) (@cons (Finite.sort aT) x0 s)) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))))) (fun x : @finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)) => @eq (prod (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y f) (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@FunFinfun.fun_of_fin aT (Finite.sort rT) x x0) (g (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y0 x)))) *) (* Goal: forall _ : is_true (@in_mem (Finite.sort rT) (@FunFinfun.fun_of_fin aT (Finite.sort rT) f0 x) (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (if orb (@eq_op (Finite.eqType aT) x x0) (@in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) s)) then @pred_of_simpl (Finite.sort rT) (@pred_of_mem_pred (Finite.sort rT) (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x))) else @pred_of_simpl (Finite.sort rT) (@pred1 (Finite.eqType rT) y0)))), is_true (@in_mem (Finite.sort rT) (if @eq_op (Finite.eqType aT) x x0 then y0 else @FunFinfun.fun_of_fin aT (Finite.sort rT) f0 x) (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (if @in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) s) then @pred_of_simpl (Finite.sort rT) (@pred_of_mem_pred (Finite.sort rT) (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x))) else @pred_of_simpl (Finite.sort rT) (@pred1 (Finite.eqType rT) y0)))) *) by case: eqP => //= -> _; rewrite ifN ?inE. (* Goal: @ex2 (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (fun x : @finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)) => is_true (@in_mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) x (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (predPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pred_of_simpl (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) (@cons (Finite.sort aT) x0 s)) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))))) (fun x : @finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)) => @eq (prod (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y f) (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@FunFinfun.fun_of_fin aT (Finite.sort rT) x x0) (g (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y0 x)))) *) exists (g (y, f)). (* Goal: @eq (prod (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y f) (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@FunFinfun.fun_of_fin aT (Finite.sort rT) (g (@pair (Finite.sort rT) (Finite.sort finfun_of_finType) y f)) x0) (g (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y0 (g (@pair (Finite.sort rT) (Finite.sort finfun_of_finType) y f))))) *) (* Goal: is_true (@in_mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (g (@pair (Finite.sort rT) (Finite.sort finfun_of_finType) y f)) (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (predPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pred_of_simpl (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@pfamily_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (seq_predType (Finite.eqType aT)) (@cons (Finite.sort aT) x0 s)) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F)))))) *) by apply/familyP=> x; have:= Ff x; rewrite ffunE /= inE; case: eqP => // ->. (* Goal: @eq (prod (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y f) (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@FunFinfun.fun_of_fin aT (Finite.sort rT) (g (@pair (Finite.sort rT) (Finite.sort finfun_of_finType) y f)) x0) (g (@pair (Finite.sort rT) (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) y0 (g (@pair (Finite.sort rT) (Finite.sort finfun_of_finType) y f))))) *) congr (_, _); last apply/ffunP=> x; do !rewrite ffunE /= ?eqxx //. (* Goal: @eq (Finite.sort rT) (@FunFinfun.fun_of_fin aT (Finite.sort rT) f x) (if @eq_op (Finite.eqType aT) x x0 then y0 else if @eq_op (Finite.eqType aT) x x0 then y else @FunFinfun.fun_of_fin aT (Finite.sort rT) f x) *) by case: eqP => // ->{x}; apply/eqP; have:= Ff x0; rewrite ifN. Qed. Lemma card_family F : #|family F| = foldr muln 1 [seq #|F x| | x : aT]. Proof. (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@family_mem aT (Finite.sort rT) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (@foldr nat nat muln (S O) (@image_mem aT nat (fun x : Finite.sort aT => @card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x))) (@mem (Equality.sort (Finite.eqType aT)) (predPredType (Equality.sort (Finite.eqType aT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT))))))) *) have [y0 _ | rT0] := pickP rT; first exact: (card_pfamily y0 aT). (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@family_mem aT (Finite.sort rT) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (@foldr nat nat muln (S O) (@image_mem aT nat (fun x : Finite.sort aT => @card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x))) (@mem (Equality.sort (Finite.eqType aT)) (predPredType (Equality.sort (Finite.eqType aT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT))))))) *) rewrite /image_mem; case DaT: (enum aT) => [{rT0}|x0 e] /=; last first. (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@family_mem aT (Finite.sort rT) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (S O) *) (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@family_mem aT (Finite.sort rT) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (muln (@card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x0))) (@foldr nat nat muln (S O) (@map (Finite.sort aT) nat (fun x : Finite.sort aT => @card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) (F x))) e))) *) by rewrite !eq_card0 // => [f | y]; [have:= rT0 (f x0) | have:= rT0 y]. (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@family_mem aT (Finite.sort rT) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (S O) *) have{DaT} no_aT P (x : aT) : P by have:= mem_enum aT x; rewrite DaT. (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@family_mem aT (Finite.sort rT) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F))))) (S O) *) apply: eq_card1 [ffun x => no_aT rT x] _ _ => f. (* Goal: @eq bool (@in_mem (Finite.sort finfun_of_finType) f (@mem (Finite.sort finfun_of_finType) (predPredType (Finite.sort finfun_of_finType)) (@pred_of_simpl (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (@family_mem aT (Finite.sort rT) (@fun_of_simpl (Finite.sort aT) (mem_pred (Finite.sort rT)) (@fmem (Finite.sort aT) (Finite.sort rT) (predPredType (Finite.sort rT)) F)))))) (@in_mem (Finite.sort finfun_of_finType) f (@mem (Equality.sort (Finite.eqType finfun_of_finType)) (simplPredType (Equality.sort (Finite.eqType finfun_of_finType))) (@pred1 (Finite.eqType finfun_of_finType) (@FunFinfun.finfun aT (Finite.sort rT) (fun x : Finite.sort aT => no_aT (Finite.sort rT) x))))) *) by apply/familyP/eqP=> _; [apply/ffunP | ] => x; apply: no_aT. Qed. Lemma card_pffun_on y0 D R : #|pffun_on y0 D R| = #|R| ^ #|D|. Proof. (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Equality.sort (Finite.eqType rT)) (Phant (forall _ : Finite.sort aT, Equality.sort (Finite.eqType rT)))) (simplPredType (@finfun_of aT (Equality.sort (Finite.eqType rT)) (Phant (forall _ : Finite.sort aT, Equality.sort (Finite.eqType rT))))) (@pffun_on_mem aT (Finite.eqType rT) y0 (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) R)))) (expn (@card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) R)) (@card aT (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) *) rewrite (cardE D) card_pfamily /image_mem. (* Goal: @eq nat (@foldr nat nat muln (S O) (@map (Finite.sort aT) nat (fun _ : Finite.sort aT => @card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) R)) (@enum_mem aT (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D)))) (expn (@card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) R)) (@size (Finite.sort aT) (@enum_mem aT (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D)))) *) by elim: (enum D) => //= _ e ->; rewrite expnS. Qed. Lemma card_ffun_on R : #|ffun_on R| = #|R| ^ #|aT|. Proof. (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (simplPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@ffun_on_mem aT (Finite.sort rT) (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) R)))) (expn (@card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) R)) (@card aT (@mem (Equality.sort (Finite.eqType aT)) (predPredType (Equality.sort (Finite.eqType aT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT))))))) *) rewrite card_family /image_mem cardT. (* Goal: @eq nat (@foldr nat nat muln (S O) (@map (Finite.sort aT) nat (fun _ : Finite.sort aT => @card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) R)) (@enum_mem aT (@mem (Equality.sort (Finite.eqType aT)) (predPredType (Equality.sort (Finite.eqType aT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT)))))))) (expn (@card rT (@mem (Finite.sort rT) (predPredType (Finite.sort rT)) R)) (@size (Finite.sort aT) (@enum_mem aT (@mem (Equality.sort (Finite.eqType aT)) (predPredType (Equality.sort (Finite.eqType aT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT)))))))) *) by elim: (enum aT) => //= _ e ->; rewrite expnS. Qed. Lemma card_ffun : #|fT| = #|rT| ^ #|aT|. Proof. (* Goal: @eq nat (@card finfun_of_finType (@mem (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (predPredType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT)))) (@sort_of_simpl_pred (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))) (pred_of_argType (@finfun_of aT (Finite.sort rT) (Phant (forall _ : Finite.sort aT, Finite.sort rT))))))) (expn (@card rT (@mem (Equality.sort (Finite.eqType rT)) (predPredType (Equality.sort (Finite.eqType rT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType rT)) (pred_of_argType (Equality.sort (Finite.eqType rT)))))) (@card aT (@mem (Equality.sort (Finite.eqType aT)) (predPredType (Equality.sort (Finite.eqType aT))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType aT)) (pred_of_argType (Equality.sort (Finite.eqType aT))))))) *) by rewrite -card_ffun_on; apply/esym/eq_card=> f; apply/forallP. Qed. End FinTheory.
From mathcomp Require Import ssreflect ssrbool eqtype ssrfun seq. Require Import Eqdep ClassicalFacts. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Axiom pext : forall p1 p2 : Prop, (p1 <-> p2) -> p1 = p2. Axiom fext : forall A (B : A -> Type) (f1 f2 : forall x, B x), (forall x, f1 x = f2 x) -> f1 = f2. Lemma proof_irrelevance (P : Prop) (p1 p2 : P) : p1 = p2. Proof. (* Goal: @eq P p1 p2 *) by apply: ext_prop_dep_proof_irrel_cic; apply: pext. Qed. Lemma eta A (B : A -> Type) (f : forall x, B x) : f = [eta f]. Proof. (* Goal: @eq (forall x : A, B x) f (fun x : A => f x) *) by apply: fext. Qed. 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. Ltac add_morphism_tactic := SetoidTactics.add_morphism_tactic. Notation " R ===> R' " := (@Morphisms.respectful _ _ R R') (right associativity, at level 55) : signature_scope. Definition inj_pair2 := @inj_pair2. Arguments inj_pair2 {U P p x y}. Lemma inj_sval A P : injective (@sval A P). Proof. (* Goal: @injective A (@sig A P) (@proj1_sig A P) *) move=>[x Hx][y Hy] /= H; move: Hx Hy; rewrite H=>*. congr exist; apply: proof_irrelevance. Qed. Qed. Lemma svalE A (P : A -> Prop) x H : sval (exist P x H) = x. Proof. (* Goal: @eq A (@proj1_sig A P (@exist A P x H)) x *) by []. Qed. Lemma sym A (x y : A) : x = y <-> y = x. Proof. (* Goal: iff (@eq A x y) (@eq A y x) *) by []. Qed. Section HasSelect. Variables (A : eqType) (p : pred A). CoInductive has_spec (s : seq A) : bool -> Type := | has_true x of x \in s & p x : has_spec s true | has_false of (all (predC p) s) : has_spec s false. Lemma hasPx : forall s, has_spec s (has p s). Proof. (* Goal: forall s : list (Equality.sort A), has_spec s (@has (Equality.sort A) p s) *) elim=>[|x s IH] /=; first by apply: has_false. (* Goal: has_spec (@cons (Equality.sort A) x s) (orb (p x) (@has (Equality.sort A) p s)) *) rewrite orbC; case: IH=>/=. (* Goal: forall _ : is_true (@all (Equality.sort A) (@pred_of_simpl (Equality.sort A) (@predC (Equality.sort A) p)) s), has_spec (@cons (Equality.sort A) x s) (p x) *) (* Goal: forall (x0 : Equality.sort A) (_ : is_true (@in_mem (Equality.sort A) x0 (@mem (Equality.sort A) (seq_predType A) s))) (_ : is_true (p x0)), has_spec (@cons (Equality.sort A) x s) true *) - (* Goal: forall _ : is_true (@all (Equality.sort A) (@pred_of_simpl (Equality.sort A) (@predC (Equality.sort A) p)) s), has_spec (@cons (Equality.sort A) x s) (p x) *) (* Goal: forall (x0 : Equality.sort A) (_ : is_true (@in_mem (Equality.sort A) x0 (@mem (Equality.sort A) (seq_predType A) s))) (_ : is_true (p x0)), has_spec (@cons (Equality.sort A) x s) true *) by move=>k H1; apply: has_true; rewrite inE H1 orbT. (* Goal: forall _ : is_true (@all (Equality.sort A) (@pred_of_simpl (Equality.sort A) (@predC (Equality.sort A) p)) s), has_spec (@cons (Equality.sort A) x s) (p x) *) case E: (p x)=>H; last by apply: has_false; rewrite /= E H. (* Goal: has_spec (@cons (Equality.sort A) x s) true *) by apply: has_true E; rewrite inE eq_refl. Qed. End HasSelect. Module Dyn. Record dynamic : Type := dyn {typ : Type; val : typ}. End Dyn. Notation dynamic := Dyn.dynamic. Notation dyn := Dyn.dyn. Lemma dyn_inj A (x y : A) : dyn x = dyn y -> x = y. Proof. (* Goal: forall _ : @eq Dyn.dynamic (@Dyn.dyn A x) (@Dyn.dyn A y), @eq A x y *) move=>[H]; apply: inj_pairT2 H. Qed. Lemma dyn_eta d : d = dyn (Dyn.val d). Proof. (* Goal: @eq Dyn.dynamic d (@Dyn.dyn (Dyn.typ d) (Dyn.val d)) *) by case:d. Qed. Lemma dyn_injT A1 A2 (x1 : A1) (x2 : A2) : dyn x1 = dyn x2 -> A1 = A2. Proof. (* Goal: forall _ : @eq Dyn.dynamic (@Dyn.dyn A1 x1) (@Dyn.dyn A2 x2), @eq Type A1 A2 *) by case. Qed. Prenex Implicits dyn_inj dyn_injT. Section Coercions. Variable (T : Type -> Type). Definition coerce A B (x : T A) : A = B -> T B := [eta eq_rect A [eta T] x B]. Lemma eqc A (x : T A) (pf : A = A) : coerce x pf = x. Proof. (* Goal: @eq (T A) (@coerce A A x pf) x *) by move:pf; apply: Streicher_K. Qed. Definition jmeq A B (x : T A) (y : T B) := forall pf, coerce x pf = y. Lemma jmE A (x y : T A) : jmeq x y <-> x = y. Proof. (* Goal: iff (@jmeq A A x y) (@eq (T A) x y) *) by split=>[|-> ?]; [move/(_ (erefl _))=><-|]; rewrite eqc. Qed. Lemma jmeq_refl A (x : T A) : jmeq x x. Proof. (* Goal: @jmeq A A x x *) by move=>pf; rewrite eqc. Qed. End Coercions. Hint Resolve jmeq_refl : core. Arguments jmeq T [A B] x y. Notation "a =jm b" := (jmeq id a b) (at level 50). Lemma contV B (P : B -> B -> Prop) : (forall x x', x =jm x' -> P x x') <-> forall x, P x x. Proof. (* Goal: iff (forall (x x' : B) (_ : @jmeq (fun x0 : Type => x0) B B x x'), P x x') (forall x : B, P x x) *) split; first by move=>H x; exact: (H x x (jmeq_refl _)). (* Goal: forall (_ : forall x : B, P x x) (x x' : B) (_ : @jmeq (fun x0 : Type => x0) B B x x'), P x x' *) by move=>H x x'; move/jmE=>->. Qed. Lemma contVT B (P : B -> B -> Prop) : (forall x x', B = B -> x =jm x' -> P x x') <-> forall x, P x x. Proof. (* Goal: iff (forall (x x' : B) (_ : @eq Type B B) (_ : @jmeq (fun x0 : Type => x0) B B x x'), P x x') (forall x : B, P x x) *) split; first by move=>H x; exact: (H x x (erefl _) (jmeq_refl _)). (* Goal: forall (_ : forall x : B, P x x) (x x' : B) (_ : @eq Type B B) (_ : @jmeq (fun x0 : Type => x0) B B x x'), P x x' *) by move=>H x x' _; move/jmE=>->. Qed. Section Coercions2. Variable (T : Type -> Type -> Type). Program Definition coerce2 A1 A2 B1 B2 (x : T A1 A2) : (A1, A2) = (B1, B2) -> T B1 B2. Proof. (* Goal: forall _ : @eq (prod Type Type) (@pair Type Type A1 A2) (@pair Type Type B1 B2), T B1 B2 *) by move =>[<- <-]; exact: x. Qed. Lemma eqc2 A1 A2 (x : T A1 A2) (pf : (A1, A2) = (A1, A2)) : coerce2 x pf = x. Proof. (* Goal: @eq (T A1 A2) (@coerce2 A1 A2 A1 A2 x pf) x *) by move:pf; apply: Streicher_K. Qed. Definition jmeq2 A1 A2 B1 B2 (x : T A1 B1) (y : T A2 B2) := forall pf, coerce2 x pf = y. Lemma jm2E A B (x y : T A B) : jmeq2 x y <-> x = y. Proof. (* Goal: iff (@jmeq2 A A B B x y) (@eq (T A B) x y) *) by move=>*; split=>[|-> ?]; [move/(_ (erefl _))=><-|]; rewrite eqc2. Qed. Lemma refl_jmeq2 A B (x : T A B) : jmeq2 x x. Proof. (* Goal: @jmeq2 A A B B x x *) by move=>pf; rewrite eqc2. Qed. End Coercions2. Hint Resolve refl_jmeq2 : core. Arguments jmeq2 T [A1 A2 B1 B2] x y. 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. Lemma compf1 A B (f : A -> B) : f = f \o id. Proof. (* Goal: @eq (forall _ : A, B) f (@funcomp B A A tt f (fun x : A => x)) *) by apply: fext. Qed. Lemma comp1f A B (f : A -> B) : f = id \o f. Proof. (* Goal: @eq (forall _ : A, B) f (@funcomp B B A tt (fun x : B => x) f) *) by apply: fext. 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 45). Section Reorder. Variables (A B C : Type). Definition swap (x : A * B) := let: (x1, x2) := x in (x2, x1). Definition rCA (x : A * (B * C)) := let: (x1, (x2, x3)) := x in (x2, (x1, x3)). Definition rAC (x : (A * B) * C) := let: ((x1, x2), x3) := x in ((x1, x3), x2). Definition rA (x : A * (B * C)) := let: (x1, (x2, x3)) := x in ((x1, x2), x3). Definition iA (x : (A * B) * C) := let: ((x1, x2), x3) := x in (x1, (x2, x3)). Definition pL (x : A * B) := let: (x1, x2) := x in x1. Definition pR (x : A * B) := let: (x1, x2) := x in x2. End Reorder. Prenex Implicits swap rCA rAC rA iA pL pR. Lemma swapI A B : swap \o swap = @id (A * B). Proof. (* Goal: @eq (forall _ : prod A B, prod A B) (@funcomp (prod A B) (prod B A) (prod A B) tt (@swap B A) (@swap A B)) (fun x : prod A B => x) *) by apply: fext; case. Qed. Lemma rCAI A B C : rCA \o (@rCA A B C) = id. Proof. (* Goal: @eq (forall _ : prod A (prod B C), prod A (prod B C)) (@funcomp (prod A (prod B C)) (prod B (prod A C)) (prod A (prod B C)) tt (@rCA B A C) (@rCA A B C)) (fun x : prod A (prod B C) => x) *) by apply: fext; case=>a [b c]. Qed. Lemma rACI A B C : rAC \o (@rAC A B C) = id. Proof. (* Goal: @eq (forall _ : prod (prod A B) C, prod (prod A B) C) (@funcomp (prod (prod A B) C) (prod (prod A C) B) (prod (prod A B) C) tt (@rAC A C B) (@rAC A B C)) (fun x : prod (prod A B) C => x) *) by apply: fext; case=>[[a]] b c. Qed. Lemma riA A B C : rA \o (@iA A B C) = id. Proof. (* Goal: @eq (forall _ : prod (prod A B) C, prod (prod A B) C) (@funcomp (prod (prod A B) C) (prod A (prod B C)) (prod (prod A B) C) tt (@rA A B C) (@iA A B C)) (fun x : prod (prod A B) C => x) *) by apply: fext; case=>[[]]. Qed. Lemma irA A B C : iA \o (@rA A B C) = id. Proof. (* Goal: @eq (forall _ : prod A (prod B C), prod A (prod B C)) (@funcomp (prod A (prod B C)) (prod (prod A B) C) (prod A (prod B C)) tt (@iA A B C) (@rA A B C)) (fun x : prod A (prod B C) => x) *) by apply: fext; case=>a []. Qed. Lemma swap_prod A1 B1 A2 B2 (f1 : A1 -> B1) (f2 : A2 -> B2) : swap \o f1 \* f2 = f2 \* f1 \o swap. Proof. (* Goal: @eq (forall _ : prod A1 A2, prod B2 B1) (@funcomp (prod B2 B1) (prod B1 B2) (prod A1 A2) tt (@swap B1 B2) (@fprod A1 A2 B1 B2 f1 f2)) (@funcomp (prod B2 B1) (prod A2 A1) (prod A1 A2) tt (@fprod A2 A1 B2 B1 f2 f1) (@swap A1 A2)) *) by apply: fext; case. Qed. Lemma swap_rCA A B C : swap \o (@rCA A B C) = rAC \o rA. Proof. (* Goal: @eq (forall _ : prod A (prod B C), prod (prod A C) B) (@funcomp (prod (prod A C) B) (prod B (prod A C)) (prod A (prod B C)) tt (@swap B (prod A C)) (@rCA A B C)) (@funcomp (prod (prod A C) B) (prod (prod A B) C) (prod A (prod B C)) tt (@rAC A B C) (@rA A B C)) *) by apply: fext; case=>x []. Qed. Lemma swap_rAC A B C : swap \o (@rAC A B C) = rCA \o iA. Proof. (* Goal: @eq (forall _ : prod (prod A B) C, prod B (prod A C)) (@funcomp (prod B (prod A C)) (prod (prod A C) B) (prod (prod A B) C) tt (@swap (prod A C) B) (@rAC A B C)) (@funcomp (prod B (prod A C)) (prod A (prod B C)) (prod (prod A B) C) tt (@rCA A B C) (@iA A B C)) *) by apply: fext; case=>[[]]. Qed. Ltac rfe1 x1 := let H := fresh "H" in move=>H; move:H x1=>-> x1. Ltac rfe2 x1 x2 := let H := fresh "H" in move=>H; move:H x1 x2=>-> x1 x2. Ltac rfjm := move/jmE=>->. Ltac rfejm1 x1 := rfe1 x1; rfjm. Ltac rfejm2 x1 x2 := rfe2 x1 x2; rfjm. Ltac rfp := move/inj_pair2=>->. Ltac rfep1 x1 := rfe1 x1; rfp. Ltac rfep2 x1 x2 := rfe1 x2; rfp. Ltac rbe1 x1 := let H := fresh "H" in move=>H; move:H x1=><- x1. Ltac rbe2 x1 x2 := let H := fresh "H" in move=>H; move:H x1 x2=><- x1 x2. Ltac rbjm := move/jmE=><-. Ltac rbejm1 x1 := rbe1 x1; rbjm. Ltac rbejm2 x1 x2 := rbe2 x1 x2; rbjm. Ltac rbp := move/inj_pair2=><-. Ltac rbep1 x1 := rbe1 x1; rbp. Ltac rbep2 x1 x2 := rbe1 x2; rbp. 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 ]" (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 ] ']'"). Inductive and6 (P1 P2 P3 P4 P5 P6 : Prop) : Prop := And6 of P1 & P2 & P3 & P4 & P5 & P6. 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. Notation "[ /\ P1 , P2 , P3 , P4 , P5 & P6 ]" := (and6 P1 P2 P3 P4 P5 P6) : 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. Section ReflectConnectives. Variable b1 b2 b3 b4 b5 b6 : 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 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]. End ReflectConnectives. Arguments and6P {b1 b2 b3 b4 b5 b6}. Arguments or5P {b1 b2 b3 b4 b5}. Arguments or6P {b1 b2 b3 b4 b5 b6}.
Require Import Classical. Require Export GeoCoq.Elements.OriginalProofs.euclidean_defs. Require Export GeoCoq.Elements.OriginalProofs.general_tactics. Ltac remove_double_neg := repeat match goal with H: ~ ~ ?X |- _ => apply NNPP in H end. Section basic_lemmas. Context `{Ax:euclidean_neutral}. Lemma Col_or_nCol : forall A B C, Col A B C \/ nCol A B C. Proof. (* Goal: forall A B C : @Point Ax, or (@Col Ax A B C) (@nCol Ax A B C) *) unfold nCol, Col. (* Goal: forall A B C : @Point Ax, or (or (@eq Ax A B) (or (@eq Ax A C) (or (@eq Ax B C) (or (@BetS Ax B A C) (or (@BetS Ax A B C) (@BetS Ax A C B)))))) (and (@neq Ax A B) (and (@neq Ax A C) (and (@neq Ax B C) (and (not (@BetS Ax A B C)) (and (not (@BetS Ax A C B)) (not (@BetS Ax B A C))))))) *) intros. (* Goal: or (or (@eq Ax A B) (or (@eq Ax A C) (or (@eq Ax B C) (or (@BetS Ax B A C) (or (@BetS Ax A B C) (@BetS Ax A C B)))))) (and (@neq Ax A B) (and (@neq Ax A C) (and (@neq Ax B C) (and (not (@BetS Ax A B C)) (and (not (@BetS Ax A C B)) (not (@BetS Ax B A C))))))) *) tauto. Qed. Lemma nCol_or_Col : forall A B C, nCol A B C \/ Col A B C. Proof. (* Goal: forall A B C : @Point Ax, or (@nCol Ax A B C) (@Col Ax A B C) *) unfold nCol, Col. (* Goal: forall A B C : @Point Ax, or (and (@neq Ax A B) (and (@neq Ax A C) (and (@neq Ax B C) (and (not (@BetS Ax A B C)) (and (not (@BetS Ax A C B)) (not (@BetS Ax B A C))))))) (or (@eq Ax A B) (or (@eq Ax A C) (or (@eq Ax B C) (or (@BetS Ax B A C) (or (@BetS Ax A B C) (@BetS Ax A C B)))))) *) intros. (* Goal: or (and (@neq Ax A B) (and (@neq Ax A C) (and (@neq Ax B C) (and (not (@BetS Ax A B C)) (and (not (@BetS Ax A C B)) (not (@BetS Ax B A C))))))) (or (@eq Ax A B) (or (@eq Ax A C) (or (@eq Ax B C) (or (@BetS Ax B A C) (or (@BetS Ax A B C) (@BetS Ax A C B)))))) *) tauto. Qed. Lemma eq_or_neq : forall A B, eq A B \/ neq A B. Proof. (* Goal: forall A B : @Point Ax, or (@eq Ax A B) (@neq Ax A B) *) intros;unfold neq;tauto. Qed. Lemma neq_or_eq : forall A B, neq A B \/ eq A B. Proof. (* Goal: forall A B : @Point Ax, or (@neq Ax A B) (@eq Ax A B) *) intros;unfold neq;tauto. Qed. Lemma Col_nCol_False : forall A B C, nCol A B C -> Col A B C -> False. Proof. (* Goal: forall (A B C : @Point Ax) (_ : @nCol Ax A B C) (_ : @Col Ax A B C), False *) unfold Col, nCol;intuition. Qed. Lemma nCol_notCol : forall A B C, ~ Col A B C -> nCol A B C. Proof. (* Goal: forall (A B C : @Point Ax) (_ : not (@Col Ax A B C)), @nCol Ax A B C *) intros. (* Goal: @nCol Ax A B C *) unfold nCol, Col, neq in *. (* Goal: and (not (@eq Ax A B)) (and (not (@eq Ax A C)) (and (not (@eq Ax B C)) (and (not (@BetS Ax A B C)) (and (not (@BetS Ax A C B)) (not (@BetS Ax B A C)))))) *) intuition. Qed. Lemma not_nCol_Col : forall A B C, ~ nCol A B C -> Col A B C. Proof. (* Goal: forall (A B C : @Point Ax) (_ : not (@nCol Ax A B C)), @Col Ax A B C *) intros. (* Goal: @Col Ax A B C *) unfold nCol, Col, neq in *. (* Goal: or (@eq Ax A B) (or (@eq Ax A C) (or (@eq Ax B C) (or (@BetS Ax B A C) (or (@BetS Ax A B C) (@BetS Ax A C B))))) *) tauto. Qed. Lemma nCol_not_Col : forall A B C, nCol A B C -> ~ Col A B C. Proof. (* Goal: forall (A B C : @Point Ax) (_ : @nCol Ax A B C), not (@Col Ax A B C) *) intros. (* Goal: not (@Col Ax A B C) *) unfold nCol, Col, neq in *. (* Goal: not (or (@eq Ax A B) (or (@eq Ax A C) (or (@eq Ax B C) (or (@BetS Ax B A C) (or (@BetS Ax A B C) (@BetS Ax A C B)))))) *) tauto. Qed. End basic_lemmas. Hint Resolve not_nCol_Col nCol_not_Col nCol_notCol Col_nCol_False. Hint Resolve Col_or_nCol nCol_or_Col eq_or_neq neq_or_eq : decidability. Tactic Notation "by" "cases" "on" constr(t) := (let H := hyp_of_type t in decompose [or] H; clear H) || let C := fresh in (assert (C:t) by (auto with decidability || unfold neq in *;tauto); decompose [or] C;clear C). Ltac remove_not_nCol := repeat match goal with H: ~ nCol ?A ?B ?C |- _ => apply not_nCol_Col in H end. Ltac forward_using thm := remove_not_nCol;spliter;splits; match goal with H: ?X |- _ => apply thm in H;spliter;assumption end. Ltac contradict := (solve [eauto using Col_nCol_False]) || contradiction || (unfold nCol in *;intuition). Ltac conclude t := spliter; remove_double_neg; solve [unfold eq in *;mysubst;assumption | eauto using t | eapply t;eauto | eapply t;intuition | apply <- t;remove_exists;eauto | unfold neq,eq in *;intuition | unfold neq,eq in *;remove_double_neg;congruence | apply t;tauto ]. Ltac close := solve [assumption | auto | repeat (split;auto) | unfold neq, nCol in *;try assumption;tauto | remove_exists;eauto 15 ]. Ltac conclude_def_aux t := (remove_double_neg; (progress (unfold t); solve [remove_exists;eauto 6 | remove_exists;splits;eauto | remove_exists;eauto 11 | one_of_disjunct | intuition ])) || solve [unfold t in *;spliter;assumption | unfold t in *;destruct_all;assumption | unfold t in *;remove_double_neg;destruct_all;remove_exists;eauto 11 ]. Tactic Notation "conclude_def" reference(x) := (conclude_def_aux x).
Require Import securite. Lemma POinvprel8 : forall (l l0 : list C) (k k0 k1 k2 : K) (c c0 c1 c2 : C) (d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 : D), inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> invP (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> rel8 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) -> invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0). Proof. (* Goal: forall (l l0 : list C) (k k0 k1 k2 : K) (c c0 c1 c2 : C) (d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 : D) (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : invP (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : rel8 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0)), invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) do 32 intro. (* Goal: forall (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : invP (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : rel8 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0)), invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) unfold rel8 in |- *; intros Inv0 Inv1 InvP and1. (* Goal: invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) elim and1; intros t1 and2; elim and2; intros t2 and3; elim and3; intros t3 and4; elim and4; intros eq_l0 t4. (* Goal: invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) elim eq_l0; assumption. Qed.
Require Import securite. Lemma POinv1rel1 : forall (l l0 : list C) (k k0 k1 k2 : K) (c c0 c1 c2 : C) (d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 : D), inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> rel1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) -> inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0). Proof. (* Goal: forall (l l0 : list C) (k k0 k1 k2 : K) (c c0 c1 c2 : C) (d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 : D) (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : rel1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0)), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) do 32 intro. (* Goal: forall (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : rel1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0)), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) intros Inv0. (* Goal: forall (_ : inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : rel1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0)), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) unfold inv1 in |- *; unfold rel1 in |- *. (* Goal: forall (_ : and (not (known_in (B2C (K2B (KeyX Aid))) (@app C l rngDDKKeyAB))) (not (known_in (B2C (K2B (KeyX Bid))) (@app C l rngDDKKeyAB)))) (_ : and (@eq (list C) l0 (@cons C (quad (B2C (D2B d18)) (B2C (D2B Aid)) (B2C (D2B d19)) (Encrypt (quad (B2C (D2B d20)) (B2C (D2B d18)) (B2C (D2B Aid)) (B2C (D2B d19))) (KeyX Aid))) l)) (and (new d20 l) (and (new d18 l) (and (@eq BState (MANbKabCaCb d4 d5 d6 k c c0) (MANbKabCaCb d15 d16 d17 k1 c1 c2)) (and (@eq SState (MABNaNbKeyK d d0 d1 d2 d3) (MABNaNbKeyK d10 d11 d12 d13 d14)) (and (@eq D d9 d20) (@eq K k0 k2))))))), and (not (known_in (B2C (K2B (KeyX Aid))) (@app C l0 rngDDKKeyAB))) (not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB))) *) intros (known_Kas, known_Kbs). (* Goal: forall _ : and (@eq (list C) l0 (@cons C (quad (B2C (D2B d18)) (B2C (D2B Aid)) (B2C (D2B d19)) (Encrypt (quad (B2C (D2B d20)) (B2C (D2B d18)) (B2C (D2B Aid)) (B2C (D2B d19))) (KeyX Aid))) l)) (and (new d20 l) (and (new d18 l) (and (@eq BState (MANbKabCaCb d4 d5 d6 k c c0) (MANbKabCaCb d15 d16 d17 k1 c1 c2)) (and (@eq SState (MABNaNbKeyK d d0 d1 d2 d3) (MABNaNbKeyK d10 d11 d12 d13 d14)) (and (@eq D d9 d20) (@eq K k0 k2)))))), and (not (known_in (B2C (K2B (KeyX Aid))) (@app C l0 rngDDKKeyAB))) (not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB))) *) intros (eq_l0, t1). (* Goal: and (not (known_in (B2C (K2B (KeyX Aid))) (@app C l0 rngDDKKeyAB))) (not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB))) *) clear Inv0 t1. (* Goal: and (not (known_in (B2C (K2B (KeyX Aid))) (@app C l0 rngDDKKeyAB))) (not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB))) *) split. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not (known_in (B2C (K2B (KeyX Aid))) (@app C l0 rngDDKKeyAB)) *) apply D2. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not_comp_of (B2C (K2B (KeyX Aid))) (@app C l0 rngDDKKeyAB) *) rewrite eq_l0. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not_comp_of (B2C (K2B (KeyX Aid))) (@app C (@cons C (quad (B2C (D2B d18)) (B2C (D2B Aid)) (B2C (D2B d19)) (Encrypt (quad (B2C (D2B d20)) (B2C (D2B d18)) (B2C (D2B Aid)) (B2C (D2B d19))) (KeyX Aid))) l) rngDDKKeyAB) *) unfold quad in |- *. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not_comp_of (B2C (K2B (KeyX Aid))) (@app C (@cons C (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) l) rngDDKKeyAB) *) simpl in |- *. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not_comp_of (B2C (K2B (KeyX Aid))) (@cons C (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) (@app C l rngDDKKeyAB)) *) repeat apply C2 || apply C3 || apply C4. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d20))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d19))) *) (* Goal: not_comp_of (B2C (K2B (KeyX Aid))) (@app C l rngDDKKeyAB) *) apply D1; assumption. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d20))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d19))) *) discriminate. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d20))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Aid))) *) discriminate. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d20))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))) *) discriminate. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d20))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) discriminate. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d20))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) *) discriminate. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d20))) *) discriminate. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))))) *) discriminate. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) discriminate. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d19))) *) discriminate. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) discriminate. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Aid))) *) discriminate. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) discriminate. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d18))) *) discriminate. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) discriminate. (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *) apply D2. (* Goal: not_comp_of (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB) *) rewrite eq_l0. (* Goal: not_comp_of (B2C (K2B (KeyX Bid))) (@app C (@cons C (quad (B2C (D2B d18)) (B2C (D2B Aid)) (B2C (D2B d19)) (Encrypt (quad (B2C (D2B d20)) (B2C (D2B d18)) (B2C (D2B Aid)) (B2C (D2B d19))) (KeyX Aid))) l) rngDDKKeyAB) *) unfold quad in |- *. (* Goal: not_comp_of (B2C (K2B (KeyX Bid))) (@app C (@cons C (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) l) rngDDKKeyAB) *) simpl in |- *. (* Goal: not_comp_of (B2C (K2B (KeyX Bid))) (@cons C (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) (@app C l rngDDKKeyAB)) *) repeat apply C2 || apply C3 || apply C4. (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d20))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d19))) *) (* Goal: not_comp_of (B2C (K2B (KeyX Bid))) (@app C l rngDDKKeyAB) *) apply D1; assumption. (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d20))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d19))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d20))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Aid))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d20))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d20))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d20))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d20))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19)))))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d19))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d19))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Aid))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid))))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d18))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (Pair (B2C (D2B d19)) (Encrypt (Pair (B2C (D2B d20)) (Pair (B2C (D2B d18)) (Pair (B2C (D2B Aid)) (B2C (D2B d19))))) (KeyX Aid)))))) *) discriminate. Qed.
Require Import ZArith. Require Import Wf_nat. Require Import lemmas. Require Import natZ. Require Import dec. Require Import exp. Definition Divides (n m : nat) : Prop := exists q : nat, m = n * q. Lemma div_refl : forall a : nat, Divides a a. Proof. (* Goal: forall a : nat, Divides a a *) intros. (* Goal: Divides a a *) split with 1. (* Goal: @eq nat a (Init.Nat.mul a (S O)) *) rewrite <- mult_n_Sm. (* Goal: @eq nat a (Init.Nat.add (Init.Nat.mul a O) a) *) rewrite <- mult_n_O. (* Goal: @eq nat a (Init.Nat.add O a) *) simpl in |- *. (* Goal: @eq nat a a *) reflexivity. Qed. Lemma div_trans : forall p q r : nat, Divides p q -> Divides q r -> Divides p r. Proof. (* Goal: forall (p q r : nat) (_ : Divides p q) (_ : Divides q r), Divides p r *) intros. (* Goal: Divides p r *) elim H. (* Goal: forall (x : nat) (_ : @eq nat q (Init.Nat.mul p x)), Divides p r *) elim H0. (* Goal: forall (x : nat) (_ : @eq nat r (Init.Nat.mul q x)) (x0 : nat) (_ : @eq nat q (Init.Nat.mul p x0)), Divides p r *) intros. (* Goal: Divides p r *) unfold Divides in |- *. (* Goal: @ex nat (fun q : nat => @eq nat r (Init.Nat.mul p q)) *) split with (x0 * x). (* Goal: @eq nat r (Init.Nat.mul p (Init.Nat.mul x0 x)) *) rewrite H1. (* Goal: @eq nat (Init.Nat.mul q x) (Init.Nat.mul p (Init.Nat.mul x0 x)) *) rewrite H2. (* Goal: @eq nat (Init.Nat.mul (Init.Nat.mul p x0) x) (Init.Nat.mul p (Init.Nat.mul x0 x)) *) rewrite mult_assoc. (* Goal: @eq nat (Init.Nat.mul (Init.Nat.mul p x0) x) (Nat.mul (Nat.mul p x0) x) *) reflexivity. Qed. Lemma div_antisym : forall a b : nat, Divides a b -> Divides b a -> a = b. Proof. (* Goal: forall (a b : nat) (_ : Divides a b) (_ : Divides b a), @eq nat a b *) intros. (* Goal: @eq nat a b *) elim H. (* Goal: forall (x : nat) (_ : @eq nat b (Init.Nat.mul a x)), @eq nat a b *) elim H0. (* Goal: forall (x : nat) (_ : @eq nat a (Init.Nat.mul b x)) (x0 : nat) (_ : @eq nat b (Init.Nat.mul a x0)), @eq nat a b *) intros x Ha y Hb. (* Goal: @eq nat a b *) rewrite Hb in Ha. (* Goal: @eq nat a b *) rewrite mult_assoc_reverse in Ha. (* Goal: @eq nat a b *) elim (mult_ppq_p0q1 a (y * x)). (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) (* Goal: forall _ : @eq nat (Init.Nat.mul y x) (S O), @eq nat a b *) (* Goal: forall _ : @eq nat a O, @eq nat a b *) intro. (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) (* Goal: forall _ : @eq nat (Init.Nat.mul y x) (S O), @eq nat a b *) (* Goal: @eq nat a b *) rewrite H1 in Hb. (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) (* Goal: forall _ : @eq nat (Init.Nat.mul y x) (S O), @eq nat a b *) (* Goal: @eq nat a b *) simpl in Hb. (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) (* Goal: forall _ : @eq nat (Init.Nat.mul y x) (S O), @eq nat a b *) (* Goal: @eq nat a b *) rewrite H1. (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) (* Goal: forall _ : @eq nat (Init.Nat.mul y x) (S O), @eq nat a b *) (* Goal: @eq nat O b *) rewrite Hb. (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) (* Goal: forall _ : @eq nat (Init.Nat.mul y x) (S O), @eq nat a b *) (* Goal: @eq nat O O *) reflexivity. (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) (* Goal: forall _ : @eq nat (Init.Nat.mul y x) (S O), @eq nat a b *) intros. (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) (* Goal: @eq nat a b *) elim (mult_pq1_p1q1 y x H1). (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) (* Goal: forall (_ : @eq nat y (S O)) (_ : @eq nat x (S O)), @eq nat a b *) intros. (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) (* Goal: @eq nat a b *) rewrite H2 in Hb. (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) (* Goal: @eq nat a b *) rewrite <- mult_n_Sm in Hb. (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) (* Goal: @eq nat a b *) rewrite <- mult_n_O in Hb. (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) (* Goal: @eq nat a b *) simpl in Hb. (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) (* Goal: @eq nat a b *) symmetry in |- *. (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) (* Goal: @eq nat b a *) assumption. (* Goal: @eq nat a (Init.Nat.mul a (Init.Nat.mul y x)) *) assumption. Qed. Lemma div_le1 : forall n d : nat, Divides d (S n) -> d <= S n. Proof. (* Goal: forall (n d : nat) (_ : Divides d (S n)), le d (S n) *) unfold Divides in |- *. (* Goal: forall (n d : nat) (_ : @ex nat (fun q : nat => @eq nat (S n) (Init.Nat.mul d q))), le d (S n) *) intros. (* Goal: le d (S n) *) elim H. (* Goal: forall (x : nat) (_ : @eq nat (S n) (Init.Nat.mul d x)), le d (S n) *) intro q. (* Goal: forall _ : @eq nat (S n) (Init.Nat.mul d q), le d (S n) *) case q. (* Goal: forall (n0 : nat) (_ : @eq nat (S n) (Init.Nat.mul d (S n0))), le d (S n) *) (* Goal: forall _ : @eq nat (S n) (Init.Nat.mul d O), le d (S n) *) rewrite <- (mult_n_O d). (* Goal: forall (n0 : nat) (_ : @eq nat (S n) (Init.Nat.mul d (S n0))), le d (S n) *) (* Goal: forall _ : @eq nat (S n) O, le d (S n) *) intros. (* Goal: forall (n0 : nat) (_ : @eq nat (S n) (Init.Nat.mul d (S n0))), le d (S n) *) (* Goal: le d (S n) *) discriminate H0. (* Goal: forall (n0 : nat) (_ : @eq nat (S n) (Init.Nat.mul d (S n0))), le d (S n) *) intro q1. (* Goal: forall _ : @eq nat (S n) (Init.Nat.mul d (S q1)), le d (S n) *) intros. (* Goal: le d (S n) *) rewrite H0. (* Goal: le d (Init.Nat.mul d (S q1)) *) apply le_n_nm. Qed. Lemma div_le : forall d n : nat, 0 < n -> Divides d n -> d <= n. Proof. (* Goal: forall (d n : nat) (_ : lt O n) (_ : Divides d n), le d n *) intros d n. (* Goal: forall (_ : lt O n) (_ : Divides d n), le d n *) case n. (* Goal: forall (n : nat) (_ : lt O (S n)) (_ : Divides d (S n)), le d (S n) *) (* Goal: forall (_ : lt O O) (_ : Divides d O), le d O *) intro. (* Goal: forall (n : nat) (_ : lt O (S n)) (_ : Divides d (S n)), le d (S n) *) (* Goal: forall _ : Divides d O, le d O *) elim (lt_irrefl 0). (* Goal: forall (n : nat) (_ : lt O (S n)) (_ : Divides d (S n)), le d (S n) *) (* Goal: lt O O *) assumption. (* Goal: forall (n : nat) (_ : lt O (S n)) (_ : Divides d (S n)), le d (S n) *) intros. (* Goal: le d (S n0) *) apply div_le1. (* Goal: Divides d (S n0) *) assumption. Qed. Definition bDivides (d n : nat) := n = 0 \/ (exists q : nat, q < S n /\ n = d * q). Lemma divbdiv : forall n d : nat, Divides d n <-> bDivides d n. Proof. (* Goal: forall n d : nat, iff (Divides d n) (bDivides d n) *) unfold Divides in |- *. (* Goal: forall n d : nat, iff (@ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q))) (bDivides d n) *) unfold bDivides in |- *. (* Goal: forall n d : nat, iff (@ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q))) (or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q))))) *) split. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: forall _ : @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)), or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))) *) case n. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: forall (n : nat) (_ : @ex nat (fun q : nat => @eq nat (S n) (Init.Nat.mul d q))), or (@eq nat (S n) O) (@ex nat (fun q : nat => and (lt q (S (S n))) (@eq nat (S n) (Init.Nat.mul d q)))) *) (* Goal: forall _ : @ex nat (fun q : nat => @eq nat O (Init.Nat.mul d q)), or (@eq nat O O) (@ex nat (fun q : nat => and (lt q (S O)) (@eq nat O (Init.Nat.mul d q)))) *) left. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: forall (n : nat) (_ : @ex nat (fun q : nat => @eq nat (S n) (Init.Nat.mul d q))), or (@eq nat (S n) O) (@ex nat (fun q : nat => and (lt q (S (S n))) (@eq nat (S n) (Init.Nat.mul d q)))) *) (* Goal: @eq nat O O *) reflexivity. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: forall (n : nat) (_ : @ex nat (fun q : nat => @eq nat (S n) (Init.Nat.mul d q))), or (@eq nat (S n) O) (@ex nat (fun q : nat => and (lt q (S (S n))) (@eq nat (S n) (Init.Nat.mul d q)))) *) right. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul d q))) *) elim H. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: forall (x : nat) (_ : @eq nat (S n0) (Init.Nat.mul d x)), @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul d q))) *) intro q. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: forall _ : @eq nat (S n0) (Init.Nat.mul d q), @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul d q))) *) case d. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: forall (n : nat) (_ : @eq nat (S n0) (Init.Nat.mul (S n) q)), @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul (S n) q))) *) (* Goal: forall _ : @eq nat (S n0) (Init.Nat.mul O q), @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul O q))) *) simpl in |- *. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: forall (n : nat) (_ : @eq nat (S n0) (Init.Nat.mul (S n) q)), @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul (S n) q))) *) (* Goal: forall _ : @eq nat (S n0) O, @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) O)) *) intros. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: forall (n : nat) (_ : @eq nat (S n0) (Init.Nat.mul (S n) q)), @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul (S n) q))) *) (* Goal: @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) O)) *) discriminate H0. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: forall (n : nat) (_ : @eq nat (S n0) (Init.Nat.mul (S n) q)), @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul (S n) q))) *) intro d1. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: forall _ : @eq nat (S n0) (Init.Nat.mul (S d1) q), @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul (S d1) q))) *) intros. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: @ex nat (fun q : nat => and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul (S d1) q))) *) split with q. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: and (lt q (S (S n0))) (@eq nat (S n0) (Init.Nat.mul (S d1) q)) *) split. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: @eq nat (S n0) (Init.Nat.mul (S d1) q) *) (* Goal: lt q (S (S n0)) *) rewrite H0. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: @eq nat (S n0) (Init.Nat.mul (S d1) q) *) (* Goal: lt q (S (Init.Nat.mul (S d1) q)) *) unfold lt in |- *. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: @eq nat (S n0) (Init.Nat.mul (S d1) q) *) (* Goal: le (S q) (S (Init.Nat.mul (S d1) q)) *) apply le_n_S. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: @eq nat (S n0) (Init.Nat.mul (S d1) q) *) (* Goal: le q (Init.Nat.mul (S d1) q) *) apply le_n_mn. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: @eq nat (S n0) (Init.Nat.mul (S d1) q) *) assumption. (* Goal: forall _ : or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) intros. (* Goal: @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) elim H. (* Goal: forall _ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: forall _ : @eq nat n O, @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) intros. (* Goal: forall _ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) rewrite H0. (* Goal: forall _ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: @ex nat (fun q : nat => @eq nat O (Init.Nat.mul d q)) *) split with 0. (* Goal: forall _ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: @eq nat O (Init.Nat.mul d O) *) rewrite <- (mult_n_O d). (* Goal: forall _ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: @eq nat O O *) reflexivity. (* Goal: forall _ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) elim H. (* Goal: forall (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))) (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: forall (_ : @eq nat n O) (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) intros. (* Goal: forall (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))) (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) rewrite H0. (* Goal: forall (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))) (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: @ex nat (fun q : nat => @eq nat O (Init.Nat.mul d q)) *) split with 0. (* Goal: forall (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))) (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: @eq nat O (Init.Nat.mul d O) *) rewrite <- (mult_n_O d). (* Goal: forall (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))) (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) (* Goal: @eq nat O O *) reflexivity. (* Goal: forall (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))) (_ : @ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) intros. (* Goal: @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) elim H0. (* Goal: forall (x : nat) (_ : and (lt x (S n)) (@eq nat n (Init.Nat.mul d x))), @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) intros. (* Goal: @ex nat (fun q : nat => @eq nat n (Init.Nat.mul d q)) *) split with x. (* Goal: @eq nat n (Init.Nat.mul d x) *) elim H2. (* Goal: forall (_ : lt x (S n)) (_ : @eq nat n (Init.Nat.mul d x)), @eq nat n (Init.Nat.mul d x) *) intros. (* Goal: @eq nat n (Init.Nat.mul d x) *) assumption. Qed. Lemma bdivdec : forall n d : nat, bDivides d n \/ ~ bDivides d n. Proof. (* Goal: forall n d : nat, or (bDivides d n) (not (bDivides d n)) *) intros. (* Goal: or (bDivides d n) (not (bDivides d n)) *) unfold bDivides in |- *. (* Goal: or (or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q))))) (not (or (@eq nat n O) (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))))) *) apply ordec. (* Goal: or (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))) (not (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q))))) *) (* Goal: or (@eq nat n O) (not (@eq nat n O)) *) apply eqdec. (* Goal: or (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q)))) (not (@ex nat (fun q : nat => and (lt q (S n)) (@eq nat n (Init.Nat.mul d q))))) *) apply (exdec (fun q : nat => n = d * q) (S n)). (* Goal: forall n0 : nat, or (@eq nat n (Init.Nat.mul d n0)) (not (@eq nat n (Init.Nat.mul d n0))) *) intros. (* Goal: or (@eq nat n (Init.Nat.mul d n0)) (not (@eq nat n (Init.Nat.mul d n0))) *) apply eqdec. Qed. Lemma divdec : forall n d : nat, Divides d n \/ ~ Divides d n. Proof. (* Goal: forall n d : nat, or (Divides d n) (not (Divides d n)) *) intros. (* Goal: or (Divides d n) (not (Divides d n)) *) elim (divbdiv n d). (* Goal: forall (_ : forall _ : Divides d n, bDivides d n) (_ : forall _ : bDivides d n, Divides d n), or (Divides d n) (not (Divides d n)) *) intros. (* Goal: or (Divides d n) (not (Divides d n)) *) elim (bdivdec n d). (* Goal: forall _ : not (bDivides d n), or (Divides d n) (not (Divides d n)) *) (* Goal: forall _ : bDivides d n, or (Divides d n) (not (Divides d n)) *) left. (* Goal: forall _ : not (bDivides d n), or (Divides d n) (not (Divides d n)) *) (* Goal: Divides d n *) apply (H0 H1). (* Goal: forall _ : not (bDivides d n), or (Divides d n) (not (Divides d n)) *) right. (* Goal: not (Divides d n) *) intro. (* Goal: False *) apply H1. (* Goal: bDivides d n *) apply (H H2). Qed. Theorem sqrdivbound : forall n d : nat, Divides d n -> exists x : nat, Divides x n /\ x * x <= n /\ (x = d \/ d * x = n). Proof. (* Goal: forall (n d : nat) (_ : Divides d n), @ex nat (fun 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)))) *) intros. (* Goal: @ex nat (fun 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)))) *) unfold Divides in H. (* Goal: @ex nat (fun 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)))) *) elim H. (* Goal: forall (x : nat) (_ : @eq nat n (Init.Nat.mul d x)), @ex nat (fun x0 : nat => and (Divides x0 n) (and (le (Init.Nat.mul x0 x0) n) (or (@eq nat x0 d) (@eq nat (Init.Nat.mul d x0) n)))) *) intros. (* Goal: @ex nat (fun 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)))) *) rewrite H0. (* Goal: @ex nat (fun x0 : nat => and (Divides x0 (Init.Nat.mul d x)) (and (le (Init.Nat.mul x0 x0) (Init.Nat.mul d x)) (or (@eq nat x0 d) (@eq nat (Init.Nat.mul d x0) (Init.Nat.mul d x))))) *) elim (sqrbound d x). (* Goal: forall _ : le (Init.Nat.mul x x) (Init.Nat.mul d x), @ex nat (fun x0 : nat => and (Divides x0 (Init.Nat.mul d x)) (and (le (Init.Nat.mul x0 x0) (Init.Nat.mul d x)) (or (@eq nat x0 d) (@eq nat (Init.Nat.mul d x0) (Init.Nat.mul d x))))) *) (* Goal: forall _ : le (Init.Nat.mul d d) (Init.Nat.mul d x), @ex nat (fun x0 : nat => and (Divides x0 (Init.Nat.mul d x)) (and (le (Init.Nat.mul x0 x0) (Init.Nat.mul d x)) (or (@eq nat x0 d) (@eq nat (Init.Nat.mul d x0) (Init.Nat.mul d x))))) *) intros. (* Goal: forall _ : le (Init.Nat.mul x x) (Init.Nat.mul d x), @ex nat (fun x0 : nat => and (Divides x0 (Init.Nat.mul d x)) (and (le (Init.Nat.mul x0 x0) (Init.Nat.mul d x)) (or (@eq nat x0 d) (@eq nat (Init.Nat.mul d x0) (Init.Nat.mul d x))))) *) (* Goal: @ex nat (fun x0 : nat => and (Divides x0 (Init.Nat.mul d x)) (and (le (Init.Nat.mul x0 x0) (Init.Nat.mul d x)) (or (@eq nat x0 d) (@eq nat (Init.Nat.mul d x0) (Init.Nat.mul d x))))) *) split with d. (* Goal: forall _ : le (Init.Nat.mul x x) (Init.Nat.mul d x), @ex nat (fun x0 : nat => and (Divides x0 (Init.Nat.mul d x)) (and (le (Init.Nat.mul x0 x0) (Init.Nat.mul d x)) (or (@eq nat x0 d) (@eq nat (Init.Nat.mul d x0) (Init.Nat.mul d x))))) *) (* Goal: and (Divides d (Init.Nat.mul d x)) (and (le (Init.Nat.mul d d) (Init.Nat.mul d x)) (or (@eq nat d d) (@eq nat (Init.Nat.mul d d) (Init.Nat.mul d x)))) *) split. (* Goal: forall _ : le (Init.Nat.mul x x) (Init.Nat.mul d x), @ex nat (fun x0 : nat => and (Divides x0 (Init.Nat.mul d x)) (and (le (Init.Nat.mul x0 x0) (Init.Nat.mul d x)) (or (@eq nat x0 d) (@eq nat (Init.Nat.mul d x0) (Init.Nat.mul d x))))) *) (* Goal: and (le (Init.Nat.mul d d) (Init.Nat.mul d x)) (or (@eq nat d d) (@eq nat (Init.Nat.mul d d) (Init.Nat.mul d x))) *) (* Goal: Divides d (Init.Nat.mul d x) *) split with x. (* Goal: forall _ : le (Init.Nat.mul x x) (Init.Nat.mul d x), @ex nat (fun x0 : nat => and (Divides x0 (Init.Nat.mul d x)) (and (le (Init.Nat.mul x0 x0) (Init.Nat.mul d x)) (or (@eq nat x0 d) (@eq nat (Init.Nat.mul d x0) (Init.Nat.mul d x))))) *) (* Goal: and (le (Init.Nat.mul d d) (Init.Nat.mul d x)) (or (@eq nat d d) (@eq nat (Init.Nat.mul d d) (Init.Nat.mul d x))) *) (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.mul d x) *) reflexivity. (* Goal: forall _ : le (Init.Nat.mul x x) (Init.Nat.mul d x), @ex nat (fun x0 : nat => and (Divides x0 (Init.Nat.mul d x)) (and (le (Init.Nat.mul x0 x0) (Init.Nat.mul d x)) (or (@eq nat x0 d) (@eq nat (Init.Nat.mul d x0) (Init.Nat.mul d x))))) *) (* Goal: and (le (Init.Nat.mul d d) (Init.Nat.mul d x)) (or (@eq nat d d) (@eq nat (Init.Nat.mul d d) (Init.Nat.mul d x))) *) split. (* Goal: forall _ : le (Init.Nat.mul x x) (Init.Nat.mul d x), @ex nat (fun x0 : nat => and (Divides x0 (Init.Nat.mul d x)) (and (le (Init.Nat.mul x0 x0) (Init.Nat.mul d x)) (or (@eq nat x0 d) (@eq nat (Init.Nat.mul d x0) (Init.Nat.mul d x))))) *) (* Goal: or (@eq nat d d) (@eq nat (Init.Nat.mul d d) (Init.Nat.mul d x)) *) (* Goal: le (Init.Nat.mul d d) (Init.Nat.mul d x) *) assumption. (* Goal: forall _ : le (Init.Nat.mul x x) (Init.Nat.mul d x), @ex nat (fun x0 : nat => and (Divides x0 (Init.Nat.mul d x)) (and (le (Init.Nat.mul x0 x0) (Init.Nat.mul d x)) (or (@eq nat x0 d) (@eq nat (Init.Nat.mul d x0) (Init.Nat.mul d x))))) *) (* Goal: or (@eq nat d d) (@eq nat (Init.Nat.mul d d) (Init.Nat.mul d x)) *) left. (* Goal: forall _ : le (Init.Nat.mul x x) (Init.Nat.mul d x), @ex nat (fun x0 : nat => and (Divides x0 (Init.Nat.mul d x)) (and (le (Init.Nat.mul x0 x0) (Init.Nat.mul d x)) (or (@eq nat x0 d) (@eq nat (Init.Nat.mul d x0) (Init.Nat.mul d x))))) *) (* Goal: @eq nat d d *) reflexivity. (* Goal: forall _ : le (Init.Nat.mul x x) (Init.Nat.mul d x), @ex nat (fun x0 : nat => and (Divides x0 (Init.Nat.mul d x)) (and (le (Init.Nat.mul x0 x0) (Init.Nat.mul d x)) (or (@eq nat x0 d) (@eq nat (Init.Nat.mul d x0) (Init.Nat.mul d x))))) *) intros. (* Goal: @ex nat (fun x0 : nat => and (Divides x0 (Init.Nat.mul d x)) (and (le (Init.Nat.mul x0 x0) (Init.Nat.mul d x)) (or (@eq nat x0 d) (@eq nat (Init.Nat.mul d x0) (Init.Nat.mul d x))))) *) split with x. (* Goal: and (Divides x (Init.Nat.mul d x)) (and (le (Init.Nat.mul x x) (Init.Nat.mul d x)) (or (@eq nat x d) (@eq nat (Init.Nat.mul d x) (Init.Nat.mul d x)))) *) split. (* Goal: and (le (Init.Nat.mul x x) (Init.Nat.mul d x)) (or (@eq nat x d) (@eq nat (Init.Nat.mul d x) (Init.Nat.mul d x))) *) (* Goal: Divides x (Init.Nat.mul d x) *) split with d. (* Goal: and (le (Init.Nat.mul x x) (Init.Nat.mul d x)) (or (@eq nat x d) (@eq nat (Init.Nat.mul d x) (Init.Nat.mul d x))) *) (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.mul x d) *) apply mult_comm. (* Goal: and (le (Init.Nat.mul x x) (Init.Nat.mul d x)) (or (@eq nat x d) (@eq nat (Init.Nat.mul d x) (Init.Nat.mul d x))) *) split. (* Goal: or (@eq nat x d) (@eq nat (Init.Nat.mul d x) (Init.Nat.mul d x)) *) (* Goal: le (Init.Nat.mul x x) (Init.Nat.mul d x) *) assumption. (* Goal: or (@eq nat x d) (@eq nat (Init.Nat.mul d x) (Init.Nat.mul d x)) *) right. (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.mul d x) *) reflexivity. Qed. Theorem div_rem : forall d n : nat, d > 0 -> exists q : nat, (exists r : nat, 0 <= r /\ r < d /\ n = q * d + r). Proof. (* Goal: forall (d n : nat) (_ : gt d O), @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros d n. (* Goal: forall _ : gt d O, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) apply (lt_wf_ind n). (* Goal: forall (n : nat) (_ : forall (m : nat) (_ : lt m n) (_ : gt d O), @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat m (Init.Nat.add (Init.Nat.mul q d) r)))))) (_ : gt d O), @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros N IH. (* Goal: forall _ : gt d O, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (le_or_lt d N). (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : le d N, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intro. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (le_witness d N). (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: forall (x : nat) (_ : @eq nat (Init.Nat.add d x) N), @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros x Hx. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (IH x). (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: forall (x0 : nat) (_ : @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat x (Init.Nat.add (Init.Nat.mul x0 d) r))))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intro q'. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: forall _ : @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat x (Init.Nat.add (Init.Nat.mul q' d) r)))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim H1. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: forall (x0 : nat) (_ : and (le O x0) (and (lt x0 d) (@eq nat x (Init.Nat.add (Init.Nat.mul q' d) x0)))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intro r'. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: forall _ : and (le O r') (and (lt r' d) (@eq nat x (Init.Nat.add (Init.Nat.mul q' d) r'))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim H2. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: forall (_ : le O r') (_ : and (lt r' d) (@eq nat x (Init.Nat.add (Init.Nat.mul q' d) r'))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim H4. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: forall (_ : lt r' d) (_ : @eq nat x (Init.Nat.add (Init.Nat.mul q' d) r')), @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with (S q'). (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S q') d) r)))) *) split with r'. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: and (le O r') (and (lt r' d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S q') d) r'))) *) split. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: and (lt r' d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S q') d) r')) *) (* Goal: le O r' *) assumption. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: and (lt r' d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S q') d) r')) *) split. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: @eq nat N (Init.Nat.add (Init.Nat.mul (S q') d) r') *) (* Goal: lt r' d *) assumption. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: @eq nat N (Init.Nat.add (Init.Nat.mul (S q') d) r') *) simpl in |- *. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: @eq nat N (Init.Nat.add (Init.Nat.add d (Init.Nat.mul q' d)) r') *) rewrite <- Hx. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: @eq nat (Init.Nat.add d x) (Init.Nat.add (Init.Nat.add d (Init.Nat.mul q' d)) r') *) rewrite (plus_assoc_reverse d (q' * d)). (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: @eq nat (Init.Nat.add d x) (Init.Nat.add d (Init.Nat.add (Init.Nat.mul q' d) r')) *) rewrite <- H6. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) (* Goal: @eq nat (Init.Nat.add d x) (Init.Nat.add d x) *) reflexivity. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt x N *) unfold lt in |- *. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: le (S x) N *) apply witness_le. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.add (S x) q) N) *) split with (pred d). (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: @eq nat (Init.Nat.add (S x) (Init.Nat.pred d)) N *) rewrite plus_Snm_nSm. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: @eq nat (Init.Nat.add x (S (Init.Nat.pred d))) N *) rewrite <- (S_pred d 0). (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt O d *) (* Goal: @eq nat (Init.Nat.add x d) N *) rewrite plus_comm. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt O d *) (* Goal: @eq nat (Nat.add d x) N *) assumption. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) (* Goal: lt O d *) assumption. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) (* Goal: gt d O *) assumption. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d N *) assumption. (* Goal: forall _ : lt N d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intro. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with 0. (* Goal: @ex nat (fun r : nat => and (le O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul O d) r)))) *) split with N. (* Goal: and (le O N) (and (lt N d) (@eq nat N (Init.Nat.add (Init.Nat.mul O d) N))) *) split. (* Goal: and (lt N d) (@eq nat N (Init.Nat.add (Init.Nat.mul O d) N)) *) (* Goal: le O N *) apply le_O_n. (* Goal: and (lt N d) (@eq nat N (Init.Nat.add (Init.Nat.mul O d) N)) *) split. (* Goal: @eq nat N (Init.Nat.add (Init.Nat.mul O d) N) *) (* Goal: lt N d *) assumption. (* Goal: @eq nat N (Init.Nat.add (Init.Nat.mul O d) N) *) simpl in |- *. (* Goal: @eq nat N N *) reflexivity. Qed. Lemma div_rem0 : forall n d q r : nat, n = q * d + r -> r < d -> Divides d n -> r = 0. Proof. (* Goal: forall (n d q r : nat) (_ : @eq nat n (Init.Nat.add (Init.Nat.mul q d) r)) (_ : lt r d) (_ : Divides d n), @eq nat r O *) intros. (* Goal: @eq nat r O *) elim H1. (* Goal: forall (x : nat) (_ : @eq nat n (Init.Nat.mul d x)), @eq nat r O *) intros. (* Goal: @eq nat r O *) rewrite H2 in H. (* Goal: @eq nat r O *) rewrite (mult_comm q d) in H. (* Goal: @eq nat r O *) apply (le_diff0 (d * q) (d * x)). (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) r) *) (* Goal: le (Init.Nat.mul d x) (Init.Nat.mul d q) *) apply le_mult_l. (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) r) *) (* Goal: le x q *) apply le_S_n. (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) r) *) (* Goal: le (S x) (S q) *) change (x < S q) in |- *. (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) r) *) (* Goal: lt x (S q) *) apply simpl_lt_mult_l with d. (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) r) *) (* Goal: lt (Init.Nat.mul d x) (Init.Nat.mul d (S q)) *) rewrite <- (mult_n_Sm d q). (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) r) *) (* Goal: lt (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) d) *) replace (d * x) with (d * q + r). (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) r) *) (* Goal: lt (Init.Nat.add (Init.Nat.mul d q) r) (Init.Nat.add (Init.Nat.mul d q) d) *) apply plus_lt_compat_l. (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) r) *) (* Goal: lt r d *) assumption. (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.add (Init.Nat.mul d q) r) *) assumption. Qed. Theorem notdiv_rem : forall d n : nat, 0 < d -> ~ Divides d n -> exists q : nat, (exists r : nat, 0 < r /\ r < d /\ n = q * d + r). Proof. (* Goal: forall (d n : nat) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros d n. (* Goal: forall (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (le_or_lt d n). (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall (_ : le d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) intro. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (le_lt_or_eq d n). (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall (_ : lt d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) apply (lt_wf_ind n). (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall (n : nat) (_ : forall (m : nat) (_ : lt m n) (_ : lt d m) (_ : lt O d) (_ : not (Divides d m)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat m (Init.Nat.add (Init.Nat.mul q d) r)))))) (_ : lt d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros N IH. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall (_ : lt d N) (_ : lt O d) (_ : not (Divides d N)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (lt_witness d N). (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (x : nat) (_ : and (@eq nat (Init.Nat.add d x) N) (lt O x)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim H3. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall (_ : @eq nat (Init.Nat.add d x) N) (_ : lt O x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (le_or_lt d x). (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : le d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intro. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (le_lt_or_eq d x). (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : lt d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intro. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (divdec x d). (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : not (Divides d x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : Divides d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : not (Divides d x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim H8. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : not (Divides d x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall (x0 : nat) (_ : @eq nat x (Init.Nat.mul d x0)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : not (Divides d x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) rewrite H9 in H4. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : not (Divides d x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) rewrite plus_comm in H4. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : not (Divides d x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) rewrite mult_n_Sm in H4. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : not (Divides d x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim H2. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : not (Divides d x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: Divides d N *) split with (S x0). (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : not (Divides d x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: @eq nat N (Init.Nat.mul d (S x0)) *) symmetry in |- *. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : not (Divides d x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: @eq nat (Init.Nat.mul d (S x0)) N *) assumption. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall _ : not (Divides d x), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim (IH x). (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: forall (x0 : nat) (_ : @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat x (Init.Nat.add (Init.Nat.mul x0 d) r))))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intro q'. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: forall _ : @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat x (Init.Nat.add (Init.Nat.mul q' d) r)))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim H9. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: forall (x0 : nat) (_ : and (lt O x0) (and (lt x0 d) (@eq nat x (Init.Nat.add (Init.Nat.mul q' d) x0)))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intro r'. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: forall _ : and (lt O r') (and (lt r' d) (@eq nat x (Init.Nat.add (Init.Nat.mul q' d) r'))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim H10. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: forall (_ : lt O r') (_ : and (lt r' d) (@eq nat x (Init.Nat.add (Init.Nat.mul q' d) r'))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim H12. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: forall (_ : lt r' d) (_ : @eq nat x (Init.Nat.add (Init.Nat.mul q' d) r')), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with (S q'). (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S q') d) r)))) *) split with r'. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: and (lt O r') (and (lt r' d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S q') d) r'))) *) split. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: and (lt r' d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S q') d) r')) *) (* Goal: lt O r' *) assumption. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: and (lt r' d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S q') d) r')) *) split. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: @eq nat N (Init.Nat.add (Init.Nat.mul (S q') d) r') *) (* Goal: lt r' d *) assumption. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: @eq nat N (Init.Nat.add (Init.Nat.mul (S q') d) r') *) simpl in |- *. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: @eq nat N (Init.Nat.add (Init.Nat.add d (Init.Nat.mul q' d)) r') *) rewrite plus_assoc_reverse. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: @eq nat N (Init.Nat.add d (Init.Nat.add (Init.Nat.mul q' d) r')) *) rewrite <- H14. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: @eq nat N (Init.Nat.add d x) *) symmetry in |- *. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) (* Goal: @eq nat (Init.Nat.add d x) N *) assumption. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x N *) rewrite <- H4. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: lt x (Init.Nat.add d x) *) pattern x at 1 in |- *. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: (fun n : nat => lt n (Init.Nat.add d x)) x *) replace x with (0 + x). (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: @eq nat (Init.Nat.add O x) x *) (* Goal: lt (Init.Nat.add O x) (Init.Nat.add d x) *) apply plus_lt_compat_r. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: @eq nat (Init.Nat.add O x) x *) (* Goal: lt O d *) assumption. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: @eq nat (Init.Nat.add O x) x *) simpl in |- *. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) (* Goal: @eq nat x x *) reflexivity. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) (* Goal: lt d x *) assumption. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) (* Goal: lt O d *) assumption. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: not (Divides d x) *) assumption. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: forall _ : @eq nat d x, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intro. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim H2. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: Divides d N *) split with 2. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: @eq nat N (Init.Nat.mul d (S (S O))) *) rewrite mult_comm. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: @eq nat N (Nat.mul (S (S O)) d) *) simpl in |- *. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: @eq nat N (Nat.add d (Nat.add d O)) *) rewrite <- (plus_n_O d). (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: @eq nat N (Nat.add d d) *) rewrite <- H4. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: @eq nat (Init.Nat.add d x) (Nat.add d d) *) rewrite H7. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) (* Goal: @eq nat (Init.Nat.add x x) (Nat.add x x) *) reflexivity. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d x *) assumption. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: forall _ : lt x d, @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) intro. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with 1. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S O) d) r)))) *) split with x. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: and (lt O x) (and (lt x d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S O) d) x))) *) split. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: and (lt x d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S O) d) x)) *) (* Goal: lt O x *) assumption. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: and (lt x d) (@eq nat N (Init.Nat.add (Init.Nat.mul (S O) d) x)) *) split. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: @eq nat N (Init.Nat.add (Init.Nat.mul (S O) d) x) *) (* Goal: lt x d *) assumption. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: @eq nat N (Init.Nat.add (Init.Nat.mul (S O) d) x) *) simpl in |- *. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: @eq nat N (Init.Nat.add (Init.Nat.add d O) x) *) rewrite <- (plus_n_O d). (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: @eq nat N (Init.Nat.add d x) *) rewrite H4. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) (* Goal: @eq nat N N *) reflexivity. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: lt d N *) assumption. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: forall (_ : @eq nat d n) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim H2. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: Divides d n *) split with 1. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: @eq nat n (Init.Nat.mul d (S O)) *) rewrite mult_comm. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: @eq nat n (Nat.mul (S O) d) *) simpl in |- *. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: @eq nat n (Nat.add d O) *) rewrite <- (plus_n_O d). (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: @eq nat n d *) symmetry in |- *. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) (* Goal: @eq nat d n *) assumption. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: le d n *) assumption. (* Goal: forall (_ : lt n d) (_ : lt O d) (_ : not (Divides d n)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat n (Init.Nat.add (Init.Nat.mul q d) r))))) *) case n. (* Goal: forall (n : nat) (_ : lt (S n) d) (_ : lt O d) (_ : not (Divides d (S n))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat (S n) (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: forall (_ : lt O d) (_ : lt O d) (_ : not (Divides d O)), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat O (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: forall (n : nat) (_ : lt (S n) d) (_ : lt O d) (_ : not (Divides d (S n))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat (S n) (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat O (Init.Nat.add (Init.Nat.mul q d) r))))) *) elim H1. (* Goal: forall (n : nat) (_ : lt (S n) d) (_ : lt O d) (_ : not (Divides d (S n))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat (S n) (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: Divides d O *) split with 0. (* Goal: forall (n : nat) (_ : lt (S n) d) (_ : lt O d) (_ : not (Divides d (S n))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat (S n) (Init.Nat.add (Init.Nat.mul q d) r))))) *) (* Goal: @eq nat O (Init.Nat.mul d O) *) apply mult_n_O. (* Goal: forall (n : nat) (_ : lt (S n) d) (_ : lt O d) (_ : not (Divides d (S n))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat (S n) (Init.Nat.add (Init.Nat.mul q d) r))))) *) intro n1. (* Goal: forall (_ : lt (S n1) d) (_ : lt O d) (_ : not (Divides d (S n1))), @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat (S n1) (Init.Nat.add (Init.Nat.mul q d) r))))) *) intros. (* Goal: @ex nat (fun q : nat => @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat (S n1) (Init.Nat.add (Init.Nat.mul q d) r))))) *) split with 0. (* Goal: @ex nat (fun r : nat => and (lt O r) (and (lt r d) (@eq nat (S n1) (Init.Nat.add (Init.Nat.mul O d) r)))) *) split with (S n1). (* Goal: and (lt O (S n1)) (and (lt (S n1) d) (@eq nat (S n1) (Init.Nat.add (Init.Nat.mul O d) (S n1)))) *) split. (* Goal: and (lt (S n1) d) (@eq nat (S n1) (Init.Nat.add (Init.Nat.mul O d) (S n1))) *) (* Goal: lt O (S n1) *) apply lt_O_Sn. (* Goal: and (lt (S n1) d) (@eq nat (S n1) (Init.Nat.add (Init.Nat.mul O d) (S n1))) *) split. (* Goal: @eq nat (S n1) (Init.Nat.add (Init.Nat.mul O d) (S n1)) *) (* Goal: lt (S n1) d *) assumption. (* Goal: @eq nat (S n1) (Init.Nat.add (Init.Nat.mul O d) (S n1)) *) simpl in |- *. (* Goal: @eq nat (S n1) (S n1) *) reflexivity. Qed. Lemma div_plus_compat : forall a b c : nat, Divides a b -> Divides a c -> Divides a (b + c). Proof. (* Goal: forall (a b c : nat) (_ : Divides a b) (_ : Divides a c), Divides a (Init.Nat.add b c) *) intros. (* Goal: Divides a (Init.Nat.add b c) *) elim H. (* Goal: forall (x : nat) (_ : @eq nat b (Init.Nat.mul a x)), Divides a (Init.Nat.add b c) *) intro x. (* Goal: forall _ : @eq nat b (Init.Nat.mul a x), Divides a (Init.Nat.add b c) *) intros. (* Goal: Divides a (Init.Nat.add b c) *) elim H0. (* Goal: forall (x : nat) (_ : @eq nat c (Init.Nat.mul a x)), Divides a (Init.Nat.add b c) *) intro y. (* Goal: forall _ : @eq nat c (Init.Nat.mul a y), Divides a (Init.Nat.add b c) *) intros. (* Goal: Divides a (Init.Nat.add b c) *) split with (x + y). (* Goal: @eq nat (Init.Nat.add b c) (Init.Nat.mul a (Init.Nat.add x y)) *) rewrite H1. (* Goal: @eq nat (Init.Nat.add (Init.Nat.mul a x) c) (Init.Nat.mul a (Init.Nat.add x y)) *) rewrite H2. (* Goal: @eq nat (Init.Nat.add (Init.Nat.mul a x) (Init.Nat.mul a y)) (Init.Nat.mul a (Init.Nat.add x y)) *) symmetry in |- *. (* Goal: @eq nat (Init.Nat.mul a (Init.Nat.add x y)) (Init.Nat.add (Init.Nat.mul a x) (Init.Nat.mul a y)) *) rewrite (mult_comm a). (* Goal: @eq nat (Nat.mul (Init.Nat.add x y) a) (Init.Nat.add (Init.Nat.mul a x) (Init.Nat.mul a y)) *) rewrite (mult_comm a). (* Goal: @eq nat (Nat.mul (Init.Nat.add x y) a) (Init.Nat.add (Nat.mul x a) (Init.Nat.mul a y)) *) rewrite (mult_comm a). (* Goal: @eq nat (Nat.mul (Init.Nat.add x y) a) (Init.Nat.add (Nat.mul x a) (Nat.mul y a)) *) apply mult_plus_distr_r. Qed. Lemma div_minus_compat : forall a b d : nat, Divides d a -> Divides d b -> Divides d (a - b). Proof. (* Goal: forall (a b d : nat) (_ : Divides d a) (_ : Divides d b), Divides d (Init.Nat.sub a b) *) intros. (* Goal: Divides d (Init.Nat.sub a b) *) elim H. (* Goal: forall (x : nat) (_ : @eq nat a (Init.Nat.mul d x)), Divides d (Init.Nat.sub a b) *) elim H0. (* Goal: forall (x : nat) (_ : @eq nat b (Init.Nat.mul d x)) (x0 : nat) (_ : @eq nat a (Init.Nat.mul d x0)), Divides d (Init.Nat.sub a b) *) intros. (* Goal: Divides d (Init.Nat.sub a b) *) unfold Divides in |- *. (* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.sub a b) (Init.Nat.mul d q)) *) rewrite H1. (* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.sub a (Init.Nat.mul d x)) (Init.Nat.mul d q)) *) rewrite H2. (* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.sub (Init.Nat.mul d x0) (Init.Nat.mul d x)) (Init.Nat.mul d q)) *) rewrite (mult_comm d). (* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.sub (Nat.mul x0 d) (Init.Nat.mul d x)) (Init.Nat.mul d q)) *) rewrite (mult_comm d). (* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.sub (Nat.mul x0 d) (Nat.mul x d)) (Init.Nat.mul d q)) *) rewrite <- mult_minus_distr_r. (* Goal: @ex nat (fun q : nat => @eq nat (Nat.mul (Nat.sub x0 x) d) (Init.Nat.mul d q)) *) split with (x0 - x). (* Goal: @eq nat (Nat.mul (Nat.sub x0 x) d) (Init.Nat.mul d (Init.Nat.sub x0 x)) *) apply mult_comm. Qed. Lemma div_mult_compat_l : forall a b c : nat, Divides a b -> Divides a (b * c). Proof. (* Goal: forall (a b c : nat) (_ : Divides a b), Divides a (Init.Nat.mul b c) *) intros. (* Goal: Divides a (Init.Nat.mul b c) *) elim H. (* Goal: forall (x : nat) (_ : @eq nat b (Init.Nat.mul a x)), Divides a (Init.Nat.mul b c) *) intro x. (* Goal: forall _ : @eq nat b (Init.Nat.mul a x), Divides a (Init.Nat.mul b c) *) intros. (* Goal: Divides a (Init.Nat.mul b c) *) unfold Divides in |- *. (* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.mul b c) (Init.Nat.mul a q)) *) rewrite H0. (* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.mul (Init.Nat.mul a x) c) (Init.Nat.mul a q)) *) split with (x * c). (* Goal: @eq nat (Init.Nat.mul (Init.Nat.mul a x) c) (Init.Nat.mul a (Init.Nat.mul x c)) *) rewrite mult_assoc. (* Goal: @eq nat (Init.Nat.mul (Init.Nat.mul a x) c) (Nat.mul (Nat.mul a x) c) *) reflexivity. Qed. Lemma div_absexp_compat : forall (b : Z) (d : nat), Divides d (Zabs_nat b) -> forall n : nat, Divides d (Zabs_nat (Exp b (S n))). Proof. (* Goal: forall (b : Z) (d : nat) (_ : Divides d (Z.abs_nat b)) (n : nat), Divides d (Z.abs_nat (Exp b (S n))) *) intros b d H. (* Goal: forall n : nat, Divides d (Z.abs_nat (Exp b (S n))) *) elim H. (* Goal: forall (x : nat) (_ : @eq nat (Z.abs_nat b) (Init.Nat.mul d x)) (n : nat), Divides d (Z.abs_nat (Exp b (S n))) *) intros k Hk. (* Goal: forall n : nat, Divides d (Z.abs_nat (Exp b (S n))) *) simple induction n. (* Goal: forall (n : nat) (_ : Divides d (Z.abs_nat (Exp b (S n)))), Divides d (Z.abs_nat (Exp b (S (S n)))) *) (* Goal: Divides d (Z.abs_nat (Exp b (S O))) *) split with k. (* Goal: forall (n : nat) (_ : Divides d (Z.abs_nat (Exp b (S n)))), Divides d (Z.abs_nat (Exp b (S (S n)))) *) (* Goal: @eq nat (Z.abs_nat (Exp b (S O))) (Init.Nat.mul d k) *) rewrite <- Hk. (* Goal: forall (n : nat) (_ : Divides d (Z.abs_nat (Exp b (S n)))), Divides d (Z.abs_nat (Exp b (S (S n)))) *) (* Goal: @eq nat (Z.abs_nat (Exp b (S O))) (Z.abs_nat b) *) simpl in |- *. (* Goal: forall (n : nat) (_ : Divides d (Z.abs_nat (Exp b (S n)))), Divides d (Z.abs_nat (Exp b (S (S n)))) *) (* Goal: @eq nat (Z.abs_nat (Z.mul b (Zpos xH))) (Z.abs_nat b) *) rewrite abs_mult. (* Goal: forall (n : nat) (_ : Divides d (Z.abs_nat (Exp b (S n)))), Divides d (Z.abs_nat (Exp b (S (S n)))) *) (* Goal: @eq nat (Init.Nat.mul (Z.abs_nat b) (Z.abs_nat (Zpos xH))) (Z.abs_nat b) *) rewrite mult_comm. (* Goal: forall (n : nat) (_ : Divides d (Z.abs_nat (Exp b (S n)))), Divides d (Z.abs_nat (Exp b (S (S n)))) *) (* Goal: @eq nat (Nat.mul (Z.abs_nat (Zpos xH)) (Z.abs_nat b)) (Z.abs_nat b) *) simpl in |- *. (* Goal: forall (n : nat) (_ : Divides d (Z.abs_nat (Exp b (S n)))), Divides d (Z.abs_nat (Exp b (S (S n)))) *) (* Goal: @eq nat (Nat.add (Z.abs_nat b) O) (Z.abs_nat b) *) rewrite <- plus_n_O. (* Goal: forall (n : nat) (_ : Divides d (Z.abs_nat (Exp b (S n)))), Divides d (Z.abs_nat (Exp b (S (S n)))) *) (* Goal: @eq nat (Z.abs_nat b) (Z.abs_nat b) *) reflexivity. (* Goal: forall (n : nat) (_ : Divides d (Z.abs_nat (Exp b (S n)))), Divides d (Z.abs_nat (Exp b (S (S n)))) *) intros m IH. (* Goal: Divides d (Z.abs_nat (Exp b (S (S m)))) *) replace (Exp b (S (S m))) with (b * Exp b (S m))%Z. (* Goal: @eq Z (Z.mul b (Exp b (S m))) (Exp b (S (S m))) *) (* Goal: Divides d (Z.abs_nat (Z.mul b (Exp b (S m)))) *) rewrite abs_mult. (* Goal: @eq Z (Z.mul b (Exp b (S m))) (Exp b (S (S m))) *) (* Goal: Divides d (Init.Nat.mul (Z.abs_nat b) (Z.abs_nat (Exp b (S m)))) *) apply div_mult_compat_l. (* Goal: @eq Z (Z.mul b (Exp b (S m))) (Exp b (S (S m))) *) (* Goal: Divides d (Z.abs_nat b) *) assumption. (* Goal: @eq Z (Z.mul b (Exp b (S m))) (Exp b (S (S m))) *) simpl in |- *. (* Goal: @eq Z (Z.mul b (Z.mul b (Exp b m))) (Z.mul b (Z.mul b (Exp b m))) *) reflexivity. Qed. Lemma div_plus_r : forall a b d : nat, Divides d a -> Divides d (a + b) -> Divides d b. Proof. (* Goal: forall (a b d : nat) (_ : Divides d a) (_ : Divides d (Init.Nat.add a b)), Divides d b *) intros. (* Goal: Divides d b *) elim H. (* Goal: forall (x : nat) (_ : @eq nat a (Init.Nat.mul d x)), Divides d b *) elim H0. (* Goal: forall (x : nat) (_ : @eq nat (Init.Nat.add a b) (Init.Nat.mul d x)) (x0 : nat) (_ : @eq nat a (Init.Nat.mul d x0)), Divides d b *) intros. (* Goal: Divides d b *) split with (x - x0). (* Goal: @eq nat b (Init.Nat.mul d (Init.Nat.sub x x0)) *) rewrite mult_comm. (* Goal: @eq nat b (Nat.mul (Init.Nat.sub x x0) d) *) rewrite mult_minus_distr_r. (* Goal: @eq nat b (Nat.sub (Nat.mul x d) (Nat.mul x0 d)) *) rewrite mult_comm. (* Goal: @eq nat b (Nat.sub (Nat.mul d x) (Nat.mul x0 d)) *) rewrite <- H1. (* Goal: @eq nat b (Nat.sub (Init.Nat.add a b) (Nat.mul x0 d)) *) rewrite mult_comm. (* Goal: @eq nat b (Nat.sub (Init.Nat.add a b) (Nat.mul d x0)) *) rewrite <- H2. (* Goal: @eq nat b (Nat.sub (Init.Nat.add a b) a) *) rewrite minus_plus. (* Goal: @eq nat b b *) reflexivity. Qed. Definition ZDivides (x y : Z) : Prop := exists q : Z, y = (x * q)%Z. Lemma zdivdiv : forall a b : Z, ZDivides a b -> Divides (Zabs_nat a) (Zabs_nat b). Proof. (* Goal: forall (a b : Z) (_ : ZDivides a b), Divides (Z.abs_nat a) (Z.abs_nat b) *) intros. (* Goal: Divides (Z.abs_nat a) (Z.abs_nat b) *) elim H. (* Goal: forall (x : Z) (_ : @eq Z b (Z.mul a x)), Divides (Z.abs_nat a) (Z.abs_nat b) *) intros d Hd. (* Goal: Divides (Z.abs_nat a) (Z.abs_nat b) *) exists (Zabs_nat d). (* Goal: @eq nat (Z.abs_nat b) (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat d)) *) rewrite Hd. (* Goal: @eq nat (Z.abs_nat (Z.mul a d)) (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat d)) *) apply abs_mult. Qed. Lemma divzdiv : forall a b : Z, Divides (Zabs_nat a) (Zabs_nat b) -> ZDivides a b. Proof. (* Goal: forall (a b : Z) (_ : Divides (Z.abs_nat a) (Z.abs_nat b)), ZDivides a b *) intros. (* Goal: ZDivides a b *) elim H. (* Goal: forall (x : nat) (_ : @eq nat (Z.abs_nat b) (Init.Nat.mul (Z.abs_nat a) x)), ZDivides a b *) intros d Hd. (* Goal: ZDivides a b *) elim (Zle_or_lt 0 a). (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: forall _ : Z.le Z0 a, ZDivides a b *) elim (Zle_or_lt 0 b). (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.le Z0 a), ZDivides a b *) (* Goal: forall (_ : Z.le Z0 b) (_ : Z.le Z0 a), ZDivides a b *) intros. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.le Z0 a), ZDivides a b *) (* Goal: ZDivides a b *) exists (Z_of_nat d). (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.le Z0 a), ZDivides a b *) (* Goal: @eq Z b (Z.mul a (Z.of_nat d)) *) rewrite <- (inj_abs_pos b). (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.le Z0 a), ZDivides a b *) (* Goal: Z.ge b Z0 *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat b)) (Z.mul a (Z.of_nat d)) *) rewrite <- (inj_abs_pos a). (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.le Z0 a), ZDivides a b *) (* Goal: Z.ge b Z0 *) (* Goal: Z.ge a Z0 *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat b)) (Z.mul (Z.of_nat (Z.abs_nat a)) (Z.of_nat d)) *) rewrite <- Znat.inj_mult. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.le Z0 a), ZDivides a b *) (* Goal: Z.ge b Z0 *) (* Goal: Z.ge a Z0 *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat b)) (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d)) *) rewrite Hd. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.le Z0 a), ZDivides a b *) (* Goal: Z.ge b Z0 *) (* Goal: Z.ge a Z0 *) (* Goal: @eq Z (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d)) (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d)) *) reflexivity. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.le Z0 a), ZDivides a b *) (* Goal: Z.ge b Z0 *) (* Goal: Z.ge a Z0 *) apply Zle_ge. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.le Z0 a), ZDivides a b *) (* Goal: Z.ge b Z0 *) (* Goal: Z.le Z0 a *) assumption. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.le Z0 a), ZDivides a b *) (* Goal: Z.ge b Z0 *) apply Zle_ge. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.le Z0 a), ZDivides a b *) (* Goal: Z.le Z0 b *) assumption. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: forall (_ : Z.lt b Z0) (_ : Z.le Z0 a), ZDivides a b *) intros. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: ZDivides a b *) exists (- Z_of_nat d)%Z. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: @eq Z b (Z.mul a (Z.opp (Z.of_nat d))) *) rewrite <- (Zopp_involutive b). (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: @eq Z (Z.opp (Z.opp b)) (Z.mul a (Z.opp (Z.of_nat d))) *) rewrite <- (inj_abs_neg b). (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: Z.lt b Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat b))) (Z.mul a (Z.opp (Z.of_nat d))) *) rewrite <- (inj_abs_pos a). (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: Z.lt b Z0 *) (* Goal: Z.ge a Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat b))) (Z.mul (Z.of_nat (Z.abs_nat a)) (Z.opp (Z.of_nat d))) *) rewrite Zmult_comm. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: Z.lt b Z0 *) (* Goal: Z.ge a Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat b))) (Z.mul (Z.opp (Z.of_nat d)) (Z.of_nat (Z.abs_nat a))) *) rewrite Zopp_mult_distr_l_reverse. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: Z.lt b Z0 *) (* Goal: Z.ge a Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat b))) (Z.opp (Z.mul (Z.of_nat d) (Z.of_nat (Z.abs_nat a)))) *) rewrite Zmult_comm. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: Z.lt b Z0 *) (* Goal: Z.ge a Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat b))) (Z.opp (Z.mul (Z.of_nat (Z.abs_nat a)) (Z.of_nat d))) *) rewrite <- Znat.inj_mult. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: Z.lt b Z0 *) (* Goal: Z.ge a Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat b))) (Z.opp (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d))) *) apply (f_equal (A:=Z)). (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: Z.lt b Z0 *) (* Goal: Z.ge a Z0 *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat b)) (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d)) *) rewrite Hd. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: Z.lt b Z0 *) (* Goal: Z.ge a Z0 *) (* Goal: @eq Z (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d)) (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d)) *) reflexivity. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: Z.lt b Z0 *) (* Goal: Z.ge a Z0 *) apply Zle_ge. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: Z.lt b Z0 *) (* Goal: Z.le Z0 a *) assumption. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) (* Goal: Z.lt b Z0 *) assumption. (* Goal: forall _ : Z.lt a Z0, ZDivides a b *) elim (Zle_or_lt 0 b). (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) (* Goal: forall (_ : Z.le Z0 b) (_ : Z.lt a Z0), ZDivides a b *) intros. (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) (* Goal: ZDivides a b *) exists (- Z_of_nat d)%Z. (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) (* Goal: @eq Z b (Z.mul a (Z.opp (Z.of_nat d))) *) rewrite <- (Zopp_involutive a). (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) (* Goal: @eq Z b (Z.mul (Z.opp (Z.opp a)) (Z.opp (Z.of_nat d))) *) rewrite <- (inj_abs_neg a). (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) (* Goal: Z.lt a Z0 *) (* Goal: @eq Z b (Z.mul (Z.opp (Z.of_nat (Z.abs_nat a))) (Z.opp (Z.of_nat d))) *) rewrite <- (inj_abs_pos b). (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) (* Goal: Z.lt a Z0 *) (* Goal: Z.ge b Z0 *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat b)) (Z.mul (Z.opp (Z.of_nat (Z.abs_nat a))) (Z.opp (Z.of_nat d))) *) rewrite Zmult_opp_opp. (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) (* Goal: Z.lt a Z0 *) (* Goal: Z.ge b Z0 *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat b)) (Z.mul (Z.of_nat (Z.abs_nat a)) (Z.of_nat d)) *) rewrite <- Znat.inj_mult. (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) (* Goal: Z.lt a Z0 *) (* Goal: Z.ge b Z0 *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat b)) (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d)) *) rewrite Hd. (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) (* Goal: Z.lt a Z0 *) (* Goal: Z.ge b Z0 *) (* Goal: @eq Z (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d)) (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d)) *) reflexivity. (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) (* Goal: Z.lt a Z0 *) (* Goal: Z.ge b Z0 *) apply Zle_ge. (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) (* Goal: Z.lt a Z0 *) (* Goal: Z.le Z0 b *) assumption. (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) (* Goal: Z.lt a Z0 *) assumption. (* Goal: forall (_ : Z.lt b Z0) (_ : Z.lt a Z0), ZDivides a b *) intros. (* Goal: ZDivides a b *) exists (Z_of_nat d). (* Goal: @eq Z b (Z.mul a (Z.of_nat d)) *) rewrite <- (Zopp_involutive b). (* Goal: @eq Z (Z.opp (Z.opp b)) (Z.mul a (Z.of_nat d)) *) rewrite <- (Zopp_involutive a). (* Goal: @eq Z (Z.opp (Z.opp b)) (Z.mul (Z.opp (Z.opp a)) (Z.of_nat d)) *) rewrite <- (inj_abs_neg b). (* Goal: Z.lt b Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat b))) (Z.mul (Z.opp (Z.opp a)) (Z.of_nat d)) *) rewrite <- (inj_abs_neg a). (* Goal: Z.lt b Z0 *) (* Goal: Z.lt a Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat b))) (Z.mul (Z.opp (Z.of_nat (Z.abs_nat a))) (Z.of_nat d)) *) rewrite Zopp_mult_distr_l_reverse. (* Goal: Z.lt b Z0 *) (* Goal: Z.lt a Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat b))) (Z.opp (Z.mul (Z.of_nat (Z.abs_nat a)) (Z.of_nat d))) *) rewrite <- Znat.inj_mult. (* Goal: Z.lt b Z0 *) (* Goal: Z.lt a Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat b))) (Z.opp (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d))) *) apply (f_equal (A:=Z)). (* Goal: Z.lt b Z0 *) (* Goal: Z.lt a Z0 *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat b)) (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d)) *) rewrite Hd. (* Goal: Z.lt b Z0 *) (* Goal: Z.lt a Z0 *) (* Goal: @eq Z (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d)) (Z.of_nat (Init.Nat.mul (Z.abs_nat a) d)) *) reflexivity. (* Goal: Z.lt b Z0 *) (* Goal: Z.lt a Z0 *) assumption. (* Goal: Z.lt b Z0 *) assumption. Qed. Lemma zdivdec : forall x d : Z, ZDivides d x \/ ~ ZDivides d x. Proof. (* Goal: forall x d : Z, or (ZDivides d x) (not (ZDivides d x)) *) intros. (* Goal: or (ZDivides d x) (not (ZDivides d x)) *) elim (divdec (Zabs_nat x) (Zabs_nat d)). (* Goal: forall _ : not (Divides (Z.abs_nat d) (Z.abs_nat x)), or (ZDivides d x) (not (ZDivides d x)) *) (* Goal: forall _ : Divides (Z.abs_nat d) (Z.abs_nat x), or (ZDivides d x) (not (ZDivides d x)) *) left. (* Goal: forall _ : not (Divides (Z.abs_nat d) (Z.abs_nat x)), or (ZDivides d x) (not (ZDivides d x)) *) (* Goal: ZDivides d x *) apply divzdiv. (* Goal: forall _ : not (Divides (Z.abs_nat d) (Z.abs_nat x)), or (ZDivides d x) (not (ZDivides d x)) *) (* Goal: Divides (Z.abs_nat d) (Z.abs_nat x) *) assumption. (* Goal: forall _ : not (Divides (Z.abs_nat d) (Z.abs_nat x)), or (ZDivides d x) (not (ZDivides d x)) *) right. (* Goal: not (ZDivides d x) *) intro. (* Goal: False *) apply H. (* Goal: Divides (Z.abs_nat d) (Z.abs_nat x) *) apply zdivdiv. (* Goal: ZDivides d x *) assumption. Qed. Lemma zdiv_plus_r : forall a b d : Z, ZDivides d a -> ZDivides d (a + b) -> ZDivides d b. Proof. (* Goal: forall (a b d : Z) (_ : ZDivides d a) (_ : ZDivides d (Z.add a b)), ZDivides d b *) intros. (* Goal: ZDivides d b *) elim H. (* Goal: forall (x : Z) (_ : @eq Z a (Z.mul d x)), ZDivides d b *) elim H0. (* Goal: forall (x : Z) (_ : @eq Z (Z.add a b) (Z.mul d x)) (x0 : Z) (_ : @eq Z a (Z.mul d x0)), ZDivides d b *) intros. (* Goal: ZDivides d b *) split with (x - x0)%Z. (* Goal: @eq Z b (Z.mul d (Z.sub x x0)) *) rewrite Zmult_comm. (* Goal: @eq Z b (Z.mul (Z.sub x x0) d) *) rewrite Zmult_minus_distr_r. (* Goal: @eq Z b (Z.sub (Z.mul x d) (Z.mul x0 d)) *) rewrite Zmult_comm. (* Goal: @eq Z b (Z.sub (Z.mul d x) (Z.mul x0 d)) *) rewrite <- H1. (* Goal: @eq Z b (Z.sub (Z.add a b) (Z.mul x0 d)) *) rewrite Zmult_comm. (* Goal: @eq Z b (Z.sub (Z.add a b) (Z.mul d x0)) *) rewrite <- H2. (* Goal: @eq Z b (Z.sub (Z.add a b) a) *) rewrite Zminus_plus. (* Goal: @eq Z b b *) reflexivity. Qed. Lemma zdiv_plus_compat : forall a b c : Z, ZDivides a b -> ZDivides a c -> ZDivides a (b + c). Proof. (* Goal: forall (a b c : Z) (_ : ZDivides a b) (_ : ZDivides a c), ZDivides a (Z.add b c) *) intros. (* Goal: ZDivides a (Z.add b c) *) elim H. (* Goal: forall (x : Z) (_ : @eq Z b (Z.mul a x)), ZDivides a (Z.add b c) *) intro x. (* Goal: forall _ : @eq Z b (Z.mul a x), ZDivides a (Z.add b c) *) intros. (* Goal: ZDivides a (Z.add b c) *) elim H0. (* Goal: forall (x : Z) (_ : @eq Z c (Z.mul a x)), ZDivides a (Z.add b c) *) intro y. (* Goal: forall _ : @eq Z c (Z.mul a y), ZDivides a (Z.add b c) *) intros. (* Goal: ZDivides a (Z.add b c) *) split with (x + y)%Z. (* Goal: @eq Z (Z.add b c) (Z.mul a (Z.add x y)) *) rewrite H1. (* Goal: @eq Z (Z.add (Z.mul a x) c) (Z.mul a (Z.add x y)) *) rewrite H2. (* Goal: @eq Z (Z.add (Z.mul a x) (Z.mul a y)) (Z.mul a (Z.add x y)) *) symmetry in |- *. (* Goal: @eq Z (Z.mul a (Z.add x y)) (Z.add (Z.mul a x) (Z.mul a y)) *) rewrite (Zmult_comm a). (* Goal: @eq Z (Z.mul (Z.add x y) a) (Z.add (Z.mul a x) (Z.mul a y)) *) rewrite (Zmult_comm a). (* Goal: @eq Z (Z.mul (Z.add x y) a) (Z.add (Z.mul x a) (Z.mul a y)) *) rewrite (Zmult_comm a). (* Goal: @eq Z (Z.mul (Z.add x y) a) (Z.add (Z.mul x a) (Z.mul y a)) *) apply Zmult_plus_distr_l. Qed. Lemma zdiv_mult_compat_l : forall a b c : Z, ZDivides a b -> ZDivides a (b * c). Proof. (* Goal: forall (a b c : Z) (_ : ZDivides a b), ZDivides a (Z.mul b c) *) intros. (* Goal: ZDivides a (Z.mul b c) *) elim H. (* Goal: forall (x : Z) (_ : @eq Z b (Z.mul a x)), ZDivides a (Z.mul b c) *) intro x. (* Goal: forall _ : @eq Z b (Z.mul a x), ZDivides a (Z.mul b c) *) intros. (* Goal: ZDivides a (Z.mul b c) *) unfold ZDivides in |- *. (* Goal: @ex Z (fun q : Z => @eq Z (Z.mul b c) (Z.mul a q)) *) rewrite H0. (* Goal: @ex Z (fun q : Z => @eq Z (Z.mul (Z.mul a x) c) (Z.mul a q)) *) split with (x * c)%Z. (* Goal: @eq Z (Z.mul (Z.mul a x) c) (Z.mul a (Z.mul x c)) *) rewrite Zmult_assoc. (* Goal: @eq Z (Z.mul (Z.mul a x) c) (Z.mul (Z.mul a x) c) *) reflexivity. Qed. Theorem zdiv_rem : forall d n : Z, (d > 0)%Z -> exists q : Z, (exists r : Z, (0 <= r < d)%Z /\ n = (q * d + r)%Z). Proof. (* Goal: forall (d n : Z) (_ : Z.gt d Z0), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) intros d n. (* Goal: forall _ : Z.gt d Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) intro. (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) elim (Zle_or_lt 0 n). (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: forall _ : Z.le Z0 n, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) intro. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) rewrite <- (inj_abs_pos d). (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z n (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) rewrite <- (inj_abs_pos n). (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) elim (div_rem (Zabs_nat d) (Zabs_nat n)). (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: forall (x : nat) (_ : @ex nat (fun r : nat => and (le O r) (and (lt r (Z.abs_nat d)) (@eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul x (Z.abs_nat d)) r))))), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) intro qn. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: forall _ : @ex nat (fun r : nat => and (le O r) (and (lt r (Z.abs_nat d)) (@eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) r)))), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) intros. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) elim H1. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: forall (x : nat) (_ : and (le O x) (and (lt x (Z.abs_nat d)) (@eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) x)))), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) intro rn. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: forall _ : and (le O rn) (and (lt rn (Z.abs_nat d)) (@eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn))), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) intros. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) elim H2. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: forall (_ : le O rn) (_ : and (lt rn (Z.abs_nat d)) (@eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn))), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) intros. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) elim H4. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) intros. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) split with (Z_of_nat qn). (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d))) r))) *) split with (Z_of_nat rn). (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: and (and (Z.le Z0 (Z.of_nat rn)) (Z.lt (Z.of_nat rn) (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d))) (Z.of_nat rn))) *) split. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d))) (Z.of_nat rn)) *) (* Goal: and (Z.le Z0 (Z.of_nat rn)) (Z.lt (Z.of_nat rn) (Z.of_nat (Z.abs_nat d))) *) split. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d))) (Z.of_nat rn)) *) (* Goal: Z.lt (Z.of_nat rn) (Z.of_nat (Z.abs_nat d)) *) (* Goal: Z.le Z0 (Z.of_nat rn) *) change (Z_of_nat 0 <= Z_of_nat rn)%Z in |- *. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d))) (Z.of_nat rn)) *) (* Goal: Z.lt (Z.of_nat rn) (Z.of_nat (Z.abs_nat d)) *) (* Goal: Z.le (Z.of_nat O) (Z.of_nat rn) *) apply Znat.inj_le. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d))) (Z.of_nat rn)) *) (* Goal: Z.lt (Z.of_nat rn) (Z.of_nat (Z.abs_nat d)) *) (* Goal: le O rn *) apply le_O_n. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d))) (Z.of_nat rn)) *) (* Goal: Z.lt (Z.of_nat rn) (Z.of_nat (Z.abs_nat d)) *) apply Znat.inj_lt. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d))) (Z.of_nat rn)) *) (* Goal: lt rn (Z.abs_nat d) *) assumption. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d))) (Z.of_nat rn)) *) rewrite <- Znat.inj_mult. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat n)) (Z.add (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d))) (Z.of_nat rn)) *) rewrite <- Znat.inj_plus. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat n)) (Z.of_nat (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)) *) apply Znat.inj_eq. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn) *) assumption. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) O *) change (Zabs_nat d > Zabs_nat 0) in |- *. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: gt (Z.abs_nat d) (Z.abs_nat Z0) *) apply gtzgt. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: Z.gt d Z0 *) (* Goal: Z.le Z0 Z0 *) (* Goal: Z.le Z0 d *) apply Zlt_le_weak. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: Z.gt d Z0 *) (* Goal: Z.le Z0 Z0 *) (* Goal: Z.lt Z0 d *) apply Zgt_lt. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: Z.gt d Z0 *) (* Goal: Z.le Z0 Z0 *) (* Goal: Z.gt d Z0 *) assumption. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: Z.gt d Z0 *) (* Goal: Z.le Z0 Z0 *) apply Zeq_le. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: Z.gt d Z0 *) (* Goal: @eq Z Z0 Z0 *) reflexivity. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) (* Goal: Z.gt d Z0 *) assumption. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.ge n Z0 *) apply Zle_ge. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.le Z0 n *) assumption. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.ge d Z0 *) apply Zle_ge. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.le Z0 d *) apply Zlt_le_weak. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.lt Z0 d *) apply Zgt_lt. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) (* Goal: Z.gt d Z0 *) assumption. (* Goal: forall _ : Z.lt n Z0, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) intro. (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r d)) (@eq Z n (Z.add (Z.mul q d) r)))) *) rewrite <- (inj_abs_pos d). (* Goal: Z.ge d Z0 *) (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z n (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) replace n with (- - n)%Z. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.opp n)) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) rewrite <- (inj_abs_neg n). (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) elim (div_rem (Zabs_nat d) (Zabs_nat n)). (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: forall (x : nat) (_ : @ex nat (fun r : nat => and (le O r) (and (lt r (Z.abs_nat d)) (@eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul x (Z.abs_nat d)) r))))), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) intro qn. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: forall _ : @ex nat (fun r : nat => and (le O r) (and (lt r (Z.abs_nat d)) (@eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) r)))), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) intros. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) elim H1. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: forall (x : nat) (_ : and (le O x) (and (lt x (Z.abs_nat d)) (@eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) x)))), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) intro rn. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: forall _ : and (le O rn) (and (lt rn (Z.abs_nat d)) (@eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn))), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) intros. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) elim H2. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: forall (_ : le O rn) (_ : and (lt rn (Z.abs_nat d)) (@eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn))), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) intros. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) elim H4. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: forall (_ : lt rn (Z.abs_nat d)) (_ : @eq nat (Z.abs_nat n) (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn)), @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) intros. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) elim (le_lt_or_eq 0 rn). (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: forall _ : lt O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) intro. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) split with (- Z_of_nat (S qn))%Z. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) r))) *) split with (d - Z_of_nat rn)%Z. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: and (and (Z.le Z0 (Z.sub d (Z.of_nat rn))) (Z.lt (Z.sub d (Z.of_nat rn)) (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn)))) *) split. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: and (Z.le Z0 (Z.sub d (Z.of_nat rn))) (Z.lt (Z.sub d (Z.of_nat rn)) (Z.of_nat (Z.abs_nat d))) *) split. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.lt (Z.sub d (Z.of_nat rn)) (Z.of_nat (Z.abs_nat d)) *) (* Goal: Z.le Z0 (Z.sub d (Z.of_nat rn)) *) rewrite <- (inj_abs_pos d). (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.lt (Z.sub d (Z.of_nat rn)) (Z.of_nat (Z.abs_nat d)) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.le Z0 (Z.sub (Z.of_nat (Z.abs_nat d)) (Z.of_nat rn)) *) apply Zle_minus. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.lt (Z.sub d (Z.of_nat rn)) (Z.of_nat (Z.abs_nat d)) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.le (Z.of_nat rn) (Z.of_nat (Z.abs_nat d)) *) apply Znat.inj_le. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.lt (Z.sub d (Z.of_nat rn)) (Z.of_nat (Z.abs_nat d)) *) (* Goal: Z.ge d Z0 *) (* Goal: le rn (Z.abs_nat d) *) apply lt_le_weak. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.lt (Z.sub d (Z.of_nat rn)) (Z.of_nat (Z.abs_nat d)) *) (* Goal: Z.ge d Z0 *) (* Goal: lt rn (Z.abs_nat d) *) assumption. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.lt (Z.sub d (Z.of_nat rn)) (Z.of_nat (Z.abs_nat d)) *) (* Goal: Z.ge d Z0 *) apply Zle_ge. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.lt (Z.sub d (Z.of_nat rn)) (Z.of_nat (Z.abs_nat d)) *) (* Goal: Z.le Z0 d *) apply Zlt_le_weak. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.lt (Z.sub d (Z.of_nat rn)) (Z.of_nat (Z.abs_nat d)) *) (* Goal: Z.lt Z0 d *) apply Zgt_lt. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.lt (Z.sub d (Z.of_nat rn)) (Z.of_nat (Z.abs_nat d)) *) (* Goal: Z.gt d Z0 *) assumption. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.lt (Z.sub d (Z.of_nat rn)) (Z.of_nat (Z.abs_nat d)) *) rewrite inj_abs_pos. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.lt (Z.sub d (Z.of_nat rn)) d *) apply Zplus_lt_reg_l with (Z_of_nat rn). (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.lt (Z.add (Z.of_nat rn) (Z.sub d (Z.of_nat rn))) (Z.add (Z.of_nat rn) d) *) unfold Zminus in |- *. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.lt (Z.add (Z.of_nat rn) (Z.add d (Z.opp (Z.of_nat rn)))) (Z.add (Z.of_nat rn) d) *) rewrite (Zplus_comm d). (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.lt (Z.add (Z.of_nat rn) (Z.add (Z.opp (Z.of_nat rn)) d)) (Z.add (Z.of_nat rn) d) *) rewrite (Zplus_assoc (Z_of_nat rn)). (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.lt (Z.add (Z.add (Z.of_nat rn) (Z.opp (Z.of_nat rn))) d) (Z.add (Z.of_nat rn) d) *) rewrite Zplus_opp_r. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.lt (Z.add Z0 d) (Z.add (Z.of_nat rn) d) *) simpl in |- *. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.lt d (Z.add (Z.of_nat rn) d) *) change (0 + d < Z_of_nat rn + d)%Z in |- *. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.lt (Z.add Z0 d) (Z.add (Z.of_nat rn) d) *) rewrite Zplus_comm. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.lt (Z.add d Z0) (Z.add (Z.of_nat rn) d) *) rewrite (Zplus_comm (Z_of_nat rn)). (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.lt (Z.add d Z0) (Z.add d (Z.of_nat rn)) *) apply Zplus_lt_compat_l. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.lt Z0 (Z.of_nat rn) *) change (Z_of_nat 0 < Z_of_nat rn)%Z in |- *. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.ge d Z0 *) (* Goal: Z.lt (Z.of_nat O) (Z.of_nat rn) *) apply Znat.inj_lt. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.ge d Z0 *) (* Goal: lt O rn *) assumption. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.ge d Z0 *) apply Zle_ge. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.le Z0 d *) apply Zlt_le_weak. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.lt Z0 d *) apply Zgt_lt. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) (* Goal: Z.gt d Z0 *) assumption. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat (S qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) rewrite Znat.inj_S. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.succ (Z.of_nat qn))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) unfold Zsucc in |- *. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.add (Z.of_nat qn) (Zpos xH))) (Z.of_nat (Z.abs_nat d))) (Z.sub d (Z.of_nat rn))) *) rewrite Zopp_mult_distr_l_reverse. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.opp (Z.mul (Z.add (Z.of_nat qn) (Zpos xH)) (Z.of_nat (Z.abs_nat d)))) (Z.sub d (Z.of_nat rn))) *) rewrite Zmult_plus_distr_l. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.opp (Z.add (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d))) (Z.mul (Zpos xH) (Z.of_nat (Z.abs_nat d))))) (Z.sub d (Z.of_nat rn))) *) rewrite <- Znat.inj_mult. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.opp (Z.add (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d))) (Z.mul (Zpos xH) (Z.of_nat (Z.abs_nat d))))) (Z.sub d (Z.of_nat rn))) *) rewrite Zmult_1_l. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.opp (Z.add (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d))) (Z.of_nat (Z.abs_nat d)))) (Z.sub d (Z.of_nat rn))) *) rewrite (inj_abs_pos d). (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.opp (Z.add (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d))) d)) (Z.sub d (Z.of_nat rn))) *) rewrite Zopp_plus_distr. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.add (Z.opp (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d)))) (Z.opp d)) (Z.sub d (Z.of_nat rn))) *) unfold Zminus in |- *. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.add (Z.opp (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d)))) (Z.opp d)) (Z.add d (Z.opp (Z.of_nat rn)))) *) rewrite Zplus_assoc_reverse. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.opp (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d)))) (Z.add (Z.opp d) (Z.add d (Z.opp (Z.of_nat rn))))) *) rewrite (Zplus_assoc (- d)). (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.opp (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d)))) (Z.add (Z.add (Z.opp d) d) (Z.opp (Z.of_nat rn)))) *) rewrite Zplus_opp_l. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.opp (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d)))) (Z.add Z0 (Z.opp (Z.of_nat rn)))) *) simpl in |- *. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.opp (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d)))) (Z.opp (Z.of_nat rn))) *) rewrite <- Zopp_plus_distr. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.opp (Z.add (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d))) (Z.of_nat rn))) *) rewrite <- Znat.inj_plus. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.opp (Z.of_nat (Init.Nat.add (Init.Nat.mul qn (Z.abs_nat d)) rn))) *) rewrite <- H6. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.opp (Z.of_nat (Z.abs_nat n))) *) reflexivity. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.ge d Z0 *) apply Zle_ge. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.le Z0 d *) apply Zlt_le_weak. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.lt Z0 d *) apply Zgt_lt. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) (* Goal: Z.gt d Z0 *) assumption. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: forall _ : @eq nat O rn, @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) intro. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: @ex Z (fun q : Z => @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul q (Z.of_nat (Z.abs_nat d))) r)))) *) split with (- Z_of_nat qn)%Z. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: @ex Z (fun r : Z => and (and (Z.le Z0 r) (Z.lt r (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) r))) *) split with 0%Z. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: and (and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d)))) (@eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0)) *) split. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: and (Z.le Z0 Z0) (Z.lt Z0 (Z.of_nat (Z.abs_nat d))) *) split. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: Z.lt Z0 (Z.of_nat (Z.abs_nat d)) *) (* Goal: Z.le Z0 Z0 *) unfold Zle in |- *. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: Z.lt Z0 (Z.of_nat (Z.abs_nat d)) *) (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) simpl in |- *. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: Z.lt Z0 (Z.of_nat (Z.abs_nat d)) *) (* Goal: not (@eq comparison Eq Gt) *) discriminate. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: Z.lt Z0 (Z.of_nat (Z.abs_nat d)) *) apply Zle_lt_trans with (Z_of_nat rn). (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: Z.lt (Z.of_nat rn) (Z.of_nat (Z.abs_nat d)) *) (* Goal: Z.le Z0 (Z.of_nat rn) *) change (Z_of_nat 0 <= Z_of_nat rn)%Z in |- *. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: Z.lt (Z.of_nat rn) (Z.of_nat (Z.abs_nat d)) *) (* Goal: Z.le (Z.of_nat O) (Z.of_nat rn) *) apply Znat.inj_le. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: Z.lt (Z.of_nat rn) (Z.of_nat (Z.abs_nat d)) *) (* Goal: le O rn *) apply le_O_n. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: Z.lt (Z.of_nat rn) (Z.of_nat (Z.abs_nat d)) *) apply Znat.inj_lt. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) (* Goal: lt rn (Z.abs_nat d) *) assumption. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.add (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) Z0) *) rewrite <- Zplus_0_r_reverse. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: @eq Z (Z.opp (Z.of_nat (Z.abs_nat n))) (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) *) rewrite inj_abs_neg. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.mul (Z.opp (Z.of_nat qn)) (Z.of_nat (Z.abs_nat d))) *) rewrite Zopp_mult_distr_l_reverse. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.mul (Z.of_nat qn) (Z.of_nat (Z.abs_nat d)))) *) rewrite <- Znat.inj_mult. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d)))) *) rewrite <- H7 in H6. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d)))) *) rewrite <- plus_n_O in H6. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.of_nat (Init.Nat.mul qn (Z.abs_nat d)))) *) rewrite <- H6. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.of_nat (Z.abs_nat n))) *) rewrite inj_abs_neg. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) (Z.opp (Z.opp n)) *) reflexivity. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: Z.lt n Z0 *) (* Goal: Z.lt n Z0 *) assumption. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) (* Goal: Z.lt n Z0 *) assumption. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) (* Goal: le O rn *) assumption. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) O *) change (Zabs_nat d > Zabs_nat 0) in |- *. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: gt (Z.abs_nat d) (Z.abs_nat Z0) *) apply gtzgt. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: Z.gt d Z0 *) (* Goal: Z.le Z0 Z0 *) (* Goal: Z.le Z0 d *) apply Zlt_le_weak. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: Z.gt d Z0 *) (* Goal: Z.le Z0 Z0 *) (* Goal: Z.lt Z0 d *) apply Zgt_lt. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: Z.gt d Z0 *) (* Goal: Z.le Z0 Z0 *) (* Goal: Z.gt d Z0 *) assumption. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: Z.gt d Z0 *) (* Goal: Z.le Z0 Z0 *) unfold Zle in |- *. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: Z.gt d Z0 *) (* Goal: not (@eq comparison (Z.compare Z0 Z0) Gt) *) simpl in |- *. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: Z.gt d Z0 *) (* Goal: not (@eq comparison Eq Gt) *) discriminate. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) (* Goal: Z.gt d Z0 *) assumption. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) (* Goal: Z.lt n Z0 *) assumption. (* Goal: Z.ge d Z0 *) (* Goal: @eq Z (Z.opp (Z.opp n)) n *) apply Zopp_involutive. (* Goal: Z.ge d Z0 *) apply Zle_ge. (* Goal: Z.le Z0 d *) apply Zlt_le_weak. (* Goal: Z.lt Z0 d *) apply Zgt_lt. (* Goal: Z.gt d Z0 *) assumption. Qed.
Require Import StructTact.StructTactics. Set Implicit Arguments. Lemma or_false : forall P : Prop, P -> (P \/ False). Proof. (* Goal: forall (P : Prop) (_ : P), or P False *) firstorder. Qed. Lemma if_sum_bool_fun_comm : forall A B C D (b : {A}+{B}) (c1 c2 : C) (f : C -> D), f (if b then c1 else c2) = if b then f c1 else f c2. Proof. (* Goal: forall (A B : Prop) (C D : Type) (b : sumbool A B) (c1 c2 : C) (f : forall _ : C, D), @eq D (f (if b then c1 else c2)) (if b then f c1 else f c2) *) intros. (* Goal: @eq D (f (if b then c1 else c2)) (if b then f c1 else f c2) *) break_if; auto. Qed. Lemma if_decider_true : forall A B (P : A -> Prop) (dec : forall x, {P x} + {~ P x}) a (b1 b2 : B), P a -> (if dec a then b1 else b2) = b1. Proof. (* Goal: forall (A B : Type) (P : forall _ : A, Prop) (dec : forall x : A, sumbool (P x) (not (P x))) (a : A) (b1 b2 : B) (_ : P a), @eq B (if dec a then b1 else b2) b1 *) intros. (* Goal: @eq B (if dec a then b1 else b2) b1 *) break_if; congruence. Qed. Lemma if_decider_false : forall A B (P : A -> Prop) (dec : forall x, {P x} + {~ P x}) a (b1 b2 : B), ~ P a -> (if dec a then b1 else b2) = b2. Proof. (* Goal: forall (A B : Type) (P : forall _ : A, Prop) (dec : forall x : A, sumbool (P x) (not (P x))) (a : A) (b1 b2 : B) (_ : not (P a)), @eq B (if dec a then b1 else b2) b2 *) intros. (* Goal: @eq B (if dec a then b1 else b2) b2 *) break_if; congruence. Qed. Definition prod_eq_dec : forall A B (A_eq_dec : forall x y : A, {x = y} + {x <> y}) (B_eq_dec : forall x y : B, {x = y} + {x <> y}) (x y : A * B), {x = y} + {x <> y}. Proof. (* Goal: forall (A B : Type) (_ : forall x y : A, sumbool (@eq A x y) (not (@eq A x y))) (_ : forall x y : B, sumbool (@eq B x y) (not (@eq B x y))) (x y : prod A B), sumbool (@eq (prod A B) x y) (not (@eq (prod A B) x y)) *) decide equality. Qed. Section equatesLemma. Variables (A0 A1 : Type) (A2 : forall(x1 : A1), Type) (A3 : forall(x1 : A1) (x2 : A2 x1), Type) (A4 : forall(x1 : A1) (x2 : A2 x1) (x3 : A3 x2), Type) (A5 : forall(x1 : A1) (x2 : A2 x1) (x3 : A3 x2) (x4 : A4 x3), Type) (A6 : forall(x1 : A1) (x2 : A2 x1) (x3 : A3 x2) (x4 : A4 x3) (x5 : A5 x4), Type). Lemma equates_0 : forall(P Q:Prop), P -> P = Q -> Q. Proof. (* Goal: forall (P Q : Prop) (_ : P) (_ : @eq Prop P Q), Q *) intros. (* Goal: Q *) subst. (* Goal: Q *) auto. Qed. Lemma equates_1 : forall(P:A0->Prop) x1 y1, P y1 -> x1 = y1 -> P x1. Proof. (* Goal: forall (P : forall _ : A0, Prop) (x1 y1 : A0) (_ : P y1) (_ : @eq A0 x1 y1), P x1 *) intros. (* Goal: P x1 *) subst. (* Goal: P y1 *) auto. Qed. Lemma equates_2 : forall y1 (P:A0->forall(x1:A1),Prop) x1 x2, P y1 x2 -> x1 = y1 -> P x1 x2. Proof. (* Goal: forall (y1 : A0) (P : forall (_ : A0) (_ : A1), Prop) (x1 : A0) (x2 : A1) (_ : P y1 x2) (_ : @eq A0 x1 y1), P x1 x2 *) intros. (* Goal: P x1 x2 *) subst. (* Goal: P y1 x2 *) auto. Qed. Lemma equates_3 : forall y1 (P:A0->forall(x1:A1)(x2:A2 x1),Prop) x1 x2 x3, P y1 x2 x3 -> x1 = y1 -> P x1 x2 x3. Proof. (* Goal: forall (y1 : A0) (P : forall (_ : A0) (x1 : A1) (_ : A2 x1), Prop) (x1 : A0) (x2 : A1) (x3 : A2 x2) (_ : P y1 x2 x3) (_ : @eq A0 x1 y1), P x1 x2 x3 *) intros. (* Goal: P x1 x2 x3 *) subst. (* Goal: P y1 x2 x3 *) auto. Qed. Lemma equates_4 : forall y1 (P:A0->forall(x1:A1)(x2:A2 x1)(x3:A3 x2),Prop) x1 x2 x3 x4, P y1 x2 x3 x4 -> x1 = y1 -> P x1 x2 x3 x4. Proof. (* Goal: forall (y1 : A0) (P : forall (_ : A0) (x1 : A1) (x2 : A2 x1) (_ : @A3 x1 x2), Prop) (x1 : A0) (x2 : A1) (x3 : A2 x2) (x4 : @A3 x2 x3) (_ : P y1 x2 x3 x4) (_ : @eq A0 x1 y1), P x1 x2 x3 x4 *) intros. (* Goal: P x1 x2 x3 x4 *) subst. (* Goal: P y1 x2 x3 x4 *) auto. Qed. Lemma equates_5 : forall y1 (P:A0->forall(x1:A1)(x2:A2 x1)(x3:A3 x2)(x4:A4 x3),Prop) x1 x2 x3 x4 x5, P y1 x2 x3 x4 x5 -> x1 = y1 -> P x1 x2 x3 x4 x5. Proof. (* Goal: forall (y1 : A0) (P : forall (_ : A0) (x1 : A1) (x2 : A2 x1) (x3 : @A3 x1 x2) (_ : @A4 x1 x2 x3), Prop) (x1 : A0) (x2 : A1) (x3 : A2 x2) (x4 : @A3 x2 x3) (x5 : @A4 x2 x3 x4) (_ : P y1 x2 x3 x4 x5) (_ : @eq A0 x1 y1), P x1 x2 x3 x4 x5 *) intros. (* Goal: P x1 x2 x3 x4 x5 *) subst. (* Goal: P y1 x2 x3 x4 x5 *) auto. Qed. Lemma equates_6 : forall y1 (P:A0->forall(x1:A1)(x2:A2 x1)(x3:A3 x2)(x4:A4 x3)(x5:A5 x4),Prop) x1 x2 x3 x4 x5 x6, P y1 x2 x3 x4 x5 x6 -> x1 = y1 -> P x1 x2 x3 x4 x5 x6. Proof. (* Goal: forall (y1 : A0) (P : forall (_ : A0) (x1 : A1) (x2 : A2 x1) (x3 : @A3 x1 x2) (x4 : @A4 x1 x2 x3) (_ : @A5 x1 x2 x3 x4), Prop) (x1 : A0) (x2 : A1) (x3 : A2 x2) (x4 : @A3 x2 x3) (x5 : @A4 x2 x3 x4) (x6 : @A5 x2 x3 x4 x5) (_ : P y1 x2 x3 x4 x5 x6) (_ : @eq A0 x1 y1), P x1 x2 x3 x4 x5 x6 *) intros. (* Goal: P x1 x2 x3 x4 x5 x6 *) subst. (* Goal: P y1 x2 x3 x4 x5 x6 *) auto. Qed. End equatesLemma.
Require Export c_completeness. Set Implicit Arguments. Module Type hilbert_mod (B: base_mod) (S: sound_mod B) (C: complete_mod B S). Import B S C. Reserved Notation "Γ ⊢H A" (at level 80). Inductive AxiomH : PropF -> Prop := | HOrI1 : forall A B , AxiomH (A → A∨B) | HOrI2 : forall A B , AxiomH (B → A∨B) | HAndI : forall A B , AxiomH (A → B → A∧B) | HOrE : forall A B C, AxiomH (A∨B → (A → C) → (B → C) → C) | HAndE1 : forall A B , AxiomH (A∧B → A) | HAndE2 : forall A B , AxiomH (A∧B → B) | HS : forall A B C, AxiomH ((A → B → C) → (A → B) → A → C) | HK : forall A B , AxiomH (A → B → A) | HClas : forall A , AxiomH (¬(¬A) → A) . Inductive Hc : list PropF-> PropF->Prop := | Hass : forall A Γ, In A Γ -> Γ ⊢H A | Hax : forall A Γ, AxiomH A -> Γ ⊢H A | HImpE : forall Γ A B, Γ ⊢H A → B -> Γ ⊢H A -> Γ ⊢H B where "Γ ⊢H A" := (Hc Γ A) : My_scope. Definition ProvH A := [] ⊢H A. Ltac Hmp := eapply HImpE. Ltac aK := constructor 2;apply HK. Ltac aS := constructor 2;apply HS. Ltac aC := constructor 2;apply HClas. Ltac is_ax := constructor 2;constructor||assumption. Lemma Nc_AxiomH : forall A, AxiomH A -> Provable A. Proof. (* Goal: None *) induction 1;repeat apply ImpI. (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) apply OrI1;is_ass. (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) apply OrI2;is_ass. (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) apply AndI;is_ass. (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) eapply OrE;[|eapply ImpE with A|mp]; is_ass. (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) eapply AndE1;is_ass. (* Goal: None *) (* Goal: None *) (* Goal: None *) (* Goal: None *) eapply AndE2;is_ass. (* Goal: None *) (* Goal: None *) (* Goal: None *) mp;mp;is_ass. (* Goal: None *) (* Goal: None *) is_ass. (* Goal: None *) apply BotC;apply ImpE with ¬A;is_ass. Qed. Theorem Hc_to_Nc : forall Γ A, Γ ⊢H A -> Γ ⊢ A. Proof. (* Goal: None *) induction 1. (* Goal: None *) (* Goal: None *) (* Goal: None *) is_ass. (* Goal: None *) (* Goal: None *) AddnilL;eapply weakening;apply Nc_AxiomH;assumption. (* Goal: None *) mp;eassumption. Qed. Lemma H_weakening : forall Γ Δ A, (forall B, In B Γ -> In B Δ) -> Γ ⊢H A -> Δ ⊢H A. Proof. (* Goal: None *) induction 2. (* Goal: Hc Δ B *) (* Goal: Hc Δ A *) (* Goal: Hc Δ A *) constructor;auto. (* Goal: Hc Δ B *) (* Goal: Hc Δ A *) is_ax. (* Goal: Hc Δ B *) Hmp;auto. Qed. Theorem H_Deduction_Theorem : forall Γ A B, A::Γ ⊢H B <-> Γ ⊢H A → B. Ltac HImpI := apply H_Deduction_Theorem. Theorem Nc_to_Hc : forall Γ A, Γ ⊢ A -> Γ ⊢H A. Theorem Nc_equiv_Hc : forall Γ A, Γ ⊢ A <-> Γ ⊢H A. Proof. (* Goal: None *) split;[apply Nc_to_Hc|apply Hc_to_Nc]. Qed. End hilbert_mod.
Require Import Ensembles. Require Import Laws. Require Import Group_definitions. Require Import gr. Parameter U : Type. Parameter Gr : Group U. Definition G : Ensemble U := G_ U Gr. Definition star : U -> U -> U := star_ U Gr. Definition inv : U -> U := inv_ U Gr. Definition e : U := e_ U Gr. Definition G0' : forall a b : U, In U G a -> In U G b -> In U G (star a b) := G0 U Gr. Definition G1' : forall a b c : U, star a (star b c) = star (star a b) c := G1 U Gr. Definition G2a' : In U G e := G2a U Gr. Definition G2b' : forall a : U, star e a = a := G2b U Gr. Definition G2c' : forall a : U, star a e = a := G2c U Gr. Definition G3a' : forall a : U, In U G a -> In U G (inv a) := G3a U Gr. Definition G3b' : forall a : U, star a (inv a) = e := G3b U Gr. Definition G3c' : forall a : U, star (inv a) a = e := G3c U Gr. Hint Resolve G1'. Hint Resolve G2a' G2b' G2c'. Hint Resolve G3a' G3b' G3c'. Hint Resolve G0'. Definition triv1' : forall a b : U, star (inv a) (star a b) = b := triv1 U Gr. Definition triv2' : forall a b : U, star (star b a) (inv a) = b := triv2 U Gr. Definition resolve' : forall a b : U, star b a = e -> b = inv a := resolve U Gr. Definition self_inv' : e = inv e := self_inv U Gr. Definition inv_star' : forall a b : U, star (inv b) (inv a) = inv (star a b) := inv_star U Gr. Definition cancellation' : forall a b : U, star a b = a -> b = e := cancellation U Gr. Definition inv_involution' : forall a : U, a = inv (inv a) := inv_involution U Gr. Hint Resolve triv1' triv2' inv_star' resolve' inv_involution'. Section Elements. Variable H : Group U. Variable sub : subgroup U H Gr. Lemma l1 : Included U (G_ U H) G. Proof. (* Goal: Included U (G_ U H) G *) elim sub; auto with sets. Qed. Hint Resolve l1. Lemma eH_in_G : In U G (e_ U H). Proof. (* Goal: In U G (e_ U H) *) elim sub. (* Goal: forall (_ : Included U (G_ U H) (G_ U Gr)) (_ : @eq (forall (_ : U) (_ : U), U) (star_ U H) (star_ U Gr)), In U G (e_ U H) *) elim H; auto with sets. Qed. Hint Resolve eH_in_G. Lemma starH_is_star : star_ U H = star. Proof. (* Goal: @eq (forall (_ : U) (_ : U), U) (star_ U H) star *) elim sub; auto with sets. Qed. Hint Resolve starH_is_star. Lemma eh_is_e : e_ U H = e. Proof. (* Goal: @eq U (e_ U H) e *) apply cancellation' with (a := e_ U H). (* Goal: @eq U (star (e_ U H) (e_ U H)) (e_ U H) *) rewrite <- starH_is_star; auto with sets. Qed. Hint Resolve eh_is_e. Theorem invH_is_inv : forall a : U, In U (G_ U H) a -> inv_ U H a = inv a. Proof. (* Goal: forall (a : U) (_ : In U (G_ U H) a), @eq U (inv_ U H a) (inv a) *) intros a H'. (* Goal: @eq U (inv_ U H a) (inv a) *) apply resolve'; auto with sets. (* Goal: @eq U (star (inv_ U H a) a) e *) rewrite <- starH_is_star. (* Goal: @eq U (star_ U H (inv_ U H a) a) e *) rewrite <- eh_is_e. (* Goal: @eq U (star_ U H (inv_ U H a) a) (e_ U H) *) generalize H'; clear H'. (* Goal: forall _ : In U (G_ U H) a, @eq U (star_ U H (inv_ U H a) a) (e_ U H) *) elim H; auto with sets. Qed. Theorem Subgroup_inhabited : Inhabited U (G_ U H). Proof. (* Goal: Inhabited U (G_ U H) *) apply Inhabited_intro with (x := e_ U H); auto with sets. Qed. Theorem star_endo : endo_operation U (G_ U H) star. Proof. (* Goal: endo_operation U (G_ U H) star *) rewrite <- starH_is_star; auto with sets. Qed. Theorem inv_endo : endo_function U (G_ U H) inv. Proof. (* Goal: endo_function U (G_ U H) inv *) red in |- *; intros a H'; rewrite <- (invH_is_inv a); auto with sets. Qed. End Elements. Section Premier. Variable H : Ensemble U. Variable witness : U. Variable inhabited : In U H witness. Variable subset : Included U H G. Variable hstar : endo_operation U H star. Variable hinv : endo_function U H inv. Hint Resolve inhabited subset hstar hinv. Let assoc : associative U star. Proof. (* Goal: associative U star *) auto with sets. Qed. Hint Resolve assoc. Let eH : U := star (inv witness) witness. Let eH_in_H : In U H eH. Proof. (* Goal: In U H eH *) unfold eH at 1 in |- *; auto with sets. Qed. Let eH_left_neutral : left_neutral U star eH. Proof. (* Goal: left_neutral U star eH *) unfold eH, left_neutral in |- *. (* Goal: forall x : U, @eq U (star (star (inv witness) witness) x) x *) rewrite (G3c' witness); auto with sets. Qed. Let eH_right_neutral : right_neutral U star eH. Proof. (* Goal: right_neutral U star eH *) unfold eH, left_neutral in |- *. (* Goal: right_neutral U star (star (inv witness) witness) *) rewrite (G3c' witness); auto with sets. Qed. Let inv_left_inverse : left_inverse U star inv eH. Proof. (* Goal: left_inverse U star inv eH *) unfold eH, left_inverse in |- *. (* Goal: forall x : U, @eq U (star (inv x) x) (star (inv witness) witness) *) intro x. (* Goal: @eq U (star (inv x) x) (star (inv witness) witness) *) rewrite (G3c' x); auto with sets. Qed. Let inv_right_inverse : right_inverse U star inv eH. Proof. (* Goal: right_inverse U star inv eH *) unfold eH, right_inverse in |- *. (* Goal: forall x : U, @eq U (star x (inv x)) (star (inv witness) witness) *) intro x. (* Goal: @eq U (star x (inv x)) (star (inv witness) witness) *) rewrite (G3b' x); auto with sets. Qed. Let GrH : Group U := group U H star inv eH hstar assoc eH_in_H eH_left_neutral eH_right_neutral hinv inv_right_inverse inv_left_inverse. Hint Resolve Definition_of_subgroup. Theorem T_1_6_2 : Setsubgroup U H Gr. Proof. (* Goal: Setsubgroup U H Gr *) unfold Setsubgroup at 1 in |- *; simpl in |- *. (* Goal: @ex (Group U) (fun g : Group U => and (subgroup U g Gr) (@eq (Ensemble U) (G_ U g) H)) *) exists GrH. (* Goal: and (subgroup U GrH Gr) (@eq (Ensemble U) (G_ U GrH) H) *) unfold GrH in |- *; simpl in |- *; auto with sets. Qed. End Premier. Require Import Zbase. Require Import Z_succ_pred. Require Import Zadd. Definition exp : Z -> U -> U. Proof. (* Goal: forall (_ : Z) (_ : U), U *) intros n a. (* Goal: U *) elim n; clear n. (* Goal: forall _ : nat, U *) (* Goal: forall _ : nat, U *) (* Goal: U *) exact e. (* Goal: forall _ : nat, U *) (* Goal: forall _ : nat, U *) intro n; elim n; clear n. (* Goal: forall _ : nat, U *) (* Goal: forall (_ : nat) (_ : U), U *) (* Goal: U *) exact a. (* Goal: forall _ : nat, U *) (* Goal: forall (_ : nat) (_ : U), U *) intros n valrec. (* Goal: forall _ : nat, U *) (* Goal: U *) exact (star a valrec). (* Goal: forall _ : nat, U *) intro n; elim n; clear n. (* Goal: forall (_ : nat) (_ : U), U *) (* Goal: U *) exact (inv a). (* Goal: forall (_ : nat) (_ : U), U *) intros n valrec. (* Goal: U *) exact (star (inv a) valrec). Qed. Theorem exp_endo : forall (a : U) (n : Z), In U G a -> In U G (exp n a). Proof. (* Goal: forall (a : U) (n : Z) (_ : In U G a), In U G (exp n a) *) intros a n; elim n; simpl in |- *; auto with sets. (* Goal: forall (n : nat) (_ : In U G a), In U G (nat_rect (fun _ : nat => U) (inv a) (fun (_ : nat) (valrec : U) => star (inv a) valrec) n) *) (* Goal: forall (n : nat) (_ : In U G a), In U G (nat_rect (fun _ : nat => U) a (fun (_ : nat) (valrec : U) => star a valrec) n) *) intro n0; elim n0; simpl in |- *; auto with sets. (* Goal: forall (n : nat) (_ : In U G a), In U G (nat_rect (fun _ : nat => U) (inv a) (fun (_ : nat) (valrec : U) => star (inv a) valrec) n) *) intro n0; elim n0; simpl in |- *; auto with sets. Qed. Hint Resolve exp_endo. Lemma exp_unfold_pos : forall (a : U) (n : nat), In U G a -> exp (pos (S n)) a = star a (exp (pos n) a). Proof. (* Goal: forall (a : U) (n : nat) (_ : In U G a), @eq U (exp (pos (S n)) a) (star a (exp (pos n) a)) *) auto with sets. Qed. Lemma exp_unfold_neg : forall (a : U) (n : nat), In U G a -> exp (neg (S n)) a = star (inv a) (exp (neg n) a). Proof. (* Goal: forall (a : U) (n : nat) (_ : In U G a), @eq U (exp (neg (S n)) a) (star (inv a) (exp (neg n) a)) *) auto with sets. Qed. Lemma exp_l1 : forall (a : U) (n : nat), In U G a -> star a (exp (neg (S n)) a) = exp (neg n) a. Proof. (* Goal: forall (a : U) (n : nat) (_ : In U G a), @eq U (star a (exp (neg (S n)) a)) (exp (neg n) a) *) intros a n H'; try assumption. (* Goal: @eq U (star a (exp (neg (S n)) a)) (exp (neg n) a) *) rewrite (exp_unfold_neg a); trivial with sets. (* Goal: @eq U (star a (star (inv a) (exp (neg n) a))) (exp (neg n) a) *) rewrite (inv_involution' a); trivial with sets. (* Goal: @eq U (star (inv (inv a)) (star (inv (inv (inv a))) (exp (neg n) (inv (inv a))))) (exp (neg n) (inv (inv a))) *) cut (inv (inv (inv a)) = inv a). (* Goal: @eq U (inv (inv (inv a))) (inv a) *) (* Goal: forall _ : @eq U (inv (inv (inv a))) (inv a), @eq U (star (inv (inv a)) (star (inv (inv (inv a))) (exp (neg n) (inv (inv a))))) (exp (neg n) (inv (inv a))) *) intro H'0; rewrite H'0; apply triv1'; auto with sets. (* Goal: @eq U (inv (inv (inv a))) (inv a) *) rewrite <- (inv_involution' a); auto with sets. Qed. Hint Resolve exp_l1. Lemma exp_l2 : forall (a : U) (n : Z), In U G a -> star a (exp n a) = exp (succZ n) a. Proof. (* Goal: forall (a : U) (n : Z) (_ : In U G a), @eq U (star a (exp n a)) (exp (succZ n) a) *) intros a n; elim n; auto with sets. (* Goal: forall (n : nat) (_ : In U G a), @eq U (star a (exp (neg n) a)) (exp (succZ (neg n)) a) *) intro n0; elim n0; auto with sets. (* Goal: forall (n : nat) (_ : forall _ : In U G a, @eq U (star a (exp (neg n) a)) (exp (succZ (neg n)) a)) (_ : In U G a), @eq U (star a (exp (neg (S n)) a)) (exp (succZ (neg (S n))) a) *) intros n1 H' H'0. (* Goal: @eq U (star a (exp (neg (S n1)) a)) (exp (succZ (neg (S n1))) a) *) rewrite (exp_l1 a n1); auto with sets. Qed. Lemma exp_l2' : forall (a : U) (n : Z), In U G a -> star (inv a) (exp n a) = exp (predZ n) a. Proof. (* Goal: forall (a : U) (n : Z) (_ : In U G a), @eq U (star (inv a) (exp n a)) (exp (predZ n) a) *) intros a n; elim n; auto with sets. (* Goal: forall (n : nat) (_ : In U G a), @eq U (star (inv a) (exp (pos n) a)) (exp (predZ (pos n)) a) *) intro n0; elim n0; auto with sets. (* Goal: forall (n : nat) (_ : forall _ : In U G a, @eq U (star (inv a) (exp (pos n) a)) (exp (predZ (pos n)) a)) (_ : In U G a), @eq U (star (inv a) (exp (pos (S n)) a)) (exp (predZ (pos (S n))) a) *) intros n1 H' H'0. (* Goal: @eq U (star (inv a) (exp (pos (S n1)) a)) (exp (predZ (pos (S n1))) a) *) rewrite (exp_unfold_pos a n1); trivial with sets. Qed. Hint Resolve exp_l2 exp_l2' exp_unfold_pos exp_unfold_neg. Hint Immediate sym_eq. Theorem add_exponents : forall (a : U) (m n : Z), In U G a -> star (exp m a) (exp n a) = exp (addZ m n) a. Proof. (* Goal: forall (a : U) (m n : Z) (_ : In U G a), @eq U (star (exp m a) (exp n a)) (exp (addZ m n) a) *) intros a m; elim m; auto with sets. (* Goal: forall (n : nat) (n0 : Z) (_ : In U G a), @eq U (star (exp (neg n) a) (exp n0 a)) (exp (addZ (neg n) n0) a) *) (* Goal: forall (n : nat) (n0 : Z) (_ : In U G a), @eq U (star (exp (pos n) a) (exp n0 a)) (exp (addZ (pos n) n0) a) *) intro n; elim n; auto with sets. (* Goal: forall (n : nat) (n0 : Z) (_ : In U G a), @eq U (star (exp (neg n) a) (exp n0 a)) (exp (addZ (neg n) n0) a) *) (* Goal: forall (n : nat) (_ : forall (n0 : Z) (_ : In U G a), @eq U (star (exp (pos n) a) (exp n0 a)) (exp (addZ (pos n) n0) a)) (n0 : Z) (_ : In U G a), @eq U (star (exp (pos (S n)) a) (exp n0 a)) (exp (addZ (pos (S n)) n0) a) *) intros n0 H' n1 H'0. (* Goal: forall (n : nat) (n0 : Z) (_ : In U G a), @eq U (star (exp (neg n) a) (exp n0 a)) (exp (addZ (neg n) n0) a) *) (* Goal: @eq U (star (exp (pos (S n0)) a) (exp n1 a)) (exp (addZ (pos (S n0)) n1) a) *) rewrite (tech_add_pos_succZ n0 n1). (* Goal: forall (n : nat) (n0 : Z) (_ : In U G a), @eq U (star (exp (neg n) a) (exp n0 a)) (exp (addZ (neg n) n0) a) *) (* Goal: @eq U (star (exp (pos (S n0)) a) (exp n1 a)) (exp (succZ (addZ (pos n0) n1)) a) *) rewrite <- (exp_l2 a (addZ (pos n0) n1)); trivial with sets. (* Goal: forall (n : nat) (n0 : Z) (_ : In U G a), @eq U (star (exp (neg n) a) (exp n0 a)) (exp (addZ (neg n) n0) a) *) (* Goal: @eq U (star (exp (pos (S n0)) a) (exp n1 a)) (star a (exp (addZ (pos n0) n1) a)) *) rewrite (exp_unfold_pos a n0); trivial with sets. (* Goal: forall (n : nat) (n0 : Z) (_ : In U G a), @eq U (star (exp (neg n) a) (exp n0 a)) (exp (addZ (neg n) n0) a) *) (* Goal: @eq U (star (star a (exp (pos n0) a)) (exp n1 a)) (star a (exp (addZ (pos n0) n1) a)) *) rewrite <- (H' n1); trivial with sets. (* Goal: forall (n : nat) (n0 : Z) (_ : In U G a), @eq U (star (exp (neg n) a) (exp n0 a)) (exp (addZ (neg n) n0) a) *) (* Goal: @eq U (star (star a (exp (pos n0) a)) (exp n1 a)) (star a (star (exp (pos n0) a) (exp n1 a))) *) auto with sets. (* Goal: forall (n : nat) (n0 : Z) (_ : In U G a), @eq U (star (exp (neg n) a) (exp n0 a)) (exp (addZ (neg n) n0) a) *) intro n; elim n. (* Goal: forall (n : nat) (_ : forall (n0 : Z) (_ : In U G a), @eq U (star (exp (neg n) a) (exp n0 a)) (exp (addZ (neg n) n0) a)) (n0 : Z) (_ : In U G a), @eq U (star (exp (neg (S n)) a) (exp n0 a)) (exp (addZ (neg (S n)) n0) a) *) (* Goal: forall (n : Z) (_ : In U G a), @eq U (star (exp (neg O) a) (exp n a)) (exp (addZ (neg O) n) a) *) simpl in |- *. (* Goal: forall (n : nat) (_ : forall (n0 : Z) (_ : In U G a), @eq U (star (exp (neg n) a) (exp n0 a)) (exp (addZ (neg n) n0) a)) (n0 : Z) (_ : In U G a), @eq U (star (exp (neg (S n)) a) (exp n0 a)) (exp (addZ (neg (S n)) n0) a) *) (* Goal: forall (n : Z) (_ : In U G a), @eq U (star (inv a) (exp n a)) (exp (predZ n) a) *) intros n0 H'. (* Goal: forall (n : nat) (_ : forall (n0 : Z) (_ : In U G a), @eq U (star (exp (neg n) a) (exp n0 a)) (exp (addZ (neg n) n0) a)) (n0 : Z) (_ : In U G a), @eq U (star (exp (neg (S n)) a) (exp n0 a)) (exp (addZ (neg (S n)) n0) a) *) (* Goal: @eq U (star (inv a) (exp n0 a)) (exp (predZ n0) a) *) apply exp_l2'; auto with sets. (* Goal: forall (n : nat) (_ : forall (n0 : Z) (_ : In U G a), @eq U (star (exp (neg n) a) (exp n0 a)) (exp (addZ (neg n) n0) a)) (n0 : Z) (_ : In U G a), @eq U (star (exp (neg (S n)) a) (exp n0 a)) (exp (addZ (neg (S n)) n0) a) *) intros n0 H' n1 H'0. (* Goal: @eq U (star (exp (neg (S n0)) a) (exp n1 a)) (exp (addZ (neg (S n0)) n1) a) *) rewrite (tech_add_neg_predZ n0 n1). (* Goal: @eq U (star (exp (neg (S n0)) a) (exp n1 a)) (exp (predZ (addZ (neg n0) n1)) a) *) rewrite <- (exp_l2' a (addZ (neg n0) n1)); trivial with sets. (* Goal: @eq U (star (exp (neg (S n0)) a) (exp n1 a)) (star (inv a) (exp (addZ (neg n0) n1) a)) *) rewrite <- (H' n1); trivial with sets. (* Goal: @eq U (star (exp (neg (S n0)) a) (exp n1 a)) (star (inv a) (star (exp (neg n0) a) (exp n1 a))) *) rewrite (exp_unfold_neg a n0); trivial with sets. (* Goal: @eq U (star (star (inv a) (exp (neg n0) a)) (exp n1 a)) (star (inv a) (star (exp (neg n0) a) (exp n1 a))) *) auto with sets. Qed. Lemma exp_commut1 : forall (a : U) (m : Z), In U G a -> star (exp m a) a = star a (exp m a). Proof. (* Goal: forall (a : U) (m : Z) (_ : In U G a), @eq U (star (exp m a) a) (star a (exp m a)) *) intros a m H'. (* Goal: @eq U (star (exp m a) a) (star a (exp m a)) *) change (star (exp m a) (exp IZ a) = star (exp IZ a) (exp m a)) in |- *. (* Goal: @eq U (star (exp m a) (exp IZ a)) (star (exp IZ a) (exp m a)) *) rewrite (add_exponents a m IZ); trivial with sets. (* Goal: @eq U (exp (addZ m IZ) a) (star (exp IZ a) (exp m a)) *) rewrite (add_exponents a IZ m); trivial with sets. (* Goal: @eq U (exp (addZ m IZ) a) (exp (addZ IZ m) a) *) rewrite (addZ_commutativity IZ m); trivial with sets. Qed. Lemma tech_opp_pos_negZ1 : forall n : nat, oppZ (pos n) = neg n. Proof. (* Goal: forall n : nat, @eq Z (oppZ (pos n)) (neg n) *) intro n; elim n; auto with sets. Qed. Lemma tech_opp_pos_negZ2 : forall n : nat, oppZ (neg n) = pos n. Proof. (* Goal: forall n : nat, @eq Z (oppZ (neg n)) (pos n) *) intro n; elim n; auto with sets. Qed. Theorem change_exponent_sign : forall (a : U) (m : Z), In U G a -> inv (exp m a) = exp (oppZ m) a. Proof. (* Goal: forall (a : U) (m : Z) (_ : In U G a), @eq U (inv (exp m a)) (exp (oppZ m) a) *) intros a m; elim m. (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (neg n) a)) (exp (oppZ (neg n)) a) *) (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (pos n) a)) (exp (oppZ (pos n)) a) *) (* Goal: forall _ : In U G a, @eq U (inv (exp OZ a)) (exp (oppZ OZ) a) *) simpl in |- *; auto with sets. (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (neg n) a)) (exp (oppZ (neg n)) a) *) (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (pos n) a)) (exp (oppZ (pos n)) a) *) (* Goal: forall _ : In U G a, @eq U (inv e) e *) simpl in |- *; auto with sets. (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (neg n) a)) (exp (oppZ (neg n)) a) *) (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (pos n) a)) (exp (oppZ (pos n)) a) *) (* Goal: forall _ : In U G a, @eq U (inv e) e *) intro H'; symmetry in |- *; auto with sets. (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (neg n) a)) (exp (oppZ (neg n)) a) *) (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (pos n) a)) (exp (oppZ (pos n)) a) *) intros n H'. (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (neg n) a)) (exp (oppZ (neg n)) a) *) (* Goal: @eq U (inv (exp (pos n) a)) (exp (oppZ (pos n)) a) *) rewrite (tech_opp_pos_negZ1 n). (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (neg n) a)) (exp (oppZ (neg n)) a) *) (* Goal: @eq U (inv (exp (pos n) a)) (exp (neg n) a) *) elim n; auto with sets. (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (neg n) a)) (exp (oppZ (neg n)) a) *) (* Goal: forall (n : nat) (_ : @eq U (inv (exp (pos n) a)) (exp (neg n) a)), @eq U (inv (exp (pos (S n)) a)) (exp (neg (S n)) a) *) intros n0 H'0. (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (neg n) a)) (exp (oppZ (neg n)) a) *) (* Goal: @eq U (inv (exp (pos (S n0)) a)) (exp (neg (S n0)) a) *) rewrite (exp_unfold_pos a n0); trivial with sets. (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (neg n) a)) (exp (oppZ (neg n)) a) *) (* Goal: @eq U (inv (star a (exp (pos n0) a))) (exp (neg (S n0)) a) *) rewrite (exp_unfold_neg a n0); trivial with sets. (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (neg n) a)) (exp (oppZ (neg n)) a) *) (* Goal: @eq U (inv (star a (exp (pos n0) a))) (star (inv a) (exp (neg n0) a)) *) rewrite <- (exp_commut1 a (pos n0)); trivial with sets. (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (neg n) a)) (exp (oppZ (neg n)) a) *) (* Goal: @eq U (inv (star (exp (pos n0) a) a)) (star (inv a) (exp (neg n0) a)) *) rewrite <- (inv_star' (exp (pos n0) a) a); auto with sets. (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (neg n) a)) (exp (oppZ (neg n)) a) *) (* Goal: @eq U (star (inv a) (inv (exp (pos n0) a))) (star (inv a) (exp (neg n0) a)) *) rewrite H'0; trivial with sets. (* Goal: forall (n : nat) (_ : In U G a), @eq U (inv (exp (neg n) a)) (exp (oppZ (neg n)) a) *) intros n H'. (* Goal: @eq U (inv (exp (neg n) a)) (exp (oppZ (neg n)) a) *) rewrite (tech_opp_pos_negZ2 n). (* Goal: @eq U (inv (exp (neg n) a)) (exp (pos n) a) *) elim n. (* Goal: forall (n : nat) (_ : @eq U (inv (exp (neg n) a)) (exp (pos n) a)), @eq U (inv (exp (neg (S n)) a)) (exp (pos (S n)) a) *) (* Goal: @eq U (inv (exp (neg O) a)) (exp (pos O) a) *) simpl in |- *; symmetry in |- *; auto with sets. (* Goal: forall (n : nat) (_ : @eq U (inv (exp (neg n) a)) (exp (pos n) a)), @eq U (inv (exp (neg (S n)) a)) (exp (pos (S n)) a) *) intros n0 H'0. (* Goal: @eq U (inv (exp (neg (S n0)) a)) (exp (pos (S n0)) a) *) rewrite (exp_unfold_pos a n0); trivial with sets. (* Goal: @eq U (inv (exp (neg (S n0)) a)) (star a (exp (pos n0) a)) *) rewrite (exp_unfold_neg a n0); trivial with sets. (* Goal: @eq U (inv (star (inv a) (exp (neg n0) a))) (star a (exp (pos n0) a)) *) rewrite <- (exp_commut1 a (pos n0)); trivial with sets. (* Goal: @eq U (inv (star (inv a) (exp (neg n0) a))) (star (exp (pos n0) a) a) *) rewrite <- (inv_star' (inv a) (exp (neg n0) a)); auto with sets. (* Goal: @eq U (star (inv (exp (neg n0) a)) (inv (inv a))) (star (exp (pos n0) a) a) *) rewrite H'0; trivial with sets. (* Goal: @eq U (star (exp (pos n0) a) (inv (inv a))) (star (exp (pos n0) a) a) *) rewrite <- (inv_involution' a); trivial with sets. Qed. Inductive powers (a : U) : Ensemble U := In_powers : forall (m : Z) (x : U), x = exp m a -> In U (powers a) x. Theorem powers_of_one_element : forall a : U, In U G a -> Setsubgroup U (powers a) Gr. Proof. (* Goal: forall (a : U) (_ : In U G a), Setsubgroup U (powers a) Gr *) intros a H'. (* Goal: Setsubgroup U (powers a) Gr *) apply T_1_6_2 with (witness := a). (* Goal: endo_function U (powers a) inv *) (* Goal: endo_operation U (powers a) star *) (* Goal: Included U (powers a) G *) (* Goal: In U (powers a) a *) apply In_powers with (m := IZ); auto with sets. (* Goal: endo_function U (powers a) inv *) (* Goal: endo_operation U (powers a) star *) (* Goal: Included U (powers a) G *) red in |- *. (* Goal: endo_function U (powers a) inv *) (* Goal: endo_operation U (powers a) star *) (* Goal: forall (x : U) (_ : In U (powers a) x), In U G x *) intros x H'0; elim H'0. (* Goal: endo_function U (powers a) inv *) (* Goal: endo_operation U (powers a) star *) (* Goal: forall (m : Z) (x : U) (_ : @eq U x (exp m a)), In U G x *) intros m x0 H'1; rewrite H'1; auto with sets. (* Goal: endo_function U (powers a) inv *) (* Goal: endo_operation U (powers a) star *) red in |- *. (* Goal: endo_function U (powers a) inv *) (* Goal: forall (x y : U) (_ : In U (powers a) x) (_ : In U (powers a) y), In U (powers a) (star x y) *) intros x y H'0; elim H'0. (* Goal: endo_function U (powers a) inv *) (* Goal: forall (m : Z) (x : U) (_ : @eq U x (exp m a)) (_ : In U (powers a) y), In U (powers a) (star x y) *) intros m x0 H'1 H'2; elim H'2. (* Goal: endo_function U (powers a) inv *) (* Goal: forall (m : Z) (x : U) (_ : @eq U x (exp m a)), In U (powers a) (star x0 x) *) intros m0 x1 H'3; rewrite H'3. (* Goal: endo_function U (powers a) inv *) (* Goal: In U (powers a) (star x0 (exp m0 a)) *) rewrite H'1. (* Goal: endo_function U (powers a) inv *) (* Goal: In U (powers a) (star (exp m a) (exp m0 a)) *) rewrite (add_exponents a m m0); trivial with sets. (* Goal: endo_function U (powers a) inv *) (* Goal: In U (powers a) (exp (addZ m m0) a) *) apply In_powers with (m := addZ m m0); trivial with sets. (* Goal: endo_function U (powers a) inv *) red in |- *. (* Goal: forall (x : U) (_ : In U (powers a) x), In U (powers a) (inv x) *) intros x H'0; elim H'0. (* Goal: forall (m : Z) (x : U) (_ : @eq U x (exp m a)), In U (powers a) (inv x) *) intros m x0 H'1. (* Goal: In U (powers a) (inv x0) *) apply In_powers with (m := oppZ m); trivial with sets. (* Goal: @eq U (inv x0) (exp (oppZ m) a) *) rewrite H'1. (* Goal: @eq U (inv (exp m a)) (exp (oppZ m) a) *) apply change_exponent_sign; trivial with sets. Qed. Section Second. Variable H : Ensemble U. Variable witness : U. Variable h0 : In U H witness. Variable h1 : Included U H G. Variable h2 : forall a b : U, In U H a -> In U H b -> In U H (star a (inv b)). Let eH : U := star witness (inv witness). Theorem T_1_6_3 : Setsubgroup U H Gr. Proof. (* Goal: Setsubgroup U H Gr *) cut (In U H eH). (* Goal: In U H eH *) (* Goal: forall _ : In U H eH, Setsubgroup U H Gr *) intro H'. (* Goal: In U H eH *) (* Goal: Setsubgroup U H Gr *) apply T_1_6_2 with (witness := witness); auto with sets. (* Goal: In U H eH *) (* Goal: endo_function U H inv *) (* Goal: endo_operation U H star *) red in |- *; intros a b H'0 H'1; try assumption. (* Goal: In U H eH *) (* Goal: endo_function U H inv *) (* Goal: In U H (star a b) *) lapply (h2 eH b); [ intro H'4; lapply H'4; [ intro H'5; try exact H'5; clear H'4 | clear H'4 ] | idtac ]; auto with sets. (* Goal: In U H eH *) (* Goal: endo_function U H inv *) (* Goal: In U H (star a b) *) unfold eH at 1 in H'5. (* Goal: In U H eH *) (* Goal: endo_function U H inv *) (* Goal: In U H (star a b) *) generalize H'5; clear H'5. (* Goal: In U H eH *) (* Goal: endo_function U H inv *) (* Goal: forall _ : In U H (star (star witness (inv witness)) (inv b)), In U H (star a b) *) rewrite (G3b' witness). (* Goal: In U H eH *) (* Goal: endo_function U H inv *) (* Goal: forall _ : In U H (star e (inv b)), In U H (star a b) *) rewrite (G2b' (inv b)). (* Goal: In U H eH *) (* Goal: endo_function U H inv *) (* Goal: forall _ : In U H (inv b), In U H (star a b) *) intro H'4. (* Goal: In U H eH *) (* Goal: endo_function U H inv *) (* Goal: In U H (star a b) *) lapply (h2 a (inv b)); [ intro H'5; lapply H'5; [ intro H'6; generalize H'6; clear H'5 | clear H'5 ] | idtac ]; auto with sets. (* Goal: In U H eH *) (* Goal: endo_function U H inv *) (* Goal: forall _ : In U H (star a (inv (inv b))), In U H (star a b) *) rewrite <- (inv_involution' b); auto with sets. (* Goal: In U H eH *) (* Goal: endo_function U H inv *) red in |- *; intros a H'0; try assumption. (* Goal: In U H eH *) (* Goal: In U H (inv a) *) rewrite <- (G2b' (inv a)). (* Goal: In U H eH *) (* Goal: In U H (star e (inv a)) *) apply h2; auto with sets. (* Goal: In U H eH *) (* Goal: In U H e *) unfold eH at 1 in H'. (* Goal: In U H eH *) (* Goal: In U H e *) rewrite <- (G3b' witness); auto with sets. (* Goal: In U H eH *) unfold eH at 1 in |- *; auto with sets. Qed. End Second. Theorem Ex1 : Setsubgroup U (Singleton U e) Gr. Proof. (* Goal: Setsubgroup U (Singleton U e) Gr *) apply T_1_6_2 with (witness := e); auto with sets. (* Goal: endo_function U (Singleton U e) inv *) (* Goal: endo_operation U (Singleton U e) star *) (* Goal: Included U (Singleton U e) G *) red in |- *; intros x H'; elim H'; auto with sets. (* Goal: endo_function U (Singleton U e) inv *) (* Goal: endo_operation U (Singleton U e) star *) red in |- *; intros a b H' H'0. (* Goal: endo_function U (Singleton U e) inv *) (* Goal: In U (Singleton U e) (star a b) *) elim H'. (* Goal: endo_function U (Singleton U e) inv *) (* Goal: In U (Singleton U e) (star e b) *) elim H'0. (* Goal: endo_function U (Singleton U e) inv *) (* Goal: In U (Singleton U e) (star e e) *) rewrite (G2c' e); auto with sets. (* Goal: endo_function U (Singleton U e) inv *) red in |- *; intros a H'; elim H'. (* Goal: In U (Singleton U e) (inv e) *) rewrite <- (resolve' e e); auto with sets. Qed. Theorem Ex2 : Setsubgroup U (Singleton U e) Gr. Proof. (* Goal: Setsubgroup U (Singleton U e) Gr *) apply T_1_6_3 with (witness := e); auto with sets. (* Goal: forall (a b : U) (_ : In U (Singleton U e) a) (_ : In U (Singleton U e) b), In U (Singleton U e) (star a (inv b)) *) (* Goal: Included U (Singleton U e) G *) red in |- *. (* Goal: forall (a b : U) (_ : In U (Singleton U e) a) (_ : In U (Singleton U e) b), In U (Singleton U e) (star a (inv b)) *) (* Goal: forall (x : U) (_ : In U (Singleton U e) x), In U G x *) intros x H'; elim H'; auto with sets. (* Goal: forall (a b : U) (_ : In U (Singleton U e) a) (_ : In U (Singleton U e) b), In U (Singleton U e) (star a (inv b)) *) intros a b H'; elim H'. (* Goal: forall _ : In U (Singleton U e) b, In U (Singleton U e) (star e (inv b)) *) intro H'0; elim H'0. (* Goal: In U (Singleton U e) (star e (inv e)) *) rewrite (G3b' e); auto with sets. Qed. Lemma Ex3 : forall n : Z, exp n e = e. Proof. (* Goal: forall n : Z, @eq U (exp n e) e *) intro n; elim n; auto with sets. (* Goal: forall n : nat, @eq U (exp (neg n) e) e *) (* Goal: forall n : nat, @eq U (exp (pos n) e) e *) intro n0; elim n0; auto with sets. (* Goal: forall n : nat, @eq U (exp (neg n) e) e *) (* Goal: forall (n : nat) (_ : @eq U (exp (pos n) e) e), @eq U (exp (pos (S n)) e) e *) intros n1 H'. (* Goal: forall n : nat, @eq U (exp (neg n) e) e *) (* Goal: @eq U (exp (pos (S n1)) e) e *) rewrite (exp_unfold_pos e n1); auto with sets. (* Goal: forall n : nat, @eq U (exp (neg n) e) e *) (* Goal: @eq U (star e (exp (pos n1) e)) e *) rewrite H'; auto with sets. (* Goal: forall n : nat, @eq U (exp (neg n) e) e *) intro n0; elim n0; auto with sets. (* Goal: forall (n : nat) (_ : @eq U (exp (neg n) e) e), @eq U (exp (neg (S n)) e) e *) (* Goal: @eq U (exp (neg O) e) e *) simpl in |- *. (* Goal: forall (n : nat) (_ : @eq U (exp (neg n) e) e), @eq U (exp (neg (S n)) e) e *) (* Goal: @eq U (inv e) e *) symmetry in |- *; auto with sets. (* Goal: forall (n : nat) (_ : @eq U (exp (neg n) e) e), @eq U (exp (neg (S n)) e) e *) intros n1 H'. (* Goal: @eq U (exp (neg (S n1)) e) e *) rewrite (exp_unfold_neg e n1); auto with sets. (* Goal: @eq U (star (inv e) (exp (neg n1) e)) e *) rewrite H'; auto with sets. Qed. Lemma Ex4 : powers e = Singleton U e. Proof. (* Goal: @eq (Ensemble U) (powers e) (Singleton U e) *) apply Extensionality_Ensembles; split; red in |- *; auto with sets. (* Goal: forall (x : U) (_ : In U (Singleton U e) x), In U (powers e) x *) (* Goal: forall (x : U) (_ : In U (powers e) x), In U (Singleton U e) x *) intros x H'; elim H'. (* Goal: forall (x : U) (_ : In U (Singleton U e) x), In U (powers e) x *) (* Goal: forall (m : Z) (x : U) (_ : @eq U x (exp m e)), In U (Singleton U e) x *) intros m x0 H'0; rewrite H'0. (* Goal: forall (x : U) (_ : In U (Singleton U e) x), In U (powers e) x *) (* Goal: In U (Singleton U e) (exp m e) *) rewrite (Ex3 m); auto with sets. (* Goal: forall (x : U) (_ : In U (Singleton U e) x), In U (powers e) x *) intros x H'; elim H'. (* Goal: In U (powers e) e *) apply In_powers with (m := IZ); auto with sets. Qed. Theorem Ex5 : Setsubgroup U (Singleton U e) Gr. Proof. (* Goal: Setsubgroup U (Singleton U e) Gr *) rewrite <- Ex4. (* Goal: Setsubgroup U (powers e) Gr *) apply powers_of_one_element; auto with sets. Qed.
Require Export GeoCoq.Elements.OriginalProofs.lemma_triangletoparallelogram. Require Export GeoCoq.Elements.OriginalProofs.lemma_PGrotate. Require Export GeoCoq.Elements.OriginalProofs.proposition_36. Section Euclid. Context `{Ax:area}. Lemma proposition_38 : forall A B C D E F P Q, Par P Q B C -> Col P Q A -> Col P Q D -> Cong B C E F -> Col B C E -> Col B C F -> ET A B C D E F. Proof. (* Goal: forall (A B C D E F P Q : @Point Ax0) (_ : @Par Ax0 P Q B C) (_ : @Col Ax0 P Q A) (_ : @Col Ax0 P Q D) (_ : @Cong Ax0 B C E F) (_ : @Col Ax0 B C E) (_ : @Col Ax0 B C F), @ET Ax0 Ax1 Ax2 Ax A B C D E F *) intros. (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (Par B C P Q) by (conclude lemma_parallelsymmetric). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (Par C B P Q) by (forward_using lemma_parallelflip). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) let Tf:=fresh in assert (Tf:exists G, (PG A G B C /\ Col P Q G)) by (conclude lemma_triangletoparallelogram);destruct Tf as [G];spliter. (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (PG G B C A) by (conclude lemma_PGrotate). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (nCol P B C) by (forward_using lemma_parallelNC). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (neq B C) by (forward_using lemma_NCdistinct). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (neq E F) by (conclude axiom_nocollapse). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (Par P Q E F) by (conclude lemma_collinearparallel2). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (Par E F P Q) by (conclude lemma_parallelsymmetric). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) rename_H H;let Tf:=fresh in assert (Tf:exists H, (PG D H F E /\ Col P Q H)) by (conclude lemma_triangletoparallelogram);destruct Tf as [H];spliter. (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (PG H F E D) by (conclude lemma_PGrotate). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (Cong B C F E) by (forward_using lemma_congruenceflip). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (nCol P Q B) by (forward_using lemma_parallelNC). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (neq P Q) by (forward_using lemma_NCdistinct). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (Col G A H) by (conclude lemma_collinear5). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (Col G A D) by (conclude lemma_collinear5). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (EF G B C A H F E D) by (conclude proposition_36). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (EF G B C A E F H D) by (forward_using axiom_EFpermutation). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (EF E F H D G B C A) by (conclude axiom_EFsymmetric). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (EF E F H D C B G A) by (forward_using axiom_EFpermutation). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) let Tf:=fresh in assert (Tf:exists M, (BetS D M F /\ BetS H M E)) by (conclude lemma_diagonalsmeet);destruct Tf as [M];spliter. (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (Col D M F) by (conclude_def Col ). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (Col F D M) by (forward_using lemma_collinearorder). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) let Tf:=fresh in assert (Tf:exists m, (BetS A m B /\ BetS G m C)) by (conclude lemma_diagonalsmeet);destruct Tf as [m];spliter. (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (Col A m B) by (conclude_def Col ). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (Col B A m) by (forward_using lemma_collinearorder). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (Par A G B C) by (conclude_def PG ). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (nCol A G B) by (forward_using lemma_parallelNC). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (nCol B A G) by (forward_using lemma_NCorder). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (Par D H F E) by (conclude_def PG ). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (nCol D H F) by (forward_using lemma_parallelNC). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (nCol F D H) by (forward_using lemma_NCorder). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (TS G B A C) by (conclude_def TS ). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (TS C B A G) by (conclude lemma_oppositesidesymmetric). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (TS H F D E) by (conclude_def TS ). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (TS E F D H) by (conclude lemma_oppositesidesymmetric). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (Cong_3 F H D D E F) by (conclude proposition_34). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (ET F H D D E F) by (conclude axiom_congruentequal). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (ET F H D E F D) by (forward_using axiom_ETpermutation). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (ET E F D F H D) by (conclude axiom_ETsymmetric). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (ET E F D F D H) by (forward_using axiom_ETpermutation). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (PG G B C A) by (conclude lemma_PGrotate). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (Cong_3 B G A A C B) by (conclude proposition_34). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (ET B G A A C B) by (conclude axiom_congruentequal). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (ET B G A C B A) by (forward_using axiom_ETpermutation). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (ET C B A B G A) by (conclude axiom_ETsymmetric). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (ET C B A B A G) by (forward_using axiom_ETpermutation). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (ET E F D C B A) by (conclude axiom_halvesofequals). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (ET E F D A B C) by (forward_using axiom_ETpermutation). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (ET A B C E F D) by (conclude axiom_ETsymmetric). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) assert (ET A B C D E F) by (forward_using axiom_ETpermutation). (* Goal: @ET Ax0 Ax1 Ax2 Ax A B C D E F *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.lemma_equalanglesflip. Require Export GeoCoq.Elements.OriginalProofs.lemma_9_5. Require Export GeoCoq.Elements.OriginalProofs.proposition_14. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_angleaddition : forall A B C D E F P Q R a b c d e f p q r, SumA A B C D E F P Q R -> CongA A B C a b c -> CongA D E F d e f -> SumA a b c d e f p q r -> CongA P Q R p q r. Proof. (* Goal: forall (A B C D E F P Q R a b c d e f p q r : @Point Ax0) (_ : @SumA Ax0 A B C D E F P Q R) (_ : @CongA Ax0 A B C a b c) (_ : @CongA Ax0 D E F d e f) (_ : @SumA Ax0 a b c d e f p q r), @CongA Ax0 P Q R p q r *) intros. (* Goal: @CongA Ax0 P Q R p q r *) let Tf:=fresh in assert (Tf:exists S, (CongA A B C P Q S /\ CongA D E F S Q R /\ BetS P S R)) by (conclude_def SumA );destruct Tf as [S];spliter. (* Goal: @CongA Ax0 P Q R p q r *) let Tf:=fresh in assert (Tf:exists s, (CongA a b c p q s /\ CongA d e f s q r /\ BetS p s r)) by (conclude_def SumA );destruct Tf as [s];spliter. (* Goal: @CongA Ax0 P Q R p q r *) assert (nCol P Q S) by (conclude lemma_equalanglesNC). (* Goal: @CongA Ax0 P Q R p q r *) assert (nCol S Q R) by (conclude lemma_equalanglesNC). (* Goal: @CongA Ax0 P Q R p q r *) assert (neq Q P) by (forward_using lemma_NCdistinct). (* Goal: @CongA Ax0 P Q R p q r *) assert (neq Q S) by (forward_using lemma_NCdistinct). (* Goal: @CongA Ax0 P Q R p q r *) assert (neq Q R) by (forward_using lemma_NCdistinct). (* Goal: @CongA Ax0 P Q R p q r *) assert (nCol p q s) by (conclude lemma_equalanglesNC). (* Goal: @CongA Ax0 P Q R p q r *) assert (nCol s q r) by (conclude lemma_equalanglesNC). (* Goal: @CongA Ax0 P Q R p q r *) assert (neq q p) by (forward_using lemma_NCdistinct). (* Goal: @CongA Ax0 P Q R p q r *) assert (neq q r) by (forward_using lemma_NCdistinct). (* Goal: @CongA Ax0 P Q R p q r *) assert (neq q s) by (forward_using lemma_NCdistinct). (* Goal: @CongA Ax0 P Q R p q r *) let Tf:=fresh in assert (Tf:exists G, (Out q p G /\ Cong q G Q P)) by (conclude lemma_layoff);destruct Tf as [G];spliter. (* Goal: @CongA Ax0 P Q R p q r *) rename_H H;let Tf:=fresh in assert (Tf:exists H, (Out q s H /\ Cong q H Q S)) by (conclude lemma_layoff);destruct Tf as [H];spliter. (* Goal: @CongA Ax0 P Q R p q r *) let Tf:=fresh in assert (Tf:exists K, (Out q r K /\ Cong q K Q R)) by (conclude lemma_layoff);destruct Tf as [K];spliter. (* Goal: @CongA Ax0 P Q R p q r *) assert (CongA P Q S A B C) by (conclude lemma_equalanglessymmetric). (* Goal: @CongA Ax0 P Q R p q r *) assert (CongA P Q S a b c) by (conclude lemma_equalanglestransitive). (* Goal: @CongA Ax0 P Q R p q r *) assert (CongA P Q S p q s) by (conclude lemma_equalanglestransitive). (* Goal: @CongA Ax0 P Q R p q r *) assert (CongA P Q S G q H) by (conclude lemma_equalangleshelper). (* Goal: @CongA Ax0 P Q R p q r *) assert (CongA S Q R D E F) by (conclude lemma_equalanglessymmetric). (* Goal: @CongA Ax0 P Q R p q r *) assert (CongA S Q R d e f) by (conclude lemma_equalanglestransitive). (* Goal: @CongA Ax0 P Q R p q r *) assert (CongA S Q R s q r) by (conclude lemma_equalanglestransitive). (* Goal: @CongA Ax0 P Q R p q r *) assert (CongA S Q R H q K) by (conclude lemma_equalangleshelper). (* Goal: @CongA Ax0 P Q R p q r *) assert (nCol G q H) by (conclude lemma_equalanglesNC). (* Goal: @CongA Ax0 P Q R p q r *) assert (CongA G q H P Q S) by (conclude lemma_equalanglessymmetric). (* Goal: @CongA Ax0 P Q R p q r *) assert ((Cong G H P S /\ CongA q G H Q P S /\ CongA q H G Q S P)) by (conclude proposition_04). (* Goal: @CongA Ax0 P Q R p q r *) assert (CongA H q K S Q R) by (conclude lemma_equalanglessymmetric). (* Goal: @CongA Ax0 P Q R p q r *) assert ((Cong H K S R /\ CongA q H K Q S R /\ CongA q K H Q R S)) by (conclude proposition_04). (* Goal: @CongA Ax0 P Q R p q r *) assert (CongA G H q P S Q) by (conclude lemma_equalanglesflip). (* Goal: @CongA Ax0 P Q R p q r *) assert (eq Q Q) by (conclude cn_equalityreflexive). (* Goal: @CongA Ax0 P Q R p q r *) assert (neq S Q) by (forward_using lemma_NCdistinct). (* Goal: @CongA Ax0 P Q R p q r *) assert (Out S Q Q) by (conclude lemma_ray4). (* Goal: @CongA Ax0 P Q R p q r *) assert (Supp P S Q Q R) by (conclude_def Supp ). (* Goal: @CongA Ax0 P Q R p q r *) assert (RT G H q q H K) by (conclude_def RT ). (* Goal: @CongA Ax0 P Q R p q r *) assert (Col q s H) by (conclude lemma_rayimpliescollinear). (* Goal: @CongA Ax0 P Q R p q r *) assert (Col q H s) by (forward_using lemma_collinearorder). (* Goal: @CongA Ax0 P Q R p q r *) assert (Col q p G) by (conclude lemma_rayimpliescollinear). (* Goal: @CongA Ax0 P Q R p q r *) assert (Col G q p) by (forward_using lemma_collinearorder). (* Goal: @CongA Ax0 P Q R p q r *) assert (eq q q) by (conclude cn_equalityreflexive). (* Goal: @CongA Ax0 P Q R p q r *) assert (Col G q q) by (conclude_def Col ). (* Goal: @CongA Ax0 P Q R p q r *) assert (neq q p) by (conclude lemma_ray2). (* Goal: @CongA Ax0 P Q R p q r *) assert (neq p q) by (conclude lemma_inequalitysymmetric). (* Goal: @CongA Ax0 P Q R p q r *) assert (nCol p q H) by (conclude lemma_NChelper). (* Goal: @CongA Ax0 P Q R p q r *) assert (nCol q H p) by (forward_using lemma_NCorder). (* Goal: @CongA Ax0 P Q R p q r *) assert (TS p q H r) by (conclude_def TS ). (* Goal: @CongA Ax0 P Q R p q r *) assert (TS r q H p) by (conclude lemma_oppositesidesymmetric). (* Goal: @CongA Ax0 P Q R p q r *) assert (Col q H q) by (conclude_def Col ). (* Goal: @CongA Ax0 P Q R p q r *) assert (Out q K r) by (conclude lemma_ray5). (* Goal: @CongA Ax0 P Q R p q r *) assert (TS K q H p) by (conclude lemma_9_5). (* Goal: @CongA Ax0 P Q R p q r *) assert (TS p q H K) by (conclude lemma_oppositesidesymmetric). (* Goal: @CongA Ax0 P Q R p q r *) assert (Out q G p) by (conclude lemma_ray5). (* Goal: @CongA Ax0 P Q R p q r *) assert (TS G q H K) by (conclude lemma_9_5). (* Goal: @CongA Ax0 P Q R p q r *) assert (TS K q H G) by (conclude lemma_oppositesidesymmetric). (* Goal: @CongA Ax0 P Q R p q r *) assert (neq q H) by (conclude lemma_raystrict). (* Goal: @CongA Ax0 P Q R p q r *) assert (neq H q) by (conclude lemma_inequalitysymmetric). (* Goal: @CongA Ax0 P Q R p q r *) assert (Out H q q) by (conclude lemma_ray4). (* Goal: @CongA Ax0 P Q R p q r *) assert (BetS G H K) by (conclude proposition_14). (* Goal: @CongA Ax0 P Q R p q r *) assert (Cong G K P R) by (conclude cn_sumofparts). (* Goal: @CongA Ax0 P Q R p q r *) assert (eq P P) by (conclude cn_equalityreflexive). (* Goal: @CongA Ax0 P Q R p q r *) assert (eq R R) by (conclude cn_equalityreflexive). (* Goal: @CongA Ax0 P Q R p q r *) assert (Out Q P P) by (conclude lemma_ray4). (* Goal: @CongA Ax0 P Q R p q r *) assert (Out Q R R) by (conclude lemma_ray4). (* Goal: @CongA Ax0 P Q R p q r *) assert (nCol P S Q) by (forward_using lemma_NCorder). (* Goal: @CongA Ax0 P Q R p q r *) assert (Col P S R) by (conclude_def Col ). (* Goal: @CongA Ax0 P Q R p q r *) assert (eq P P) by (conclude cn_equalityreflexive). (* Goal: @CongA Ax0 P Q R p q r *) assert (Col P S P) by (conclude_def Col ). (* Goal: @CongA Ax0 P Q R p q r *) assert (neq P R) by (forward_using lemma_betweennotequal). (* Goal: @CongA Ax0 P Q R p q r *) assert (nCol P R Q) by (conclude lemma_NChelper). (* Goal: @CongA Ax0 P Q R p q r *) assert (nCol P Q R) by (forward_using lemma_NCorder). (* Goal: @CongA Ax0 P Q R p q r *) assert (Cong Q P q G) by (conclude lemma_congruencesymmetric). (* Goal: @CongA Ax0 P Q R p q r *) assert (Cong Q R q K) by (conclude lemma_congruencesymmetric). (* Goal: @CongA Ax0 P Q R p q r *) assert (Cong P R G K) by (conclude lemma_congruencesymmetric). (* Goal: @CongA Ax0 P Q R p q r *) assert (CongA P Q R p q r) by (conclude_def CongA ). (* Goal: @CongA Ax0 P Q R p q r *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.lemma_samesideflip. Require Export GeoCoq.Elements.OriginalProofs.proposition_39A. Section Euclid. Context `{Ax:area}. Lemma proposition_39 : forall A B C D, Triangle A B C -> Triangle D B C -> OS A D B C -> ET A B C D B C -> neq A D -> Par A D B C. Proof. (* Goal: forall (A B C D : @Point Ax0) (_ : @Triangle Ax0 A B C) (_ : @Triangle Ax0 D B C) (_ : @OS Ax0 A D B C) (_ : @ET Ax0 Ax1 Ax2 Ax A B C D B C) (_ : @neq Ax0 A D), @Par Ax0 A D B C *) intros. (* Goal: @Par Ax0 A D B C *) assert (OS D A B C) by (forward_using lemma_samesidesymmetric). (* Goal: @Par Ax0 A D B C *) assert (OS A D C B) by (conclude lemma_samesideflip). (* Goal: @Par Ax0 A D B C *) assert (OS D A C B) by (forward_using lemma_samesidesymmetric). (* Goal: @Par Ax0 A D B C *) assert (nCol A B C) by (conclude_def Triangle ). (* Goal: @Par Ax0 A D B C *) assert (nCol D B C) by (conclude_def Triangle ). (* Goal: @Par Ax0 A D B C *) assert (neq A B) by (forward_using lemma_NCdistinct). (* Goal: @Par Ax0 A D B C *) assert (neq B D) by (forward_using lemma_NCdistinct). (* Goal: @Par Ax0 A D B C *) assert (neq B A) by (conclude lemma_inequalitysymmetric). (* Goal: @Par Ax0 A D B C *) assert (neq B C) by (forward_using lemma_NCdistinct). (* Goal: @Par Ax0 A D B C *) assert (neq C A) by (forward_using lemma_NCdistinct). (* Goal: @Par Ax0 A D B C *) assert (neq C B) by (forward_using lemma_NCdistinct). (* Goal: @Par Ax0 A D B C *) assert (neq C D) by (forward_using lemma_NCdistinct). (* Goal: @Par Ax0 A D B C *) assert (eq A A) by (conclude cn_equalityreflexive). (* Goal: @Par Ax0 A D B C *) assert (eq C C) by (conclude cn_equalityreflexive). (* Goal: @Par Ax0 A D B C *) assert (eq D D) by (conclude cn_equalityreflexive). (* Goal: @Par Ax0 A D B C *) assert (eq B B) by (conclude cn_equalityreflexive). (* Goal: @Par Ax0 A D B C *) assert (Out B C C) by (conclude lemma_ray4). (* Goal: @Par Ax0 A D B C *) assert (Out B A A) by (conclude lemma_ray4). (* Goal: @Par Ax0 A D B C *) assert (Out B D D) by (conclude lemma_ray4). (* Goal: @Par Ax0 A D B C *) assert (Out C B B) by (conclude lemma_ray4). (* Goal: @Par Ax0 A D B C *) assert (Out C A A) by (conclude lemma_ray4). (* Goal: @Par Ax0 A D B C *) assert (Out C D D) by (conclude lemma_ray4). (* Goal: @Par Ax0 A D B C *) assert (~ ~ Par A D B C). (* Goal: @Par Ax0 A D B C *) (* Goal: not (not (@Par Ax0 A D B C)) *) { (* Goal: not (not (@Par Ax0 A D B C)) *) intro. (* Goal: False *) assert (~ LtA C B D C B A). (* Goal: False *) (* Goal: not (@LtA Ax0 C B D C B A) *) { (* Goal: not (@LtA Ax0 C B D C B A) *) intro. (* Goal: False *) let Tf:=fresh in assert (Tf:exists M, (BetS A M C /\ Out B D M)) by (conclude lemma_crossbar2);destruct Tf as [M];spliter. (* Goal: False *) assert (Par A D B C) by (conclude proposition_39A). (* Goal: False *) contradict. (* BG Goal: @Par Ax0 A D B C *) (* BG Goal: False *) } (* Goal: False *) assert (~ LtA C B A C B D). (* Goal: False *) (* Goal: not (@LtA Ax0 C B A C B D) *) { (* Goal: not (@LtA Ax0 C B A C B D) *) intro. (* Goal: False *) let Tf:=fresh in assert (Tf:exists M, (BetS D M C /\ Out B A M)) by (conclude lemma_crossbar2);destruct Tf as [M];spliter. (* Goal: False *) assert (ET D B C A B C) by (conclude axiom_ETsymmetric). (* Goal: False *) assert (Par D A B C) by (conclude proposition_39A). (* Goal: False *) assert (Par A D B C) by (forward_using lemma_parallelflip). (* Goal: False *) contradict. (* BG Goal: @Par Ax0 A D B C *) (* BG Goal: False *) } (* Goal: False *) assert (~ ~ CongA C B D C B A). (* Goal: False *) (* Goal: not (not (@CongA Ax0 C B D C B A)) *) { (* Goal: not (not (@CongA Ax0 C B D C B A)) *) intro. (* Goal: False *) assert (nCol C B A) by (forward_using lemma_NCorder). (* Goal: False *) assert (nCol C B D) by (forward_using lemma_NCorder). (* Goal: False *) assert (LtA C B D C B A) by (conclude lemma_angletrichotomy2). (* Goal: False *) contradict. (* BG Goal: @Par Ax0 A D B C *) (* BG Goal: False *) } (* Goal: False *) assert (nCol A C B) by (forward_using lemma_NCorder). (* Goal: False *) assert (Triangle A C B) by (conclude_def Triangle ). (* Goal: False *) assert (nCol D C B) by (forward_using lemma_NCorder). (* Goal: False *) assert (Triangle D C B) by (conclude_def Triangle ). (* Goal: False *) assert (OS A D C B) by (conclude lemma_samesideflip). (* Goal: False *) assert (ET A B C D C B) by (forward_using axiom_ETpermutation). (* Goal: False *) assert (ET D C B A B C) by (conclude axiom_ETsymmetric). (* Goal: False *) assert (ET D C B A C B) by (forward_using axiom_ETpermutation). (* Goal: False *) assert (ET A C B D C B) by (conclude axiom_ETsymmetric). (* Goal: False *) assert (~ LtA B C D B C A). (* Goal: False *) (* Goal: not (@LtA Ax0 B C D B C A) *) { (* Goal: not (@LtA Ax0 B C D B C A) *) intro. (* Goal: False *) let Tf:=fresh in assert (Tf:exists M, (BetS A M B /\ Out C D M)) by (conclude lemma_crossbar2);destruct Tf as [M];spliter. (* Goal: False *) assert (Par A D C B) by (conclude proposition_39A). (* Goal: False *) assert (Par A D B C) by (forward_using lemma_parallelflip). (* Goal: False *) contradict. (* BG Goal: @Par Ax0 A D B C *) (* BG Goal: False *) } (* Goal: False *) assert (~ LtA B C A B C D). (* Goal: False *) (* Goal: not (@LtA Ax0 B C A B C D) *) { (* Goal: not (@LtA Ax0 B C A B C D) *) intro. (* Goal: False *) let Tf:=fresh in assert (Tf:exists M, (BetS D M B /\ Out C A M)) by (conclude lemma_crossbar2);destruct Tf as [M];spliter. (* Goal: False *) assert (ET D C B A C B) by (conclude axiom_ETsymmetric). (* Goal: False *) assert (Par D A C B) by (conclude proposition_39A). (* Goal: False *) assert (Par A D B C) by (forward_using lemma_parallelflip). (* Goal: False *) contradict. (* BG Goal: @Par Ax0 A D B C *) (* BG Goal: False *) } (* Goal: False *) assert (~ ~ CongA B C D B C A). (* Goal: False *) (* Goal: not (not (@CongA Ax0 B C D B C A)) *) { (* Goal: not (not (@CongA Ax0 B C D B C A)) *) intro. (* Goal: False *) assert (nCol B C A) by (forward_using lemma_NCorder). (* Goal: False *) assert (nCol B C D) by (forward_using lemma_NCorder). (* Goal: False *) assert (LtA B C D B C A) by (conclude lemma_angletrichotomy2). (* Goal: False *) contradict. (* BG Goal: @Par Ax0 A D B C *) (* BG Goal: False *) } (* Goal: False *) assert (CongA B C A B C D) by (conclude lemma_equalanglessymmetric). (* Goal: False *) assert (Cong B C B C) by (conclude cn_congruencereflexive). (* Goal: False *) assert (CongA D B C A B C) by (conclude lemma_equalanglesflip). (* Goal: False *) assert (CongA A B C D B C) by (conclude lemma_equalanglessymmetric). (* Goal: False *) assert ((Cong A B D B /\ Cong A C D C /\ CongA B A C B D C)) by (conclude proposition_26A). (* Goal: False *) assert (neq B C) by (forward_using lemma_NCdistinct). (* Goal: False *) assert (eq A D) by (conclude proposition_07). (* Goal: False *) contradict. (* BG Goal: @Par Ax0 A D B C *) } (* Goal: @Par Ax0 A D B C *) close. Qed. End Euclid.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrbool ssrfun eqtype ssrnat seq path div fintype. From mathcomp Require Import tuple finfun. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Reserved Notation "\big [ op / idx ]_ i F" (at level 36, F at level 36, op, idx at level 10, i at level 0, right associativity, format "'[' \big [ op / idx ]_ i '/ ' F ']'"). Reserved Notation "\big [ op / idx ]_ ( i <- r | P ) F" (at level 36, F at level 36, op, idx at level 10, i, r at level 50, format "'[' \big [ op / idx ]_ ( i <- r | P ) '/ ' F ']'"). Reserved Notation "\big [ op / idx ]_ ( i <- r ) F" (at level 36, F at level 36, op, idx at level 10, i, r at level 50, format "'[' \big [ op / idx ]_ ( i <- r ) '/ ' F ']'"). Reserved Notation "\big [ op / idx ]_ ( m <= i < n | P ) F" (at level 36, F at level 36, op, idx at level 10, m, i, n at level 50, format "'[' \big [ op / idx ]_ ( m <= i < n | P ) F ']'"). Reserved Notation "\big [ op / idx ]_ ( m <= i < n ) F" (at level 36, F at level 36, op, idx at level 10, i, m, n at level 50, format "'[' \big [ op / idx ]_ ( m <= i < n ) '/ ' F ']'"). Reserved Notation "\big [ op / idx ]_ ( i | P ) F" (at level 36, F at level 36, op, idx at level 10, i at level 50, format "'[' \big [ op / idx ]_ ( i | P ) '/ ' F ']'"). Reserved Notation "\big [ op / idx ]_ ( i : t | P ) F" (at level 36, F at level 36, op, idx at level 10, i at level 50, format "'[' \big [ op / idx ]_ ( i : t | P ) '/ ' F ']'"). Reserved Notation "\big [ op / idx ]_ ( i : t ) F" (at level 36, F at level 36, op, idx at level 10, i at level 50, format "'[' \big [ op / idx ]_ ( i : t ) '/ ' F ']'"). Reserved Notation "\big [ op / idx ]_ ( i < n | P ) F" (at level 36, F at level 36, op, idx at level 10, i, n at level 50, format "'[' \big [ op / idx ]_ ( i < n | P ) '/ ' F ']'"). Reserved Notation "\big [ op / idx ]_ ( i < n ) F" (at level 36, F at level 36, op, idx at level 10, i, n at level 50, format "'[' \big [ op / idx ]_ ( i < n ) F ']'"). Reserved Notation "\big [ op / idx ]_ ( i 'in' A | P ) F" (at level 36, F at level 36, op, idx at level 10, i, A at level 50, format "'[' \big [ op / idx ]_ ( i 'in' A | P ) '/ ' F ']'"). Reserved Notation "\big [ op / idx ]_ ( i 'in' A ) F" (at level 36, F at level 36, op, idx at level 10, i, A at level 50, format "'[' \big [ op / idx ]_ ( i 'in' A ) '/ ' F ']'"). Reserved Notation "\sum_ i F" (at level 41, F at level 41, i at level 0, right associativity, format "'[' \sum_ i '/ ' F ']'"). Reserved Notation "\sum_ ( i <- r | P ) F" (at level 41, F at level 41, i, r at level 50, format "'[' \sum_ ( i <- r | P ) '/ ' F ']'"). Reserved Notation "\sum_ ( i <- r ) F" (at level 41, F at level 41, i, r at level 50, format "'[' \sum_ ( i <- r ) '/ ' F ']'"). Reserved Notation "\sum_ ( m <= i < n | P ) F" (at level 41, F at level 41, i, m, n at level 50, format "'[' \sum_ ( m <= i < n | P ) '/ ' F ']'"). Reserved Notation "\sum_ ( m <= i < n ) F" (at level 41, F at level 41, i, m, n at level 50, format "'[' \sum_ ( m <= i < n ) '/ ' F ']'"). Reserved Notation "\sum_ ( i | P ) F" (at level 41, F at level 41, i at level 50, format "'[' \sum_ ( i | P ) '/ ' F ']'"). Reserved Notation "\sum_ ( i : t | P ) F" (at level 41, F at level 41, i at level 50, only parsing). Reserved Notation "\sum_ ( i : t ) F" (at level 41, F at level 41, i at level 50, only parsing). Reserved Notation "\sum_ ( i < n | P ) F" (at level 41, F at level 41, i, n at level 50, format "'[' \sum_ ( i < n | P ) '/ ' F ']'"). Reserved Notation "\sum_ ( i < n ) F" (at level 41, F at level 41, i, n at level 50, format "'[' \sum_ ( i < n ) '/ ' F ']'"). Reserved Notation "\sum_ ( i 'in' A | P ) F" (at level 41, F at level 41, i, A at level 50, format "'[' \sum_ ( i 'in' A | P ) '/ ' F ']'"). Reserved Notation "\sum_ ( i 'in' A ) F" (at level 41, F at level 41, i, A at level 50, format "'[' \sum_ ( i 'in' A ) '/ ' F ']'"). Reserved Notation "\max_ i F" (at level 41, F at level 41, i at level 0, format "'[' \max_ i '/ ' F ']'"). Reserved Notation "\max_ ( i <- r | P ) F" (at level 41, F at level 41, i, r at level 50, format "'[' \max_ ( i <- r | P ) '/ ' F ']'"). Reserved Notation "\max_ ( i <- r ) F" (at level 41, F at level 41, i, r at level 50, format "'[' \max_ ( i <- r ) '/ ' F ']'"). Reserved Notation "\max_ ( m <= i < n | P ) F" (at level 41, F at level 41, i, m, n at level 50, format "'[' \max_ ( m <= i < n | P ) '/ ' F ']'"). Reserved Notation "\max_ ( m <= i < n ) F" (at level 41, F at level 41, i, m, n at level 50, format "'[' \max_ ( m <= i < n ) '/ ' F ']'"). Reserved Notation "\max_ ( i | P ) F" (at level 41, F at level 41, i at level 50, format "'[' \max_ ( i | P ) '/ ' F ']'"). Reserved Notation "\max_ ( i : t | P ) F" (at level 41, F at level 41, i at level 50, only parsing). Reserved Notation "\max_ ( i : t ) F" (at level 41, F at level 41, i at level 50, only parsing). Reserved Notation "\max_ ( i < n | P ) F" (at level 41, F at level 41, i, n at level 50, format "'[' \max_ ( i < n | P ) '/ ' F ']'"). Reserved Notation "\max_ ( i < n ) F" (at level 41, F at level 41, i, n at level 50, format "'[' \max_ ( i < n ) F ']'"). Reserved Notation "\max_ ( i 'in' A | P ) F" (at level 41, F at level 41, i, A at level 50, format "'[' \max_ ( i 'in' A | P ) '/ ' F ']'"). Reserved Notation "\max_ ( i 'in' A ) F" (at level 41, F at level 41, i, A at level 50, format "'[' \max_ ( i 'in' A ) '/ ' F ']'"). Reserved Notation "\prod_ i F" (at level 36, F at level 36, i at level 0, format "'[' \prod_ i '/ ' F ']'"). Reserved Notation "\prod_ ( i <- r | P ) F" (at level 36, F at level 36, i, r at level 50, format "'[' \prod_ ( i <- r | P ) '/ ' F ']'"). Reserved Notation "\prod_ ( i <- r ) F" (at level 36, F at level 36, i, r at level 50, format "'[' \prod_ ( i <- r ) '/ ' F ']'"). Reserved Notation "\prod_ ( m <= i < n | P ) F" (at level 36, F at level 36, i, m, n at level 50, format "'[' \prod_ ( m <= i < n | P ) '/ ' F ']'"). Reserved Notation "\prod_ ( m <= i < n ) F" (at level 36, F at level 36, i, m, n at level 50, format "'[' \prod_ ( m <= i < n ) '/ ' F ']'"). Reserved Notation "\prod_ ( i | P ) F" (at level 36, F at level 36, i at level 50, format "'[' \prod_ ( i | P ) '/ ' F ']'"). Reserved Notation "\prod_ ( i : t | P ) F" (at level 36, F at level 36, i at level 50, only parsing). Reserved Notation "\prod_ ( i : t ) F" (at level 36, F at level 36, i at level 50, only parsing). Reserved Notation "\prod_ ( i < n | P ) F" (at level 36, F at level 36, i, n at level 50, format "'[' \prod_ ( i < n | P ) '/ ' F ']'"). Reserved Notation "\prod_ ( i < n ) F" (at level 36, F at level 36, i, n at level 50, format "'[' \prod_ ( i < n ) '/ ' F ']'"). Reserved Notation "\prod_ ( i 'in' A | P ) F" (at level 36, F at level 36, i, A at level 50, format "'[' \prod_ ( i 'in' A | P ) F ']'"). Reserved Notation "\prod_ ( i 'in' A ) F" (at level 36, F at level 36, i, A at level 50, format "'[' \prod_ ( i 'in' A ) '/ ' F ']'"). Reserved Notation "\bigcup_ i F" (at level 41, F at level 41, i at level 0, format "'[' \bigcup_ i '/ ' F ']'"). Reserved Notation "\bigcup_ ( i <- r | P ) F" (at level 41, F at level 41, i, r at level 50, format "'[' \bigcup_ ( i <- r | P ) '/ ' F ']'"). Reserved Notation "\bigcup_ ( i <- r ) F" (at level 41, F at level 41, i, r at level 50, format "'[' \bigcup_ ( i <- r ) '/ ' F ']'"). Reserved Notation "\bigcup_ ( m <= i < n | P ) F" (at level 41, F at level 41, m, i, n at level 50, format "'[' \bigcup_ ( m <= i < n | P ) '/ ' F ']'"). Reserved Notation "\bigcup_ ( m <= i < n ) F" (at level 41, F at level 41, i, m, n at level 50, format "'[' \bigcup_ ( m <= i < n ) '/ ' F ']'"). Reserved Notation "\bigcup_ ( i | P ) F" (at level 41, F at level 41, i at level 50, format "'[' \bigcup_ ( i | P ) '/ ' F ']'"). Reserved Notation "\bigcup_ ( i : t | P ) F" (at level 41, F at level 41, i at level 50, format "'[' \bigcup_ ( i : t | P ) '/ ' F ']'"). Reserved Notation "\bigcup_ ( i : t ) F" (at level 41, F at level 41, i at level 50, format "'[' \bigcup_ ( i : t ) '/ ' F ']'"). Reserved Notation "\bigcup_ ( i < n | P ) F" (at level 41, F at level 41, i, n at level 50, format "'[' \bigcup_ ( i < n | P ) '/ ' F ']'"). Reserved Notation "\bigcup_ ( i < n ) F" (at level 41, F at level 41, i, n at level 50, format "'[' \bigcup_ ( i < n ) '/ ' F ']'"). Reserved Notation "\bigcup_ ( i 'in' A | P ) F" (at level 41, F at level 41, i, A at level 50, format "'[' \bigcup_ ( i 'in' A | P ) '/ ' F ']'"). Reserved Notation "\bigcup_ ( i 'in' A ) F" (at level 41, F at level 41, i, A at level 50, format "'[' \bigcup_ ( i 'in' A ) '/ ' F ']'"). Reserved Notation "\bigcap_ i F" (at level 41, F at level 41, i at level 0, format "'[' \bigcap_ i '/ ' F ']'"). Reserved Notation "\bigcap_ ( i <- r | P ) F" (at level 41, F at level 41, i, r at level 50, format "'[' \bigcap_ ( i <- r | P ) F ']'"). Reserved Notation "\bigcap_ ( i <- r ) F" (at level 41, F at level 41, i, r at level 50, format "'[' \bigcap_ ( i <- r ) '/ ' F ']'"). Reserved Notation "\bigcap_ ( m <= i < n | P ) F" (at level 41, F at level 41, m, i, n at level 50, format "'[' \bigcap_ ( m <= i < n | P ) '/ ' F ']'"). Reserved Notation "\bigcap_ ( m <= i < n ) F" (at level 41, F at level 41, i, m, n at level 50, format "'[' \bigcap_ ( m <= i < n ) '/ ' F ']'"). Reserved Notation "\bigcap_ ( i | P ) F" (at level 41, F at level 41, i at level 50, format "'[' \bigcap_ ( i | P ) '/ ' F ']'"). Reserved Notation "\bigcap_ ( i : t | P ) F" (at level 41, F at level 41, i at level 50, format "'[' \bigcap_ ( i : t | P ) '/ ' F ']'"). Reserved Notation "\bigcap_ ( i : t ) F" (at level 41, F at level 41, i at level 50, format "'[' \bigcap_ ( i : t ) '/ ' F ']'"). Reserved Notation "\bigcap_ ( i < n | P ) F" (at level 41, F at level 41, i, n at level 50, format "'[' \bigcap_ ( i < n | P ) '/ ' F ']'"). Reserved Notation "\bigcap_ ( i < n ) F" (at level 41, F at level 41, i, n at level 50, format "'[' \bigcap_ ( i < n ) '/ ' F ']'"). Reserved Notation "\bigcap_ ( i 'in' A | P ) F" (at level 41, F at level 41, i, A at level 50, format "'[' \bigcap_ ( i 'in' A | P ) '/ ' F ']'"). Reserved Notation "\bigcap_ ( i 'in' A ) F" (at level 41, F at level 41, i, A at level 50, format "'[' \bigcap_ ( i 'in' A ) '/ ' F ']'"). Module Monoid. Section Definitions. Variables (T : Type) (idm : T). Structure law := Law { operator : T -> T -> T; _ : associative operator; _ : left_id idm operator; _ : right_id idm operator }. Local Coercion operator : law >-> Funclass. Structure com_law := ComLaw { com_operator : law; _ : commutative com_operator }. Local Coercion com_operator : com_law >-> law. Structure mul_law := MulLaw { mul_operator : T -> T -> T; _ : left_zero idm mul_operator; _ : right_zero idm mul_operator }. Local Coercion mul_operator : mul_law >-> Funclass. Structure add_law (mul : T -> T -> T) := AddLaw { add_operator : com_law; _ : left_distributive mul add_operator; _ : right_distributive mul add_operator }. Local Coercion add_operator : add_law >-> com_law. Let op_id (op1 op2 : T -> T -> T) := phant_id op1 op2. Definition clone_law op := fun (opL : law) & op_id opL op => fun opmA op1m opm1 (opL' := @Law op opmA op1m opm1) & phant_id opL' opL => opL'. Definition clone_com_law op := fun (opL : law) (opC : com_law) & op_id opL op & op_id opC op => fun opmC (opC' := @ComLaw opL opmC) & phant_id opC' opC => opC'. Definition clone_mul_law op := fun (opM : mul_law) & op_id opM op => fun op0m opm0 (opM' := @MulLaw op op0m opm0) & phant_id opM' opM => opM'. Definition clone_add_law mop aop := fun (opC : com_law) (opA : add_law mop) & op_id opC aop & op_id opA aop => fun mopDm mopmD (opA' := @AddLaw mop opC mopDm mopmD) & phant_id opA' opA => opA'. End Definitions. Module Import Exports. Coercion operator : law >-> Funclass. Coercion com_operator : com_law >-> law. Coercion mul_operator : mul_law >-> Funclass. Coercion add_operator : add_law >-> com_law. Notation "[ 'law' 'of' f ]" := (@clone_law _ _ f _ id _ _ _ id) (at level 0, format"[ 'law' 'of' f ]") : form_scope. Notation "[ 'com_law' 'of' f ]" := (@clone_com_law _ _ f _ _ id id _ id) (at level 0, format "[ 'com_law' 'of' f ]") : form_scope. Notation "[ 'mul_law' 'of' f ]" := (@clone_mul_law _ _ f _ id _ _ id) (at level 0, format"[ 'mul_law' 'of' f ]") : form_scope. Notation "[ 'add_law' m 'of' a ]" := (@clone_add_law _ _ m a _ _ id id _ _ id) (at level 0, format "[ 'add_law' m 'of' a ]") : form_scope. End Exports. Section CommutativeAxioms. Variable (T : Type) (zero one : T) (mul add : T -> T -> T) (inv : T -> T). Hypothesis mulC : commutative mul. Lemma mulC_id : left_id one mul -> right_id one mul. Proof. (* Goal: forall _ : @left_id T T one mul, @right_id T T one mul *) by move=> mul1x x; rewrite mulC. Qed. Lemma mulC_zero : left_zero zero mul -> right_zero zero mul. Proof. (* Goal: forall _ : @left_zero T T zero mul, @right_zero T T zero mul *) by move=> mul0x x; rewrite mulC. Qed. Lemma mulC_dist : left_distributive mul add -> right_distributive mul add. Proof. (* Goal: forall _ : @left_distributive T T mul add, @right_distributive T T mul add *) by move=> mul_addl x y z; rewrite !(mulC x). Qed. Lemma mulm1 : right_id idm mul. Proof. by case mul. Qed. Proof. (* Goal: @right_id T T idm (@operator T idm mul) *) by case mul. Qed. Lemma iteropE n x : iterop n mul x idm = iter n (mul x) idm. Proof. (* Goal: @eq T (@iterop T n (@operator T idm mul) x idm) (@iter T n (@operator T idm mul x) idm) *) by case: n => // n; rewrite iterSr mulm1 iteropS. Qed. Lemma mulmCA : left_commutative mul. Proof. (* Goal: @left_commutative T T (@operator T idm (@com_operator T idm mul)) *) by move=> x y z; rewrite !mulmA (mulmC x). Qed. Lemma mulmAC : right_commutative mul. Proof. (* Goal: @right_commutative T T (@operator T idm (@com_operator T idm mul)) *) by move=> x y z; rewrite -!mulmA (mulmC y). Qed. Lemma mulmACA : interchange mul mul. Proof. (* Goal: @interchange T (@operator T idm (@com_operator T idm mul)) (@operator T idm (@com_operator T idm mul)) *) by move=> x y z t; rewrite -!mulmA (mulmCA y). Qed. End Commutative. Section Mul. Variable mul : mul_law idm. Lemma mul0m : left_zero idm mul. Proof. by case mul. Qed. Proof. (* Goal: @left_zero T T idm (@mul_operator T idm mul) *) by case mul. Qed. End Mul. Section Add. Variables (mul : T -> T -> T) (add : add_law idm mul). Lemma addmA : associative add. Proof. exact: mulmA. Qed. Proof. (* Goal: @associative T (@operator T idm (@com_operator T idm (@add_operator T idm mul add))) *) exact: mulmA. Qed. Lemma addmCA : left_commutative add. Proof. exact: mulmCA. Qed. Proof. (* Goal: @left_commutative T T (@operator T idm (@com_operator T idm (@add_operator T idm mul add))) *) exact: mulmCA. Qed. Lemma add0m : left_id idm add. Proof. exact: mul1m. Qed. Proof. (* Goal: @left_id T T idm (@operator T idm (@com_operator T idm (@add_operator T idm mul add))) *) exact: mul1m. Qed. Lemma mulm_addl : left_distributive mul add. Proof. by case add. Qed. Proof. (* Goal: @left_distributive T T mul (@operator T idm (@com_operator T idm (@add_operator T idm mul add))) *) by case add. Qed. End Add. Definition simpm := (mulm1, mulm0, mul1m, mul0m, mulmA). End Theory. End Theory. Include Theory. End Monoid. Export Monoid.Exports. Section PervasiveMonoids. Import Monoid. Canonical andb_monoid := Law andbA andTb andbT. Canonical andb_comoid := ComLaw andbC. Canonical andb_muloid := MulLaw andFb andbF. Canonical orb_monoid := Law orbA orFb orbF. Canonical orb_comoid := ComLaw orbC. Canonical orb_muloid := MulLaw orTb orbT. Canonical addb_monoid := Law addbA addFb addbF. Canonical addb_comoid := ComLaw addbC. Canonical orb_addoid := AddLaw andb_orl andb_orr. Canonical andb_addoid := AddLaw orb_andl orb_andr. Canonical addb_addoid := AddLaw andb_addl andb_addr. Canonical addn_monoid := Law addnA add0n addn0. Canonical addn_comoid := ComLaw addnC. Canonical muln_monoid := Law mulnA mul1n muln1. Canonical muln_comoid := ComLaw mulnC. Canonical muln_muloid := MulLaw mul0n muln0. Canonical addn_addoid := AddLaw mulnDl mulnDr. Canonical maxn_monoid := Law maxnA max0n maxn0. Canonical maxn_comoid := ComLaw maxnC. Canonical maxn_addoid := AddLaw maxn_mull maxn_mulr. Canonical gcdn_monoid := Law gcdnA gcd0n gcdn0. Canonical gcdn_comoid := ComLaw gcdnC. Canonical gcdnDoid := AddLaw muln_gcdl muln_gcdr. Canonical lcmn_monoid := Law lcmnA lcm1n lcmn1. Canonical lcmn_comoid := ComLaw lcmnC. Canonical lcmn_addoid := AddLaw muln_lcml muln_lcmr. Canonical cat_monoid T := Law (@catA T) (@cat0s T) (@cats0 T). End PervasiveMonoids. Delimit Scope big_scope with BIG. Open Scope big_scope. Variant bigbody R I := BigBody of I & (R -> R -> R) & bool & R. Definition applybig {R I} (body : bigbody R I) x := let: BigBody _ op b v := body in if b then op v x else x. Definition reducebig R I idx r (body : I -> bigbody R I) := foldr (applybig \o body) idx r. Module Type BigOpSig. Parameter bigop : forall R I, R -> seq I -> (I -> bigbody R I) -> R. Axiom bigopE : bigop = reducebig. End BigOpSig. Module BigOp : BigOpSig. Definition bigop := reducebig. End BigOp. Notation bigop := BigOp.bigop (only parsing). Canonical bigop_unlock := Unlockable BigOp.bigopE. Definition index_iota m n := iota m (n - m). Definition index_enum (T : finType) := Finite.enum T. Lemma mem_index_iota m n i : i \in index_iota m n = (m <= i < n). Proof. (* Goal: @eq bool (@in_mem (Equality.sort nat_eqType) i (@mem (Equality.sort nat_eqType) (seq_predType nat_eqType) (index_iota m n))) (andb (leq m i) (leq (S i) n)) *) rewrite mem_iota; case le_m_i: (m <= i) => //=. (* Goal: @eq bool (leq (S i) (addn m (subn n m))) (leq (S i) n) *) by rewrite -leq_subLR subSn // -subn_gt0 -subnDA subnKC // subn_gt0. Qed. Lemma mem_index_enum T i : i \in index_enum T. Proof. (* Goal: is_true (@in_mem (Equality.sort (Finite.eqType T)) i (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (index_enum T))) *) by rewrite -[index_enum T]enumT mem_enum. Qed. Hint Resolve mem_index_enum : core. Lemma filter_index_enum T P : filter P (index_enum T) = enum P. Proof. (* Goal: @eq (list (Finite.sort T)) (@filter (Finite.sort T) P (index_enum T)) (@enum_mem T (@mem (Finite.sort T) (predPredType (Finite.sort T)) P)) *) by []. Qed. Notation "\big [ op / idx ]_ ( i <- r | P ) F" := (bigop idx r (fun i => BigBody i op P%B F)) : big_scope. Notation "\big [ op / idx ]_ ( i <- r ) F" := (bigop idx r (fun i => BigBody i op true F)) : big_scope. Notation "\big [ op / idx ]_ ( m <= i < n | P ) F" := (bigop idx (index_iota m n) (fun i : nat => BigBody i op P%B F)) : big_scope. Notation "\big [ op / idx ]_ ( m <= i < n ) F" := (bigop idx (index_iota m n) (fun i : nat => BigBody i op true F)) : big_scope. Notation "\big [ op / idx ]_ ( i | P ) F" := (bigop idx (index_enum _) (fun i => BigBody i op P%B F)) : big_scope. Notation "\big [ op / idx ]_ i F" := (bigop idx (index_enum _) (fun i => BigBody i op true F)) : big_scope. Notation "\big [ op / idx ]_ ( i : t | P ) F" := (bigop idx (index_enum _) (fun i : t => BigBody i op P%B F)) (only parsing) : big_scope. Notation "\big [ op / idx ]_ ( i : t ) F" := (bigop idx (index_enum _) (fun i : t => BigBody i op true F)) (only parsing) : big_scope. Notation "\big [ op / idx ]_ ( i < n | P ) F" := (\big[op/idx]_(i : ordinal n | P%B) F) : big_scope. Notation "\big [ op / idx ]_ ( i < n ) F" := (\big[op/idx]_(i : ordinal n) F) : big_scope. Notation "\big [ op / idx ]_ ( i 'in' A | P ) F" := (\big[op/idx]_(i | (i \in A) && P) F) : big_scope. Notation "\big [ op / idx ]_ ( i 'in' A ) F" := (\big[op/idx]_(i | i \in A) F) : big_scope. Notation BIG_F := (F in \big[_/_]_(i <- _ | _) F i)%pattern. Notation BIG_P := (P in \big[_/_]_(i <- _ | P i) _)%pattern. Local Notation "+%N" := addn (at level 0, only parsing). Notation "\sum_ ( i <- r | P ) F" := (\big[+%N/0%N]_(i <- r | P%B) F%N) : nat_scope. Notation "\sum_ ( i <- r ) F" := (\big[+%N/0%N]_(i <- r) F%N) : nat_scope. Notation "\sum_ ( m <= i < n | P ) F" := (\big[+%N/0%N]_(m <= i < n | P%B) F%N) : nat_scope. Notation "\sum_ ( m <= i < n ) F" := (\big[+%N/0%N]_(m <= i < n) F%N) : nat_scope. Notation "\sum_ ( i | P ) F" := (\big[+%N/0%N]_(i | P%B) F%N) : nat_scope. Notation "\sum_ i F" := (\big[+%N/0%N]_i F%N) : nat_scope. Notation "\sum_ ( i : t | P ) F" := (\big[+%N/0%N]_(i : t | P%B) F%N) (only parsing) : nat_scope. Notation "\sum_ ( i : t ) F" := (\big[+%N/0%N]_(i : t) F%N) (only parsing) : nat_scope. Notation "\sum_ ( i < n | P ) F" := (\big[+%N/0%N]_(i < n | P%B) F%N) : nat_scope. Notation "\sum_ ( i < n ) F" := (\big[+%N/0%N]_(i < n) F%N) : nat_scope. Notation "\sum_ ( i 'in' A | P ) F" := (\big[+%N/0%N]_(i in A | P%B) F%N) : nat_scope. Notation "\sum_ ( i 'in' A ) F" := (\big[+%N/0%N]_(i in A) F%N) : nat_scope. Local Notation "*%N" := muln (at level 0, only parsing). Notation "\prod_ ( i <- r | P ) F" := (\big[*%N/1%N]_(i <- r | P%B) F%N) : nat_scope. Notation "\prod_ ( i <- r ) F" := (\big[*%N/1%N]_(i <- r) F%N) : nat_scope. Notation "\prod_ ( m <= i < n | P ) F" := (\big[*%N/1%N]_(m <= i < n | P%B) F%N) : nat_scope. Notation "\prod_ ( m <= i < n ) F" := (\big[*%N/1%N]_(m <= i < n) F%N) : nat_scope. Notation "\prod_ ( i | P ) F" := (\big[*%N/1%N]_(i | P%B) F%N) : nat_scope. Notation "\prod_ i F" := (\big[*%N/1%N]_i F%N) : nat_scope. Notation "\prod_ ( i : t | P ) F" := (\big[*%N/1%N]_(i : t | P%B) F%N) (only parsing) : nat_scope. Notation "\prod_ ( i : t ) F" := (\big[*%N/1%N]_(i : t) F%N) (only parsing) : nat_scope. Notation "\prod_ ( i < n | P ) F" := (\big[*%N/1%N]_(i < n | P%B) F%N) : nat_scope. Notation "\prod_ ( i < n ) F" := (\big[*%N/1%N]_(i < n) F%N) : nat_scope. Notation "\prod_ ( i 'in' A | P ) F" := (\big[*%N/1%N]_(i in A | P%B) F%N) : nat_scope. Notation "\prod_ ( i 'in' A ) F" := (\big[*%N/1%N]_(i in A) F%N) : nat_scope. Notation "\max_ ( i <- r | P ) F" := (\big[maxn/0%N]_(i <- r | P%B) F%N) : nat_scope. Notation "\max_ ( i <- r ) F" := (\big[maxn/0%N]_(i <- r) F%N) : nat_scope. Notation "\max_ ( i | P ) F" := (\big[maxn/0%N]_(i | P%B) F%N) : nat_scope. Notation "\max_ i F" := (\big[maxn/0%N]_i F%N) : nat_scope. Notation "\max_ ( i : I | P ) F" := (\big[maxn/0%N]_(i : I | P%B) F%N) (only parsing) : nat_scope. Notation "\max_ ( i : I ) F" := (\big[maxn/0%N]_(i : I) F%N) (only parsing) : nat_scope. Notation "\max_ ( m <= i < n | P ) F" := (\big[maxn/0%N]_(m <= i < n | P%B) F%N) : nat_scope. Notation "\max_ ( m <= i < n ) F" := (\big[maxn/0%N]_(m <= i < n) F%N) : nat_scope. Notation "\max_ ( i < n | P ) F" := (\big[maxn/0%N]_(i < n | P%B) F%N) : nat_scope. Notation "\max_ ( i < n ) F" := (\big[maxn/0%N]_(i < n) F%N) : nat_scope. Notation "\max_ ( i 'in' A | P ) F" := (\big[maxn/0%N]_(i in A | P%B) F%N) : nat_scope. Notation "\max_ ( i 'in' A ) F" := (\big[maxn/0%N]_(i in A) F%N) : nat_scope. Lemma big_load R (K K' : R -> Type) idx op I r (P : pred I) F : K (\big[op/idx]_(i <- r | P i) F i) * K' (\big[op/idx]_(i <- r | P i) F i) -> K' (\big[op/idx]_(i <- r | P i) F i). Proof. (* Goal: forall _ : prod (K (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P i) (F i)))) (K' (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P i) (F i)))), K' (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P i) (F i))) *) by case. Qed. Arguments big_load [R] K [K'] idx op [I]. Section Elim3. Variables (R1 R2 R3 : Type) (K : R1 -> R2 -> R3 -> Type). Variables (id1 : R1) (op1 : R1 -> R1 -> R1). Variables (id2 : R2) (op2 : R2 -> R2 -> R2). Variables (id3 : R3) (op3 : R3 -> R3 -> R3). Hypothesis Kid : K id1 id2 id3. Lemma big_rec3 I r (P : pred I) F1 F2 F3 (K_F : forall i y1 y2 y3, P i -> K y1 y2 y3 -> K (op1 (F1 i) y1) (op2 (F2 i) y2) (op3 (F3 i) y3)) : K (\big[op1/id1]_(i <- r | P i) F1 i) (\big[op2/id2]_(i <- r | P i) F2 i) (\big[op3/id3]_(i <- r | P i) F3 i). Proof. (* Goal: K (@BigOp.bigop R1 I id1 r (fun i : I => @BigBody R1 I i op1 (P i) (F1 i))) (@BigOp.bigop R2 I id2 r (fun i : I => @BigBody R2 I i op2 (P i) (F2 i))) (@BigOp.bigop R3 I id3 r (fun i : I => @BigBody R3 I i op3 (P i) (F3 i))) *) by rewrite unlock; elim: r => //= i r; case: ifP => //; apply: K_F. Qed. Hypothesis Kop : forall x1 x2 x3 y1 y2 y3, K x1 x2 x3 -> K y1 y2 y3-> K (op1 x1 y1) (op2 x2 y2) (op3 x3 y3). Lemma big_ind3 I r (P : pred I) F1 F2 F3 (K_F : forall i, P i -> K (F1 i) (F2 i) (F3 i)) : K (\big[op1/id1]_(i <- r | P i) F1 i) (\big[op2/id2]_(i <- r | P i) F2 i) (\big[op3/id3]_(i <- r | P i) F3 i). Proof. (* Goal: K (@BigOp.bigop R1 I id1 r (fun i : I => @BigBody R1 I i op1 (P i) (F1 i))) (@BigOp.bigop R2 I id2 r (fun i : I => @BigBody R2 I i op2 (P i) (F2 i))) (@BigOp.bigop R3 I id3 r (fun i : I => @BigBody R3 I i op3 (P i) (F3 i))) *) by apply: big_rec3 => i x1 x2 x3 /K_F; apply: Kop. Qed. End Elim3. Arguments big_rec3 [R1 R2 R3] K [id1 op1 id2 op2 id3 op3] _ [I r P F1 F2 F3]. Arguments big_ind3 [R1 R2 R3] K [id1 op1 id2 op2 id3 op3] _ _ [I r P F1 F2 F3]. Section Elim2. Variables (R1 R2 : Type) (K : R1 -> R2 -> Type) (f : R2 -> R1). Variables (id1 : R1) (op1 : R1 -> R1 -> R1). Variables (id2 : R2) (op2 : R2 -> R2 -> R2). Hypothesis Kid : K id1 id2. Lemma big_rec2 I r (P : pred I) F1 F2 (K_F : forall i y1 y2, P i -> K y1 y2 -> K (op1 (F1 i) y1) (op2 (F2 i) y2)) : K (\big[op1/id1]_(i <- r | P i) F1 i) (\big[op2/id2]_(i <- r | P i) F2 i). Proof. (* Goal: K (@BigOp.bigop R1 I id1 r (fun i : I => @BigBody R1 I i op1 (P i) (F1 i))) (@BigOp.bigop R2 I id2 r (fun i : I => @BigBody R2 I i op2 (P i) (F2 i))) *) by rewrite unlock; elim: r => //= i r; case: ifP => //; apply: K_F. Qed. Hypothesis Kop : forall x1 x2 y1 y2, K x1 x2 -> K y1 y2 -> K (op1 x1 y1) (op2 x2 y2). Lemma big_ind2 I r (P : pred I) F1 F2 (K_F : forall i, P i -> K (F1 i) (F2 i)) : K (\big[op1/id1]_(i <- r | P i) F1 i) (\big[op2/id2]_(i <- r | P i) F2 i). Proof. (* Goal: K (@BigOp.bigop R1 I id1 r (fun i : I => @BigBody R1 I i op1 (P i) (F1 i))) (@BigOp.bigop R2 I id2 r (fun i : I => @BigBody R2 I i op2 (P i) (F2 i))) *) by apply: big_rec2 => i x1 x2 /K_F; apply: Kop. Qed. Hypotheses (f_op : {morph f : x y / op2 x y >-> op1 x y}) (f_id : f id2 = id1). Lemma big_morph I r (P : pred I) F : f (\big[op2/id2]_(i <- r | P i) F i) = \big[op1/id1]_(i <- r | P i) f (F i). Proof. (* Goal: @eq R1 (f (@BigOp.bigop R2 I id2 r (fun i : I => @BigBody R2 I i op2 (P i) (F i)))) (@BigOp.bigop R1 I id1 r (fun i : I => @BigBody R1 I i op1 (P i) (f (F i)))) *) by rewrite unlock; elim: r => //= i r <-; rewrite -f_op -fun_if. Qed. End Elim2. Arguments big_rec2 [R1 R2] K [id1 op1 id2 op2] _ [I r P F1 F2]. Arguments big_ind2 [R1 R2] K [id1 op1 id2 op2] _ _ [I r P F1 F2]. Arguments big_morph [R1 R2] f [id1 op1 id2 op2] _ _ [I]. Section Elim1. Variables (R : Type) (K : R -> Type) (f : R -> R). Variables (idx : R) (op op' : R -> R -> R). Hypothesis Kid : K idx. Lemma big_rec I r (P : pred I) F (Kop : forall i x, P i -> K x -> K (op (F i) x)) : K (\big[op/idx]_(i <- r | P i) F i). Proof. (* Goal: K (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P i) (F i))) *) by rewrite unlock; elim: r => //= i r; case: ifP => //; apply: Kop. Qed. Hypothesis Kop : forall x y, K x -> K y -> K (op x y). Lemma big_ind I r (P : pred I) F (K_F : forall i, P i -> K (F i)) : K (\big[op/idx]_(i <- r | P i) F i). Proof. (* Goal: K (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P i) (F i))) *) by apply: big_rec => // i x /K_F /Kop; apply. Qed. Hypothesis Kop' : forall x y, K x -> K y -> op x y = op' x y. Lemma eq_big_op I r (P : pred I) F (K_F : forall i, P i -> K (F i)) : \big[op/idx]_(i <- r | P i) F i = \big[op'/idx]_(i <- r | P i) F i. Proof. (* Goal: @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P i) (F i))) (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op' (P i) (F i))) *) by elim/(big_load K): _; elim/big_rec2: _ => // i _ y Pi [Ky <-]; auto. Qed. Hypotheses (fM : {morph f : x y / op x y}) (f_id : f idx = idx). Lemma big_endo I r (P : pred I) F : f (\big[op/idx]_(i <- r | P i) F i) = \big[op/idx]_(i <- r | P i) f (F i). Proof. (* Goal: @eq R (f (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P i) (F i)))) (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P i) (f (F i)))) *) exact: big_morph. Qed. End Elim1. Arguments big_rec [R] K [idx op] _ [I r P F]. Arguments big_ind [R] K [idx op] _ _ [I r P F]. Arguments eq_big_op [R] K [idx op] op' _ _ _ [I]. Arguments big_endo [R] f [idx op] _ _ [I]. Section Extensionality. Variables (R : Type) (idx : R) (op : R -> R -> R). Section SeqExtension. Variable I : Type. Lemma big_filter r (P : pred I) F : \big[op/idx]_(i <- filter P r) F i = \big[op/idx]_(i <- r | P i) F i. Proof. (* Goal: @eq R (@BigOp.bigop R I idx (@filter I P r) (fun i : I => @BigBody R I i op true (F i))) (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P i) (F i))) *) by rewrite unlock; elim: r => //= i r <-; case (P i). Qed. Lemma big_filter_cond r (P1 P2 : pred I) F : \big[op/idx]_(i <- filter P1 r | P2 i) F i = \big[op/idx]_(i <- r | P1 i && P2 i) F i. Lemma eq_bigl r (P1 P2 : pred I) F : P1 =1 P2 -> \big[op/idx]_(i <- r | P1 i) F i = \big[op/idx]_(i <- r | P2 i) F i. Proof. (* Goal: forall _ : @eqfun bool I P1 P2, @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P1 i) (F i))) (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P2 i) (F i))) *) by move=> eqP12; rewrite -!(big_filter r) (eq_filter eqP12). Qed. Lemma big_andbC r (P Q : pred I) F : \big[op/idx]_(i <- r | P i && Q i) F i = \big[op/idx]_(i <- r | Q i && P i) F i. Proof. (* Goal: @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (andb (P i) (Q i)) (F i))) (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (andb (Q i) (P i)) (F i))) *) by apply: eq_bigl => i; apply: andbC. Qed. Lemma eq_bigr r (P : pred I) F1 F2 : (forall i, P i -> F1 i = F2 i) -> \big[op/idx]_(i <- r | P i) F1 i = \big[op/idx]_(i <- r | P i) F2 i. Proof. (* Goal: forall _ : forall (i : I) (_ : is_true (P i)), @eq R (F1 i) (F2 i), @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P i) (F1 i))) (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P i) (F2 i))) *) by move=> eqF12; elim/big_rec2: _ => // i x _ /eqF12-> ->. Qed. Lemma eq_big r (P1 P2 : pred I) F1 F2 : P1 =1 P2 -> (forall i, P1 i -> F1 i = F2 i) -> \big[op/idx]_(i <- r | P1 i) F1 i = \big[op/idx]_(i <- r | P2 i) F2 i. Proof. (* Goal: forall (_ : @eqfun bool I P1 P2) (_ : forall (i : I) (_ : is_true (P1 i)), @eq R (F1 i) (F2 i)), @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P1 i) (F1 i))) (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P2 i) (F2 i))) *) by move/eq_bigl <-; move/eq_bigr->. Qed. Lemma congr_big r1 r2 (P1 P2 : pred I) F1 F2 : r1 = r2 -> P1 =1 P2 -> (forall i, P1 i -> F1 i = F2 i) -> \big[op/idx]_(i <- r1 | P1 i) F1 i = \big[op/idx]_(i <- r2 | P2 i) F2 i. Proof. (* Goal: forall (_ : @eq (list I) r1 r2) (_ : @eqfun bool I P1 P2) (_ : forall (i : I) (_ : is_true (P1 i)), @eq R (F1 i) (F2 i)), @eq R (@BigOp.bigop R I idx r1 (fun i : I => @BigBody R I i op (P1 i) (F1 i))) (@BigOp.bigop R I idx r2 (fun i : I => @BigBody R I i op (P2 i) (F2 i))) *) by move=> <-{r2}; apply: eq_big. Qed. Lemma big_nil (P : pred I) F : \big[op/idx]_(i <- [::] | P i) F i = idx. Proof. (* Goal: @eq R (@BigOp.bigop R I idx (@nil I) (fun i : I => @BigBody R I i op (P i) (F i))) idx *) by rewrite unlock. Qed. Lemma big_cons i r (P : pred I) F : let x := \big[op/idx]_(j <- r | P j) F j in \big[op/idx]_(j <- i :: r | P j) F j = if P i then op (F i) x else x. Proof. (* Goal: let x := @BigOp.bigop R I idx r (fun j : I => @BigBody R I j op (P j) (F j)) in @eq R (@BigOp.bigop R I idx (@cons I i r) (fun j : I => @BigBody R I j op (P j) (F j))) (if P i then op (F i) x else x) *) by rewrite unlock. Qed. Lemma big_map J (h : J -> I) r (P : pred I) F : \big[op/idx]_(i <- map h r | P i) F i = \big[op/idx]_(j <- r | P (h j)) F (h j). Proof. (* Goal: @eq R (@BigOp.bigop R I idx (@map J I h r) (fun i : I => @BigBody R I i op (P i) (F i))) (@BigOp.bigop R J idx r (fun j : J => @BigBody R J j op (P (h j)) (F (h j)))) *) by rewrite unlock; elim: r => //= j r ->. Qed. Lemma big_nth x0 r (P : pred I) F : \big[op/idx]_(i <- r | P i) F i = \big[op/idx]_(0 <= i < size r | P (nth x0 r i)) (F (nth x0 r i)). Proof. (* Goal: @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P i) (F i))) (@BigOp.bigop R nat idx (index_iota O (@size I r)) (fun i : nat => @BigBody R nat i op (P (@nth I x0 r i)) (F (@nth I x0 r i)))) *) by rewrite -{1}(mkseq_nth x0 r) big_map /index_iota subn0. Qed. Lemma big_hasC r (P : pred I) F : ~~ has P r -> \big[op/idx]_(i <- r | P i) F i = idx. Proof. (* Goal: forall _ : is_true (negb (@has I P r)), @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P i) (F i))) idx *) by rewrite -big_filter has_count -size_filter -eqn0Ngt unlock => /nilP->. Qed. Lemma big_pred0_eq (r : seq I) F : \big[op/idx]_(i <- r | false) F i = idx. Proof. (* Goal: @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op false (F i))) idx *) by rewrite big_hasC // has_pred0. Qed. Lemma big_pred0 r (P : pred I) F : P =1 xpred0 -> \big[op/idx]_(i <- r | P i) F i = idx. Proof. (* Goal: forall _ : @eqfun bool I P (fun _ : I => false), @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P i) (F i))) idx *) by move/eq_bigl->; apply: big_pred0_eq. Qed. Lemma big_cat_nested r1 r2 (P : pred I) F : let x := \big[op/idx]_(i <- r2 | P i) F i in \big[op/idx]_(i <- r1 ++ r2 | P i) F i = \big[op/x]_(i <- r1 | P i) F i. Proof. (* Goal: let x := @BigOp.bigop R I idx r2 (fun i : I => @BigBody R I i op (P i) (F i)) in @eq R (@BigOp.bigop R I idx (@cat I r1 r2) (fun i : I => @BigBody R I i op (P i) (F i))) (@BigOp.bigop R I x r1 (fun i : I => @BigBody R I i op (P i) (F i))) *) by rewrite unlock /reducebig foldr_cat. Qed. Lemma big_catl r1 r2 (P : pred I) F : ~~ has P r2 -> \big[op/idx]_(i <- r1 ++ r2 | P i) F i = \big[op/idx]_(i <- r1 | P i) F i. Proof. (* Goal: forall _ : is_true (negb (@has I P r2)), @eq R (@BigOp.bigop R I idx (@cat I r1 r2) (fun i : I => @BigBody R I i op (P i) (F i))) (@BigOp.bigop R I idx r1 (fun i : I => @BigBody R I i op (P i) (F i))) *) by rewrite big_cat_nested => /big_hasC->. Qed. Lemma big_catr r1 r2 (P : pred I) F : ~~ has P r1 -> \big[op/idx]_(i <- r1 ++ r2 | P i) F i = \big[op/idx]_(i <- r2 | P i) F i. Proof. (* Goal: forall _ : is_true (negb (@has I P r1)), @eq R (@BigOp.bigop R I idx (@cat I r1 r2) (fun i : I => @BigBody R I i op (P i) (F i))) (@BigOp.bigop R I idx r2 (fun i : I => @BigBody R I i op (P i) (F i))) *) rewrite -big_filter -(big_filter r2) filter_cat. (* Goal: forall _ : is_true (negb (@has I P r1)), @eq R (@BigOp.bigop R I idx (@cat I (@filter I P r1) (@filter I P r2)) (fun i : I => @BigBody R I i op true (F i))) (@BigOp.bigop R I idx (@filter I P r2) (fun i : I => @BigBody R I i op true (F i))) *) by rewrite has_count -size_filter; case: filter. Qed. Lemma big_const_seq r (P : pred I) x : \big[op/idx]_(i <- r | P i) x = iter (count P r) (op x) idx. Proof. (* Goal: @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P i) x)) (@iter R (@count I P r) (op x) idx) *) by rewrite unlock; elim: r => //= i r ->; case: (P i). Qed. End SeqExtension. Lemma big_seq_cond (I : eqType) r (P : pred I) F : \big[op/idx]_(i <- r | P i) F i = \big[op/idx]_(i <- r | (i \in r) && P i) F i. Proof. (* Goal: @eq R (@BigOp.bigop R (Equality.sort I) idx r (fun i : Equality.sort I => @BigBody R (Equality.sort I) i op (P i) (F i))) (@BigOp.bigop R (Equality.sort I) idx r (fun i : Equality.sort I => @BigBody R (Equality.sort I) i op (andb (@in_mem (Equality.sort I) i (@mem (Equality.sort I) (seq_predType I) r)) (P i)) (F i))) *) by rewrite -!(big_filter r); congr bigop; apply: eq_in_filter => i ->. Qed. Lemma big_seq (I : eqType) (r : seq I) F : \big[op/idx]_(i <- r) F i = \big[op/idx]_(i <- r | i \in r) F i. Proof. (* Goal: @eq R (@BigOp.bigop R (Equality.sort I) idx r (fun i : Equality.sort I => @BigBody R (Equality.sort I) i op true (F i))) (@BigOp.bigop R (Equality.sort I) idx r (fun i : Equality.sort I => @BigBody R (Equality.sort I) i op (@in_mem (Equality.sort I) i (@mem (Equality.sort I) (seq_predType I) r)) (F i))) *) by rewrite big_seq_cond big_andbC. Qed. Lemma eq_big_seq (I : eqType) (r : seq I) F1 F2 : {in r, F1 =1 F2} -> \big[op/idx]_(i <- r) F1 i = \big[op/idx]_(i <- r) F2 i. Proof. (* Goal: forall _ : @prop_in1 (Equality.sort I) (@mem (Equality.sort I) (seq_predType I) r) (fun x : Equality.sort I => @eq R (F1 x) (F2 x)) (inPhantom (@eqfun R (Equality.sort I) F1 F2)), @eq R (@BigOp.bigop R (Equality.sort I) idx r (fun i : Equality.sort I => @BigBody R (Equality.sort I) i op true (F1 i))) (@BigOp.bigop R (Equality.sort I) idx r (fun i : Equality.sort I => @BigBody R (Equality.sort I) i op true (F2 i))) *) by move=> eqF; rewrite !big_seq (eq_bigr _ eqF). Qed. Lemma big_nat_cond m n (P : pred nat) F : \big[op/idx]_(m <= i < n | P i) F i = \big[op/idx]_(m <= i < n | (m <= i < n) && P i) F i. Proof. (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i op (P i) (F i))) (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i op (andb (andb (leq m i) (leq (S i) n)) (P i)) (F i))) *) by rewrite big_seq_cond; apply: eq_bigl => i; rewrite mem_index_iota. Qed. Lemma big_nat m n F : \big[op/idx]_(m <= i < n) F i = \big[op/idx]_(m <= i < n | m <= i < n) F i. Proof. (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i op true (F i))) (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i op (andb (leq m i) (leq (S i) n)) (F i))) *) by rewrite big_nat_cond big_andbC. Qed. Lemma congr_big_nat m1 n1 m2 n2 P1 P2 F1 F2 : m1 = m2 -> n1 = n2 -> (forall i, m1 <= i < n2 -> P1 i = P2 i) -> (forall i, P1 i && (m1 <= i < n2) -> F1 i = F2 i) -> \big[op/idx]_(m1 <= i < n1 | P1 i) F1 i = \big[op/idx]_(m2 <= i < n2 | P2 i) F2 i. Proof. (* Goal: forall (_ : @eq nat m1 m2) (_ : @eq nat n1 n2) (_ : forall (i : nat) (_ : is_true (andb (leq m1 i) (leq (S i) n2))), @eq bool (P1 i) (P2 i)) (_ : forall (i : nat) (_ : is_true (andb (P1 i) (andb (leq m1 i) (leq (S i) n2)))), @eq R (F1 i) (F2 i)), @eq R (@BigOp.bigop R nat idx (index_iota m1 n1) (fun i : nat => @BigBody R nat i op (P1 i) (F1 i))) (@BigOp.bigop R nat idx (index_iota m2 n2) (fun i : nat => @BigBody R nat i op (P2 i) (F2 i))) *) move=> <- <- eqP12 eqF12; rewrite big_seq_cond (big_seq_cond _ P2). (* Goal: @eq R (@BigOp.bigop R (Equality.sort nat_eqType) idx (index_iota m1 n1) (fun i : Equality.sort nat_eqType => @BigBody R (Equality.sort nat_eqType) i op (andb (@in_mem (Equality.sort nat_eqType) i (@mem (Equality.sort nat_eqType) (seq_predType nat_eqType) (index_iota m1 n1))) (P1 i)) (F1 i))) (@BigOp.bigop R (Equality.sort nat_eqType) idx (index_iota m1 n1) (fun i : Equality.sort nat_eqType => @BigBody R (Equality.sort nat_eqType) i op (andb (@in_mem (Equality.sort nat_eqType) i (@mem (Equality.sort nat_eqType) (seq_predType nat_eqType) (index_iota m1 n1))) (P2 i)) (F2 i))) *) apply: eq_big => i; rewrite ?inE /= !mem_index_iota. (* Goal: forall _ : is_true (andb (andb (leq m1 i) (leq (S i) n1)) (P1 i)), @eq R (F1 i) (F2 i) *) (* Goal: @eq bool (andb (andb (leq m1 i) (leq (S i) n1)) (P1 i)) (andb (andb (leq m1 i) (leq (S i) n1)) (P2 i)) *) by apply: andb_id2l; apply: eqP12. (* Goal: forall _ : is_true (andb (andb (leq m1 i) (leq (S i) n1)) (P1 i)), @eq R (F1 i) (F2 i) *) by rewrite andbC; apply: eqF12. Qed. Lemma eq_big_nat m n F1 F2 : (forall i, m <= i < n -> F1 i = F2 i) -> \big[op/idx]_(m <= i < n) F1 i = \big[op/idx]_(m <= i < n) F2 i. Proof. (* Goal: forall _ : forall (i : nat) (_ : is_true (andb (leq m i) (leq (S i) n))), @eq R (F1 i) (F2 i), @eq R (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i op true (F1 i))) (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i op true (F2 i))) *) by move=> eqF; apply: congr_big_nat. Qed. Lemma big_geq m n (P : pred nat) F : m >= n -> \big[op/idx]_(m <= i < n | P i) F i = idx. Proof. (* Goal: forall _ : is_true (leq n m), @eq R (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i op (P i) (F i))) idx *) by move=> ge_m_n; rewrite /index_iota (eqnP ge_m_n) big_nil. Qed. Lemma big_ltn_cond m n (P : pred nat) F : m < n -> let x := \big[op/idx]_(m.+1 <= i < n | P i) F i in Proof. (* Goal: forall _ : is_true (leq (S m) n), let x := @BigOp.bigop R nat idx (index_iota (S m) n) (fun i : nat => @BigBody R nat i op (P i) (F i)) in @eq R (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i op (P i) (F i))) (if P m then op (F m) x else x) *) by case: n => [//|n] le_m_n; rewrite /index_iota subSn // big_cons. Qed. Lemma big_ltn m n F : m < n -> \big[op/idx]_(m <= i < n) F i = op (F m) (\big[op/idx]_(m.+1 <= i < n) F i). Proof. (* Goal: forall _ : is_true (leq (S m) n), @eq R (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i op true (F i))) (op (F m) (@BigOp.bigop R nat idx (index_iota (S m) n) (fun i : nat => @BigBody R nat i op true (F i)))) *) by move=> lt_mn; apply: big_ltn_cond. Qed. Lemma big_addn m n a (P : pred nat) F : \big[op/idx]_(m + a <= i < n | P i) F i = \big[op/idx]_(m <= i < n - a | P (i + a)) F (i + a). Proof. (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota (addn m a) n) (fun i : nat => @BigBody R nat i op (P i) (F i))) (@BigOp.bigop R nat idx (index_iota m (subn n a)) (fun i : nat => @BigBody R nat i op (P (addn i a)) (F (addn i a)))) *) rewrite /index_iota -subnDA addnC iota_addl big_map. (* Goal: @eq R (@BigOp.bigop R nat idx (iota m (subn n (addn a m))) (fun j : nat => @BigBody R nat j op (P (addn a j)) (F (addn a j)))) (@BigOp.bigop R nat idx (iota m (subn n (addn a m))) (fun i : nat => @BigBody R nat i op (P (addn i a)) (F (addn i a)))) *) by apply: eq_big => ? *; rewrite addnC. Qed. Lemma big_add1 m n (P : pred nat) F : \big[op/idx]_(m.+1 <= i < n | P i) F i = Proof. (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota (S m) n) (fun i : nat => @BigBody R nat i op (P i) (F i))) (@BigOp.bigop R nat idx (index_iota m (Nat.pred n)) (fun i : nat => @BigBody R nat i op (P (S i)) (F (S i)))) *) by rewrite -addn1 big_addn subn1; apply: eq_big => ? *; rewrite addn1. Qed. Lemma big_nat_recl n m F : m <= n -> \big[op/idx]_(m <= i < n.+1) F i = Proof. (* Goal: forall _ : is_true (leq m n), @eq R (@BigOp.bigop R nat idx (index_iota m (S n)) (fun i : nat => @BigBody R nat i op true (F i))) (op (F m) (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i op true (F (S i))))) *) by move=> lemn; rewrite big_ltn // big_add1. Qed. Lemma big_mkord n (P : pred nat) F : \big[op/idx]_(0 <= i < n | P i) F i = \big[op/idx]_(i < n | P i) F i. Proof. (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota O n) (fun i : nat => @BigBody R nat i op (P i) (F i))) (@BigOp.bigop R (Finite.sort (ordinal_finType n)) idx (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody R (ordinal n) i op (P (@nat_of_ord n i)) (F (@nat_of_ord n i)))) *) rewrite /index_iota subn0 -(big_map (@nat_of_ord n)). (* Goal: @eq R (@BigOp.bigop R nat idx (iota O n) (fun i : nat => @BigBody R nat i op (P i) (F i))) (@BigOp.bigop R nat idx (@map (ordinal n) nat (@nat_of_ord n) (index_enum (ordinal_finType n))) (fun i : nat => @BigBody R nat i op (P i) (F i))) *) by congr bigop; rewrite /index_enum unlock val_ord_enum. Qed. Lemma big_nat_widen m n1 n2 (P : pred nat) F : n1 <= n2 -> \big[op/idx]_(m <= i < n1 | P i) F i = \big[op/idx]_(m <= i < n2 | P i && (i < n1)) F i. Proof. (* Goal: forall _ : is_true (leq n1 n2), @eq R (@BigOp.bigop R nat idx (index_iota m n1) (fun i : nat => @BigBody R nat i op (P i) (F i))) (@BigOp.bigop R nat idx (index_iota m n2) (fun i : nat => @BigBody R nat i op (andb (P i) (leq (S i) n1)) (F i))) *) move=> len12; symmetry; rewrite -big_filter filter_predI big_filter. (* Goal: @eq R (@BigOp.bigop R nat idx (@filter nat (fun x : nat => leq (S x) n1) (index_iota m n2)) (fun i : nat => @BigBody R nat i op (P i) (F i))) (@BigOp.bigop R nat idx (index_iota m n1) (fun i : nat => @BigBody R nat i op (P i) (F i))) *) have [ltn_trans eq_by_mem] := (ltn_trans, eq_sorted_irr ltn_trans ltnn). (* Goal: @eq R (@BigOp.bigop R nat idx (@filter nat (fun x : nat => leq (S x) n1) (index_iota m n2)) (fun i : nat => @BigBody R nat i op (P i) (F i))) (@BigOp.bigop R nat idx (index_iota m n1) (fun i : nat => @BigBody R nat i op (P i) (F i))) *) congr bigop; apply: eq_by_mem; rewrite ?sorted_filter ?iota_ltn_sorted // => i. (* Goal: @eq bool (@in_mem (Equality.sort nat_eqType) i (@mem (Equality.sort nat_eqType) (seq_predType nat_eqType) (@filter nat (fun x : nat => leq (S x) n1) (index_iota m n2)))) (@in_mem (Equality.sort nat_eqType) i (@mem (Equality.sort nat_eqType) (seq_predType nat_eqType) (index_iota m n1))) *) rewrite mem_filter !mem_index_iota andbCA andbA andb_idr => // /andP[_]. (* Goal: forall _ : is_true (leq (S i) n1), is_true (leq (S i) n2) *) by move/leq_trans->. Qed. Lemma big_ord_widen_cond n1 n2 (P : pred nat) (F : nat -> R) : n1 <= n2 -> \big[op/idx]_(i < n1 | P i) F i = \big[op/idx]_(i < n2 | P i && (i < n1)) F i. Proof. (* Goal: forall _ : is_true (leq n1 n2), @eq R (@BigOp.bigop R (Finite.sort (ordinal_finType n1)) idx (index_enum (ordinal_finType n1)) (fun i : ordinal n1 => @BigBody R (ordinal n1) i op (P (@nat_of_ord n1 i)) (F (@nat_of_ord n1 i)))) (@BigOp.bigop R (Finite.sort (ordinal_finType n2)) idx (index_enum (ordinal_finType n2)) (fun i : ordinal n2 => @BigBody R (ordinal n2) i op (andb (P (@nat_of_ord n2 i)) (leq (S (@nat_of_ord n2 i)) n1)) (F (@nat_of_ord n2 i)))) *) by move/big_nat_widen=> len12; rewrite -big_mkord len12 big_mkord. Qed. Lemma big_ord_widen n1 n2 (F : nat -> R) : n1 <= n2 -> \big[op/idx]_(i < n1) F i = \big[op/idx]_(i < n2 | i < n1) F i. Proof. (* Goal: forall _ : is_true (leq n1 n2), @eq R (@BigOp.bigop R (Finite.sort (ordinal_finType n1)) idx (index_enum (ordinal_finType n1)) (fun i : ordinal n1 => @BigBody R (ordinal n1) i op true (F (@nat_of_ord n1 i)))) (@BigOp.bigop R (Finite.sort (ordinal_finType n2)) idx (index_enum (ordinal_finType n2)) (fun i : ordinal n2 => @BigBody R (ordinal n2) i op (leq (S (@nat_of_ord n2 i)) n1) (F (@nat_of_ord n2 i)))) *) by move=> le_n12; apply: (big_ord_widen_cond (predT)). Qed. Lemma big_ord_widen_leq n1 n2 (P : pred 'I_(n1.+1)) F : Proof. (* Goal: forall _ : is_true (leq (S n1) n2), @eq R (@BigOp.bigop R (Finite.sort (ordinal_finType (S n1))) idx (index_enum (ordinal_finType (S n1))) (fun i : ordinal (S n1) => @BigBody R (ordinal (S n1)) i op (P i) (F i))) (@BigOp.bigop R (Finite.sort (ordinal_finType n2)) idx (index_enum (ordinal_finType n2)) (fun i : ordinal n2 => @BigBody R (ordinal n2) i op (andb (P (@inord n1 (@nat_of_ord n2 i))) (leq (@nat_of_ord n2 i) n1)) (F (@inord n1 (@nat_of_ord n2 i))))) *) move=> len12; pose g G i := G (inord i : 'I_(n1.+1)). (* Goal: @eq R (@BigOp.bigop R (Finite.sort (ordinal_finType (S n1))) idx (index_enum (ordinal_finType (S n1))) (fun i : ordinal (S n1) => @BigBody R (ordinal (S n1)) i op (P i) (F i))) (@BigOp.bigop R (Finite.sort (ordinal_finType n2)) idx (index_enum (ordinal_finType n2)) (fun i : ordinal n2 => @BigBody R (ordinal n2) i op (andb (P (@inord n1 (@nat_of_ord n2 i))) (leq (@nat_of_ord n2 i) n1)) (F (@inord n1 (@nat_of_ord n2 i))))) *) rewrite -(big_ord_widen_cond (g _ P) (g _ F) len12) {}/g. (* Goal: @eq R (@BigOp.bigop R (Finite.sort (ordinal_finType (S n1))) idx (index_enum (ordinal_finType (S n1))) (fun i : ordinal (S n1) => @BigBody R (ordinal (S n1)) i op (P i) (F i))) (@BigOp.bigop R (Finite.sort (ordinal_finType (S n1))) idx (index_enum (ordinal_finType (S n1))) (fun i : ordinal (S n1) => @BigBody R (ordinal (S n1)) i op (P (@inord n1 (@nat_of_ord (S n1) i))) (F (@inord n1 (@nat_of_ord (S n1) i))))) *) by apply: eq_big => i *; rewrite inord_val. Qed. Lemma big_ord0 P F : \big[op/idx]_(i < 0 | P i) F i = idx. Proof. (* Goal: @eq R (@BigOp.bigop R (Finite.sort (ordinal_finType O)) idx (index_enum (ordinal_finType O)) (fun i : ordinal O => @BigBody R (ordinal O) i op (P i) (F i))) idx *) by rewrite big_pred0 => [|[]]. Qed. Lemma big_tnth I r (P : pred I) F : let r_ := tnth (in_tuple r) in \big[op/idx]_(i <- r | P i) F i = \big[op/idx]_(i < size r | P (r_ i)) (F (r_ i)). Proof. (* Goal: let r_ := @tnth (@size I r) I (@in_tuple I r) in @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i op (P i) (F i))) (@BigOp.bigop R (Finite.sort (ordinal_finType (@size I r))) idx (index_enum (ordinal_finType (@size I r))) (fun i : ordinal (@size I r) => @BigBody R (ordinal (@size I r)) i op (P (r_ i)) (F (r_ i)))) *) case: r => /= [|x0 r]; first by rewrite big_nil big_ord0. (* Goal: @eq R (@BigOp.bigop R I idx (@cons I x0 r) (fun i : I => @BigBody R I i op (P i) (F i))) (@BigOp.bigop R (ordinal (S (@size I r))) idx (index_enum (ordinal_finType (S (@size I r)))) (fun i : ordinal (S (@size I r)) => @BigBody R (ordinal (S (@size I r))) i op (P (@tnth (S (@size I r)) I (@in_tuple I (@cons I x0 r)) i)) (F (@tnth (S (@size I r)) I (@in_tuple I (@cons I x0 r)) i)))) *) by rewrite (big_nth x0) big_mkord; apply: eq_big => i; rewrite (tnth_nth x0). Qed. Lemma big_index_uniq (I : eqType) (r : seq I) (E : 'I_(size r) -> R) : uniq r -> \big[op/idx]_i E i = \big[op/idx]_(x <- r) oapp E idx (insub (index x r)). Proof. (* Goal: forall _ : is_true (@uniq I r), @eq R (@BigOp.bigop R (Finite.sort (ordinal_finType (@size (Equality.sort I) r))) idx (index_enum (ordinal_finType (@size (Equality.sort I) r))) (fun i : Finite.sort (ordinal_finType (@size (Equality.sort I) r)) => @BigBody R (Finite.sort (ordinal_finType (@size (Equality.sort I) r))) i op true (E i))) (@BigOp.bigop R (Equality.sort I) idx r (fun x : Equality.sort I => @BigBody R (Equality.sort I) x op true (@Option.apply (ordinal (@size (Equality.sort I) r)) R E idx (@insub nat (fun x0 : nat => leq (S x0) (@size (Equality.sort I) r)) (ordinal_subType (@size (Equality.sort I) r)) (@index I x r))))) *) move=> Ur; apply/esym; rewrite big_tnth; apply: eq_bigr => i _. (* Goal: @eq R (@Option.apply (ordinal (@size (Equality.sort I) r)) R E idx (@insub nat (fun x : nat => leq (S x) (@size (Equality.sort I) r)) (ordinal_subType (@size (Equality.sort I) r)) (@index I (@tnth (@size (Equality.sort I) r) (Equality.sort I) (@in_tuple (Equality.sort I) r) i) r))) (E i) *) by rewrite index_uniq // valK. Qed. Lemma big_tuple I n (t : n.-tuple I) (P : pred I) F : Proof. (* Goal: @eq R (@BigOp.bigop R I idx (@tval n I t) (fun i : I => @BigBody R I i op (P i) (F i))) (@BigOp.bigop R (Finite.sort (ordinal_finType n)) idx (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody R (ordinal n) i op (P (@tnth n I t i)) (F (@tnth n I t i)))) *) by rewrite big_tnth tvalK; case: _ / (esym _). Qed. Lemma big_ord_narrow_cond n1 n2 (P : pred 'I_n2) F (le_n12 : n1 <= n2) : let w := widen_ord le_n12 in \big[op/idx]_(i < n2 | P i && (i < n1)) F i = \big[op/idx]_(i < n1 | P (w i)) F (w i). Proof. (* Goal: let w := @widen_ord n1 n2 le_n12 in @eq R (@BigOp.bigop R (Finite.sort (ordinal_finType n2)) idx (index_enum (ordinal_finType n2)) (fun i : ordinal n2 => @BigBody R (ordinal n2) i op (andb (P i) (leq (S (@nat_of_ord n2 i)) n1)) (F i))) (@BigOp.bigop R (Finite.sort (ordinal_finType n1)) idx (index_enum (ordinal_finType n1)) (fun i : ordinal n1 => @BigBody R (ordinal n1) i op (P (w i)) (F (w i)))) *) case: n1 => [|n1] /= in le_n12 *. by rewrite big_ord0 big_pred0 // => i; rewrite andbF. rewrite (big_ord_widen_leq _ _ le_n12); apply: eq_big => i. by apply: andb_id2r => le_i_n1; congr P; apply: val_inj; rewrite /= inordK. by case/andP=> _ le_i_n1; congr F; apply: val_inj; rewrite /= inordK. Qed. Qed. Lemma big_ord_narrow_cond_leq n1 n2 (P : pred _) F (le_n12 : n1 <= n2) : let w := @widen_ord n1.+1 n2.+1 le_n12 in Proof. (* Goal: let w := @widen_ord (S n1) (S n2) le_n12 in @eq R (@BigOp.bigop R (Finite.sort (ordinal_finType (S n2))) idx (index_enum (ordinal_finType (S n2))) (fun i : ordinal (S n2) => @BigBody R (ordinal (S n2)) i op (andb (P i) (leq (@nat_of_ord (S n2) i) n1)) (F i))) (@BigOp.bigop R (Finite.sort (ordinal_finType (S n1))) idx (index_enum (ordinal_finType (S n1))) (fun i : ordinal (S n1) => @BigBody R (ordinal (S n1)) i op (P (w i)) (F (w i)))) *) exact: (@big_ord_narrow_cond n1.+1 n2.+1). Qed. Lemma big_ord_narrow n1 n2 F (le_n12 : n1 <= n2) : let w := widen_ord le_n12 in \big[op/idx]_(i < n2 | i < n1) F i = \big[op/idx]_(i < n1) F (w i). Proof. (* Goal: let w := @widen_ord n1 n2 le_n12 in @eq R (@BigOp.bigop R (Finite.sort (ordinal_finType n2)) idx (index_enum (ordinal_finType n2)) (fun i : ordinal n2 => @BigBody R (ordinal n2) i op (leq (S (@nat_of_ord n2 i)) n1) (F i))) (@BigOp.bigop R (Finite.sort (ordinal_finType n1)) idx (index_enum (ordinal_finType n1)) (fun i : ordinal n1 => @BigBody R (ordinal n1) i op true (F (w i)))) *) exact: (big_ord_narrow_cond (predT)). Qed. Lemma big_ord_narrow_leq n1 n2 F (le_n12 : n1 <= n2) : let w := @widen_ord n1.+1 n2.+1 le_n12 in Proof. (* Goal: let w := @widen_ord (S n1) (S n2) le_n12 in @eq R (@BigOp.bigop R (Finite.sort (ordinal_finType (S n2))) idx (index_enum (ordinal_finType (S n2))) (fun i : ordinal (S n2) => @BigBody R (ordinal (S n2)) i op (leq (@nat_of_ord (S n2) i) n1) (F i))) (@BigOp.bigop R (Finite.sort (ordinal_finType (S n1))) idx (index_enum (ordinal_finType (S n1))) (fun i : ordinal (S n1) => @BigBody R (ordinal (S n1)) i op true (F (w i)))) *) exact: (big_ord_narrow_cond_leq (predT)). Qed. Lemma big_ord_recl n F : \big[op/idx]_(i < n.+1) F i = Lemma big_const (I : finType) (A : pred I) x : \big[op/idx]_(i in A) x = iter #|A| (op x) idx. Proof. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i op (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) x)) (@iter R (@card I (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (op x) idx) *) by rewrite big_const_seq -size_filter cardE. Qed. Lemma big_const_nat m n x : \big[op/idx]_(m <= i < n) x = iter (n - m) (op x) idx. Proof. (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i op true x)) (@iter R (subn n m) (op x) idx) *) by rewrite big_const_seq count_predT size_iota. Qed. Lemma big_const_ord n x : \big[op/idx]_(i < n) x = iter n (op x) idx. Proof. (* Goal: @eq R (@BigOp.bigop R (Finite.sort (ordinal_finType n)) idx (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody R (ordinal n) i op true x)) (@iter R n (op x) idx) *) by rewrite big_const card_ord. Qed. Lemma big_nseq_cond I n a (P : pred I) F : \big[op/idx]_(i <- nseq n a | P i) F i = if P a then iter n (op (F a)) idx else idx. Proof. (* Goal: @eq R (@BigOp.bigop R I idx (@nseq I n a) (fun i : I => @BigBody R I i op (P i) (F i))) (if P a then @iter R n (op (F a)) idx else idx) *) by rewrite unlock; elim: n => /= [|n ->]; case: (P a). Qed. Lemma big_nseq I n a (F : I -> R): \big[op/idx]_(i <- nseq n a) F i = iter n (op (F a)) idx. Proof. (* Goal: @eq R (@BigOp.bigop R I idx (@nseq I n a) (fun i : I => @BigBody R I i op true (F i))) (@iter R n (op (F a)) idx) *) exact: big_nseq_cond. Qed. End Extensionality. Section MonoidProperties. Import Monoid.Theory. Variable R : Type. Variable idx : R. Local Notation "1" := idx. Section Plain. Variable op : Monoid.law 1. Local Notation "*%M" := op (at level 0). Local Notation "x * y" := (op x y). Lemma eq_big_idx_seq idx' I r (P : pred I) F : right_id idx' *%M -> has P r -> \big[*%M/idx']_(i <- r | P i) F i =\big[*%M/1]_(i <- r | P i) F i. Proof. (* Goal: forall (_ : @right_id R R idx' (@Monoid.operator R idx op)) (_ : is_true (@has I P r)), @eq R (@BigOp.bigop R I idx' r (fun i : I => @BigBody R I i (@Monoid.operator R idx op) (P i) (F i))) (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx op) (P i) (F i))) *) move=> op_idx'; rewrite -!(big_filter _ _ r) has_count -size_filter. (* Goal: forall _ : is_true (leq (S O) (@size I (@filter I P r))), @eq R (@BigOp.bigop R I idx' (@filter I P r) (fun i : I => @BigBody R I i (@Monoid.operator R idx op) true (F i))) (@BigOp.bigop R I idx (@filter I P r) (fun i : I => @BigBody R I i (@Monoid.operator R idx op) true (F i))) *) case/lastP: (filter P r) => {r}// r i _. (* Goal: @eq R (@BigOp.bigop R I idx' (@rcons I r i) (fun i : I => @BigBody R I i (@Monoid.operator R idx op) true (F i))) (@BigOp.bigop R I idx (@rcons I r i) (fun i : I => @BigBody R I i (@Monoid.operator R idx op) true (F i))) *) by rewrite -cats1 !(big_cat_nested, big_cons, big_nil) op_idx' mulm1. Qed. Lemma eq_big_idx idx' (I : finType) i0 (P : pred I) F : P i0 -> right_id idx' *%M -> \big[*%M/idx']_(i | P i) F i =\big[*%M/1]_(i | P i) F i. Proof. (* Goal: forall (_ : is_true (P i0)) (_ : @right_id R R idx' (@Monoid.operator R idx op)), @eq R (@BigOp.bigop R (Finite.sort I) idx' (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx op) (P i) (F i))) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx op) (P i) (F i))) *) by move=> Pi0 op_idx'; apply: eq_big_idx_seq => //; apply/hasP; exists i0. Qed. Lemma big1_eq I r (P : pred I) : \big[*%M/1]_(i <- r | P i) 1 = 1. Proof. (* Goal: @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx op) (P i) idx)) idx *) by rewrite big_const_seq; elim: (count _ _) => //= n ->; apply: mul1m. Qed. Lemma big1 I r (P : pred I) F : (forall i, P i -> F i = 1) -> \big[*%M/1]_(i <- r | P i) F i = 1. Proof. (* Goal: forall _ : forall (i : I) (_ : is_true (P i)), @eq R (F i) idx, @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx op) (P i) (F i))) idx *) by move/(eq_bigr _)->; apply: big1_eq. Qed. Lemma big1_seq (I : eqType) r (P : pred I) F : (forall i, P i && (i \in r) -> F i = 1) -> \big[*%M/1]_(i <- r | P i) F i = 1. Proof. (* Goal: forall _ : forall (i : Equality.sort I) (_ : is_true (andb (P i) (@in_mem (Equality.sort I) i (@mem (Equality.sort I) (seq_predType I) r)))), @eq R (F i) idx, @eq R (@BigOp.bigop R (Equality.sort I) idx r (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx op) (P i) (F i))) idx *) by move=> eqF1; rewrite big_seq_cond big_andbC big1. Qed. Lemma big_seq1 I (i : I) F : \big[*%M/1]_(j <- [:: i]) F j = F i. Proof. (* Goal: @eq R (@BigOp.bigop R I idx (@cons I i (@nil I)) (fun j : I => @BigBody R I j (@Monoid.operator R idx op) true (F j))) (F i) *) by rewrite unlock /= mulm1. Qed. Lemma big_mkcond I r (P : pred I) F : \big[*%M/1]_(i <- r | P i) F i = \big[*%M/1]_(i <- r) (if P i then F i else 1). Proof. (* Goal: @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx op) (P i) (F i))) (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx op) true (if P i then F i else idx))) *) by rewrite unlock; elim: r => //= i r ->; case P; rewrite ?mul1m. Qed. Lemma big_mkcondr I r (P Q : pred I) F : \big[*%M/1]_(i <- r | P i && Q i) F i = \big[*%M/1]_(i <- r | P i) (if Q i then F i else 1). Proof. (* Goal: @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx op) (andb (P i) (Q i)) (F i))) (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx op) (P i) (if Q i then F i else idx))) *) by rewrite -big_filter_cond big_mkcond big_filter. Qed. Lemma big_mkcondl I r (P Q : pred I) F : \big[*%M/1]_(i <- r | P i && Q i) F i = \big[*%M/1]_(i <- r | Q i) (if P i then F i else 1). Proof. (* Goal: @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx op) (andb (P i) (Q i)) (F i))) (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx op) (Q i) (if P i then F i else idx))) *) by rewrite big_andbC big_mkcondr. Qed. Lemma big_cat I r1 r2 (P : pred I) F : \big[*%M/1]_(i <- r1 ++ r2 | P i) F i = \big[*%M/1]_(i <- r1 | P i) F i * \big[*%M/1]_(i <- r2 | P i) F i. Proof. (* Goal: @eq R (@BigOp.bigop R I idx (@cat I r1 r2) (fun i : I => @BigBody R I i (@Monoid.operator R idx op) (P i) (F i))) (@Monoid.operator R idx op (@BigOp.bigop R I idx r1 (fun i : I => @BigBody R I i (@Monoid.operator R idx op) (P i) (F i))) (@BigOp.bigop R I idx r2 (fun i : I => @BigBody R I i (@Monoid.operator R idx op) (P i) (F i)))) *) rewrite !(big_mkcond _ P) unlock. (* Goal: @eq R (@reducebig R I idx (@cat I r1 r2) (fun i : I => @BigBody R I i (@Monoid.operator R idx op) true (if P i then F i else idx))) (@Monoid.operator R idx op (@reducebig R I idx r1 (fun i : I => @BigBody R I i (@Monoid.operator R idx op) true (if P i then F i else idx))) (@reducebig R I idx r2 (fun i : I => @BigBody R I i (@Monoid.operator R idx op) true (if P i then F i else idx)))) *) by elim: r1 => /= [|i r1 ->]; rewrite (mul1m, mulmA). Qed. Lemma big_allpairs I1 I2 (r1 : seq I1) (r2 : seq I2) F : \big[*%M/1]_(i <- [seq (i1, i2) | i1 <- r1, i2 <- r2]) F i = \big[*%M/1]_(i1 <- r1) \big[op/idx]_(i2 <- r2) F (i1, i2). Proof. (* Goal: @eq R (@BigOp.bigop R (prod I1 I2) idx (@allpairs I1 I2 (prod I1 I2) (fun (i1 : I1) (i2 : I2) => @pair I1 I2 i1 i2) r1 r2) (fun i : prod I1 I2 => @BigBody R (prod I1 I2) 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 idx r2 (fun i2 : I2 => @BigBody R I2 i2 (@Monoid.operator R idx op) true (F (@pair I1 I2 i1 i2)))))) *) elim: r1 => [|i1 r1 IHr1]; first by rewrite !big_nil. (* Goal: @eq R (@BigOp.bigop R (prod I1 I2) idx (@allpairs I1 I2 (prod I1 I2) (fun (i1 : I1) (i2 : I2) => @pair I1 I2 i1 i2) (@cons I1 i1 r1) r2) (fun i : prod I1 I2 => @BigBody R (prod I1 I2) i (@Monoid.operator R idx op) true (F i))) (@BigOp.bigop R I1 idx (@cons I1 i1 r1) (fun i1 : I1 => @BigBody R I1 i1 (@Monoid.operator R idx op) true (@BigOp.bigop R I2 idx r2 (fun i2 : I2 => @BigBody R I2 i2 (@Monoid.operator R idx op) true (F (@pair I1 I2 i1 i2)))))) *) by rewrite big_cat IHr1 big_cons big_map. Qed. Lemma big_pred1_eq (I : finType) (i : I) F : \big[*%M/1]_(j | j == i) F j = F i. Proof. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun j : Finite.sort I => @BigBody R (Finite.sort I) j (@Monoid.operator R idx op) (@eq_op (Finite.eqType I) j i) (F j))) (F i) *) by rewrite -big_filter filter_index_enum enum1 big_seq1. Qed. Lemma big_pred1 (I : finType) i (P : pred I) F : P =1 pred1 i -> \big[*%M/1]_(j | P j) F j = F i. Proof. (* Goal: forall _ : @eqfun bool (Finite.sort I) P (@pred_of_simpl (Equality.sort (Finite.eqType I)) (@pred1 (Finite.eqType I) i)), @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun j : Finite.sort I => @BigBody R (Finite.sort I) j (@Monoid.operator R idx op) (P j) (F j))) (F i) *) by move/(eq_bigl _ _)->; apply: big_pred1_eq. Qed. Lemma big_cat_nat n m p (P : pred nat) F : m <= n -> n <= p -> \big[*%M/1]_(m <= i < p | P i) F i = (\big[*%M/1]_(m <= i < n | P i) F i) * (\big[*%M/1]_(n <= i < p | P i) F i). Proof. (* Goal: forall (_ : is_true (leq m n)) (_ : is_true (leq n p)), @eq R (@BigOp.bigop R nat idx (index_iota m p) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx op) (P i) (F i))) (@Monoid.operator R idx op (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx op) (P i) (F i))) (@BigOp.bigop R nat idx (index_iota n p) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx op) (P i) (F i)))) *) move=> le_mn le_np; rewrite -big_cat -{2}(subnKC le_mn) -iota_add subnDA. (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota m p) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx op) (P i) (F i))) (@BigOp.bigop R nat idx (iota m (addn (subn n m) (subn (subn p m) (subn n m)))) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx op) (P i) (F i))) *) by rewrite subnKC // leq_sub. Qed. Lemma big_nat1 n F : \big[*%M/1]_(n <= i < n.+1) F i = F n. Proof. (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota n (S n)) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx op) true (F i))) (F n) *) by rewrite big_ltn // big_geq // mulm1. Qed. Lemma big_nat_recr n m F : m <= n -> \big[*%M/1]_(m <= i < n.+1) F i = (\big[*%M/1]_(m <= i < n) F i) * F n. Proof. (* Goal: forall _ : is_true (leq m n), @eq R (@BigOp.bigop R nat idx (index_iota m (S n)) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx op) true (F i))) (@Monoid.operator R idx op (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx op) true (F i))) (F n)) *) by move=> lemn; rewrite (@big_cat_nat n) ?leqnSn // big_nat1. Qed. Lemma big_ord_recr n F : \big[*%M/1]_(i < n.+1) F i = Lemma big_sumType (I1 I2 : finType) (P : pred (I1 + I2)) F : \big[*%M/1]_(i | P i) F i = (\big[*%M/1]_(i | P (inl _ i)) F (inl _ i)) * (\big[*%M/1]_(i | P (inr _ i)) F (inr _ i)). Proof. (* Goal: @eq R (@BigOp.bigop R (Finite.sort (sum_finType I1 I2)) idx (index_enum (sum_finType I1 I2)) (fun i : Finite.sort (sum_finType I1 I2) => @BigBody R (Finite.sort (sum_finType I1 I2)) i (@Monoid.operator R idx op) (P i) (F i))) (@Monoid.operator R idx op (@BigOp.bigop R (Finite.sort I1) idx (index_enum I1) (fun i : Finite.sort I1 => @BigBody R (Finite.sort I1) i (@Monoid.operator R idx op) (P (@inl (Finite.sort I1) (Finite.sort I2) i)) (F (@inl (Finite.sort I1) (Finite.sort I2) i)))) (@BigOp.bigop R (Finite.sort I2) idx (index_enum I2) (fun i : Finite.sort I2 => @BigBody R (Finite.sort I2) i (@Monoid.operator R idx op) (P (@inr (Finite.sort I1) (Finite.sort I2) i)) (F (@inr (Finite.sort I1) (Finite.sort I2) i))))) *) by rewrite /index_enum {1}[@Finite.enum]unlock /= big_cat !big_map. Qed. Lemma big_split_ord m n (P : pred 'I_(m + n)) F : \big[*%M/1]_(i | P i) F i = (\big[*%M/1]_(i | P (lshift n i)) F (lshift n i)) * (\big[*%M/1]_(i | P (rshift m i)) F (rshift m i)). Lemma big_flatten I rr (P : pred I) F : \big[*%M/1]_(i <- flatten rr | P i) F i = \big[*%M/1]_(r <- rr) \big[*%M/1]_(i <- r | P i) F i. Proof. (* Goal: @eq R (@BigOp.bigop R I idx (@flatten I rr) (fun i : I => @BigBody R I i (@Monoid.operator R idx op) (P i) (F i))) (@BigOp.bigop R (list I) idx rr (fun r : list I => @BigBody R (list I) r (@Monoid.operator R idx op) true (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx op) (P i) (F i))))) *) by elim: rr => [|r rr IHrr]; rewrite ?big_nil //= big_cat big_cons -IHrr. Qed. End Plain. Section Abelian. Variable op : Monoid.com_law 1. Local Notation "'*%M'" := op (at level 0). Local Notation "x * y" := (op x y). Lemma eq_big_perm (I : eqType) r1 r2 (P : pred I) F : perm_eq r1 r2 -> \big[*%M/1]_(i <- r1 | P i) F i = \big[*%M/1]_(i <- r2 | P i) F i. Proof. (* Goal: forall _ : is_true (@perm_eq I r1 r2), @eq R (@BigOp.bigop R (Equality.sort I) idx r1 (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) (@BigOp.bigop R (Equality.sort I) idx r2 (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) *) move/perm_eqP; rewrite !(big_mkcond _ _ P). (* Goal: forall _ : @eqfun nat (pred (Equality.sort I)) (fun x : pred (Equality.sort I) => @count (Equality.sort I) x r1) (fun x : pred (Equality.sort I) => @count (Equality.sort I) x r2), @eq R (@BigOp.bigop R (Equality.sort I) idx r1 (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (if P i then F i else idx))) (@BigOp.bigop R (Equality.sort I) idx r2 (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (if P i then F i else idx))) *) elim: r1 r2 => [|i r1 IHr1] r2 eq_r12. (* Goal: @eq R (@BigOp.bigop R (Equality.sort I) idx (@cons (Equality.sort I) i r1) (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (if P i then F i else idx))) (@BigOp.bigop R (Equality.sort I) idx r2 (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (if P i then F i else idx))) *) (* Goal: @eq R (@BigOp.bigop R (Equality.sort I) idx (@nil (Equality.sort I)) (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (if P i then F i else idx))) (@BigOp.bigop R (Equality.sort I) idx r2 (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (if P i then F i else idx))) *) by case: r2 eq_r12 => // i r2; move/(_ (pred1 i)); rewrite /= eqxx. (* Goal: @eq R (@BigOp.bigop R (Equality.sort I) idx (@cons (Equality.sort I) i r1) (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (if P i then F i else idx))) (@BigOp.bigop R (Equality.sort I) idx r2 (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (if P i then F i else idx))) *) have r2i: i \in r2 by rewrite -has_pred1 has_count -eq_r12 /= eqxx. (* Goal: @eq R (@BigOp.bigop R (Equality.sort I) idx (@cons (Equality.sort I) i r1) (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (if P i then F i else idx))) (@BigOp.bigop R (Equality.sort I) idx r2 (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (if P i then F i else idx))) *) case/splitPr: r2 / r2i => [r3 r4] in eq_r12 *; rewrite big_cat /= !big_cons. (* Goal: @eq R (@Monoid.operator R idx (@Monoid.com_operator R idx op) (if P i then F i else idx) (@BigOp.bigop R (Equality.sort I) idx r1 (fun j : Equality.sort I => @BigBody R (Equality.sort I) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (if P j then F j else idx)))) (@Monoid.operator R idx (@Monoid.com_operator R idx op) (@BigOp.bigop R (Equality.sort I) idx r3 (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (if P i then F i else idx))) (@Monoid.operator R idx (@Monoid.com_operator R idx op) (if P i then F i else idx) (@BigOp.bigop R (Equality.sort I) idx r4 (fun j : Equality.sort I => @BigBody R (Equality.sort I) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (if P j then F j else idx))))) *) rewrite mulmCA; congr (_ * _); rewrite -big_cat; apply: IHr1 => a. (* Goal: @eq nat (@count (Equality.sort I) a r1) (@count (Equality.sort I) a (@cat (Equality.sort I) r3 r4)) *) by move/(_ a): eq_r12; rewrite !count_cat /= addnCA; apply: addnI. Qed. Lemma big_uniq (I : finType) (r : seq I) F : uniq r -> \big[*%M/1]_(i <- r) F i = \big[*%M/1]_(i in r) F i. Lemma big_rem (I : eqType) r x (P : pred I) F : x \in r -> \big[*%M/1]_(y <- r | P y) F y = (if P x then F x else 1) * \big[*%M/1]_(y <- rem x r | P y) F y. Proof. (* Goal: forall _ : is_true (@in_mem (Equality.sort I) x (@mem (Equality.sort I) (seq_predType I) r)), @eq R (@BigOp.bigop R (Equality.sort I) idx r (fun y : Equality.sort I => @BigBody R (Equality.sort I) y (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P y) (F y))) (@Monoid.operator R idx (@Monoid.com_operator R idx op) (if P x then F x else idx) (@BigOp.bigop R (Equality.sort I) idx (@rem I x r) (fun y : Equality.sort I => @BigBody R (Equality.sort I) y (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P y) (F y)))) *) by move/perm_to_rem/(eq_big_perm _)->; rewrite !(big_mkcond _ _ P) big_cons. Qed. Lemma big_undup (I : eqType) (r : seq I) (P : pred I) F : idempotent *%M -> \big[*%M/1]_(i <- undup r | P i) F i = \big[*%M/1]_(i <- r | P i) F i. Proof. (* Goal: forall _ : @idempotent R (@Monoid.operator R idx (@Monoid.com_operator R idx op)), @eq R (@BigOp.bigop R (Equality.sort I) idx (@undup I r) (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) (@BigOp.bigop R (Equality.sort I) idx r (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) *) move=> idM; rewrite -!(big_filter _ _ _ P) filter_undup. (* Goal: @eq R (@BigOp.bigop R (Equality.sort I) idx (@undup I (@filter (Equality.sort I) P r)) (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) (@BigOp.bigop R (Equality.sort I) idx (@filter (Equality.sort I) P r) (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) *) elim: {P r}(filter P r) => //= i r IHr. (* Goal: @eq R (@BigOp.bigop R (Equality.sort I) idx (if @in_mem (Equality.sort I) i (@mem (Equality.sort I) (seq_predType I) r) then @undup I r else @cons (Equality.sort I) i (@undup I r)) (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) (@BigOp.bigop R (Equality.sort I) idx (@cons (Equality.sort I) i r) (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) *) case: ifP => [r_i | _]; rewrite !big_cons {}IHr //. (* Goal: @eq R (@BigOp.bigop R (Equality.sort I) idx r (fun i : Equality.sort I => @BigBody R (Equality.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 i) (@BigOp.bigop R (Equality.sort I) idx r (fun j : Equality.sort I => @BigBody R (Equality.sort I) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F j)))) *) by rewrite (big_rem _ _ r_i) mulmA idM. Qed. Lemma eq_big_idem (I : eqType) (r1 r2 : seq I) (P : pred I) F : idempotent *%M -> r1 =i r2 -> \big[*%M/1]_(i <- r1 | P i) F i = \big[*%M/1]_(i <- r2 | P i) F i. Lemma big_undup_iterop_count (I : eqType) (r : seq I) (P : pred I) F : \big[*%M/1]_(i <- undup r | P i) iterop (count_mem i r) *%M (F i) 1 = \big[*%M/1]_(i <- r | P i) F i. Proof. (* Goal: @eq R (@BigOp.bigop R (Equality.sort I) idx (@undup I r) (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (@iterop R (@count (Equality.sort I) (@pred_of_simpl (Equality.sort I) (@pred1 I i)) r) (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (F i) idx))) (@BigOp.bigop R (Equality.sort I) idx r (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) *) rewrite -[RHS](eq_big_perm _ F (perm_undup_count _)) big_flatten big_map. (* Goal: @eq R (@BigOp.bigop R (Equality.sort I) idx (@undup I r) (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (@iterop R (@count (Equality.sort I) (@pred_of_simpl (Equality.sort I) (@pred1 I i)) r) (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (F i) idx))) (@BigOp.bigop R (Equality.sort I) idx (@undup I r) (fun j : Equality.sort I => @BigBody R (Equality.sort I) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (@BigOp.bigop R (Equality.sort I) idx (@nseq (Equality.sort I) (@count (Equality.sort I) (@pred_of_simpl (Equality.sort I) (@pred1 I j)) r) j) (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))))) *) by rewrite big_mkcond; apply: eq_bigr => i _; rewrite big_nseq_cond iteropE. Qed. Lemma big_split I r (P : pred I) F1 F2 : \big[*%M/1]_(i <- r | P i) (F1 i * F2 i) = \big[*%M/1]_(i <- r | P i) F1 i * \big[*%M/1]_(i <- r | P i) F2 i. Proof. (* Goal: @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (@Monoid.operator R idx (@Monoid.com_operator R idx op) (F1 i) (F2 i)))) (@Monoid.operator R idx (@Monoid.com_operator R idx op) (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F1 i))) (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F2 i)))) *) by elim/big_rec3: _ => [|i x y _ _ ->]; rewrite ?mulm1 // mulmCA -!mulmA mulmCA. Qed. Lemma bigID I r (a P : pred I) F : \big[*%M/1]_(i <- r | P i) F i = \big[*%M/1]_(i <- r | P i && a i) F i * \big[*%M/1]_(i <- r | P i && ~~ a i) F i. Proof. (* Goal: @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R 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 I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (a i)) (F i))) (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (negb (a i))) (F i)))) *) rewrite !(big_mkcond _ _ _ F) -big_split. (* Goal: @eq R (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (if P i then F i else idx))) (@BigOp.bigop R I idx r (fun i : I => @BigBody R I i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (@Monoid.operator R idx (@Monoid.com_operator R idx op) (if andb (P i) (a i) then F i else idx) (if andb (P i) (negb (a i)) then F i else idx)))) *) by apply: eq_bigr => i; case: (a i); rewrite !simpm. Qed. Arguments bigID [I r]. Lemma bigU (I : finType) (A B : pred I) F : [disjoint A & B] -> \big[*%M/1]_(i in [predU A & B]) F i = (\big[*%M/1]_(i in A) F i) * (\big[*%M/1]_(i in B) F i). Proof. (* Goal: forall _ : is_true (@disjoint I (@mem (Finite.sort I) (predPredType (Finite.sort I)) A) (@mem (Finite.sort I) (predPredType (Finite.sort I)) B)), @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (simplPredType (Finite.sort I)) (@predU (Finite.sort I) (@pred_of_simpl (Finite.sort I) (@pred_of_mem_pred (Finite.sort I) (@mem (Finite.sort I) (predPredType (Finite.sort I)) A))) (@pred_of_simpl (Finite.sort I) (@pred_of_mem_pred (Finite.sort I) (@mem (Finite.sort I) (predPredType (Finite.sort I)) B)))))) (F i))) (@Monoid.operator R idx (@Monoid.com_operator R idx op) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (F i))) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) B)) (F i)))) *) move=> dAB; rewrite (bigID (mem A)). (* Goal: @eq R (@Monoid.operator R idx (@Monoid.com_operator R idx op) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (simplPredType (Finite.sort I)) (@predU (Finite.sort I) (@pred_of_simpl (Finite.sort I) (@pred_of_mem_pred (Finite.sort I) (@mem (Finite.sort I) (predPredType (Finite.sort I)) A))) (@pred_of_simpl (Finite.sort I) (@pred_of_mem_pred (Finite.sort I) (@mem (Finite.sort I) (predPredType (Finite.sort I)) B)))))) (@pred_of_simpl (Finite.sort I) (@pred_of_mem_pred (Finite.sort I) (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) i)) (F i))) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (simplPredType (Finite.sort I)) (@predU (Finite.sort I) (@pred_of_simpl (Finite.sort I) (@pred_of_mem_pred (Finite.sort I) (@mem (Finite.sort I) (predPredType (Finite.sort I)) A))) (@pred_of_simpl (Finite.sort I) (@pred_of_mem_pred (Finite.sort I) (@mem (Finite.sort I) (predPredType (Finite.sort I)) B)))))) (negb (@pred_of_simpl (Finite.sort I) (@pred_of_mem_pred (Finite.sort I) (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) i))) (F i)))) (@Monoid.operator R idx (@Monoid.com_operator R idx op) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (F i))) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) B)) (F i)))) *) congr (_ * _); apply: eq_bigl => i; first by rewrite orbK. (* Goal: @eq bool (andb (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (simplPredType (Finite.sort I)) (@predU (Finite.sort I) (@pred_of_simpl (Finite.sort I) (@pred_of_mem_pred (Finite.sort I) (@mem (Finite.sort I) (predPredType (Finite.sort I)) A))) (@pred_of_simpl (Finite.sort I) (@pred_of_mem_pred (Finite.sort I) (@mem (Finite.sort I) (predPredType (Finite.sort I)) B)))))) (negb (@pred_of_simpl (Finite.sort I) (@pred_of_mem_pred (Finite.sort I) (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) i))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) B)) *) by have:= pred0P dAB i; rewrite andbC /= !inE; case: (i \in A). Qed. Lemma bigD1 (I : finType) j (P : pred I) F : P j -> \big[*%M/1]_(i | P i) F i = F j * \big[*%M/1]_(i | P i && (i != j)) F i. Arguments bigD1 [I] j [P F]. Lemma bigD1_seq (I : eqType) (r : seq I) j F : j \in r -> uniq r -> \big[*%M/1]_(i <- r) F i = F j * \big[*%M/1]_(i <- r | i != j) F i. Proof. (* Goal: forall (_ : is_true (@in_mem (Equality.sort I) j (@mem (Equality.sort I) (seq_predType I) r))) (_ : is_true (@uniq I r)), @eq R (@BigOp.bigop R (Equality.sort I) idx r (fun i : Equality.sort I => @BigBody R (Equality.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 j) (@BigOp.bigop R (Equality.sort I) idx r (fun i : Equality.sort I => @BigBody R (Equality.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (negb (@eq_op I i j)) (F i)))) *) by move=> /big_rem-> /rem_filter->; rewrite big_filter. Qed. Lemma cardD1x (I : finType) (A : pred I) j : A j -> #|SimplPred A| = 1 + #|[pred i | A i & i != j]|. Arguments cardD1x [I A]. Lemma partition_big (I J : finType) (P : pred I) p (Q : pred J) F : (forall i, P i -> Q (p i)) -> \big[*%M/1]_(i | P i) F i = \big[*%M/1]_(j | Q j) \big[*%M/1]_(i | P i && (p i == j)) F i. Proof. (* Goal: forall _ : forall (i : Finite.sort I) (_ : is_true (P i)), is_true (Q (p i)), @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) (@BigOp.bigop R (Finite.sort J) idx (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q j) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (@eq_op (Finite.eqType J) (p i) j)) (F i))))) *) move=> Qp; transitivity (\big[*%M/1]_(i | P i && Q (p i)) F i). (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (Q (p i))) (F i))) (@BigOp.bigop R (Finite.sort J) idx (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q j) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (@eq_op (Finite.eqType J) (p i) j)) (F i))))) *) (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (Q (p i))) (F i))) *) by apply: eq_bigl => i; case Pi: (P i); rewrite // Qp. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (Q (p i))) (F i))) (@BigOp.bigop R (Finite.sort J) idx (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q j) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (@eq_op (Finite.eqType J) (p i) j)) (F i))))) *) elim: {Q Qp}_.+1 {-2}Q (ltnSn #|Q|) => // n IHn Q. (* Goal: forall _ : is_true (leq (S (@card J (@mem (Finite.sort J) (predPredType (Finite.sort J)) Q))) (S n)), @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (Q (p i))) (F i))) (@BigOp.bigop R (Finite.sort J) idx (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q j) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (@eq_op (Finite.eqType J) (p i) j)) (F i))))) *) case: (pickP Q) => [j Qj | Q0 _]; last first. (* Goal: forall _ : is_true (leq (S (@card J (@mem (Finite.sort J) (predPredType (Finite.sort J)) Q))) (S n)), @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (Q (p i))) (F i))) (@BigOp.bigop R (Finite.sort J) idx (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q j) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (@eq_op (Finite.eqType J) (p i) j)) (F i))))) *) (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (Q (p i))) (F i))) (@BigOp.bigop R (Finite.sort J) idx (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q j) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (@eq_op (Finite.eqType J) (p i) j)) (F i))))) *) by rewrite !big_pred0 // => i; rewrite Q0 andbF. (* Goal: forall _ : is_true (leq (S (@card J (@mem (Finite.sort J) (predPredType (Finite.sort J)) Q))) (S n)), @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (Q (p i))) (F i))) (@BigOp.bigop R (Finite.sort J) idx (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q j) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (@eq_op (Finite.eqType J) (p i) j)) (F i))))) *) rewrite ltnS (cardD1x j Qj) (bigD1 j) //; move/IHn=> {n IHn} <-. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (Q (p i))) (F i))) (@Monoid.operator R idx (@Monoid.com_operator R idx op) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (@eq_op (Finite.eqType J) (p i) j)) (F i))) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (@pred_of_simpl (Finite.sort J) (@SimplPred (Finite.sort J) (fun i0 : Finite.sort J => andb (Q i0) (negb (@eq_op (Finite.eqType J) i0 j)))) (p i))) (F i)))) *) rewrite (bigID (fun i => p i == j)); congr (_ * _); apply: eq_bigl => i. (* Goal: @eq bool (andb (andb (P i) (Q (p i))) (negb (@eq_op (Finite.eqType J) (p i) j))) (andb (P i) (@pred_of_simpl (Finite.sort J) (@SimplPred (Finite.sort J) (fun i : Finite.sort J => andb (Q i) (negb (@eq_op (Finite.eqType J) i j)))) (p i))) *) (* Goal: @eq bool (andb (andb (P i) (Q (p i))) (@eq_op (Finite.eqType J) (p i) j)) (andb (P i) (@eq_op (Finite.eqType J) (p i) j)) *) by case: eqP => [-> | _]; rewrite !(Qj, simpm). (* Goal: @eq bool (andb (andb (P i) (Q (p i))) (negb (@eq_op (Finite.eqType J) (p i) j))) (andb (P i) (@pred_of_simpl (Finite.sort J) (@SimplPred (Finite.sort J) (fun i : Finite.sort J => andb (Q i) (negb (@eq_op (Finite.eqType J) i j)))) (p i))) *) by rewrite andbA. Qed. Arguments partition_big [I J P] p Q [F]. Lemma reindex_onto (I J : finType) (h : J -> I) h' (P : pred I) F : (forall i, P i -> h (h' i) = i) -> \big[*%M/1]_(i | P i) F i = \big[*%M/1]_(j | P (h j) && (h' (h j) == j)) F (h j). Arguments reindex_onto [I J] h h' [P F]. Lemma reindex (I J : finType) (h : J -> I) (P : pred I) F : {on [pred i | P i], bijective h} -> \big[*%M/1]_(i | P i) F i = \big[*%M/1]_(j | P (h j)) F (h j). Proof. (* Goal: forall _ : @bijective_on (Finite.sort J) (Finite.sort I) (@mem (Finite.sort I) (simplPredType (Finite.sort I)) (@SimplPred (Finite.sort I) (fun i : Finite.sort I => P i))) h, @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) (@BigOp.bigop R (Finite.sort J) idx (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P (h j)) (F (h j)))) *) case=> h' hK h'K; rewrite (reindex_onto h h' h'K). (* Goal: @eq R (@BigOp.bigop R (Finite.sort J) idx (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (@in_mem (Finite.sort I) (h j) (@mem (Finite.sort I) (simplPredType (Finite.sort I)) (@SimplPred (Finite.sort I) (fun i : Finite.sort I => P i)))) (@eq_op (Finite.eqType J) (h' (h j)) j)) (F (h j)))) (@BigOp.bigop R (Finite.sort J) idx (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P (h j)) (F (h j)))) *) by apply: eq_bigl => j; rewrite !inE; case Pi: (P _); rewrite //= hK ?eqxx. Qed. Arguments reindex [I J] h [P F]. Lemma reindex_inj (I : finType) (h : I -> I) (P : pred I) F : injective h -> \big[*%M/1]_(i | P i) F i = \big[*%M/1]_(j | P (h j)) F (h j). Proof. (* Goal: forall _ : @injective (Finite.sort I) (Finite.sort I) h, @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun j : Finite.sort I => @BigBody R (Finite.sort I) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P (h j)) (F (h j)))) *) by move=> injh; apply: reindex (onW_bij _ (injF_bij injh)). Qed. Arguments reindex_inj [I h P F]. Lemma big_nat_rev m n P F : \big[*%M/1]_(m <= i < n | P i) F i = \big[*%M/1]_(m <= i < n | P (m + n - i.+1)) F (m + n - i.+1). Proof. (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P (subn (addn m n) (S i))) (F (subn (addn m n) (S i))))) *) case: (ltnP m n) => ltmn; last by rewrite !big_geq. (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P (subn (addn m n) (S i))) (F (subn (addn m n) (S i))))) *) rewrite -{3 4}(subnK (ltnW ltmn)) addnA. (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) (@BigOp.bigop R nat idx (index_iota m n) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P (subn (addn (addn m (subn n m)) m) (S i))) (F (subn (addn (addn m (subn n m)) m) (S i))))) *) do 2!rewrite (big_addn _ _ 0) big_mkord; rewrite (reindex_inj rev_ord_inj) /=. (* Goal: @eq R (@BigOp.bigop R (ordinal (subn n m)) idx (index_enum (ordinal_finType (subn n m))) (fun j : ordinal (subn n m) => @BigBody R (ordinal (subn n m)) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P (addn (subn (subn n m) (S (@nat_of_ord (subn n m) j))) m)) (F (addn (subn (subn n m) (S (@nat_of_ord (subn n m) j))) m)))) (@BigOp.bigop R (ordinal (subn n m)) idx (index_enum (ordinal_finType (subn n m))) (fun i : ordinal (subn n m) => @BigBody R (ordinal (subn n m)) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P (subn (addn (addn m (subn n m)) m) (S (addn (@nat_of_ord (subn n m) i) m)))) (F (subn (addn (addn m (subn n m)) m) (S (addn (@nat_of_ord (subn n m) i) m)))))) *) by apply: eq_big => [i | i _]; rewrite /= -addSn subnDr addnC addnBA. Qed. Lemma pair_big_dep (I J : finType) (P : pred I) (Q : I -> pred J) F : \big[*%M/1]_(i | P i) \big[*%M/1]_(j | Q i j) F i j = \big[*%M/1]_(p | P p.1 && Q p.1 p.2) F p.1 p.2. Proof. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (@BigOp.bigop R (Finite.sort J) idx (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q i j) (F i j))))) (@BigOp.bigop R (Finite.sort (prod_finType I J)) idx (index_enum (prod_finType I J)) (fun p : Finite.sort (prod_finType I J) => @BigBody R (Finite.sort (prod_finType I J)) p (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P (@fst (Finite.sort I) (Finite.sort J) p)) (Q (@fst (Finite.sort I) (Finite.sort J) p) (@snd (Finite.sort I) (Finite.sort J) p))) (F (@fst (Finite.sort I) (Finite.sort J) p) (@snd (Finite.sort I) (Finite.sort J) p)))) *) rewrite (partition_big (fun p => p.1) P) => [|j]; last by case/andP. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (@BigOp.bigop R (Finite.sort J) idx (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q i j) (F i j))))) (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun j : Finite.sort I => @BigBody R (Finite.sort I) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P j) (@BigOp.bigop R (Finite.sort (prod_finType I J)) idx (index_enum (prod_finType I J)) (fun i : Finite.sort (prod_finType I J) => @BigBody R (Finite.sort (prod_finType I J)) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (andb (P (@fst (Finite.sort I) (Finite.sort J) i)) (Q (@fst (Finite.sort I) (Finite.sort J) i) (@snd (Finite.sort I) (Finite.sort J) i))) (@eq_op (Finite.eqType I) (@fst (Finite.sort I) (Finite.sort J) i) j)) (F (@fst (Finite.sort I) (Finite.sort J) i) (@snd (Finite.sort I) (Finite.sort J) i)))))) *) apply: eq_bigr => i /= Pi; rewrite (reindex_onto (pair i) (fun p => p.2)). (* Goal: forall (i0 : Finite.sort (prod_finType I J)) (_ : is_true (andb (andb (P (@fst (Finite.sort I) (Finite.sort J) i0)) (Q (@fst (Finite.sort I) (Finite.sort J) i0) (@snd (Finite.sort I) (Finite.sort J) i0))) (@eq_op (Finite.eqType I) (@fst (Finite.sort I) (Finite.sort J) i0) i))), @eq (Finite.sort (prod_finType I J)) (@pair (Finite.sort I) (Finite.sort J) i (@snd (Finite.sort I) (Finite.sort J) i0)) i0 *) (* Goal: @eq R (@BigOp.bigop R (Finite.sort J) idx (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q i j) (F i j))) (@BigOp.bigop R (Finite.sort J) idx (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (andb (andb (P (@fst (Finite.sort I) (Finite.sort J) (@pair (Finite.sort I) (Finite.sort J) i j))) (Q (@fst (Finite.sort I) (Finite.sort J) (@pair (Finite.sort I) (Finite.sort J) i j)) (@snd (Finite.sort I) (Finite.sort J) (@pair (Finite.sort I) (Finite.sort J) i j)))) (@eq_op (Finite.eqType I) (@fst (Finite.sort I) (Finite.sort J) (@pair (Finite.sort I) (Finite.sort J) i j)) i)) (@eq_op (Finite.eqType J) (@snd (Finite.sort I) (Finite.sort J) (@pair (Finite.sort I) (Finite.sort J) i j)) j)) (F (@fst (Finite.sort I) (Finite.sort J) (@pair (Finite.sort I) (Finite.sort J) i j)) (@snd (Finite.sort I) (Finite.sort J) (@pair (Finite.sort I) (Finite.sort J) i j))))) *) by apply: eq_bigl => j; rewrite !eqxx [P i]Pi !andbT. (* Goal: forall (i0 : Finite.sort (prod_finType I J)) (_ : is_true (andb (andb (P (@fst (Finite.sort I) (Finite.sort J) i0)) (Q (@fst (Finite.sort I) (Finite.sort J) i0) (@snd (Finite.sort I) (Finite.sort J) i0))) (@eq_op (Finite.eqType I) (@fst (Finite.sort I) (Finite.sort J) i0) i))), @eq (Finite.sort (prod_finType I J)) (@pair (Finite.sort I) (Finite.sort J) i (@snd (Finite.sort I) (Finite.sort J) i0)) i0 *) by case=> i' j /=; case/andP=> _ /=; move/eqP->. Qed. Lemma pair_big (I J : finType) (P : pred I) (Q : pred J) F : \big[*%M/1]_(i | P i) \big[*%M/1]_(j | Q j) F i j = \big[*%M/1]_(p | P p.1 && Q p.2) F p.1 p.2. Proof. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (@BigOp.bigop R (Finite.sort J) idx (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q j) (F i j))))) (@BigOp.bigop R (Finite.sort (prod_finType I J)) idx (index_enum (prod_finType I J)) (fun p : Finite.sort (prod_finType I J) => @BigBody R (Finite.sort (prod_finType I J)) p (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P (@fst (Finite.sort I) (Finite.sort J) p)) (Q (@snd (Finite.sort I) (Finite.sort J) p))) (F (@fst (Finite.sort I) (Finite.sort J) p) (@snd (Finite.sort I) (Finite.sort J) p)))) *) exact: pair_big_dep. Qed. Lemma pair_bigA (I J : finType) (F : I -> J -> R) : \big[*%M/1]_i \big[*%M/1]_j F i j = \big[*%M/1]_p F p.1 p.2. Proof. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) idx (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (@BigOp.bigop R (Finite.sort J) idx (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i j))))) (@BigOp.bigop R (Finite.sort (prod_finType I J)) idx (index_enum (prod_finType I J)) (fun p : Finite.sort (prod_finType I J) => @BigBody R (Finite.sort (prod_finType I J)) p (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F (@fst (Finite.sort I) (Finite.sort J) p) (@snd (Finite.sort I) (Finite.sort J) p)))) *) exact: pair_big_dep. Qed. Lemma exchange_big_dep I J rI rJ (P : pred I) (Q : I -> pred J) (xQ : pred J) F : (forall i j, P i -> Q i j -> xQ j) -> \big[*%M/1]_(i <- rI | P i) \big[*%M/1]_(j <- rJ | Q i j) F i j = \big[*%M/1]_(j <- rJ | xQ j) \big[*%M/1]_(i <- rI | P i && Q i j) F i j. Proof. (* Goal: forall _ : forall (i : I) (j : J) (_ : is_true (P i)) (_ : is_true (Q i j)), is_true (xQ j), @eq R (@BigOp.bigop R I idx rI (fun i : I => @BigBody R I i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (@BigOp.bigop R J idx rJ (fun j : J => @BigBody R J j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q i j) (F i j))))) (@BigOp.bigop R J idx rJ (fun j : J => @BigBody R J j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (xQ j) (@BigOp.bigop R I idx rI (fun i : I => @BigBody R I i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (Q i j)) (F i j))))) *) move=> PQxQ; pose p u := (u.2, u.1). (* Goal: @eq R (@BigOp.bigop R I idx rI (fun i : I => @BigBody R I i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (@BigOp.bigop R J idx rJ (fun j : J => @BigBody R J j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q i j) (F i j))))) (@BigOp.bigop R J idx rJ (fun j : J => @BigBody R J j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (xQ j) (@BigOp.bigop R I idx rI (fun i : I => @BigBody R I i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (Q i j)) (F i j))))) *) rewrite (eq_bigr _ _ _ (fun _ _ => big_tnth _ _ rI _ _)) (big_tnth _ _ rJ). (* Goal: @eq R (@BigOp.bigop R I idx rI (fun i : I => @BigBody R I i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (@BigOp.bigop R J idx rJ (fun j : J => @BigBody R J j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q i j) (F i j))))) (@BigOp.bigop R (Finite.sort (ordinal_finType (@size J rJ))) idx (index_enum (ordinal_finType (@size J rJ))) (fun i : ordinal (@size J rJ) => @BigBody R (ordinal (@size J rJ)) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (xQ (@tnth (@size J rJ) J (@in_tuple J rJ) i)) (@BigOp.bigop R (Finite.sort (ordinal_finType (@size I rI))) idx (index_enum (ordinal_finType (@size I rI))) (fun i0 : ordinal (@size I rI) => @BigBody R (ordinal (@size I rI)) i0 (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P (@tnth (@size I rI) I (@in_tuple I rI) i0)) (Q (@tnth (@size I rI) I (@in_tuple I rI) i0) (@tnth (@size J rJ) J (@in_tuple J rJ) i))) (F (@tnth (@size I rI) I (@in_tuple I rI) i0) (@tnth (@size J rJ) J (@in_tuple J rJ) i)))))) *) rewrite (eq_bigr _ _ _ (fun _ _ => (big_tnth _ _ rJ _ _))) big_tnth. (* Goal: @eq R (@BigOp.bigop R (Finite.sort (ordinal_finType (@size I rI))) idx (index_enum (ordinal_finType (@size I rI))) (fun i : ordinal (@size I rI) => @BigBody R (ordinal (@size I rI)) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P (@tnth (@size I rI) I (@in_tuple I rI) i)) (@BigOp.bigop R (Finite.sort (ordinal_finType (@size J rJ))) idx (index_enum (ordinal_finType (@size J rJ))) (fun i0 : ordinal (@size J rJ) => @BigBody R (ordinal (@size J rJ)) i0 (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q (@tnth (@size I rI) I (@in_tuple I rI) i) (@tnth (@size J rJ) J (@in_tuple J rJ) i0)) (F (@tnth (@size I rI) I (@in_tuple I rI) i) (@tnth (@size J rJ) J (@in_tuple J rJ) i0)))))) (@BigOp.bigop R (Finite.sort (ordinal_finType (@size J rJ))) idx (index_enum (ordinal_finType (@size J rJ))) (fun i : ordinal (@size J rJ) => @BigBody R (ordinal (@size J rJ)) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (xQ (@tnth (@size J rJ) J (@in_tuple J rJ) i)) (@BigOp.bigop R (Finite.sort (ordinal_finType (@size I rI))) idx (index_enum (ordinal_finType (@size I rI))) (fun i0 : ordinal (@size I rI) => @BigBody R (ordinal (@size I rI)) i0 (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P (@tnth (@size I rI) I (@in_tuple I rI) i0)) (Q (@tnth (@size I rI) I (@in_tuple I rI) i0) (@tnth (@size J rJ) J (@in_tuple J rJ) i))) (F (@tnth (@size I rI) I (@in_tuple I rI) i0) (@tnth (@size J rJ) J (@in_tuple J rJ) i)))))) *) rewrite !pair_big_dep (reindex_onto (p _ _) (p _ _)) => [|[]] //=. (* Goal: @eq R (@BigOp.bigop R (prod (ordinal (@size J rJ)) (ordinal (@size I rI))) idx (index_enum (prod_finType (ordinal_finType (@size J rJ)) (ordinal_finType (@size I rI)))) (fun j : prod (ordinal (@size J rJ)) (ordinal (@size I rI)) => @BigBody R (prod (ordinal (@size J rJ)) (ordinal (@size I rI))) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (andb (P (@tnth (@size I rI) I (@in_tuple I rI) (@snd (ordinal (@size J rJ)) (ordinal (@size I rI)) j))) (Q (@tnth (@size I rI) I (@in_tuple I rI) (@snd (ordinal (@size J rJ)) (ordinal (@size I rI)) j)) (@tnth (@size J rJ) J (@in_tuple J rJ) (@fst (ordinal (@size J rJ)) (ordinal (@size I rI)) j)))) (@eq_op (Finite.eqType (prod_finType (ordinal_finType (@size J rJ)) (ordinal_finType (@size I rI)))) (p (ordinal (@size I rI)) (ordinal (@size J rJ)) (p (ordinal (@size J rJ)) (ordinal (@size I rI)) j)) j)) (F (@tnth (@size I rI) I (@in_tuple I rI) (@snd (ordinal (@size J rJ)) (ordinal (@size I rI)) j)) (@tnth (@size J rJ) J (@in_tuple J rJ) (@fst (ordinal (@size J rJ)) (ordinal (@size I rI)) j))))) (@BigOp.bigop R (prod (ordinal (@size J rJ)) (ordinal (@size I rI))) idx (index_enum (prod_finType (ordinal_finType (@size J rJ)) (ordinal_finType (@size I rI)))) (fun p : prod (ordinal (@size J rJ)) (ordinal (@size I rI)) => @BigBody R (prod (ordinal (@size J rJ)) (ordinal (@size I rI))) p (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (xQ (@tnth (@size J rJ) J (@in_tuple J rJ) (@fst (ordinal (@size J rJ)) (ordinal (@size I rI)) p))) (andb (P (@tnth (@size I rI) I (@in_tuple I rI) (@snd (ordinal (@size J rJ)) (ordinal (@size I rI)) p))) (Q (@tnth (@size I rI) I (@in_tuple I rI) (@snd (ordinal (@size J rJ)) (ordinal (@size I rI)) p)) (@tnth (@size J rJ) J (@in_tuple J rJ) (@fst (ordinal (@size J rJ)) (ordinal (@size I rI)) p))))) (F (@tnth (@size I rI) I (@in_tuple I rI) (@snd (ordinal (@size J rJ)) (ordinal (@size I rI)) p)) (@tnth (@size J rJ) J (@in_tuple J rJ) (@fst (ordinal (@size J rJ)) (ordinal (@size I rI)) p))))) *) apply: eq_big => [] [j i] //=; symmetry; rewrite eqxx andbT andb_idl //. (* Goal: forall _ : is_true (andb (P (@tnth (@size I rI) I (@in_tuple I rI) i)) (Q (@tnth (@size I rI) I (@in_tuple I rI) i) (@tnth (@size J rJ) J (@in_tuple J rJ) j))), is_true (xQ (@tnth (@size J rJ) J (@in_tuple J rJ) j)) *) by case/andP; apply: PQxQ. Qed. Arguments exchange_big_dep [I J rI rJ P Q] xQ [F]. Lemma exchange_big I J rI rJ (P : pred I) (Q : pred J) F : \big[*%M/1]_(i <- rI | P i) \big[*%M/1]_(j <- rJ | Q j) F i j = \big[*%M/1]_(j <- rJ | Q j) \big[*%M/1]_(i <- rI | P i) F i j. Proof. (* Goal: @eq R (@BigOp.bigop R I idx rI (fun i : I => @BigBody R I i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (@BigOp.bigop R J idx rJ (fun j : J => @BigBody R J j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q j) (F i j))))) (@BigOp.bigop R J idx rJ (fun j : J => @BigBody R J j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q j) (@BigOp.bigop R I idx rI (fun i : I => @BigBody R I i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i j))))) *) rewrite (exchange_big_dep Q) //; apply: eq_bigr => i /= Qi. (* Goal: @eq R (@BigOp.bigop R I idx rI (fun i0 : I => @BigBody R I i0 (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i0) (Q i)) (F i0 i))) (@BigOp.bigop R I idx rI (fun i0 : I => @BigBody R I i0 (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i0) (F i0 i))) *) by apply: eq_bigl => j; rewrite Qi andbT. Qed. Lemma exchange_big_dep_nat m1 n1 m2 n2 (P : pred nat) (Q : rel nat) (xQ : pred nat) F : (forall i j, m1 <= i < n1 -> m2 <= j < n2 -> P i -> Q i j -> xQ j) -> \big[*%M/1]_(m1 <= i < n1 | P i) \big[*%M/1]_(m2 <= j < n2 | Q i j) F i j = \big[*%M/1]_(m2 <= j < n2 | xQ j) \big[*%M/1]_(m1 <= i < n1 | P i && Q i j) F i j. Proof. (* Goal: forall _ : forall (i j : nat) (_ : is_true (andb (leq m1 i) (leq (S i) n1))) (_ : is_true (andb (leq m2 j) (leq (S j) n2))) (_ : is_true (P i)) (_ : is_true (Q i j)), is_true (xQ j), @eq R (@BigOp.bigop R nat idx (index_iota m1 n1) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (@BigOp.bigop R nat idx (index_iota m2 n2) (fun j : nat => @BigBody R nat j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q i j) (F i j))))) (@BigOp.bigop R nat idx (index_iota m2 n2) (fun j : nat => @BigBody R nat j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (xQ j) (@BigOp.bigop R nat idx (index_iota m1 n1) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (Q i j)) (F i j))))) *) move=> PQxQ; rewrite (eq_bigr _ _ _ (fun _ _ => big_seq_cond _ _ _ _ _)). (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota m1 n1) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (@BigOp.bigop R (Equality.sort nat_eqType) idx (index_iota m2 n2) (fun i0 : Equality.sort nat_eqType => @BigBody R (Equality.sort nat_eqType) i0 (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (@in_mem (Equality.sort nat_eqType) i0 (@mem (Equality.sort nat_eqType) (seq_predType nat_eqType) (index_iota m2 n2))) (Q i i0)) (F i i0))))) (@BigOp.bigop R nat idx (index_iota m2 n2) (fun j : nat => @BigBody R nat j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (xQ j) (@BigOp.bigop R nat idx (index_iota m1 n1) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (Q i j)) (F i j))))) *) rewrite big_seq_cond /= (exchange_big_dep xQ) => [|i j]; last first. (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota m2 n2) (fun j : nat => @BigBody R nat j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (xQ j) (@BigOp.bigop R nat idx (index_iota m1 n1) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (andb (@in_mem nat i (@mem nat (seq_predType nat_eqType) (index_iota m1 n1))) (P i)) (andb (@in_mem nat j (@mem nat (seq_predType nat_eqType) (index_iota m2 n2))) (Q i j))) (F i j))))) (@BigOp.bigop R nat idx (index_iota m2 n2) (fun j : nat => @BigBody R nat j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (xQ j) (@BigOp.bigop R nat idx (index_iota m1 n1) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (Q i j)) (F i j))))) *) (* Goal: forall (_ : is_true (andb (@in_mem nat i (@mem nat (seq_predType nat_eqType) (index_iota m1 n1))) (P i))) (_ : is_true (andb (@in_mem nat j (@mem nat (seq_predType nat_eqType) (index_iota m2 n2))) (Q i j))), is_true (xQ j) *) by rewrite !mem_index_iota => /andP[mn_i Pi] /andP[mn_j /PQxQ->]. (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota m2 n2) (fun j : nat => @BigBody R nat j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (xQ j) (@BigOp.bigop R nat idx (index_iota m1 n1) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (andb (@in_mem nat i (@mem nat (seq_predType nat_eqType) (index_iota m1 n1))) (P i)) (andb (@in_mem nat j (@mem nat (seq_predType nat_eqType) (index_iota m2 n2))) (Q i j))) (F i j))))) (@BigOp.bigop R nat idx (index_iota m2 n2) (fun j : nat => @BigBody R nat j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (xQ j) (@BigOp.bigop R nat idx (index_iota m1 n1) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (Q i j)) (F i j))))) *) rewrite 2!(big_seq_cond _ _ _ xQ); apply: eq_bigr => j /andP[-> _] /=. (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota m1 n1) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (andb (@in_mem nat i (@mem nat (seq_predType nat_eqType) (index_iota m1 n1))) (P i)) (Q i j)) (F i j))) (@BigOp.bigop R nat idx (index_iota m1 n1) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (Q i j)) (F i j))) *) by rewrite [rhs in _ = rhs]big_seq_cond; apply: eq_bigl => i; rewrite -andbA. Qed. Arguments exchange_big_dep_nat [m1 n1 m2 n2 P Q] xQ [F]. Lemma exchange_big_nat m1 n1 m2 n2 (P Q : pred nat) F : \big[*%M/1]_(m1 <= i < n1 | P i) \big[*%M/1]_(m2 <= j < n2 | Q j) F i j = \big[*%M/1]_(m2 <= j < n2 | Q j) \big[*%M/1]_(m1 <= i < n1 | P i) F i j. Proof. (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota m1 n1) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (@BigOp.bigop R nat idx (index_iota m2 n2) (fun j : nat => @BigBody R nat j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q j) (F i j))))) (@BigOp.bigop R nat idx (index_iota m2 n2) (fun j : nat => @BigBody R nat j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q j) (@BigOp.bigop R nat idx (index_iota m1 n1) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i j))))) *) rewrite (exchange_big_dep_nat Q) //. (* Goal: @eq R (@BigOp.bigop R nat idx (index_iota m2 n2) (fun j : nat => @BigBody R nat j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q j) (@BigOp.bigop R nat idx (index_iota m1 n1) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (P i) (Q j)) (F i j))))) (@BigOp.bigop R nat idx (index_iota m2 n2) (fun j : nat => @BigBody R nat j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q j) (@BigOp.bigop R nat idx (index_iota m1 n1) (fun i : nat => @BigBody R nat i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i j))))) *) by apply: eq_bigr => i /= Qi; apply: eq_bigl => j; rewrite Qi andbT. Qed. End Abelian. End MonoidProperties. Arguments big_filter [R idx op I]. Arguments big_filter_cond [R idx op I]. Arguments congr_big [R idx op I r1] r2 [P1] P2 [F1] F2. Arguments eq_big [R idx op I r P1] P2 [F1] F2. Arguments eq_bigl [R idx op I r P1] P2. Arguments eq_bigr [R idx op I r P F1] F2. Arguments eq_big_idx [R idx op idx' I] i0 [P F]. Arguments big_seq_cond [R idx op I r]. Arguments eq_big_seq [R idx op I r F1] F2. Arguments congr_big_nat [R idx op m1 n1] m2 n2 [P1] P2 [F1] F2. Arguments big_map [R idx op I J] h [r]. Arguments big_nth [R idx op I] x0 [r]. Arguments big_catl [R idx op I r1 r2 P F]. Arguments big_catr [R idx op I r1 r2 P F]. Arguments big_geq [R idx op m n P F]. Arguments big_ltn_cond [R idx op m n P F]. Arguments big_ltn [R idx op m n F]. Arguments big_addn [R idx op]. Arguments big_mkord [R idx op n]. Arguments big_nat_widen [R idx op] . Arguments big_ord_widen_cond [R idx op n1]. Arguments big_ord_widen [R idx op n1]. Arguments big_ord_widen_leq [R idx op n1]. Arguments big_ord_narrow_cond [R idx op n1 n2 P F]. Arguments big_ord_narrow_cond_leq [R idx op n1 n2 P F]. Arguments big_ord_narrow [R idx op n1 n2 F]. Arguments big_ord_narrow_leq [R idx op n1 n2 F]. Arguments big_mkcond [R idx op I r]. Arguments big1_eq [R idx op I]. Arguments big1_seq [R idx op I]. Arguments big1 [R idx op I]. Arguments big_pred1 [R idx op I] i [P F]. Arguments eq_big_perm [R idx op I r1] r2 [P F]. Arguments big_uniq [R idx op I] r [F]. Arguments big_rem [R idx op I r] x [P F]. Arguments bigID [R idx op I r]. Arguments bigU [R idx op I]. Arguments bigD1 [R idx op I] j [P F]. Arguments bigD1_seq [R idx op I r] j [F]. Arguments partition_big [R idx op I J P] p Q [F]. Arguments reindex_onto [R idx op I J] h h' [P F]. Arguments reindex [R idx op I J] h [P F]. Arguments reindex_inj [R idx op I h P F]. Arguments pair_big_dep [R idx op I J]. Arguments pair_big [R idx op I J]. Arguments big_allpairs [R idx op I1 I2 r1 r2 F]. Arguments exchange_big_dep [R idx op I J rI rJ P Q] xQ [F]. Arguments exchange_big_dep_nat [R idx op m1 n1 m2 n2 P Q] xQ [F]. Arguments big_ord_recl [R idx op]. Arguments big_ord_recr [R idx op]. Arguments big_nat_recl [R idx op]. Arguments big_nat_recr [R idx op]. Section Distributivity. Import Monoid.Theory. Variable R : Type. Variables zero one : R. Local Notation "0" := zero. Local Notation "1" := one. Variable times : Monoid.mul_law 0. Local Notation "*%M" := times (at level 0). Local Notation "x * y" := (times x y). Variable plus : Monoid.add_law 0 *%M. Local Notation "+%M" := plus (at level 0). Local Notation "x + y" := (plus x y). Lemma big_distrl I r a (P : pred I) F : \big[+%M/0]_(i <- r | P i) F i * a = \big[+%M/0]_(i <- r | P i) (F i * a). Proof. (* Goal: @eq R (@Monoid.mul_operator R zero times (@BigOp.bigop R I zero r (fun i : I => @BigBody R I i (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (P i) (F i))) a) (@BigOp.bigop R I zero r (fun i : I => @BigBody R I i (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (P i) (@Monoid.mul_operator R zero times (F i) a))) *) by rewrite (big_endo ( *%M^~ a)) ?mul0m // => x y; apply: mulm_addl. Qed. Lemma big_distrr I r a (P : pred I) F : a * \big[+%M/0]_(i <- r | P i) F i = \big[+%M/0]_(i <- r | P i) (a * F i). Proof. (* Goal: @eq R (@Monoid.mul_operator R zero times a (@BigOp.bigop R I zero r (fun i : I => @BigBody R I i (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (P i) (F i)))) (@BigOp.bigop R I zero r (fun i : I => @BigBody R I i (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (P i) (@Monoid.mul_operator R zero times a (F i)))) *) by rewrite big_endo ?mulm0 // => x y; apply: mulm_addr. Qed. Lemma big_distrlr I J rI rJ (pI : pred I) (pJ : pred J) F G : (\big[+%M/0]_(i <- rI | pI i) F i) * (\big[+%M/0]_(j <- rJ | pJ j) G j) = \big[+%M/0]_(i <- rI | pI i) \big[+%M/0]_(j <- rJ | pJ j) (F i * G j). Proof. (* Goal: @eq R (@Monoid.mul_operator R zero times (@BigOp.bigop R I zero rI (fun i : I => @BigBody R I i (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (pI i) (F i))) (@BigOp.bigop R J zero rJ (fun j : J => @BigBody R J j (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (pJ j) (G j)))) (@BigOp.bigop R I zero rI (fun i : I => @BigBody R I i (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (pI i) (@BigOp.bigop R J zero rJ (fun j : J => @BigBody R J j (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (pJ j) (@Monoid.mul_operator R zero times (F i) (G j)))))) *) by rewrite big_distrl; apply: eq_bigr => i _; rewrite big_distrr. Qed. Lemma big_distr_big_dep (I J : finType) j0 (P : pred I) (Q : I -> pred J) F : \big[*%M/1]_(i | P i) \big[+%M/0]_(j | Q i j) F i j = \big[+%M/0]_(f in pfamily j0 P Q) \big[*%M/1]_(i | P i) F i (f i). Lemma big_distr_big (I J : finType) j0 (P : pred I) (Q : pred J) F : \big[*%M/1]_(i | P i) \big[+%M/0]_(j | Q j) F i j = \big[+%M/0]_(f in pffun_on j0 P Q) \big[*%M/1]_(i | P i) F i (f i). Proof. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) one (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) (P i) (@BigOp.bigop R (Finite.sort J) zero (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (Q j) (F i j))))) (@BigOp.bigop R (Finite.sort (finfun_of_finType I J)) zero (index_enum (finfun_of_finType I J)) (fun f : Finite.sort (finfun_of_finType I J) => @BigBody R (Finite.sort (finfun_of_finType I J)) f (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (@in_mem (Finite.sort (finfun_of_finType I J)) f (@mem (@finfun_of I (Equality.sort (Finite.eqType J)) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType J)))) (simplPredType (@finfun_of I (Equality.sort (Finite.eqType J)) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType J))))) (@pffun_on_mem I (Finite.eqType J) j0 (@mem (Finite.sort I) (predPredType (Finite.sort I)) P) (@mem (Finite.sort J) (predPredType (Finite.sort J)) Q)))) (@BigOp.bigop R (Finite.sort I) one (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) (P i) (F i (@FunFinfun.fun_of_fin I (Finite.sort J) f i)))))) *) rewrite (big_distr_big_dep j0); apply: eq_bigl => f. (* Goal: @eq bool (@in_mem (Finite.sort (finfun_of_finType I J)) f (@mem (@finfun_of I (Equality.sort (Finite.eqType J)) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType J)))) (simplPredType (@finfun_of I (Equality.sort (Finite.eqType J)) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType J))))) (@pfamily_mem I (Finite.eqType J) j0 (@mem (Finite.sort I) (predPredType (Finite.sort I)) P) (@fun_of_simpl (Finite.sort I) (mem_pred (Finite.sort J)) (@fmem (Finite.sort I) (Finite.sort J) (predPredType (Finite.sort J)) (fun (_ : Finite.sort I) (j : Finite.sort J) => Q j)))))) (@in_mem (Finite.sort (finfun_of_finType I J)) f (@mem (@finfun_of I (Equality.sort (Finite.eqType J)) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType J)))) (simplPredType (@finfun_of I (Equality.sort (Finite.eqType J)) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType J))))) (@pffun_on_mem I (Finite.eqType J) j0 (@mem (Finite.sort I) (predPredType (Finite.sort I)) P) (@mem (Finite.sort J) (predPredType (Finite.sort J)) Q)))) *) by apply/familyP/familyP=> Pf i; case: ifP (Pf i). Qed. Lemma bigA_distr_big_dep (I J : finType) (Q : I -> pred J) F : \big[*%M/1]_i \big[+%M/0]_(j | Q i j) F i j = \big[+%M/0]_(f in family Q) \big[*%M/1]_i F i (f i). Proof. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) one (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (@BigOp.bigop R (Finite.sort J) zero (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (Q i j) (F i j))))) (@BigOp.bigop R (Finite.sort (finfun_of_finType I J)) zero (index_enum (finfun_of_finType I J)) (fun f : Finite.sort (finfun_of_finType I J) => @BigBody R (Finite.sort (finfun_of_finType I J)) f (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (@in_mem (Finite.sort (finfun_of_finType I J)) f (@mem (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J))) (simplPredType (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J)))) (@family_mem I (Finite.sort J) (@fun_of_simpl (Finite.sort I) (mem_pred (Finite.sort J)) (@fmem (Finite.sort I) (Finite.sort J) (predPredType (Finite.sort J)) Q))))) (@BigOp.bigop R (Finite.sort I) one (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (F i (@FunFinfun.fun_of_fin I (Finite.sort J) f i)))))) *) case: (pickP J) => [j0 _ | J0]; first exact: (big_distr_big_dep j0). (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) one (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (@BigOp.bigop R (Finite.sort J) zero (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (Q i j) (F i j))))) (@BigOp.bigop R (Finite.sort (finfun_of_finType I J)) zero (index_enum (finfun_of_finType I J)) (fun f : Finite.sort (finfun_of_finType I J) => @BigBody R (Finite.sort (finfun_of_finType I J)) f (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (@in_mem (Finite.sort (finfun_of_finType I J)) f (@mem (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J))) (simplPredType (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J)))) (@family_mem I (Finite.sort J) (@fun_of_simpl (Finite.sort I) (mem_pred (Finite.sort J)) (@fmem (Finite.sort I) (Finite.sort J) (predPredType (Finite.sort J)) Q))))) (@BigOp.bigop R (Finite.sort I) one (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (F i (@FunFinfun.fun_of_fin I (Finite.sort J) f i)))))) *) rewrite {1 4}/index_enum -enumT; case: (enum I) (mem_enum I) => [I0 | i r _]. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) one (@cons (Finite.sort I) i r) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (@BigOp.bigop R (Finite.sort J) zero (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (Q i j) (F i j))))) (@BigOp.bigop R (Finite.sort (finfun_of_finType I J)) zero (index_enum (finfun_of_finType I J)) (fun f : Finite.sort (finfun_of_finType I J) => @BigBody R (Finite.sort (finfun_of_finType I J)) f (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (@in_mem (Finite.sort (finfun_of_finType I J)) f (@mem (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J))) (simplPredType (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J)))) (@family_mem I (Finite.sort J) (@fun_of_simpl (Finite.sort I) (mem_pred (Finite.sort J)) (@fmem (Finite.sort I) (Finite.sort J) (predPredType (Finite.sort J)) Q))))) (@BigOp.bigop R (Finite.sort I) one (@cons (Finite.sort I) i r) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (F i (@FunFinfun.fun_of_fin I (Finite.sort J) f i)))))) *) (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) one (@nil (Finite.sort I)) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (@BigOp.bigop R (Finite.sort J) zero (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (Q i j) (F i j))))) (@BigOp.bigop R (Finite.sort (finfun_of_finType I J)) zero (index_enum (finfun_of_finType I J)) (fun f : Finite.sort (finfun_of_finType I J) => @BigBody R (Finite.sort (finfun_of_finType I J)) f (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (@in_mem (Finite.sort (finfun_of_finType I J)) f (@mem (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J))) (simplPredType (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J)))) (@family_mem I (Finite.sort J) (@fun_of_simpl (Finite.sort I) (mem_pred (Finite.sort J)) (@fmem (Finite.sort I) (Finite.sort J) (predPredType (Finite.sort J)) Q))))) (@BigOp.bigop R (Finite.sort I) one (@nil (Finite.sort I)) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (F i (@FunFinfun.fun_of_fin I (Finite.sort J) f i)))))) *) have f0: I -> J by move=> i; have:= I0 i. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) one (@cons (Finite.sort I) i r) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (@BigOp.bigop R (Finite.sort J) zero (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (Q i j) (F i j))))) (@BigOp.bigop R (Finite.sort (finfun_of_finType I J)) zero (index_enum (finfun_of_finType I J)) (fun f : Finite.sort (finfun_of_finType I J) => @BigBody R (Finite.sort (finfun_of_finType I J)) f (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (@in_mem (Finite.sort (finfun_of_finType I J)) f (@mem (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J))) (simplPredType (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J)))) (@family_mem I (Finite.sort J) (@fun_of_simpl (Finite.sort I) (mem_pred (Finite.sort J)) (@fmem (Finite.sort I) (Finite.sort J) (predPredType (Finite.sort J)) Q))))) (@BigOp.bigop R (Finite.sort I) one (@cons (Finite.sort I) i r) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (F i (@FunFinfun.fun_of_fin I (Finite.sort J) f i)))))) *) (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) one (@nil (Finite.sort I)) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (@BigOp.bigop R (Finite.sort J) zero (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (Q i j) (F i j))))) (@BigOp.bigop R (Finite.sort (finfun_of_finType I J)) zero (index_enum (finfun_of_finType I J)) (fun f : Finite.sort (finfun_of_finType I J) => @BigBody R (Finite.sort (finfun_of_finType I J)) f (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (@in_mem (Finite.sort (finfun_of_finType I J)) f (@mem (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J))) (simplPredType (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J)))) (@family_mem I (Finite.sort J) (@fun_of_simpl (Finite.sort I) (mem_pred (Finite.sort J)) (@fmem (Finite.sort I) (Finite.sort J) (predPredType (Finite.sort J)) Q))))) (@BigOp.bigop R (Finite.sort I) one (@nil (Finite.sort I)) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (F i (@FunFinfun.fun_of_fin I (Finite.sort J) f i)))))) *) rewrite (big_pred1 (finfun f0)) ?big_nil // => g. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) one (@cons (Finite.sort I) i r) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (@BigOp.bigop R (Finite.sort J) zero (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (Q i j) (F i j))))) (@BigOp.bigop R (Finite.sort (finfun_of_finType I J)) zero (index_enum (finfun_of_finType I J)) (fun f : Finite.sort (finfun_of_finType I J) => @BigBody R (Finite.sort (finfun_of_finType I J)) f (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (@in_mem (Finite.sort (finfun_of_finType I J)) f (@mem (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J))) (simplPredType (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J)))) (@family_mem I (Finite.sort J) (@fun_of_simpl (Finite.sort I) (mem_pred (Finite.sort J)) (@fmem (Finite.sort I) (Finite.sort J) (predPredType (Finite.sort J)) Q))))) (@BigOp.bigop R (Finite.sort I) one (@cons (Finite.sort I) i r) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (F i (@FunFinfun.fun_of_fin I (Finite.sort J) f i)))))) *) (* Goal: @eq bool (@in_mem (Finite.sort (finfun_of_finType I J)) g (@mem (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J))) (simplPredType (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J)))) (@family_mem I (Finite.sort J) (@fun_of_simpl (Finite.sort I) (mem_pred (Finite.sort J)) (@fmem (Finite.sort I) (Finite.sort J) (predPredType (Finite.sort J)) Q))))) (@pred_of_simpl (Equality.sort (Finite.eqType (finfun_of_finType I J))) (@pred1 (Finite.eqType (finfun_of_finType I J)) (@FunFinfun.finfun I (Finite.sort J) f0)) g) *) by apply/familyP/eqP=> _; first apply/ffunP; move => i; have:= I0 i. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) one (@cons (Finite.sort I) i r) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (@BigOp.bigop R (Finite.sort J) zero (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (Q i j) (F i j))))) (@BigOp.bigop R (Finite.sort (finfun_of_finType I J)) zero (index_enum (finfun_of_finType I J)) (fun f : Finite.sort (finfun_of_finType I J) => @BigBody R (Finite.sort (finfun_of_finType I J)) f (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (@in_mem (Finite.sort (finfun_of_finType I J)) f (@mem (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J))) (simplPredType (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J)))) (@family_mem I (Finite.sort J) (@fun_of_simpl (Finite.sort I) (mem_pred (Finite.sort J)) (@fmem (Finite.sort I) (Finite.sort J) (predPredType (Finite.sort J)) Q))))) (@BigOp.bigop R (Finite.sort I) one (@cons (Finite.sort I) i r) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (F i (@FunFinfun.fun_of_fin I (Finite.sort J) f i)))))) *) have Q0 i': Q i' =1 pred0 by move=> j; have:= J0 j. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) one (@cons (Finite.sort I) i r) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (@BigOp.bigop R (Finite.sort J) zero (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (Q i j) (F i j))))) (@BigOp.bigop R (Finite.sort (finfun_of_finType I J)) zero (index_enum (finfun_of_finType I J)) (fun f : Finite.sort (finfun_of_finType I J) => @BigBody R (Finite.sort (finfun_of_finType I J)) f (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (@in_mem (Finite.sort (finfun_of_finType I J)) f (@mem (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J))) (simplPredType (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J)))) (@family_mem I (Finite.sort J) (@fun_of_simpl (Finite.sort I) (mem_pred (Finite.sort J)) (@fmem (Finite.sort I) (Finite.sort J) (predPredType (Finite.sort J)) Q))))) (@BigOp.bigop R (Finite.sort I) one (@cons (Finite.sort I) i r) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (F i (@FunFinfun.fun_of_fin I (Finite.sort J) f i)))))) *) rewrite big_cons /= big_pred0 // mul0m big_pred0 // => f. (* Goal: @eq bool (@in_mem (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J))) f (@mem (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J))) (simplPredType (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J)))) (@family_mem I (Finite.sort J) (@fun_of_simpl (Finite.sort I) (mem_pred (Finite.sort J)) (@fmem (Finite.sort I) (Finite.sort J) (predPredType (Finite.sort J)) Q))))) false *) by apply/familyP=> /(_ i); rewrite [_ \in _]Q0. Qed. Lemma bigA_distr_big (I J : finType) (Q : pred J) (F : I -> J -> R) : \big[*%M/1]_i \big[+%M/0]_(j | Q j) F i j = \big[+%M/0]_(f in ffun_on Q) \big[*%M/1]_i F i (f i). Proof. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) one (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (@BigOp.bigop R (Finite.sort J) zero (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (Q j) (F i j))))) (@BigOp.bigop R (Finite.sort (finfun_of_finType I J)) zero (index_enum (finfun_of_finType I J)) (fun f : Finite.sort (finfun_of_finType I J) => @BigBody R (Finite.sort (finfun_of_finType I J)) f (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) (@in_mem (Finite.sort (finfun_of_finType I J)) f (@mem (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J))) (simplPredType (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J)))) (@ffun_on_mem I (Finite.sort J) (@mem (Finite.sort J) (predPredType (Finite.sort J)) Q)))) (@BigOp.bigop R (Finite.sort I) one (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (F i (@FunFinfun.fun_of_fin I (Finite.sort J) f i)))))) *) exact: bigA_distr_big_dep. Qed. Lemma bigA_distr_bigA (I J : finType) F : \big[*%M/1]_(i : I) \big[+%M/0]_(j : J) F i j = \big[+%M/0]_(f : {ffun I -> J}) \big[*%M/1]_i F i (f i). Proof. (* Goal: @eq R (@BigOp.bigop R (Finite.sort I) one (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (@BigOp.bigop R (Finite.sort J) zero (index_enum J) (fun j : Finite.sort J => @BigBody R (Finite.sort J) j (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) true (F i j))))) (@BigOp.bigop R (Finite.sort (finfun_of_finType I J)) zero (index_enum (finfun_of_finType I J)) (fun f : @finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J)) => @BigBody R (@finfun_of I (Finite.sort J) (Phant (forall _ : Finite.sort I, Finite.sort J))) f (@Monoid.operator R zero (@Monoid.com_operator R zero (@Monoid.add_operator R zero (@Monoid.mul_operator R zero times) plus))) true (@BigOp.bigop R (Finite.sort I) one (index_enum I) (fun i : Finite.sort I => @BigBody R (Finite.sort I) i (@Monoid.mul_operator R zero times) true (F i (@FunFinfun.fun_of_fin I (Finite.sort J) f i)))))) *) by rewrite bigA_distr_big; apply: eq_bigl => ?; apply/familyP. Qed. End Distributivity. Arguments big_distrl [R zero times plus I r]. Arguments big_distrr [R zero times plus I r]. Arguments big_distr_big_dep [R zero one times plus I J]. Arguments big_distr_big [R zero one times plus I J]. Arguments bigA_distr_big_dep [R zero one times plus I J]. Arguments bigA_distr_big [R zero one times plus I J]. Arguments bigA_distr_bigA [R zero one times plus I J]. Section BigBool. Section Seq. Variables (I : Type) (r : seq I) (P B : pred I). Lemma big_has : \big[orb/false]_(i <- r) B i = has B r. Proof. (* Goal: @eq bool (@BigOp.bigop bool I false r (fun i : I => @BigBody bool I i orb true (B i))) (@has I B r) *) by rewrite unlock. Qed. Lemma big_all : \big[andb/true]_(i <- r) B i = all B r. Proof. (* Goal: @eq bool (@BigOp.bigop bool I true r (fun i : I => @BigBody bool I i andb true (B i))) (@all I B r) *) by rewrite unlock. Qed. Lemma big_has_cond : \big[orb/false]_(i <- r | P i) B i = has (predI P B) r. Proof. (* Goal: @eq bool (@BigOp.bigop bool I false r (fun i : I => @BigBody bool I i orb (P i) (B i))) (@has I (@pred_of_simpl I (@predI I P B)) r) *) by rewrite big_mkcond unlock. Qed. Lemma big_all_cond : \big[andb/true]_(i <- r | P i) B i = all [pred i | P i ==> B i] r. Proof. (* Goal: @eq bool (@BigOp.bigop bool I true r (fun i : I => @BigBody bool I i andb (P i) (B i))) (@all I (@pred_of_simpl I (@SimplPred I (fun i : I => implb (P i) (B i)))) r) *) by rewrite big_mkcond unlock. Qed. End Seq. Section FinType. Variables (I : finType) (P B : pred I). Lemma big_orE : \big[orb/false]_(i | P i) B i = [exists (i | P i), B i]. Proof. (* Goal: @eq bool (@BigOp.bigop bool (Finite.sort I) false (index_enum I) (fun i : Finite.sort I => @BigBody bool (Finite.sort I) i orb (P i) (B i))) (negb (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.ex_in I (P i) (FiniteQuant.Quantified (B i)) i))) *) by rewrite big_has_cond; apply/hasP/existsP=> [] [i]; exists i. Qed. Lemma big_andE : \big[andb/true]_(i | P i) B i = [forall (i | P i), B i]. Proof. (* Goal: @eq bool (@BigOp.bigop bool (Finite.sort I) true (index_enum I) (fun i : Finite.sort I => @BigBody bool (Finite.sort I) i andb (P i) (B i))) (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.all_in I (P i) (FiniteQuant.Quantified (B i)) i)) *) rewrite big_all_cond; apply/allP/forallP=> /= allB i; rewrite allB //. (* Goal: is_true (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (seq_predType (Finite.eqType I)) (index_enum I))) *) exact: mem_index_enum. Qed. End FinType. End BigBool. Section NatConst. Variables (I : finType) (A : pred I). Lemma sum_nat_const n : \sum_(i in A) n = #|A| * n. Proof. (* Goal: @eq nat (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i addn (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) n)) (muln (@card I (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) n) *) by rewrite big_const iter_addn_0 mulnC. Qed. Lemma sum1_card : \sum_(i in A) 1 = #|A|. Proof. (* Goal: @eq nat (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i addn (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (S O))) (@card I (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) *) by rewrite sum_nat_const muln1. Qed. Lemma sum1_count J (r : seq J) (a : pred J) : \sum_(j <- r | a j) 1 = count a r. Proof. (* Goal: @eq nat (@BigOp.bigop nat J O r (fun j : J => @BigBody nat J j addn (a j) (S O))) (@count J a r) *) by rewrite big_const_seq iter_addn_0 mul1n. Qed. Lemma sum1_size J (r : seq J) : \sum_(j <- r) 1 = size r. Proof. (* Goal: @eq nat (@BigOp.bigop nat J O r (fun j : J => @BigBody nat J j addn true (S O))) (@size J r) *) by rewrite sum1_count count_predT. Qed. Lemma prod_nat_const n : \prod_(i in A) n = n ^ #|A|. Proof. (* Goal: @eq nat (@BigOp.bigop nat (Finite.sort I) (S O) (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i muln (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) n)) (expn n (@card I (@mem (Finite.sort I) (predPredType (Finite.sort I)) A))) *) by rewrite big_const -Monoid.iteropE. Qed. Lemma sum_nat_const_nat n1 n2 n : \sum_(n1 <= i < n2) n = (n2 - n1) * n. Proof. (* Goal: @eq nat (@BigOp.bigop nat nat O (index_iota n1 n2) (fun i : nat => @BigBody nat nat i addn true n)) (muln (subn n2 n1) n) *) by rewrite big_const_nat; elim: (_ - _) => //= ? ->. Qed. Lemma prod_nat_const_nat n1 n2 n : \prod_(n1 <= i < n2) n = n ^ (n2 - n1). Proof. (* Goal: @eq nat (@BigOp.bigop nat nat (S O) (index_iota n1 n2) (fun i : nat => @BigBody nat nat i muln true n)) (expn n (subn n2 n1)) *) by rewrite big_const_nat -Monoid.iteropE. Qed. End NatConst. Lemma leqif_sum (I : finType) (P C : pred I) (E1 E2 : I -> nat) : (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)), leqif (E1 i) (E2 i) (C i), leqif (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i addn (P i) (E1 i))) (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i addn (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: leqif (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i addn (P i) (E1 i))) (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i addn (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))) *) by elim/big_rec3: _ => // i Ci m1 m2 /leE12; apply: leqif_add. Qed. Lemma leq_sum I r (P : pred I) (E1 E2 : I -> nat) : (forall i, P i -> E1 i <= E2 i) -> \sum_(i <- r | P i) E1 i <= \sum_(i <- r | P i) E2 i. Proof. (* Goal: forall _ : forall (i : I) (_ : is_true (P i)), is_true (leq (E1 i) (E2 i)), is_true (leq (@BigOp.bigop nat I O r (fun i : I => @BigBody nat I i addn (P i) (E1 i))) (@BigOp.bigop nat I O r (fun i : I => @BigBody nat I i addn (P i) (E2 i)))) *) by move=> leE12; elim/big_ind2: _ => // m1 m2 n1 n2; apply: leq_add. Qed. Lemma sum_nat_eq0 (I : finType) (P : pred I) (E : I -> nat) : (\sum_(i | P i) E i == 0)%N = [forall (i | P i), E i == 0%N]. Proof. (* Goal: @eq bool (@eq_op nat_eqType (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i addn (P i) (E i))) O) (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.all_in I (P i) (FiniteQuant.Quantified (@eq_op nat_eqType (E i) O)) i)) *) by rewrite eq_sym -(@leqif_sum I P _ (fun _ => 0%N) E) ?big1_eq. Qed. Lemma prodn_cond_gt0 I r (P : pred I) F : (forall i, P i -> 0 < F i) -> 0 < \prod_(i <- r | P i) F i. Proof. (* Goal: forall _ : forall (i : I) (_ : is_true (P i)), is_true (leq (S O) (F i)), is_true (leq (S O) (@BigOp.bigop nat I (S O) r (fun i : I => @BigBody nat I i muln (P i) (F i)))) *) by move=> Fpos; elim/big_ind: _ => // n1 n2; rewrite muln_gt0 => ->. Qed. Lemma prodn_gt0 I r (P : pred I) F : (forall i, 0 < F i) -> 0 < \prod_(i <- r | P i) F i. Proof. (* Goal: forall _ : forall i : I, is_true (leq (S O) (F i)), is_true (leq (S O) (@BigOp.bigop nat I (S O) r (fun i : I => @BigBody nat I i muln (P i) (F i)))) *) by move=> Fpos; apply: prodn_cond_gt0. Qed. Lemma leq_bigmax_cond (I : finType) (P : pred I) F i0 : P i0 -> F i0 <= \max_(i | P i) F i. Proof. (* Goal: forall _ : is_true (P i0), is_true (leq (F i0) (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i maxn (P i) (F i)))) *) by move=> Pi0; rewrite (bigD1 i0) ?leq_maxl. Qed. Arguments leq_bigmax_cond [I P F]. Lemma leq_bigmax (I : finType) F (i0 : I) : F i0 <= \max_i F i. Proof. (* Goal: is_true (leq (F i0) (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i maxn true (F i)))) *) exact: leq_bigmax_cond. Qed. Arguments leq_bigmax [I F]. Lemma bigmax_leqP (I : finType) (P : pred I) m F : reflect (forall i, P i -> F i <= m) (\max_(i | P i) F i <= m). Proof. (* Goal: Bool.reflect (forall (i : Finite.sort I) (_ : is_true (P i)), is_true (leq (F i) m)) (leq (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i maxn (P i) (F i))) m) *) apply: (iffP idP) => leFm => [i Pi|]. (* Goal: is_true (leq (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i maxn (P i) (F i))) m) *) (* Goal: is_true (leq (F i) m) *) by apply: leq_trans leFm; apply: leq_bigmax_cond. (* Goal: is_true (leq (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i maxn (P i) (F i))) m) *) by elim/big_ind: _ => // m1 m2; rewrite geq_max => ->. Qed. Lemma bigmax_sup (I : finType) i0 (P : pred I) m F : P i0 -> m <= F i0 -> m <= \max_(i | P i) F i. Proof. (* Goal: forall (_ : is_true (P i0)) (_ : is_true (leq m (F i0))), is_true (leq m (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i maxn (P i) (F i)))) *) by move=> Pi0 le_m_Fi0; apply: leq_trans (leq_bigmax_cond i0 Pi0). Qed. Arguments bigmax_sup [I] i0 [P m F]. Lemma bigmax_eq_arg (I : finType) i0 (P : pred I) F : P i0 -> \max_(i | P i) F i = F [arg max_(i > i0 | P i) F i]. Proof. (* Goal: forall _ : is_true (P i0), @eq nat (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i maxn (P i) (F i))) (F (@arg_max I i0 (fun i : Finite.sort I => P i) (fun i : Finite.sort I => F i))) *) move=> Pi0; case: arg_maxP => //= i Pi maxFi. (* Goal: @eq nat (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i maxn (P i) (F i))) (F i) *) by apply/eqP; rewrite eqn_leq leq_bigmax_cond // andbT; apply/bigmax_leqP. Qed. Arguments bigmax_eq_arg [I] i0 [P F]. Lemma eq_bigmax_cond (I : finType) (A : pred I) F : #|A| > 0 -> {i0 | i0 \in A & \max_(i in A) F i = F i0}. Proof. (* Goal: forall _ : is_true (leq (S O) (@card I (@mem (Finite.sort I) (predPredType (Finite.sort I)) A))), @sig2 (Finite.sort I) (fun i0 : Finite.sort I => is_true (@in_mem (Finite.sort I) i0 (@mem (Finite.sort I) (predPredType (Finite.sort I)) A))) (fun i0 : Finite.sort I => @eq nat (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i maxn (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (F i))) (F i0)) *) case: (pickP A) => [i0 Ai0 _ | ]; last by move/eq_card0->. (* Goal: @sig2 (Finite.sort I) (fun i0 : Finite.sort I => is_true (@in_mem (Finite.sort I) i0 (@mem (Finite.sort I) (predPredType (Finite.sort I)) A))) (fun i0 : Finite.sort I => @eq nat (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i maxn (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (F i))) (F i0)) *) by exists [arg max_(i > i0 in A) F i]; [case: arg_maxP | apply: bigmax_eq_arg]. Qed. Lemma eq_bigmax (I : finType) F : #|I| > 0 -> {i0 : I | \max_i F i = F i0}. Proof. (* Goal: forall _ : is_true (leq (S O) (@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))))))), @sig (Finite.sort I) (fun i0 : Finite.sort I => @eq nat (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i maxn true (F i))) (F i0)) *) by case/(eq_bigmax_cond F) => x _ ->; exists x. Qed. Lemma expn_sum m I r (P : pred I) F : (m ^ (\sum_(i <- r | P i) F i) = \prod_(i <- r | P i) m ^ F i)%N. Proof. (* Goal: @eq nat (expn m (@BigOp.bigop nat I O r (fun i : I => @BigBody nat I i addn (P i) (F i)))) (@BigOp.bigop nat I (S O) r (fun i : I => @BigBody nat I i muln (P i) (expn m (F i)))) *) exact: (big_morph _ (expnD m)). Qed. Lemma dvdn_biglcmP (I : finType) (P : pred I) F m : reflect (forall i, P i -> F i %| m) (\big[lcmn/1%N]_(i | P i) F i %| m). Proof. (* Goal: Bool.reflect (forall (i : Finite.sort I) (_ : is_true (P i)), is_true (dvdn (F i) m)) (dvdn (@BigOp.bigop nat (Finite.sort I) (S O) (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i lcmn (P i) (F i))) m) *) apply: (iffP idP) => [dvFm i Pi | dvFm]. (* Goal: is_true (dvdn (@BigOp.bigop nat (Finite.sort I) (S O) (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i lcmn (P i) (F i))) m) *) (* Goal: is_true (dvdn (F i) m) *) by rewrite (bigD1 i) // dvdn_lcm in dvFm; case/andP: dvFm. (* Goal: is_true (dvdn (@BigOp.bigop nat (Finite.sort I) (S O) (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i lcmn (P i) (F i))) m) *) by elim/big_ind: _ => // p q p_m; rewrite dvdn_lcm p_m. Qed. Lemma biglcmn_sup (I : finType) i0 (P : pred I) F m : P i0 -> m %| F i0 -> m %| \big[lcmn/1%N]_(i | P i) F i. Proof. (* Goal: forall (_ : is_true (P i0)) (_ : is_true (dvdn m (F i0))), is_true (dvdn m (@BigOp.bigop nat (Finite.sort I) (S O) (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i lcmn (P i) (F i)))) *) by move=> Pi0 m_Fi0; rewrite (dvdn_trans m_Fi0) // (bigD1 i0) ?dvdn_lcml. Qed. Arguments biglcmn_sup [I] i0 [P F m]. Lemma dvdn_biggcdP (I : finType) (P : pred I) F m : reflect (forall i, P i -> m %| F i) (m %| \big[gcdn/0]_(i | P i) F i). Proof. (* Goal: Bool.reflect (forall (i : Finite.sort I) (_ : is_true (P i)), is_true (dvdn m (F i))) (dvdn m (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i gcdn (P i) (F i)))) *) apply: (iffP idP) => [dvmF i Pi | dvmF]. (* Goal: is_true (dvdn m (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i gcdn (P i) (F i)))) *) (* Goal: is_true (dvdn m (F i)) *) by rewrite (bigD1 i) // dvdn_gcd in dvmF; case/andP: dvmF. (* Goal: is_true (dvdn m (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i gcdn (P i) (F i)))) *) by elim/big_ind: _ => // p q m_p; rewrite dvdn_gcd m_p. Qed. Lemma biggcdn_inf (I : finType) i0 (P : pred I) F m : P i0 -> F i0 %| m -> \big[gcdn/0]_(i | P i) F i %| m. Proof. (* Goal: forall (_ : is_true (P i0)) (_ : is_true (dvdn (F i0) m)), is_true (dvdn (@BigOp.bigop nat (Finite.sort I) O (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i gcdn (P i) (F i))) m) *) by move=> Pi0; apply: dvdn_trans; rewrite (bigD1 i0) ?dvdn_gcdl. Qed. Arguments biggcdn_inf [I] i0 [P F m]. Unset Implicit Arguments.
Require Import Arith. Require Import Terms. Require Import Reduction. Require Import Redexes. Require Import Test. Require Import Marks. Require Import Substitution. Require Import Residuals. Lemma mark_lift_rec : forall (M : lambda) (n k : nat), lift_rec_r (mark M) k n = mark (lift_rec M k n). Proof. (* Goal: forall (M : lambda) (n k : nat), @eq redexes (lift_rec_r (mark M) k n) (mark (lift_rec M k n)) *) simple induction M; simpl in |- *; intros. (* Goal: @eq redexes (Ap false (lift_rec_r (mark l) k n) (lift_rec_r (mark l0) k n)) (Ap false (mark (lift_rec l k n)) (mark (lift_rec l0 k n))) *) (* Goal: @eq redexes (Fun (lift_rec_r (mark l) (S k) n)) (Fun (mark (lift_rec l (S k) n))) *) (* Goal: @eq redexes (Var (relocate n k n0)) (Var (relocate n k n0)) *) elim (test k n); simpl in |- *; intros; trivial. (* Goal: @eq redexes (Ap false (lift_rec_r (mark l) k n) (lift_rec_r (mark l0) k n)) (Ap false (mark (lift_rec l k n)) (mark (lift_rec l0 k n))) *) (* Goal: @eq redexes (Fun (lift_rec_r (mark l) (S k) n)) (Fun (mark (lift_rec l (S k) n))) *) elim H; trivial. (* Goal: @eq redexes (Ap false (lift_rec_r (mark l) k n) (lift_rec_r (mark l0) k n)) (Ap false (mark (lift_rec l k n)) (mark (lift_rec l0 k n))) *) elim H; elim H0; trivial. Qed. Lemma mark_lift : forall (M : lambda) (n : nat), lift_r n (mark M) = mark (lift n M). Proof. (* Goal: forall (M : lambda) (n : nat), @eq redexes (lift_r n (mark M)) (mark (lift n M)) *) unfold lift in |- *; unfold lift_r in |- *; intros; apply mark_lift_rec. Qed. Lemma mark_subst_rec : forall (N M : lambda) (n : nat), subst_rec_r (mark M) (mark N) n = mark (subst_rec M N n). Proof. (* Goal: forall (N M : lambda) (n : nat), @eq redexes (subst_rec_r (mark M) (mark N) n) (mark (subst_rec M N n)) *) simple induction M; simpl in |- *; intros. (* Goal: @eq redexes (Ap false (subst_rec_r (mark l) (mark N) n) (subst_rec_r (mark l0) (mark N) n)) (Ap false (mark (subst_rec l N n)) (mark (subst_rec l0 N n))) *) (* Goal: @eq redexes (Fun (subst_rec_r (mark l) (mark N) (S n))) (Fun (mark (subst_rec l N (S n)))) *) (* Goal: @eq redexes (insert_Var (mark N) n n0) (mark (insert_Ref N n n0)) *) unfold insert_Var, insert_Ref in |- *. (* Goal: @eq redexes (Ap false (subst_rec_r (mark l) (mark N) n) (subst_rec_r (mark l0) (mark N) n)) (Ap false (mark (subst_rec l N n)) (mark (subst_rec l0 N n))) *) (* Goal: @eq redexes (Fun (subst_rec_r (mark l) (mark N) (S n))) (Fun (mark (subst_rec l N (S n)))) *) (* Goal: @eq redexes match compare n0 n with | inleft (left l as s) => Var (Init.Nat.pred n) | inleft (right e as s) => lift_r n0 (mark N) | inright g => Var n end (mark match compare n0 n with | inleft (left l as s) => Ref (Init.Nat.pred n) | inleft (right e as s) => lift n0 N | inright g => Ref n end) *) elim (compare n0 n); intro H. (* Goal: @eq redexes (Ap false (subst_rec_r (mark l) (mark N) n) (subst_rec_r (mark l0) (mark N) n)) (Ap false (mark (subst_rec l N n)) (mark (subst_rec l0 N n))) *) (* Goal: @eq redexes (Fun (subst_rec_r (mark l) (mark N) (S n))) (Fun (mark (subst_rec l N (S n)))) *) (* Goal: @eq redexes (Var n) (mark (Ref n)) *) (* Goal: @eq redexes (if H then Var (Init.Nat.pred n) else lift_r n0 (mark N)) (mark (if H then Ref (Init.Nat.pred n) else lift n0 N)) *) elim H; intro H'. (* Goal: @eq redexes (Ap false (subst_rec_r (mark l) (mark N) n) (subst_rec_r (mark l0) (mark N) n)) (Ap false (mark (subst_rec l N n)) (mark (subst_rec l0 N n))) *) (* Goal: @eq redexes (Fun (subst_rec_r (mark l) (mark N) (S n))) (Fun (mark (subst_rec l N (S n)))) *) (* Goal: @eq redexes (Var n) (mark (Ref n)) *) (* Goal: @eq redexes (lift_r n0 (mark N)) (mark (lift n0 N)) *) (* Goal: @eq redexes (Var (Init.Nat.pred n)) (mark (Ref (Init.Nat.pred n))) *) simpl in |- *; trivial. (* Goal: @eq redexes (Ap false (subst_rec_r (mark l) (mark N) n) (subst_rec_r (mark l0) (mark N) n)) (Ap false (mark (subst_rec l N n)) (mark (subst_rec l0 N n))) *) (* Goal: @eq redexes (Fun (subst_rec_r (mark l) (mark N) (S n))) (Fun (mark (subst_rec l N (S n)))) *) (* Goal: @eq redexes (Var n) (mark (Ref n)) *) (* Goal: @eq redexes (lift_r n0 (mark N)) (mark (lift n0 N)) *) rewrite (mark_lift N n0); trivial. (* Goal: @eq redexes (Ap false (subst_rec_r (mark l) (mark N) n) (subst_rec_r (mark l0) (mark N) n)) (Ap false (mark (subst_rec l N n)) (mark (subst_rec l0 N n))) *) (* Goal: @eq redexes (Fun (subst_rec_r (mark l) (mark N) (S n))) (Fun (mark (subst_rec l N (S n)))) *) (* Goal: @eq redexes (Var n) (mark (Ref n)) *) simpl in |- *; trivial. (* Goal: @eq redexes (Ap false (subst_rec_r (mark l) (mark N) n) (subst_rec_r (mark l0) (mark N) n)) (Ap false (mark (subst_rec l N n)) (mark (subst_rec l0 N n))) *) (* Goal: @eq redexes (Fun (subst_rec_r (mark l) (mark N) (S n))) (Fun (mark (subst_rec l N (S n)))) *) elim H; trivial. (* Goal: @eq redexes (Ap false (subst_rec_r (mark l) (mark N) n) (subst_rec_r (mark l0) (mark N) n)) (Ap false (mark (subst_rec l N n)) (mark (subst_rec l0 N n))) *) elim H; elim H0; trivial. Qed. Lemma mark_subst : forall M N : lambda, subst_r (mark M) (mark N) = mark (subst M N). Proof. (* Goal: forall M N : lambda, @eq redexes (subst_r (mark M) (mark N)) (mark (subst M N)) *) unfold subst in |- *; unfold subst_r in |- *; intros; apply mark_subst_rec. Qed. Lemma simulation : forall M M' : lambda, par_red1 M M' -> exists V : redexes, residuals (mark M) V (mark M'). Proof. (* Goal: forall (M M' : lambda) (_ : par_red1 M M'), @ex redexes (fun V : redexes => residuals (mark M) V (mark M')) *) simple induction 1; simpl in |- *; intros. (* Goal: @ex redexes (fun V : redexes => residuals (Ap false (mark M0) (mark N)) V (Ap false (mark M'0) (mark N'))) *) (* Goal: @ex redexes (fun V : redexes => residuals (Fun (mark M0)) V (Fun (mark M'0))) *) (* Goal: @ex redexes (fun V : redexes => residuals (Var n) V (Var n)) *) (* Goal: @ex redexes (fun V : redexes => residuals (Ap false (Fun (mark M0)) (mark N)) V (mark (subst N' M'0))) *) elim H1; intros V1 P1. (* Goal: @ex redexes (fun V : redexes => residuals (Ap false (mark M0) (mark N)) V (Ap false (mark M'0) (mark N'))) *) (* Goal: @ex redexes (fun V : redexes => residuals (Fun (mark M0)) V (Fun (mark M'0))) *) (* Goal: @ex redexes (fun V : redexes => residuals (Var n) V (Var n)) *) (* Goal: @ex redexes (fun V : redexes => residuals (Ap false (Fun (mark M0)) (mark N)) V (mark (subst N' M'0))) *) elim H3; intros V2 P2. (* Goal: @ex redexes (fun V : redexes => residuals (Ap false (mark M0) (mark N)) V (Ap false (mark M'0) (mark N'))) *) (* Goal: @ex redexes (fun V : redexes => residuals (Fun (mark M0)) V (Fun (mark M'0))) *) (* Goal: @ex redexes (fun V : redexes => residuals (Var n) V (Var n)) *) (* Goal: @ex redexes (fun V : redexes => residuals (Ap false (Fun (mark M0)) (mark N)) V (mark (subst N' M'0))) *) exists (Ap true (Fun V1) V2). (* Goal: @ex redexes (fun V : redexes => residuals (Ap false (mark M0) (mark N)) V (Ap false (mark M'0) (mark N'))) *) (* Goal: @ex redexes (fun V : redexes => residuals (Fun (mark M0)) V (Fun (mark M'0))) *) (* Goal: @ex redexes (fun V : redexes => residuals (Var n) V (Var n)) *) (* Goal: residuals (Ap false (Fun (mark M0)) (mark N)) (Ap true (Fun V1) V2) (mark (subst N' M'0)) *) elim mark_subst; auto. (* Goal: @ex redexes (fun V : redexes => residuals (Ap false (mark M0) (mark N)) V (Ap false (mark M'0) (mark N'))) *) (* Goal: @ex redexes (fun V : redexes => residuals (Fun (mark M0)) V (Fun (mark M'0))) *) (* Goal: @ex redexes (fun V : redexes => residuals (Var n) V (Var n)) *) exists (Var n); trivial. (* Goal: @ex redexes (fun V : redexes => residuals (Ap false (mark M0) (mark N)) V (Ap false (mark M'0) (mark N'))) *) (* Goal: @ex redexes (fun V : redexes => residuals (Fun (mark M0)) V (Fun (mark M'0))) *) elim H1; intros V1 P1. (* Goal: @ex redexes (fun V : redexes => residuals (Ap false (mark M0) (mark N)) V (Ap false (mark M'0) (mark N'))) *) (* Goal: @ex redexes (fun V : redexes => residuals (Fun (mark M0)) V (Fun (mark M'0))) *) exists (Fun V1); auto. (* Goal: @ex redexes (fun V : redexes => residuals (Ap false (mark M0) (mark N)) V (Ap false (mark M'0) (mark N'))) *) elim H1; intros V1 P1. (* Goal: @ex redexes (fun V : redexes => residuals (Ap false (mark M0) (mark N)) V (Ap false (mark M'0) (mark N'))) *) elim H3; intros V2 P2. (* Goal: @ex redexes (fun V : redexes => residuals (Ap false (mark M0) (mark N)) V (Ap false (mark M'0) (mark N'))) *) exists (Ap false V1 V2); auto. Qed. Lemma unmark_lift_rec : forall (U : redexes) (n k : nat), lift_rec (unmark U) k n = unmark (lift_rec_r U k n). Proof. (* Goal: forall (U : redexes) (n k : nat), @eq lambda (lift_rec (unmark U) k n) (unmark (lift_rec_r U k n)) *) simple induction U; simpl in |- *; intros. (* Goal: @eq lambda (App (lift_rec (unmark r) k n) (lift_rec (unmark r0) k n)) (App (unmark (lift_rec_r r k n)) (unmark (lift_rec_r r0 k n))) *) (* Goal: @eq lambda (Abs (lift_rec (unmark r) (S k) n)) (Abs (unmark (lift_rec_r r (S k) n))) *) (* Goal: @eq lambda (Ref (relocate n k n0)) (Ref (relocate n k n0)) *) elim (test k n); trivial. (* Goal: @eq lambda (App (lift_rec (unmark r) k n) (lift_rec (unmark r0) k n)) (App (unmark (lift_rec_r r k n)) (unmark (lift_rec_r r0 k n))) *) (* Goal: @eq lambda (Abs (lift_rec (unmark r) (S k) n)) (Abs (unmark (lift_rec_r r (S k) n))) *) elim H; trivial. (* Goal: @eq lambda (App (lift_rec (unmark r) k n) (lift_rec (unmark r0) k n)) (App (unmark (lift_rec_r r k n)) (unmark (lift_rec_r r0 k n))) *) elim H; elim H0; trivial. Qed. Lemma unmark_lift : forall (U : redexes) (n : nat), lift n (unmark U) = unmark (lift_r n U). Proof. (* Goal: forall (U : redexes) (n : nat), @eq lambda (lift n (unmark U)) (unmark (lift_r n U)) *) unfold lift in |- *; unfold lift_r in |- *; intros; apply unmark_lift_rec. Qed. Lemma unmark_subst_rec : forall (V U : redexes) (n : nat), subst_rec (unmark U) (unmark V) n = unmark (subst_rec_r U V n). Proof. (* Goal: forall (V U : redexes) (n : nat), @eq lambda (subst_rec (unmark U) (unmark V) n) (unmark (subst_rec_r U V n)) *) simple induction U; simpl in |- *; intros. (* Goal: @eq lambda (App (subst_rec (unmark r) (unmark V) n) (subst_rec (unmark r0) (unmark V) n)) (App (unmark (subst_rec_r r V n)) (unmark (subst_rec_r r0 V n))) *) (* Goal: @eq lambda (Abs (subst_rec (unmark r) (unmark V) (S n))) (Abs (unmark (subst_rec_r r V (S n)))) *) (* Goal: @eq lambda (insert_Ref (unmark V) n n0) (unmark (insert_Var V n n0)) *) unfold insert_Var, insert_Ref in |- *. (* Goal: @eq lambda (App (subst_rec (unmark r) (unmark V) n) (subst_rec (unmark r0) (unmark V) n)) (App (unmark (subst_rec_r r V n)) (unmark (subst_rec_r r0 V n))) *) (* Goal: @eq lambda (Abs (subst_rec (unmark r) (unmark V) (S n))) (Abs (unmark (subst_rec_r r V (S n)))) *) (* Goal: @eq lambda match compare n0 n with | inleft (left l as s) => Ref (Init.Nat.pred n) | inleft (right e as s) => lift n0 (unmark V) | inright g => Ref n end (unmark match compare n0 n with | inleft (left l as s) => Var (Init.Nat.pred n) | inleft (right e as s) => lift_r n0 V | inright g => Var n end) *) elim (compare n0 n); intro H; simpl in |- *; trivial. (* Goal: @eq lambda (App (subst_rec (unmark r) (unmark V) n) (subst_rec (unmark r0) (unmark V) n)) (App (unmark (subst_rec_r r V n)) (unmark (subst_rec_r r0 V n))) *) (* Goal: @eq lambda (Abs (subst_rec (unmark r) (unmark V) (S n))) (Abs (unmark (subst_rec_r r V (S n)))) *) (* Goal: @eq lambda (if H then Ref (Init.Nat.pred n) else lift n0 (unmark V)) (unmark (if H then Var (Init.Nat.pred n) else lift_r n0 V)) *) elim H; trivial. (* Goal: @eq lambda (App (subst_rec (unmark r) (unmark V) n) (subst_rec (unmark r0) (unmark V) n)) (App (unmark (subst_rec_r r V n)) (unmark (subst_rec_r r0 V n))) *) (* Goal: @eq lambda (Abs (subst_rec (unmark r) (unmark V) (S n))) (Abs (unmark (subst_rec_r r V (S n)))) *) (* Goal: forall _ : @eq nat n0 n, @eq lambda (lift n0 (unmark V)) (unmark (lift_r n0 V)) *) rewrite (unmark_lift V n0); trivial. (* Goal: @eq lambda (App (subst_rec (unmark r) (unmark V) n) (subst_rec (unmark r0) (unmark V) n)) (App (unmark (subst_rec_r r V n)) (unmark (subst_rec_r r0 V n))) *) (* Goal: @eq lambda (Abs (subst_rec (unmark r) (unmark V) (S n))) (Abs (unmark (subst_rec_r r V (S n)))) *) elim H; trivial. (* Goal: @eq lambda (App (subst_rec (unmark r) (unmark V) n) (subst_rec (unmark r0) (unmark V) n)) (App (unmark (subst_rec_r r V n)) (unmark (subst_rec_r r0 V n))) *) elim H; elim H0; trivial. Qed. Lemma unmark_subst : forall U V : redexes, subst (unmark U) (unmark V) = unmark (subst_r U V). Proof. (* Goal: forall U V : redexes, @eq lambda (subst (unmark U) (unmark V)) (unmark (subst_r U V)) *) unfold subst in |- *; unfold subst_r in |- *; intros; apply unmark_subst_rec. Qed. Lemma completeness : forall U V W : redexes, residuals U V W -> par_red1 (unmark U) (unmark W). Proof. (* Goal: forall (U V W : redexes) (_ : residuals U V W), par_red1 (unmark U) (unmark W) *) simple induction 1; simpl in |- *; auto. (* Goal: forall (U1 V1 W1 : redexes) (_ : residuals U1 V1 W1) (_ : par_red1 (unmark U1) (unmark W1)) (U2 V2 W2 : redexes) (_ : residuals U2 V2 W2) (_ : par_red1 (unmark U2) (unmark W2)) (_ : bool), par_red1 (App (Abs (unmark U1)) (unmark U2)) (unmark (subst_r W2 W1)) *) intros; elim unmark_subst; auto. Qed. Definition reduction (M : lambda) (U : redexes) (N : lambda) := residuals (mark M) U (mark N). Lemma reduction_function : forall (M N P : lambda) (U : redexes), reduction M U N -> reduction M U P -> N = P. Proof. (* Goal: forall (M N P : lambda) (U : redexes) (_ : reduction M U N) (_ : reduction M U P), @eq lambda N P *) unfold reduction in |- *; intros; cut (comp (mark N) (mark P)). (* Goal: comp (mark N) (mark P) *) (* Goal: forall _ : comp (mark N) (mark P), @eq lambda N P *) intro; rewrite (inverse N); rewrite (inverse P); apply comp_unmark_eq; trivial. (* Goal: comp (mark N) (mark P) *) apply mutual_residuals_comp with U (mark M) (mark M); trivial. Qed.
Set Implicit Arguments. Unset Strict Implicit. Require Export Sgroup_cat. Section Lemmas. Variable E : SGROUP. Lemma SGROUP_assoc : forall x y z : E, Equal (sgroup_law _ (sgroup_law _ x y) z) (sgroup_law _ x (sgroup_law _ y z)). Proof. (* Goal: forall x y z : Carrier (sgroup_set E), @Equal (sgroup_set E) (sgroup_law E (sgroup_law E x y) z) (sgroup_law E x (sgroup_law E y z)) *) intros x y z; try assumption. (* Goal: @Equal (sgroup_set E) (sgroup_law E (sgroup_law E x y) z) (sgroup_law E x (sgroup_law E y z)) *) apply (sgroup_assoc_prf E x y z); auto with algebra. Qed. Lemma SGROUP_comp : forall x x' y y' : E, Equal x x' -> Equal y y' -> Equal (sgroup_law _ x y) (sgroup_law _ x' y'). Proof. (* Goal: forall (x x' y y' : Carrier (sgroup_set E)) (_ : @Equal (sgroup_set E) x x') (_ : @Equal (sgroup_set E) y y'), @Equal (sgroup_set E) (sgroup_law E x y) (sgroup_law E x' y') *) unfold sgroup_law in |- *; auto with algebra. Qed. Variable F : SGROUP. Variable f : Hom E F. Lemma SGROUP_hom_prop : forall x y : E, Equal (f (sgroup_law _ x y)) (sgroup_law _ (f x) (f y)). Proof. (* Goal: forall x y : Carrier (sgroup_set E), @Equal (sgroup_set F) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) (sgroup_law E x y)) (sgroup_law F (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y)) *) intros x y; try assumption. (* Goal: @Equal (sgroup_set F) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) (sgroup_law E x y)) (sgroup_law F (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) x) (@Ap (sgroup_set E) (sgroup_set F) (@sgroup_map E F f) y)) *) apply (sgroup_hom_prf f). Qed. End Lemmas. Hint Resolve SGROUP_assoc SGROUP_comp SGROUP_hom_prop: algebra.
Require Export GeoCoq.Elements.OriginalProofs.lemma_ray. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_ray1 : forall A B P, Out A B P -> (BetS A P B \/ eq B P \/ BetS A B P). Proof. (* Goal: forall (A B P : @Point Ax0) (_ : @Out Ax0 A B P), or (@BetS Ax0 A P B) (or (@eq Ax0 B P) (@BetS Ax0 A B P)) *) intros. (* Goal: or (@BetS Ax0 A P B) (or (@eq Ax0 B P) (@BetS Ax0 A B P)) *) assert (~ ~ (BetS A P B \/ eq B P \/ BetS A B P)). (* Goal: or (@BetS Ax0 A P B) (or (@eq Ax0 B P) (@BetS Ax0 A B P)) *) (* Goal: not (not (or (@BetS Ax0 A P B) (or (@eq Ax0 B P) (@BetS Ax0 A B P)))) *) { (* Goal: not (not (or (@BetS Ax0 A P B) (or (@eq Ax0 B P) (@BetS Ax0 A B P)))) *) intro. (* Goal: False *) assert (neq P B) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (BetS A B P) by (conclude lemma_ray). (* Goal: False *) contradict. (* BG Goal: or (@BetS Ax0 A P B) (or (@eq Ax0 B P) (@BetS Ax0 A B P)) *) } (* Goal: or (@BetS Ax0 A P B) (or (@eq Ax0 B P) (@BetS Ax0 A B P)) *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.lemma_equalanglestransitive. Require Export GeoCoq.Elements.OriginalProofs.lemma_supplements. Section Euclid. Context `{Ax1:euclidean_neutral_ruler_compass}. Lemma lemma_supplements2 : forall A B C D E F J K L P Q R, RT A B C P Q R -> CongA A B C J K L -> RT J K L D E F -> CongA P Q R D E F /\ CongA D E F P Q R. Proof. (* Goal: forall (A B C D E F J K L P Q R : @Point Ax) (_ : @RT Ax A B C P Q R) (_ : @CongA Ax A B C J K L) (_ : @RT Ax J K L D E F), and (@CongA Ax P Q R D E F) (@CongA Ax D E F P Q R) *) intros. (* Goal: and (@CongA Ax P Q R D E F) (@CongA Ax D E F P Q R) *) let Tf:=fresh in assert (Tf:exists a b c d e, (Supp a b c d e /\ CongA A B C a b c /\ CongA P Q R d b e)) by (conclude_def RT );destruct Tf as [a[b[c[d[e]]]]];spliter. (* Goal: and (@CongA Ax P Q R D E F) (@CongA Ax D E F P Q R) *) let Tf:=fresh in assert (Tf:exists j k l m n, (Supp j k l m n /\ CongA J K L j k l /\ CongA D E F m k n)) by (conclude_def RT );destruct Tf as [j[k[l[m[n]]]]];spliter. (* Goal: and (@CongA Ax P Q R D E F) (@CongA Ax D E F P Q R) *) assert (CongA a b c A B C) by (conclude lemma_equalanglessymmetric). (* Goal: and (@CongA Ax P Q R D E F) (@CongA Ax D E F P Q R) *) assert (CongA a b c J K L) by (conclude lemma_equalanglestransitive). (* Goal: and (@CongA Ax P Q R D E F) (@CongA Ax D E F P Q R) *) assert (CongA a b c j k l) by (conclude lemma_equalanglestransitive). (* Goal: and (@CongA Ax P Q R D E F) (@CongA Ax D E F P Q R) *) assert (CongA d b e m k n) by (conclude lemma_supplements). (* Goal: and (@CongA Ax P Q R D E F) (@CongA Ax D E F P Q R) *) assert (CongA P Q R m k n) by (conclude lemma_equalanglestransitive). (* Goal: and (@CongA Ax P Q R D E F) (@CongA Ax D E F P Q R) *) assert (CongA m k n D E F) by (conclude lemma_equalanglessymmetric). (* Goal: and (@CongA Ax P Q R D E F) (@CongA Ax D E F P Q R) *) assert (CongA P Q R D E F) by (conclude lemma_equalanglestransitive). (* Goal: and (@CongA Ax P Q R D E F) (@CongA Ax D E F P Q R) *) assert (CongA D E F P Q R) by (conclude lemma_equalanglessymmetric). (* Goal: and (@CongA Ax P Q R D E F) (@CongA Ax D E F P Q R) *) close. Qed. End Euclid.
From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat seq. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Section Prefix. Variable A : Type. Fixpoint onth (s : seq A) n : option A := if s is x :: s' then if n is n'.+1 then onth s' n' else Some x else None. Definition prefix s1 s2 := forall n x, onth s1 n = some x -> onth s2 n = some x. Lemma size_onth (s : seq A) n : n < size s -> exists x, onth s n = Some x. Proof. (* Goal: forall _ : is_true (leq (S n) (@size A s)), @ex A (fun x : A => @eq (option A) (onth s n) (@Some A x)) *) elim:s n=>[//|x' s' IH] [|n] /=. (* Goal: forall _ : is_true (leq (S (S n)) (S (@size A s'))), @ex A (fun x : A => @eq (option A) (onth s' n) (@Some A x)) *) (* Goal: forall _ : is_true (leq (S O) (S (@size A s'))), @ex A (fun x : A => @eq (option A) (@Some A x') (@Some A x)) *) - (* Goal: forall _ : is_true (leq (S (S n)) (S (@size A s'))), @ex A (fun x : A => @eq (option A) (onth s' n) (@Some A x)) *) (* Goal: forall _ : is_true (leq (S O) (S (@size A s'))), @ex A (fun x : A => @eq (option A) (@Some A x') (@Some A x)) *) by move=>_; exists x'. (* Goal: forall _ : is_true (leq (S (S n)) (S (@size A s'))), @ex A (fun x : A => @eq (option A) (onth s' n) (@Some A x)) *) rewrite -(addn1 n) -(addn1 (size s')) ltn_add2r. (* Goal: forall _ : is_true (leq (S n) (@size A s')), @ex A (fun x : A => @eq (option A) (onth s' n) (@Some A x)) *) by apply: IH. Qed. Lemma onth_size (s : seq A) n x : onth s n = Some x -> n < size s. Proof. (* Goal: forall _ : @eq (option A) (onth s n) (@Some A x), is_true (leq (S n) (@size A s)) *) by elim:s n=>[//|x' s' IH] [//|n]; apply: IH. Qed. Lemma prefix_refl s : prefix s s. Proof. (* Goal: prefix s s *) by move=>n x <-. Qed. Lemma prefix_trans (s2 s1 s3 : seq A) : prefix s1 s2 -> prefix s2 s3 -> prefix s1 s3. Proof. (* Goal: forall (_ : prefix s1 s2) (_ : prefix s2 s3), prefix s1 s3 *) by move=>H1 H2 n x E; apply: H2; apply: H1. Qed. Lemma prefix_cons x s1 s2 : prefix (x :: s1) (x :: s2) <-> prefix s1 s2. Proof. (* Goal: iff (prefix (@cons A x s1) (@cons A x s2)) (prefix s1 s2) *) by split=>E n; [apply: (E n.+1) | case: n]. Qed. Lemma prefix_cons' x y s1 s2 : prefix (x :: s1) (y :: s2) -> x = y /\ prefix s1 s2. Proof. (* Goal: forall _ : prefix (@cons A x s1) (@cons A y s2), and (@eq A x y) (prefix s1 s2) *) move=>H; move: (H 0 x (erefl _))=>[H']. (* Goal: and (@eq A x y) (prefix s1 s2) *) by move: H; rewrite H' prefix_cons. Qed. Lemma prefix_size (s t : seq A) : prefix s t -> size s <= size t. Proof. (* Goal: forall _ : prefix s t, is_true (leq (@size A s) (@size A t)) *) elim: s t=>[//|a s IH] [|b t] H; first by move: (H 0 a (erefl _)). (* Goal: is_true (leq (@size A (@cons A a s)) (@size A (@cons A b t))) *) by rewrite ltnS; apply: (IH _ (proj2 (prefix_cons' H))). Qed. Lemma prefix_onth (s t : seq A) x : x < size s -> prefix s t -> onth s x = onth t x. Proof. (* Goal: forall (_ : is_true (leq (S x) (@size A s))) (_ : prefix s t), @eq (option A) (onth s x) (onth t x) *) elim:s t x =>[//|a s IH] [|b t] x H1 H2; first by move: (H2 0 a (erefl _)). (* Goal: @eq (option A) (onth (@cons A a s) x) (onth (@cons A b t) x) *) apply prefix_cons' in H2. (* Goal: @eq (option A) (onth (@cons A a s) x) (onth (@cons A b t) x) *) case: x H1=>[_|n H1]; first by rewrite (proj1 H2). (* Goal: @eq (option A) (onth (@cons A a s) (S n)) (onth (@cons A b t) (S n)) *) by apply: IH=>//; exact (proj2 H2). Qed. End Prefix. Hint Resolve prefix_refl : core.
Require Export Lib_Minus. Lemma plus_opp : forall n m : nat, n + m - m = n. Proof. (* Goal: forall n m : nat, @eq nat (Init.Nat.sub (Init.Nat.add n m) m) n *) intros n m; elim (plus_comm m n); apply minus_plus. Qed. Hint Resolve plus_opp. Lemma S_plus : forall n : nat, S n = n + 1. Proof. (* Goal: forall n : nat, @eq nat (S n) (Init.Nat.add n (S O)) *) intro; elim plus_comm; auto with arith. Qed. Hint Resolve S_plus. Lemma lt_plus : forall n m : nat, 0 < n -> m < n + m. Proof. (* Goal: forall (n m : nat) (_ : lt O n), lt m (Init.Nat.add n m) *) simple induction n; simple induction m; auto with arith. (* Goal: forall (n : nat) (_ : forall _ : lt O (S n0), lt n (Init.Nat.add (S n0) n)) (_ : lt O (S n0)), lt (S n) (Init.Nat.add (S n0) (S n)) *) intros. (* Goal: lt (S n1) (Init.Nat.add (S n0) (S n1)) *) simpl in |- *; apply lt_n_S. (* Goal: lt n1 (Init.Nat.add n0 (S n1)) *) auto with arith. Qed. Hint Resolve lt_plus. Lemma le_minus_plus : forall n m : nat, n - m <= n + m. Proof. (* Goal: forall n m : nat, le (Init.Nat.sub n m) (Init.Nat.add n m) *) simple induction n; auto with arith. Qed. Hint Resolve le_minus_plus. Lemma le_le_assoc_plus_minus : forall n m p : nat, n <= m -> n <= p -> m - n + p = m + (p - n). Proof. (* Goal: forall (n m p : nat) (_ : le n m) (_ : le n p), @eq nat (Init.Nat.add (Init.Nat.sub m n) p) (Init.Nat.add m (Init.Nat.sub p n)) *) intros. (* Goal: @eq nat (Init.Nat.add (Init.Nat.sub m n) p) (Init.Nat.add m (Init.Nat.sub p n)) *) elim H. (* Goal: forall (m : nat) (_ : le n m) (_ : @eq nat (Init.Nat.add (Init.Nat.sub m n) p) (Init.Nat.add m (Init.Nat.sub p n))), @eq nat (Init.Nat.add (Init.Nat.sub (S m) n) p) (Init.Nat.add (S m) (Init.Nat.sub p n)) *) (* Goal: @eq nat (Init.Nat.add (Init.Nat.sub n n) p) (Init.Nat.add n (Init.Nat.sub p n)) *) elim minus_n_n; simpl in |- *; elim le_plus_minus; auto with arith. (* Goal: forall (m : nat) (_ : le n m) (_ : @eq nat (Init.Nat.add (Init.Nat.sub m n) p) (Init.Nat.add m (Init.Nat.sub p n))), @eq nat (Init.Nat.add (Init.Nat.sub (S m) n) p) (Init.Nat.add (S m) (Init.Nat.sub p n)) *) intros. (* Goal: @eq nat (Init.Nat.add (Init.Nat.sub (S m0) n) p) (Init.Nat.add (S m0) (Init.Nat.sub p n)) *) elim minus_Sn_m; simpl in |- *. (* Goal: le n m0 *) (* Goal: @eq nat (S (Init.Nat.add (Init.Nat.sub m0 n) p)) (S (Init.Nat.add m0 (Init.Nat.sub p n))) *) apply eq_S; auto with arith. (* Goal: le n m0 *) assumption. Qed. Hint Resolve le_le_assoc_plus_minus. Lemma le_lt_plus : forall n m p q : nat, n <= p -> m < q -> n + m < p + q. Proof. (* Goal: forall (n m p q : nat) (_ : le n p) (_ : lt m q), lt (Init.Nat.add n m) (Init.Nat.add p q) *) intros. (* Goal: lt (Init.Nat.add n m) (Init.Nat.add p q) *) apply lt_le_trans with (n + q). (* Goal: le (Init.Nat.add n q) (Init.Nat.add p q) *) (* Goal: lt (Init.Nat.add n m) (Init.Nat.add n q) *) apply plus_lt_compat_l; try trivial with arith. (* Goal: le (Init.Nat.add n q) (Init.Nat.add p q) *) apply plus_le_compat_r; try trivial with arith. Qed. Lemma plus_eq_zero : forall a b : nat, a + b = 0 -> a = 0 /\ b = 0. Proof. (* Goal: forall (a b : nat) (_ : @eq nat (Init.Nat.add a b) O), and (@eq nat a O) (@eq nat b O) *) intros a b H. (* Goal: and (@eq nat a O) (@eq nat b O) *) split; apply sym_equal; apply le_n_O_eq; elim H; auto with arith. Qed. Hint Resolve plus_eq_zero. Lemma le_transp_l : forall n m p : nat, n + m <= p -> m <= p - n. Proof. (* Goal: forall (n m p : nat) (_ : le (Init.Nat.add n m) p), le m (Init.Nat.sub p n) *) simple induction n; intros. (* Goal: le m (Init.Nat.sub p (S n0)) *) (* Goal: le m (Init.Nat.sub p O) *) simpl in H; elim minus_n_O; assumption. (* Goal: le m (Init.Nat.sub p (S n0)) *) elim H0. (* Goal: forall (m0 : nat) (_ : le (Init.Nat.add (S n0) m) m0) (_ : le m (Init.Nat.sub m0 (S n0))), le m (Init.Nat.sub (S m0) (S n0)) *) (* Goal: le m (Init.Nat.sub (Init.Nat.add (S n0) m) (S n0)) *) elim plus_comm; rewrite plus_opp; auto with arith. (* Goal: forall (m0 : nat) (_ : le (Init.Nat.add (S n0) m) m0) (_ : le m (Init.Nat.sub m0 (S n0))), le m (Init.Nat.sub (S m0) (S n0)) *) intros. (* Goal: le m (Init.Nat.sub (S m0) (S n0)) *) simpl in |- *; apply H; auto with arith. Qed. Hint Resolve le_transp_l. Lemma le_transp_r : forall n m p : nat, n + m <= p -> n <= p - m. Proof. (* Goal: forall (n m p : nat) (_ : le (Init.Nat.add n m) p), le n (Init.Nat.sub p m) *) intros. (* Goal: le n (Init.Nat.sub p m) *) apply le_transp_l. (* Goal: le (Init.Nat.add m n) p *) elim plus_comm; assumption. Qed. Hint Resolve le_transp_r.
Require Export GeoCoq.Elements.OriginalProofs.lemma_lessthantransitive. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_midpointunique : forall A B C D, Midpoint A B C -> Midpoint A D C -> eq B D. Proof. (* Goal: forall (A B C D : @Point Ax0) (_ : @Midpoint Ax0 A B C) (_ : @Midpoint Ax0 A D C), @eq Ax0 B D *) intros. (* Goal: @eq Ax0 B D *) assert ((BetS A B C /\ Cong A B B C)) by (conclude_def Midpoint ). (* Goal: @eq Ax0 B D *) assert ((BetS A D C /\ Cong A D D C)) by (conclude_def Midpoint ). (* Goal: @eq Ax0 B D *) assert (Cong A B A B) by (conclude cn_congruencereflexive). (* Goal: @eq Ax0 B D *) assert (~ BetS C D B). (* Goal: @eq Ax0 B D *) (* Goal: not (@BetS Ax0 C D B) *) { (* Goal: not (@BetS Ax0 C D B) *) intro. (* Goal: False *) assert (BetS B D C) by (conclude axiom_betweennesssymmetry). (* Goal: False *) assert (BetS A B D) by (conclude axiom_innertransitivity). (* Goal: False *) assert (Lt A B A D) by (conclude_def Lt ). (* Goal: False *) assert (Cong A D C D) by (forward_using lemma_congruenceflip). (* Goal: False *) assert (Lt A B C D) by (conclude lemma_lessthancongruence). (* Goal: False *) assert (BetS C D B) by (conclude axiom_betweennesssymmetry). (* Goal: False *) assert (Cong C D C D) by (conclude cn_congruencereflexive). (* Goal: False *) assert (Lt C D C B) by (conclude_def Lt ). (* Goal: False *) assert (Lt A B C B) by (conclude lemma_lessthantransitive). (* Goal: False *) assert (Cong C B B C) by (conclude cn_equalityreverse). (* Goal: False *) assert (Lt A B B C) by (conclude lemma_lessthancongruence). (* Goal: False *) assert (Cong B C A B) by (conclude lemma_congruencesymmetric). (* Goal: False *) assert (Lt A B A B) by (conclude lemma_lessthancongruence). (* Goal: False *) let Tf:=fresh in assert (Tf:exists E, (BetS A E B /\ Cong A E A B)) by (conclude_def Lt );destruct Tf as [E];spliter. (* Goal: False *) assert (~ Cong A E A B) by (conclude lemma_partnotequalwhole). (* Goal: False *) contradict. (* BG Goal: @eq Ax0 B D *) } (* Goal: @eq Ax0 B D *) assert (~ BetS C B D). (* Goal: @eq Ax0 B D *) (* Goal: not (@BetS Ax0 C B D) *) { (* Goal: not (@BetS Ax0 C B D) *) intro. (* Goal: False *) assert (BetS D B C) by (conclude axiom_betweennesssymmetry). (* Goal: False *) assert (BetS A D B) by (conclude axiom_innertransitivity). (* Goal: False *) assert (Cong A D A D) by (conclude cn_congruencereflexive). (* Goal: False *) assert (Lt A D A B) by (conclude_def Lt ). (* Goal: False *) assert (Cong A B C B) by (forward_using lemma_congruenceflip). (* Goal: False *) assert (Lt A D C B) by (conclude lemma_lessthancongruence). (* Goal: False *) assert (BetS C B D) by (conclude axiom_betweennesssymmetry). (* Goal: False *) assert (Cong C B C B) by (conclude cn_congruencereflexive). (* Goal: False *) assert (Lt C B C D) by (conclude_def Lt ). (* Goal: False *) assert (Lt A D C D) by (conclude lemma_lessthantransitive). (* Goal: False *) assert (Cong C D D C) by (conclude cn_equalityreverse). (* Goal: False *) assert (Lt A D D C) by (conclude lemma_lessthancongruence). (* Goal: False *) assert (Cong D C C D) by (conclude lemma_congruencesymmetric). (* Goal: False *) assert (Lt A D C D) by (conclude lemma_lessthancongruence). (* Goal: False *) assert (Cong D C A D) by (conclude lemma_congruencesymmetric). (* Goal: False *) assert (Cong C D A D) by (forward_using lemma_congruenceflip). (* Goal: False *) assert (Lt A D A D) by (conclude lemma_lessthancongruence). (* Goal: False *) let Tf:=fresh in assert (Tf:exists F, (BetS A F D /\ Cong A F A D)) by (conclude_def Lt );destruct Tf as [F];spliter. (* Goal: False *) assert (~ Cong A F A D) by (conclude lemma_partnotequalwhole). (* Goal: False *) contradict. (* BG Goal: @eq Ax0 B D *) } (* Goal: @eq Ax0 B D *) assert (BetS C D A) by (conclude axiom_betweennesssymmetry). (* Goal: @eq Ax0 B D *) assert (BetS C B A) by (conclude axiom_betweennesssymmetry). (* Goal: @eq Ax0 B D *) assert (eq B D) by (conclude axiom_connectivity). (* Goal: @eq Ax0 B D *) close. Qed. End Euclid.
Require Import Decidable DecidableTypeEx MSetFacts Setoid. Module WDecide_fun (E : DecidableType)(Import M : WSetsOn E). Module F := MSetFacts.WFactsOn E M. Module FSetLogicalFacts. Export Decidable. Export Setoid. Tactic Notation "fold" "any" "not" := repeat ( match goal with | H: context [?P -> False] |- _ => fold (~ P) in H | |- context [?P -> False] => fold (~ P) end). Ltac or_not_l_iff P Q tac := (rewrite (or_not_l_iff_1 P Q) by tac) || (rewrite (or_not_l_iff_2 P Q) by tac). Ltac or_not_r_iff P Q tac := (rewrite (or_not_r_iff_1 P Q) by tac) || (rewrite (or_not_r_iff_2 P Q) by tac). Ltac or_not_l_iff_in P Q H tac := (rewrite (or_not_l_iff_1 P Q) in H by tac) || (rewrite (or_not_l_iff_2 P Q) in H by tac). Ltac or_not_r_iff_in P Q H tac := (rewrite (or_not_r_iff_1 P Q) in H by tac) || (rewrite (or_not_r_iff_2 P Q) in H by tac). Tactic Notation "push" "not" "using" ident(db) := let dec := solve_decidable using db in unfold not, iff; repeat ( match goal with | |- context [True -> False] => rewrite not_true_iff | |- context [False -> False] => rewrite not_false_iff | |- context [(?P -> False) -> False] => rewrite (not_not_iff P) by dec | |- context [(?P -> False) -> (?Q -> False)] => rewrite (contrapositive P Q) by dec | |- context [(?P -> False) \/ ?Q] => or_not_l_iff P Q dec | |- context [?P \/ (?Q -> False)] => or_not_r_iff P Q dec | |- context [(?P -> False) -> ?Q] => rewrite (imp_not_l P Q) by dec | |- context [?P \/ ?Q -> False] => rewrite (not_or_iff P Q) | |- context [?P /\ ?Q -> False] => rewrite (not_and_iff P Q) | |- context [(?P -> ?Q) -> False] => rewrite (not_imp_iff P Q) by dec end); fold any not. Tactic Notation "push" "not" := push not using core. Tactic Notation "push" "not" "in" "*" "|-" "using" ident(db) := let dec := solve_decidable using db in unfold not, iff in * |-; repeat ( match goal with | H: context [True -> False] |- _ => rewrite not_true_iff in H | H: context [False -> False] |- _ => rewrite not_false_iff in H | H: context [(?P -> False) -> False] |- _ => rewrite (not_not_iff P) in H by dec | H: context [(?P -> False) -> (?Q -> False)] |- _ => rewrite (contrapositive P Q) in H by dec | H: context [(?P -> False) \/ ?Q] |- _ => or_not_l_iff_in P Q H dec | H: context [?P \/ (?Q -> False)] |- _ => or_not_r_iff_in P Q H dec | H: context [(?P -> False) -> ?Q] |- _ => rewrite (imp_not_l P Q) in H by dec | H: context [?P \/ ?Q -> False] |- _ => rewrite (not_or_iff P Q) in H | H: context [?P /\ ?Q -> False] |- _ => rewrite (not_and_iff P Q) in H | H: context [(?P -> ?Q) -> False] |- _ => rewrite (not_imp_iff P Q) in H by dec end); fold any not. Tactic Notation "push" "not" "in" "*" "|-" := push not in * |- using core. Tactic Notation "push" "not" "in" "*" "using" ident(db) := push not using db; push not in * |- using db. Tactic Notation "push" "not" "in" "*" := push not in * using core. Lemma test_push : forall P Q R : Prop, decidable P -> decidable Q -> (~ True) -> (~ False) -> (~ ~ P) -> (~ (P /\ Q) -> ~ R) -> ((P /\ Q) \/ ~ R) -> (~ (P /\ Q) \/ R) -> (R \/ ~ (P /\ Q)) -> (~ R \/ (P /\ Q)) -> (~ P -> R) -> (~ ((R -> P) \/ (Q -> R))) -> (~ (P /\ R)) -> (~ (P -> R)) -> True. Proof. (* Goal: forall (P Q R : Prop) (_ : decidable P) (_ : decidable Q) (_ : not True) (_ : not False) (_ : not (not P)) (_ : forall _ : not (and P Q), not R) (_ : or (and P Q) (not R)) (_ : or (not (and P Q)) R) (_ : or R (not (and P Q))) (_ : or (not R) (and P Q)) (_ : forall _ : not P, R) (_ : not (or (forall _ : R, P) (forall _ : Q, R))) (_ : not (and P R)) (_ : not (forall _ : P, R)), True *) intros. (* Goal: True *) push not in *. (* Goal: True *) tauto. Qed. Tactic Notation "pull" "not" "using" ident(db) := let dec := solve_decidable using db in unfold not, iff; repeat ( match goal with | |- context [True -> False] => rewrite not_true_iff | |- context [False -> False] => rewrite not_false_iff | |- context [(?P -> False) -> False] => rewrite (not_not_iff P) by dec | |- context [(?P -> False) -> (?Q -> False)] => rewrite (contrapositive P Q) by dec | |- context [(?P -> False) \/ ?Q] => or_not_l_iff P Q dec | |- context [?P \/ (?Q -> False)] => or_not_r_iff P Q dec | |- context [(?P -> False) -> ?Q] => rewrite (imp_not_l P Q) by dec | |- context [(?P -> False) /\ (?Q -> False)] => rewrite <- (not_or_iff P Q) | |- context [?P -> ?Q -> False] => rewrite <- (not_and_iff P Q) | |- context [?P /\ (?Q -> False)] => rewrite <- (not_imp_iff P Q) by dec | |- context [(?Q -> False) /\ ?P] => rewrite <- (not_imp_rev_iff P Q) by dec end); fold any not. Tactic Notation "pull" "not" := pull not using core. Tactic Notation "pull" "not" "in" "*" "|-" "using" ident(db) := let dec := solve_decidable using db in unfold not, iff in * |-; repeat ( match goal with | H: context [True -> False] |- _ => rewrite not_true_iff in H | H: context [False -> False] |- _ => rewrite not_false_iff in H | H: context [(?P -> False) -> False] |- _ => rewrite (not_not_iff P) in H by dec | H: context [(?P -> False) -> (?Q -> False)] |- _ => rewrite (contrapositive P Q) in H by dec | H: context [(?P -> False) \/ ?Q] |- _ => or_not_l_iff_in P Q H dec | H: context [?P \/ (?Q -> False)] |- _ => or_not_r_iff_in P Q H dec | H: context [(?P -> False) -> ?Q] |- _ => rewrite (imp_not_l P Q) in H by dec | H: context [(?P -> False) /\ (?Q -> False)] |- _ => rewrite <- (not_or_iff P Q) in H | H: context [?P -> ?Q -> False] |- _ => rewrite <- (not_and_iff P Q) in H | H: context [?P /\ (?Q -> False)] |- _ => rewrite <- (not_imp_iff P Q) in H by dec | H: context [(?Q -> False) /\ ?P] |- _ => rewrite <- (not_imp_rev_iff P Q) in H by dec end); fold any not. Tactic Notation "pull" "not" "in" "*" "|-" := pull not in * |- using core. Tactic Notation "pull" "not" "in" "*" "using" ident(db) := pull not using db; pull not in * |- using db. Tactic Notation "pull" "not" "in" "*" := pull not in * using core. Lemma test_pull : forall P Q R : Prop, decidable P -> decidable Q -> (~ True) -> (~ False) -> (~ ~ P) -> (~ (P /\ Q) -> ~ R) -> ((P /\ Q) \/ ~ R) -> (~ (P /\ Q) \/ R) -> (R \/ ~ (P /\ Q)) -> (~ R \/ (P /\ Q)) -> (~ P -> R) -> (~ (R -> P) /\ ~ (Q -> R)) -> (~ P \/ ~ R) -> (P /\ ~ R) -> (~ R /\ P) -> True. Proof. (* Goal: forall (P Q R : Prop) (_ : decidable P) (_ : decidable Q) (_ : not True) (_ : not False) (_ : not (not P)) (_ : forall _ : not (and P Q), not R) (_ : or (and P Q) (not R)) (_ : or (not (and P Q)) R) (_ : or R (not (and P Q))) (_ : or (not R) (and P Q)) (_ : forall _ : not P, R) (_ : and (not (forall _ : R, P)) (not (forall _ : Q, R))) (_ : or (not P) (not R)) (_ : and P (not R)) (_ : and (not R) P), True *) intros. (* Goal: True *) pull not in *. (* Goal: True *) tauto. Qed. End FSetLogicalFacts. Import FSetLogicalFacts. Module FSetDecideAuxiliary. Tactic Notation "if" tactic(t) "then" tactic(t1) "else" tactic(t2) := first [ t; first [ t1 | fail 2 ] | t2 ]. Tactic Notation "prop" constr(P) "holds" "by" tactic(t) := let H := fresh in assert P as H by t; clear H. Tactic Notation "assert" "new" constr(e) "by" tactic(t) := match goal with | H: e |- _ => fail 1 | _ => assert e by t end. Tactic Notation "subst" "++" := repeat ( match goal with | x : _ |- _ => subst x end); cbv zeta beta in *. Tactic Notation "decompose" "records" := repeat ( match goal with | H: _ |- _ => progress (decompose record H); clear H end). Inductive FSet_elt_Prop : Prop -> Prop := | eq_Prop : forall (S : Type) (x y : S), FSet_elt_Prop (x = y) | eq_elt_prop : forall x y, FSet_elt_Prop (E.eq x y) | In_elt_prop : forall x s, FSet_elt_Prop (In x s) | True_elt_prop : FSet_elt_Prop True | False_elt_prop : FSet_elt_Prop False | conj_elt_prop : forall P Q, FSet_elt_Prop P -> FSet_elt_Prop Q -> FSet_elt_Prop (P /\ Q) | disj_elt_prop : forall P Q, FSet_elt_Prop P -> FSet_elt_Prop Q -> FSet_elt_Prop (P \/ Q) | impl_elt_prop : forall P Q, FSet_elt_Prop P -> FSet_elt_Prop Q -> FSet_elt_Prop (P -> Q) | not_elt_prop : forall P, FSet_elt_Prop P -> FSet_elt_Prop (~ P). Inductive FSet_Prop : Prop -> Prop := | elt_FSet_Prop : forall P, FSet_elt_Prop P -> FSet_Prop P | Empty_FSet_Prop : forall s, FSet_Prop (Empty s) | Subset_FSet_Prop : forall s1 s2, FSet_Prop (Subset s1 s2) | Equal_FSet_Prop : forall s1 s2, FSet_Prop (Equal s1 s2). Hint Constructors FSet_elt_Prop FSet_Prop : FSet_Prop. Ltac discard_nonFSet := repeat ( match goal with | H : ?P |- _ => if prop (FSet_Prop P) holds by (auto 100 with FSet_Prop) then fail else clear H end). Hint Rewrite F.empty_iff F.singleton_iff F.add_iff F.remove_iff F.union_iff F.inter_iff F.diff_iff : set_simpl. Lemma dec_In : forall x s, decidable (In x s). Proof. (* Goal: None *) red; intros; generalize (F.mem_iff s x); case (mem x s); intuition. Qed. Lemma dec_eq : forall (x y : E.t), Proof. (* Goal: None *) red; intros x y; destruct (E.eq_dec x y); auto. Qed. Hint Resolve dec_In dec_eq : FSet_decidability. Ltac change_to_E_t := repeat ( match goal with | H : ?T |- _ => progress (change T with E.t in H); repeat ( match goal with | J : _ |- _ => progress (change T with E.t in J) | |- _ => progress (change T with E.t) end ) | H : forall x : ?T, _ |- _ => progress (change T with E.t in H); repeat ( match goal with | J : _ |- _ => progress (change T with E.t in J) | |- _ => progress (change T with E.t) end ) end). Ltac Logic_eq_to_E_eq := repeat ( match goal with | H: _ |- _ => progress (change (@Logic.eq E.t) with E.eq in H) | |- _ => progress (change (@Logic.eq E.t) with E.eq) end). Ltac E_eq_to_Logic_eq := repeat ( match goal with | H: _ |- _ => progress (change E.eq with (@Logic.eq E.t) in H) | |- _ => progress (change E.eq with (@Logic.eq E.t)) end). Ltac substFSet := repeat ( match goal with | H: E.eq ?x ?y |- _ => rewrite H in *; clear H end). Ltac assert_decidability := repeat ( match goal with | H: context [~ E.eq ?x ?y] |- _ => assert new (E.eq x y \/ ~ E.eq x y) by (apply dec_eq) | H: context [~ In ?x ?s] |- _ => assert new (In x s \/ ~ In x s) by (apply dec_In) | |- context [~ E.eq ?x ?y] => assert new (E.eq x y \/ ~ E.eq x y) by (apply dec_eq) | |- context [~ In ?x ?s] => assert new (In x s \/ ~ In x s) by (apply dec_In) end); repeat ( match goal with | _: ~ ?P, H : ?P \/ ~ ?P |- _ => clear H end). Ltac inst_FSet_hypotheses := repeat ( match goal with | H : forall a : E.t, _, _ : context [ In ?x _ ] |- _ => let P := type of (H x) in assert new P by (exact (H x)) | H : forall a : E.t, _ |- context [ In ?x _ ] => let P := type of (H x) in assert new P by (exact (H x)) | H : forall a : E.t, _, _ : context [ E.eq ?x _ ] |- _ => let P := type of (H x) in assert new P by (exact (H x)) | H : forall a : E.t, _ |- context [ E.eq ?x _ ] => let P := type of (H x) in assert new P by (exact (H x)) | H : forall a : E.t, _, _ : context [ E.eq _ ?x ] |- _ => let P := type of (H x) in assert new P by (exact (H x)) | H : forall a : E.t, _ |- context [ E.eq _ ?x ] => let P := type of (H x) in assert new P by (exact (H x)) end); repeat ( match goal with | H : forall a : E.t, _ |- _ => clear H end). Hint Resolve (E.eq_equiv.(@Equivalence_Reflexive _ _)) : FSet_Auto. Ltac fsetdec_rec := auto with FSet_Auto; subst++; try (match goal with | H: E.eq ?x ?x -> False |- _ => destruct H end); (reflexivity || contradiction || (progress substFSet; intuition fsetdec_rec)). Ltac fsetdec_body := inst_FSet_hypotheses; autorewrite with set_simpl in *; push not in * using FSet_decidability; substFSet; assert_decidability; auto with FSet_Auto; (intuition fsetdec_rec) || fail 1 "because the goal is beyond the scope of this tactic". End FSetDecideAuxiliary. Import FSetDecideAuxiliary. Ltac fsetdec := unfold iff in *; fold any not; intros; decompose records; discard_nonFSet; unfold Empty, Subset, Equal in *; intros; autorewrite with set_simpl in *; change_to_E_t; E_eq_to_Logic_eq; subst++; Logic_eq_to_E_eq; pull not using FSet_decidability; unfold not in *; match goal with | H: (In ?x ?r) -> False |- (In ?x ?s) -> False => contradict H; fsetdec_body | H: (In ?x ?r) -> False |- (E.eq ?x ?y) -> False => contradict H; fsetdec_body | H: (In ?x ?r) -> False |- (E.eq ?y ?x) -> False => contradict H; fsetdec_body | H: ?P -> False |- ?Q -> False => if prop (FSet_elt_Prop P) holds by (auto 100 with FSet_Prop) then (contradict H; fsetdec_body) else fsetdec_body | |- _ => fsetdec_body end. Module FSetDecideTestCases. Lemma test_eq_trans_1 : forall x y z s, E.eq x y -> Proof. (* Goal: None *) fsetdec. Qed. Lemma test_eq_trans_2 : forall x y z r s, In x (singleton y) -> ~ In z r -> ~ ~ In z (add y r) -> In x s -> In z s. Proof. (* Goal: None *) fsetdec. Qed. Lemma test_eq_neq_trans_1 : forall w x y z s, E.eq x w -> Proof. (* Goal: None *) fsetdec. Qed. Lemma test_eq_neq_trans_2 : forall w x y z r1 r2 s, In x (singleton w) -> ~ In x r1 -> In x (add y r1) -> In y r2 -> In y (remove z r2) -> In w s -> In w (remove z s). Proof. (* Goal: None *) fsetdec. Qed. Lemma test_In_singleton : forall x, In x (singleton x). Proof. (* Goal: None *) fsetdec. Qed. Lemma test_add_In : forall x y s, In x (add y s) -> ~ E.eq x y -> Proof. (* Goal: None *) fsetdec. Qed. Lemma test_Subset_add_remove : forall x s, s [<=] (add x (remove x s)). Proof. (* Goal: None *) fsetdec. Qed. Lemma test_eq_disjunction : forall w x y z, In w (add x (add y (singleton z))) -> E.eq w x \/ E.eq w y \/ E.eq w z. Proof. (* Goal: None *) fsetdec. Qed. Lemma test_not_In_disj : forall x y s1 s2 s3 s4, ~ In x (union s1 (union s2 (union s3 (add y s4)))) -> ~ (In x s1 \/ In x s4 \/ E.eq y x). Proof. (* Goal: None *) fsetdec. Qed. Lemma test_not_In_conj : forall x y s1 s2 s3 s4, ~ In x (union s1 (union s2 (union s3 (add y s4)))) -> ~ In x s1 /\ ~ In x s4 /\ ~ E.eq y x. Proof. (* Goal: None *) fsetdec. Qed. Lemma test_iff_conj : forall a x s s', (In a s' <-> E.eq x a \/ In a s) -> Proof. (* Goal: None *) fsetdec. Qed. Lemma test_set_ops_1 : forall x q r s, (singleton x) [<=] s -> Empty (union q r) -> Empty (inter (diff s q) (diff s r)) -> ~ In x s. Proof. (* Goal: None *) fsetdec. Qed. Lemma eq_chain_test : forall x1 x2 x3 x4 s1 s2 s3 s4, Empty s1 -> In x2 (add x1 s1) -> In x3 s2 -> ~ In x3 (remove x2 s2) -> ~ In x4 s3 -> In x4 (add x3 s3) -> In x1 s4 -> Subset (add x4 s4) s4. Proof. (* Goal: None *) fsetdec. Qed. Lemma test_too_complex : forall x y z r s, E.eq x y -> Proof. (* Goal: None *) intros until s; intros Heq H Hr; lapply H; fsetdec. Qed. Lemma function_test_1 : forall (f : t -> t), forall (g : elt -> elt), forall (s1 s2 : t), forall (x1 x2 : elt), Equal s1 (f s2) -> E.eq x1 (g (g x2)) -> Proof. (* Goal: None *) fsetdec. Qed. Lemma function_test_2 : forall (f : t -> t), forall (g : elt -> elt), forall (s1 s2 : t), forall (x1 x2 : elt), Equal s1 (f s2) -> E.eq x1 (g x2) -> Proof. (* Goal: None *) intros until 3. (* Goal: None *) intros g_eq. (* Goal: None *) rewrite <- g_eq. (* Goal: None *) fsetdec. Qed. Lemma test_baydemir : forall (f : t -> t), forall (s : t), forall (x y : elt), In x (add y (f s)) -> ~ E.eq x y -> Proof. (* Goal: None *) fsetdec. Qed. Lemma test_baydemir_2 : forall (x : elt) (s : t), Subset (inter (singleton x) s) empty -> ~ In x s. Proof. (* Goal: None *) fsetdec. Qed. Lemma test_baydemir_3 : forall (x y : elt) (s : t), ~ In x (add y s) -> x = y -> False. Proof. (* Goal: None *) fsetdec. Qed. Lemma test_baydemir_4 : forall (x : elt) (s : t), Equal (inter (add x empty) s) empty -> ~ In x s. Proof. (* Goal: None *) fsetdec. Qed. Lemma test_sweirich : forall (x : elt) (s : t), In x s -> Subset (singleton x) s. Proof. (* Goal: None *) fsetdec. Qed. End FSetDecideTestCases. End WDecide_fun. Require Import CoqMSetInterface. Module WDecide (M:WSets) := !WDecide_fun M.E M. Module Decide := WDecide.
Require Export GeoCoq.Tarski_dev.Ch12_parallel. Section L13_1. Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}. Lemma per2_col_eq : forall A P P' B, A <> P -> A <> P' -> Per A P B -> Per A P' B -> Col P A P' -> P = P'. Proof. (* Goal: forall (A P P' B : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A P)) (_ : not (@eq (@Tpoint Tn) A P')) (_ : @Per Tn A P B) (_ : @Per Tn A P' B) (_ : @Col Tn P A P'), @eq (@Tpoint Tn) P P' *) intros. (* Goal: @eq (@Tpoint Tn) P P' *) induction(eq_dec_points P B). (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) subst B. (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) assert( A = P' \/ P = P'). (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: or (@eq (@Tpoint Tn) A P') (@eq (@Tpoint Tn) P P') *) apply(l8_9 A P' P H2); Col. (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) induction H4. (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) contradiction. (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) assumption. (* Goal: @eq (@Tpoint Tn) P P' *) induction(eq_dec_points P' B). (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) subst B. (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) assert(A = P \/ P' = P). (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: or (@eq (@Tpoint Tn) A P) (@eq (@Tpoint Tn) P' P) *) apply(l8_9 A P P' H1); Col. (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) induction H5; auto. (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) contradiction. (* Goal: @eq (@Tpoint Tn) P P' *) apply per_perp_in in H1; auto. (* Goal: @eq (@Tpoint Tn) P P' *) apply per_perp_in in H2; auto. (* Goal: @eq (@Tpoint Tn) P P' *) apply perp_in_comm in H1. (* Goal: @eq (@Tpoint Tn) P P' *) apply perp_in_comm in H2. (* Goal: @eq (@Tpoint Tn) P P' *) apply perp_in_perp_bis in H1. (* Goal: @eq (@Tpoint Tn) P P' *) apply perp_in_perp_bis in H2. (* Goal: @eq (@Tpoint Tn) P P' *) induction H1; induction H2. (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) apply(l8_18_uniqueness P A B P P'); Col. (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @Perp Tn P A B P' *) (* Goal: not (@Col Tn P A B) *) apply perp_not_col; auto. (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @Perp Tn P A B P' *) apply perp_left_comm. (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @Perp Tn A P B P' *) apply(perp_col A P' B P' P); Perp. (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @Col Tn A P' P *) Col. (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) apply perp_distinct in H2. (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) tauto. (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) apply perp_distinct in H1. (* Goal: @eq (@Tpoint Tn) P P' *) (* Goal: @eq (@Tpoint Tn) P P' *) tauto. (* Goal: @eq (@Tpoint Tn) P P' *) apply perp_distinct in H1. (* Goal: @eq (@Tpoint Tn) P P' *) tauto. Qed. Lemma per2_preserves_diff : forall O A B A' B', O <> A' -> O <> B' -> Col O A' B' -> Per O A' A -> Per O B' B -> A' <> B' -> A <> B. Proof. (* Goal: forall (O A B A' B' : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) O A')) (_ : not (@eq (@Tpoint Tn) O B')) (_ : @Col Tn O A' B') (_ : @Per Tn O A' A) (_ : @Per Tn O B' B) (_ : not (@eq (@Tpoint Tn) A' B')), not (@eq (@Tpoint Tn) A B) *) intros. (* Goal: not (@eq (@Tpoint Tn) A B) *) intro. (* Goal: False *) subst B. (* Goal: False *) apply H4. (* Goal: @eq (@Tpoint Tn) A' B' *) apply(per2_col_eq O A' B' A);Col. Qed. Lemma per23_preserves_bet : forall A B C B' C', Bet A B C -> A <> B' -> A <> C' -> Col A B' C' -> Per A B' B -> Per A C' C -> Bet A B' C'. Lemma per23_preserves_bet_inv : forall A B C B' C', Bet A B' C' -> A <> B' -> Col A B C -> Per A B' B -> Per A C' C -> Bet A B C. Proof. (* Goal: forall (A B C B' C' : @Tpoint Tn) (_ : @Bet Tn A B' C') (_ : not (@eq (@Tpoint Tn) A B')) (_ : @Col Tn A B C) (_ : @Per Tn A B' B) (_ : @Per Tn A C' C), @Bet Tn A B C *) intros. (* Goal: @Bet Tn A B C *) induction(eq_dec_points B B'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) subst B'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(Col A C' C). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn A C' C *) apply bet_col in H. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn A C' C *) ColR. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(A = C' \/ C = C'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@eq (@Tpoint Tn) A C') (@eq (@Tpoint Tn) C C') *) apply(l8_9 A C' C); auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) induction H5. (* Goal: @Bet Tn A B C *) (* 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 *) (* Goal: @Bet Tn A B C *) apply between_identity in H. (* 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(Perp A B' B' B). (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn A B' B' B *) apply per_perp_in in H2. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) (* Goal: not (@eq (@Tpoint Tn) A B') *) (* Goal: @Perp Tn A B' B' B *) apply perp_in_comm in H2. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) (* Goal: not (@eq (@Tpoint Tn) A B') *) (* Goal: @Perp Tn A B' B' B *) apply perp_in_perp_bis in H2. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) (* Goal: not (@eq (@Tpoint Tn) A B') *) (* Goal: @Perp Tn A B' B' B *) induction H2. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) (* Goal: not (@eq (@Tpoint Tn) A B') *) (* Goal: @Perp Tn A B' B' B *) (* Goal: @Perp Tn A B' B' B *) Perp. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) (* Goal: not (@eq (@Tpoint Tn) A B') *) (* Goal: @Perp Tn A B' B' B *) apply perp_distinct in H2. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) (* Goal: not (@eq (@Tpoint Tn) A B') *) (* Goal: @Perp Tn A B' B' B *) tauto. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) (* Goal: not (@eq (@Tpoint Tn) A B') *) auto. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) B' B) *) auto. (* Goal: @Bet Tn A B C *) assert(Perp A C' C' C). (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn A C' C' C *) apply per_perp_in in H3. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@eq (@Tpoint Tn) A C') *) (* Goal: @Perp Tn A C' C' C *) apply perp_in_comm in H3. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@eq (@Tpoint Tn) A C') *) (* Goal: @Perp Tn A C' C' C *) apply perp_in_perp_bis in H3. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@eq (@Tpoint Tn) A C') *) (* Goal: @Perp Tn A C' C' C *) induction H3. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@eq (@Tpoint Tn) A C') *) (* Goal: @Perp Tn A C' C' C *) (* Goal: @Perp Tn A C' C' C *) Perp. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@eq (@Tpoint Tn) A C') *) (* Goal: @Perp Tn A C' C' C *) apply perp_distinct in H3. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@eq (@Tpoint Tn) A C') *) (* Goal: @Perp Tn A C' C' C *) tauto. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) C' C) *) (* Goal: not (@eq (@Tpoint Tn) A C') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) C' C) *) (* Goal: False *) subst C'. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) C' C) *) (* Goal: False *) apply between_identity in H. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) C' C) *) (* Goal: False *) contradiction. (* 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 *) induction(eq_dec_points A C). (* Goal: @Bet Tn A B C *) (* Goal: False *) (* Goal: False *) subst C. (* Goal: @Bet Tn A B C *) (* Goal: False *) (* Goal: False *) apply between_identity in H. (* Goal: @Bet Tn A B C *) (* Goal: False *) (* Goal: False *) contradiction. (* Goal: @Bet Tn A B C *) (* Goal: False *) assert(Col A B' B). (* Goal: @Bet Tn A B C *) (* Goal: False *) (* Goal: @Col Tn A B' B *) apply bet_col in H. (* Goal: @Bet Tn A B C *) (* Goal: False *) (* Goal: @Col Tn A B' B *) ColR. (* Goal: @Bet Tn A B C *) (* Goal: False *) assert(A = B' \/ B = B'). (* Goal: @Bet Tn A B C *) (* Goal: False *) (* Goal: or (@eq (@Tpoint Tn) A B') (@eq (@Tpoint Tn) B B') *) apply(l8_9 A B' B); auto. (* Goal: @Bet Tn A B C *) (* Goal: False *) induction H8;contradiction. (* Goal: @Bet Tn A B C *) assert(Perp A B' C' C). (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn A B' C' C *) apply bet_col in H. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn A B' C' C *) apply(perp_col _ C'); Col. (* Goal: @Bet Tn A B C *) assert( Par B' B C' C). (* Goal: @Bet Tn A B C *) (* Goal: @Par Tn B' B C' C *) apply(l12_9 B' B C' C A B'); Cop. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn C' C A B' *) (* Goal: @Perp Tn B' B A B' *) Perp. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn C' C A B' *) Perp. (* Goal: @Bet Tn A B C *) induction(eq_dec_points B C). (* 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 B *) Between. (* Goal: @Bet Tn A B C *) induction H8. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(B' <> C'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) subst C'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) apply H8. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B' B) (@Col Tn X B' C)) *) exists B'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: and (@Col Tn B' B' B) (@Col Tn B' B' C) *) split; Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(HH:=l12_6 B' B C' C H8). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(TS B' B A C'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @TS Tn B' B A C' *) repeat split; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B' B) (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B' B) *) (* Goal: not (@Col Tn A B' B) *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B' B) (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B' B) *) (* Goal: False *) assert(A = B' \/ B = B'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B' B) (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B' B) *) (* Goal: False *) (* Goal: or (@eq (@Tpoint Tn) A B') (@eq (@Tpoint Tn) B B') *) apply(l8_9 A B' B); auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B' B) (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B' B) *) (* Goal: False *) induction H12;contradiction. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B' B) (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B' B) *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B' B) (@Bet Tn A T C')) *) (* Goal: False *) assert(Col A B' B). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B' B) (@Bet Tn A T C')) *) (* Goal: False *) (* Goal: @Col Tn A B' B *) assert_cols. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B' B) (@Bet Tn A T C')) *) (* Goal: False *) (* Goal: @Col Tn A B' B *) ColR. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B' B) (@Bet Tn A T C')) *) (* Goal: False *) assert(A = B' \/ B = B'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B' B) (@Bet Tn A T C')) *) (* Goal: False *) (* Goal: or (@eq (@Tpoint Tn) A B') (@eq (@Tpoint Tn) B B') *) apply(l8_9 A B' B); auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B' B) (@Bet Tn A T C')) *) (* Goal: False *) induction H13;contradiction. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B' B) (@Bet Tn A T C')) *) exists B'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: and (@Col Tn B' B' B) (@Bet Tn A B' C') *) split; Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(TS B' B C A). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @TS Tn B' B C A *) apply(l9_8_2 B' B C' C A); auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @TS Tn B' B C' A *) apply l9_2. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @TS Tn B' B A C' *) assumption. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) unfold TS in H12. (* 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 *) ex_and H14 T. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(A <> C). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) A C) *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) subst C. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) apply between_identity in H15. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) subst T. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) contradiction. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert (T = B). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @eq (@Tpoint Tn) T B *) assert_cols. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @eq (@Tpoint Tn) T B *) apply (l6_21 A C B' B); Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: not (@Col Tn A C B') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) assert(Col A B' B). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) (* Goal: @Col Tn A B' B *) ColR. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) assert(A = B' \/ B = B'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) (* Goal: or (@eq (@Tpoint Tn) A B') (@eq (@Tpoint Tn) B B') *) apply(l8_9 A B' B); auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) induction H21;contradiction. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) subst T. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) Between. (* Goal: @Bet Tn A B C *) spliter. (* Goal: @Bet Tn A B C *) assert_cols. (* Goal: @Bet Tn A B C *) assert(Col A B' B). (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn A B' B *) ColR. (* Goal: @Bet Tn A B C *) assert(A = B' \/ B = B'). (* Goal: @Bet Tn A B C *) (* Goal: or (@eq (@Tpoint Tn) A B') (@eq (@Tpoint Tn) B B') *) apply(l8_9 A B' B); auto. (* Goal: @Bet Tn A B C *) induction H15;contradiction. Qed. Lemma per13_preserves_bet : 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(B = C' \/ C = C'). (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A B C' *) (* Goal: or (@eq (@Tpoint Tn) B C') (@eq (@Tpoint Tn) C C') *) apply l8_9; auto. (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A B C' *) induction H7. (* 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 A A' B). (* Goal: @Bet Tn A' B C' *) (* Goal: False *) (* Goal: @Col Tn A A' B *) ColR. (* Goal: @Bet Tn A' B C' *) (* Goal: False *) assert(B = A' \/ A = A'). (* Goal: @Bet Tn A' B C' *) (* Goal: False *) (* Goal: or (@eq (@Tpoint Tn) B A') (@eq (@Tpoint Tn) A A') *) apply l8_9; Col. (* Goal: @Bet Tn A' B C' *) (* Goal: False *) induction H8; tauto. (* 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 *) 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: not (@eq (@Tpoint Tn) C A) *) (* 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: not (@eq (@Tpoint Tn) C A) *) (* Goal: False *) unfold TS in H13. (* 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 *) 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: not (@eq (@Tpoint Tn) C A) *) (* Goal: False *) apply H13. (* 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 C' B 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) *) (* 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 *) 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 *) 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' *) 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' *) apply invert_one_side in H15. (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) apply invert_one_side in H16. (* 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' *) induction(eq_dec_points A C). (* 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' *) apply between_identity in H. (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) subst B. (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' A C' *) clean_duplicated_hyps. (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' A C' *) clean_trivial_hyps. (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' A C' *) apply l8_8 in H4. (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' A C' *) contradiction. (* Goal: @Bet Tn A' B C' *) assert(Col B C' C). (* Goal: @Bet Tn A' B C' *) (* Goal: @Col Tn B C' C *) ColR. (* Goal: @Bet Tn A' B C' *) apply per_not_col in H4; auto. (* Goal: @Bet Tn A' B C' *) contradiction. 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 per3_preserves_bet1 : forall O A B C A' B' C', Col O A B -> Bet A B C -> O <> A' -> O <> B' -> O <> C' -> Per O A' A -> Per O B' B -> Per O C' C -> Col A' B' C' -> Col O A' B' -> Bet A' B' C'. Proof. (* Goal: forall (O A B C A' B' C' : @Tpoint Tn) (_ : @Col Tn O A B) (_ : @Bet Tn A B C) (_ : not (@eq (@Tpoint Tn) O A')) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O C')) (_ : @Per Tn O A' A) (_ : @Per Tn O B' B) (_ : @Per Tn O C' C) (_ : @Col Tn A' B' C') (_ : @Col Tn O A' B'), @Bet Tn A' B' C' *) intros O A B C A' B' C'. (* Goal: forall (_ : @Col Tn O A B) (_ : @Bet Tn A B C) (_ : not (@eq (@Tpoint Tn) O A')) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O C')) (_ : @Per Tn O A' A) (_ : @Per Tn O B' B) (_ : @Per Tn O C' C) (_ : @Col Tn A' B' C') (_ : @Col Tn O A' B'), @Bet Tn A' B' C' *) intro HC. (* Goal: forall (_ : @Bet Tn A B C) (_ : not (@eq (@Tpoint Tn) O A')) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O C')) (_ : @Per Tn O A' A) (_ : @Per Tn O B' B) (_ : @Per Tn O C' C) (_ : @Col Tn A' B' C') (_ : @Col Tn O A' B'), @Bet Tn A' B' C' *) intros. (* Goal: @Bet Tn A' B' C' *) induction(eq_dec_points A B). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) subst B. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) assert(A' = B'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @eq (@Tpoint Tn) A' B' *) apply(per2_col_eq O A' B' A H0 H1 H3 H4); Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) subst B'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' A' C' *) Between. (* 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' *) induction(eq_dec_points B B'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) subst B'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B C' *) assert(Col O C C'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B C' *) (* Goal: @Col Tn O C C' *) apply bet_col in H. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B C' *) (* Goal: @Col Tn O C C' *) ColR. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B C' *) assert(C = C'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B C' *) (* Goal: @eq (@Tpoint Tn) C C' *) apply bet_col in H. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B C' *) (* Goal: @eq (@Tpoint Tn) C C' *) assert(O = C' \/ C = C'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B C' *) (* Goal: @eq (@Tpoint Tn) C C' *) (* Goal: or (@eq (@Tpoint Tn) O C') (@eq (@Tpoint Tn) C C') *) apply(l8_9 O C' C H5); Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B C' *) (* Goal: @eq (@Tpoint Tn) C C' *) induction H10. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B C' *) (* Goal: @eq (@Tpoint Tn) C C' *) (* Goal: @eq (@Tpoint Tn) C C' *) contradiction. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B C' *) (* Goal: @eq (@Tpoint Tn) C C' *) assumption. (* Goal: @Bet Tn A' B' C' *) (* 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' *) (* Goal: @Bet Tn A B C *) assumption. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) induction(eq_dec_points A B'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) subst B'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A A C' *) Between. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) assert(A <> C). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: not (@eq (@Tpoint Tn) A C) *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: False *) subst C. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: False *) apply between_identity in H. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: False *) contradiction. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) assert( ~ Col O B' B). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: not (@Col Tn O B' B) *) apply(per_not_col O B' B H1); auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) assert(C <> C'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: not (@eq (@Tpoint Tn) C C') *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: False *) subst C'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: False *) clean_trivial_hyps. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: False *) apply H12. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Col Tn O B' B *) apply bet_col in H. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Col Tn O B' B *) ColR. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) assert(Perp B B' O A). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Perp Tn B B' O A *) apply per_perp_in in H4; auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Perp Tn B B' O A *) apply perp_in_perp_bis in H4. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Perp Tn B B' O A *) induction H4. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Perp Tn B B' O A *) (* Goal: @Perp Tn B B' O A *) apply perp_distinct in H4. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Perp Tn B B' O A *) (* Goal: @Perp Tn B B' O A *) tauto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Perp Tn B B' O A *) apply perp_sym. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Perp Tn O A B B' *) apply perp_right_comm. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Perp Tn O A B' B *) apply(perp_col O B' B' B A); auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Col Tn O B' A *) Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) assert(Perp C C' O A). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Perp Tn C C' O A *) apply per_perp_in in H5; auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Perp Tn C C' O A *) apply perp_in_perp_bis in H5. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Perp Tn C C' O A *) induction H5. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Perp Tn C C' O A *) (* Goal: @Perp Tn C C' O A *) apply perp_distinct in H5. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Perp Tn C C' O A *) (* Goal: @Perp Tn C C' O A *) tauto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Perp Tn C C' O A *) apply perp_sym. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Perp Tn O A C C' *) apply perp_right_comm. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Perp Tn O A C' C *) apply(perp_col O C' C' C A); auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Col Tn O C' A *) apply bet_col in H. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Col Tn O C' A *) ColR. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) assert(Par B B' C C'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Par Tn B B' C C' *) apply(l12_9 B B' C C' O A); Cop. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) induction H16. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) assert(HH:=l12_6 B B' C C' H16). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) assert(TS B B' A C). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @TS Tn B B' A C *) unfold TS. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: and (not (@Col Tn A B B')) (and (not (@Col Tn C B B')) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)))) *) repeat split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C B B') *) (* Goal: not (@Col Tn A B B') *) assert(~Col B' A B). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C B B') *) (* Goal: not (@Col Tn A B B') *) (* Goal: not (@Col Tn B' A B) *) apply(perp_not_col). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C B B') *) (* Goal: not (@Col Tn A B B') *) (* Goal: @Perp Tn B' A B B' *) apply perp_left_comm. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C B B') *) (* Goal: not (@Col Tn A B B') *) (* Goal: @Perp Tn A B' B B' *) apply(perp_col A O B B' B'); Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C B B') *) (* Goal: not (@Col Tn A B B') *) (* Goal: @Perp Tn A O B B' *) finish. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C B B') *) (* Goal: not (@Col Tn A B B') *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C B B') *) (* Goal: False *) apply H17. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C B B') *) (* Goal: @Col Tn B' A B *) Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C B B') *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: False *) apply H16. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X C C')) *) exists C. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: and (@Col Tn C B B') (@Col Tn C C C') *) split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) exists B. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: and (@Col Tn B B B') (@Bet Tn A B C) *) split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) assert(TS B B' C' A). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @TS Tn B B' C' A *) apply(l9_8_2 B B' C C' A). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @OS Tn B B' C C' *) (* Goal: @TS Tn B B' C A *) apply l9_2. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @OS Tn B B' C C' *) (* Goal: @TS Tn B B' A C *) assumption. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @OS Tn B B' C C' *) assumption. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) unfold TS in H18. (* Goal: @Bet Tn A' B' C' *) (* 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' *) (* Goal: @Bet Tn A B' C' *) ex_and H20 T. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) assert(B'=T). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @eq (@Tpoint Tn) B' T *) apply (l6_21 B B' A C'); Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: not (@eq (@Tpoint Tn) A C') *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: False *) subst C'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: False *) apply between_identity in H21. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: False *) subst T. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: False *) contradiction. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) subst T. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn A B' C' *) apply between_symmetry. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Bet Tn C' B' A *) assumption. (* 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' *) assert(Per O C' B). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Per Tn O C' B *) apply(per_col O C' C B); Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) assert(B'=C'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @eq (@Tpoint Tn) B' C' *) apply(per2_col_eq O B' C' B); Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A B' C' *) (* Goal: @Col Tn B' O C' *) ColR. (* 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' B' *) Between. (* Goal: @Bet Tn A' B' C' *) induction(eq_dec_points A' B'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) subst B'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' A' C' *) Between. (* Goal: @Bet Tn A' B' C' *) induction(eq_dec_points B C). (* 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' *) assert(B' = C'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @eq (@Tpoint Tn) B' C' *) apply(per2_col_eq O B' C' B); auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Col Tn B' O C' *) ColR. (* 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' B' *) Between. (* Goal: @Bet Tn A' B' C' *) induction(eq_dec_points B B'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) subst B'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) induction(eq_dec_points A' B). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) subst B. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' A' C' *) Between. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) assert(C <> C'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: not (@eq (@Tpoint Tn) C C') *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: False *) subst C'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: False *) assert( ~ Col O A' A). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: False *) (* Goal: not (@Col Tn O A' A) *) apply(per_not_col O A' A ); auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: False *) apply H13. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Col Tn O A' A *) apply bet_col in H. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Col Tn O A' A *) ColR. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) assert(Perp A A' O A'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn A A' O A' *) apply per_perp_in in H3; auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn A A' O A' *) apply perp_in_comm in H3. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn A A' O A' *) apply perp_in_perp_bis in H3. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn A A' O A' *) induction H3. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn A A' O A' *) (* Goal: @Perp Tn A A' O A' *) finish. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn A A' O A' *) apply perp_distinct in H3. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn A A' O A' *) tauto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) assert(Perp C C' O A'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn C C' O A' *) apply per_perp_in in H5; auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn C C' O A' *) apply perp_in_comm in H5. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn C C' O A' *) apply perp_in_perp_bis in H5. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn C C' O A' *) induction H5. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn C C' O A' *) (* Goal: @Perp Tn C C' O A' *) apply perp_sym. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn C C' O A' *) (* Goal: @Perp Tn O A' C C' *) apply (perp_col _ C'); auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn C C' O A' *) (* Goal: @Col Tn O C' A' *) (* Goal: @Perp Tn O C' C C' *) finish. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn C C' O A' *) (* Goal: @Col Tn O C' A' *) ColR. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn C C' O A' *) apply perp_distinct in H5. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Perp Tn C C' O A' *) tauto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) assert(Col O A A'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) assert(Par A A' C C'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Par Tn A A' C C' *) apply(l12_9 A A' C C' O A'); Cop. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) induction H17. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) assert(HH:=l12_6 A A' C C' H17). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) assert(OS C C' A A'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @OS Tn C C' A A' *) apply(l12_6 C C' A A'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Par_strict Tn C C' A A' *) finish. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) assert(OS C C' A B). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @OS Tn C C' A B *) apply(out_one_side C C' A B). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C A B *) (* Goal: or (not (@Col Tn C C' A)) (not (@Col Tn C C' B)) *) left. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C A B *) (* Goal: not (@Col Tn C C' A) *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C A B *) (* Goal: False *) apply H17. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C A B *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A A') (@Col Tn X C C')) *) exists A. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C A B *) (* Goal: and (@Col Tn A A A') (@Col Tn A C C') *) split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C A B *) unfold Out. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: and (not (@eq (@Tpoint Tn) A C)) (and (not (@eq (@Tpoint Tn) B C)) (or (@Bet Tn C A B) (@Bet Tn C B A))) *) repeat split; auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: or (@Bet Tn C A B) (@Bet Tn C B A) *) (* Goal: not (@eq (@Tpoint Tn) A C) *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: or (@Bet Tn C A B) (@Bet Tn C B A) *) (* Goal: False *) subst C. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: or (@Bet Tn C A B) (@Bet Tn C B A) *) (* Goal: False *) apply between_identity in H. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: or (@Bet Tn C A B) (@Bet Tn C B A) *) (* Goal: False *) contradiction. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: or (@Bet Tn C A B) (@Bet Tn C B A) *) right. (* Goal: @Bet Tn A' B' C' *) (* 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' *) (* Goal: @Bet Tn A' B C' *) assert(OS C C' A' B). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @OS Tn C C' A' B *) apply(one_side_transitivity C C' A' A); auto. (* Goal: @Bet Tn A' B' C' *) (* 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: @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' *) (* Goal: @Bet Tn A' B C' *) assert(Out C' B A'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) induction H6. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) unfold Out. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: and (not (@eq (@Tpoint Tn) B C')) (and (not (@eq (@Tpoint Tn) A' C')) (or (@Bet Tn C' B A') (@Bet Tn C' A' B))) *) repeat split. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* 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: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* 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: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: False *) clean_trivial_hyps. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: False *) unfold OS in H18. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: False *) ex_and H18 T. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: False *) unfold TS in H4. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: False *) spliter. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: False *) apply H4. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn A C B *) Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* 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: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* 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: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: False *) apply H17. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A A') (@Col Tn X C A')) *) exists A'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: and (@Col Tn A' A A') (@Col Tn A' C A') *) split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* 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 A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Bet Tn C' B A' *) Between. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) induction H6. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) assert(TS C C' B A'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) (* Goal: @TS Tn C C' B A' *) unfold TS. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) (* Goal: and (not (@Col Tn B C C')) (and (not (@Col Tn A' C C')) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C C') (@Bet Tn B T A')))) *) repeat split. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C C') (@Bet Tn B T A')) *) (* Goal: not (@Col Tn A' C C') *) (* Goal: not (@Col Tn B C C') *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C C') (@Bet Tn B T A')) *) (* Goal: not (@Col Tn A' C C') *) (* Goal: False *) unfold OS in H19. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C C') (@Bet Tn B T A')) *) (* Goal: not (@Col Tn A' C C') *) (* Goal: False *) ex_and H19 T. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C C') (@Bet Tn B T A')) *) (* Goal: not (@Col Tn A' C C') *) (* Goal: False *) unfold TS in H22. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C C') (@Bet Tn B T A')) *) (* Goal: not (@Col Tn A' C C') *) (* Goal: False *) spliter. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C C') (@Bet Tn B T A')) *) (* Goal: not (@Col Tn A' C C') *) (* Goal: False *) contradiction. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C C') (@Bet Tn B T A')) *) (* Goal: not (@Col Tn A' C C') *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C C') (@Bet Tn B T A')) *) (* Goal: False *) apply H17. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C C') (@Bet Tn B T A')) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A A') (@Col Tn X C C')) *) exists A'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C C') (@Bet Tn B T A')) *) (* Goal: and (@Col Tn A' A A') (@Col Tn A' C C') *) split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C C') (@Bet Tn B T A')) *) exists C'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) (* Goal: and (@Col Tn C' C C') (@Bet Tn B C' A') *) split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) apply one_side_symmetry in H20. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) apply l9_9_bis in H20. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) (* Goal: @Out Tn C' B A' *) contradiction. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn C' B A' *) unfold Out. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: and (not (@eq (@Tpoint Tn) B C')) (and (not (@eq (@Tpoint Tn) A' C')) (or (@Bet Tn C' B A') (@Bet Tn C' A' B))) *) repeat split. (* Goal: @Bet Tn A' B' 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: not (@eq (@Tpoint Tn) B C') *) intro. (* Goal: @Bet Tn A' B' 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 *) subst C'. (* Goal: @Bet Tn A' B' 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 H17. (* Goal: @Bet Tn A' B' 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: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A A') (@Col Tn X C B)) *) exists A. (* Goal: @Bet Tn A' B' 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: and (@Col Tn A A A') (@Col Tn A C B) *) apply bet_col in H. (* Goal: @Bet Tn A' B' 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: and (@Col Tn A A A') (@Col Tn A C B) *) split; Col. (* Goal: @Bet Tn A' B' 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') *) intro. (* Goal: @Bet Tn A' B' 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 *) subst C'. (* Goal: @Bet Tn A' B' 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 H17. (* Goal: @Bet Tn A' B' 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: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A A') (@Col Tn X C A')) *) exists A'. (* Goal: @Bet Tn A' B' 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: and (@Col Tn A' A A') (@Col Tn A' C A') *) split; Col. (* Goal: @Bet Tn A' B' 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) *) right; auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) assert(Out A' B C'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) induction H6. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @Out Tn A' B C' *) unfold Out. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: and (not (@eq (@Tpoint Tn) B A')) (and (not (@eq (@Tpoint Tn) C' A')) (or (@Bet Tn A' B C') (@Bet Tn A' C' B))) *) repeat split. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out 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: @Bet Tn A' B C' *) (* Goal: @Out 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: @Bet Tn A' B C' *) (* Goal: @Out 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 *) clean_trivial_hyps. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out 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 H17. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X C C')) *) exists C. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: and (@Col Tn C A B) (@Col Tn C C C') *) apply bet_col in H. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: and (@Col Tn C A B) (@Col Tn C C C') *) split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out 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: @Bet Tn A' B C' *) (* Goal: @Out 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: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: False *) unfold Out in H21. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: False *) tauto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out 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' *) (* Goal: @Out Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) induction H6. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @Out Tn A' B C' *) unfold Out in H21. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @Out Tn A' B C' *) spliter. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @Out Tn A' B C' *) unfold Out. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: and (not (@eq (@Tpoint Tn) B A')) (and (not (@eq (@Tpoint Tn) C' A')) (or (@Bet Tn A' B C') (@Bet Tn A' C' B))) *) repeat split. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out 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: @Bet Tn A' B C' *) (* Goal: @Out 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: @Bet Tn A' B C' *) (* Goal: @Out 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 H17. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X C C')) *) exists C. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: and (@Col Tn C A B) (@Col Tn C C C') *) apply bet_col in H. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: and (@Col Tn C A B) (@Col Tn C C C') *) split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) induction H23. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* 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' *) (* Goal: @Out Tn A' B C' *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: @Bet Tn A' B C' *) Between. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) apply False_ind. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: False *) apply H22. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @eq (@Tpoint Tn) A' C' *) apply (between_equality _ _ B); Between. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) assert(OS A A' B C). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @OS Tn A A' B C *) apply(out_one_side A A' B C). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @Out Tn A B C *) (* Goal: or (not (@Col Tn A A' B)) (not (@Col Tn A A' C)) *) right. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @Out Tn A B C *) (* Goal: not (@Col Tn A A' C) *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @Out Tn A B C *) (* Goal: False *) apply H17. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @Out Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A A') (@Col Tn X C C')) *) exists C. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @Out Tn A B C *) (* Goal: and (@Col Tn C A A') (@Col Tn C C C') *) split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @Out Tn A B C *) unfold Out. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: and (not (@eq (@Tpoint Tn) B A)) (and (not (@eq (@Tpoint Tn) C A)) (or (@Bet Tn A B C) (@Bet Tn A C B))) *) repeat split; auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: not (@eq (@Tpoint Tn) C A) *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: False *) subst C. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: False *) apply between_identity in H. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: False *) contradiction. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) assert(OS A A' C' B). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @OS Tn A A' C' B *) apply(one_side_transitivity A A' C' C); apply one_side_symmetry; auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) assert(TS A A' B C'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @TS Tn A A' B C' *) unfold TS. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: and (not (@Col Tn B A A')) (and (not (@Col Tn C' A A')) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B T C')))) *) repeat split. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B T C')) *) (* Goal: not (@Col Tn C' A A') *) (* Goal: not (@Col Tn B A A') *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B T C')) *) (* Goal: not (@Col Tn C' A A') *) (* Goal: False *) unfold OS in H22. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B T C')) *) (* Goal: not (@Col Tn C' A A') *) (* Goal: False *) ex_and H22 T. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B T C')) *) (* Goal: not (@Col Tn C' A A') *) (* Goal: False *) unfold TS in H22. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B T C')) *) (* Goal: not (@Col Tn C' A A') *) (* Goal: False *) spliter. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B T C')) *) (* Goal: not (@Col Tn C' A A') *) (* Goal: False *) contradiction. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B T C')) *) (* Goal: not (@Col Tn C' A A') *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B T C')) *) (* Goal: False *) apply H17. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B T C')) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A A') (@Col Tn X C C')) *) exists C'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B T C')) *) (* Goal: and (@Col Tn C' A A') (@Col Tn C' C C') *) split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn B T C')) *) exists A'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: and (@Col Tn A' A A') (@Bet Tn B A' C') *) split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) (* Goal: @Bet Tn B A' C' *) Between. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) apply one_side_symmetry in H23. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) apply l9_9_bis in H23. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Out Tn A' B C' *) contradiction. (* Goal: @Bet Tn A' B' C' *) (* 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' *) (* Goal: @Bet Tn A' B C' *) spliter. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) clean_duplicated_hyps. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) induction H26; induction H24. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* 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' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) apply False_ind. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: False *) apply H21. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @eq (@Tpoint Tn) B C' *) apply(between_equality _ _ A'); Between. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) apply False_ind. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: False *) apply H10. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @eq (@Tpoint Tn) A' B *) apply(between_equality _ _ C'); Between. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @Bet Tn A' B C' *) apply False_ind. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: False *) apply H25. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: @eq (@Tpoint Tn) A' C' *) apply(between_equality _ _ B); Between. (* 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' *) assert(~Col O C' C). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) (* Goal: not (@Col Tn O C' C) *) apply(per_not_col); auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B C' *) apply False_ind. (* Goal: @Bet Tn A' B' C' *) (* Goal: False *) apply H21. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Col Tn O C' C *) assert(A<>C). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Col Tn O C' C *) (* Goal: not (@eq (@Tpoint Tn) A C) *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Col Tn O C' C *) (* Goal: False *) subst C. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Col Tn O C' C *) (* Goal: False *) apply between_identity in H. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Col Tn O C' C *) (* Goal: False *) subst B. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Col Tn O C' C *) (* Goal: False *) tauto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Col Tn O C' C *) apply bet_col in H. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Col Tn O C' C *) ColR. (* Goal: @Bet Tn A' B' C' *) assert(Perp A A' O A'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn A A' O A' *) apply per_perp_in in H3; auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn A A' O A' *) apply perp_in_comm in H3. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn A A' O A' *) apply perp_in_perp_bis in H3. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn A A' O A' *) induction H3. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn A A' O A' *) (* Goal: @Perp Tn A A' O A' *) finish. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn A A' O A' *) apply perp_distinct in H3. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn A A' O A' *) tauto. (* Goal: @Bet Tn A' B' C' *) assert(Perp B B' O A'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn B B' O A' *) apply per_perp_in in H4; auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn B B' O A' *) apply perp_in_comm in H4. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn B B' O A' *) apply perp_in_perp_bis in H4. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn B B' O A' *) induction H4. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn B B' O A' *) (* Goal: @Perp Tn B B' O A' *) apply perp_sym. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn B B' O A' *) (* Goal: @Perp Tn O A' B B' *) apply (perp_col _ B'); Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn B B' O A' *) (* Goal: @Perp Tn O B' B B' *) finish. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn B B' O A' *) apply perp_distinct in H4. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn B B' O A' *) tauto. (* Goal: @Bet Tn A' B' C' *) assert(Par A A' B B'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Par Tn A A' B B' *) apply(l12_9 A A' B B' O A'); Cop. (* Goal: @Bet Tn A' B' C' *) induction H15. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) assert(HH:=l12_6 A A' B B' H15). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) assert(TS B B' A C). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @TS Tn B B' A C *) unfold TS. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: and (not (@Col Tn A B B')) (and (not (@Col Tn C B B')) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)))) *) repeat split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C B B') *) (* Goal: not (@Col Tn A B B') *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C B B') *) (* Goal: False *) apply H15. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C B B') *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A A') (@Col Tn X B B')) *) exists A. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C B B') *) (* Goal: and (@Col Tn A A A') (@Col Tn A B B') *) split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C B B') *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: False *) apply H11. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: @eq (@Tpoint Tn) B C *) apply (l6_21 B B' A C); Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@eq (@Tpoint Tn) A C) *) (* Goal: not (@Col Tn B B' A) *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@eq (@Tpoint Tn) A C) *) (* Goal: False *) apply H15. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@eq (@Tpoint Tn) A C) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A A') (@Col Tn X B B')) *) exists A. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@eq (@Tpoint Tn) A C) *) (* Goal: and (@Col Tn A A A') (@Col Tn A B B') *) split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: not (@eq (@Tpoint Tn) A C) *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: False *) subst C. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: False *) apply between_identity in H. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: False *) subst B. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) (* Goal: False *) tauto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C)) *) exists B. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: and (@Col Tn B B B') (@Bet Tn A B C) *) split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) assert(OS B B' A A'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @OS Tn B B' A A' *) apply(l12_6 B B' A A'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Par_strict Tn B B' A A' *) finish. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) assert(HP:= l9_8_2 B B' A A' C H16 H17). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) induction(eq_dec_points C C'). (* Goal: @Bet Tn A' B' C' *) (* 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' *) (* Goal: @Bet Tn A' B' C *) unfold TS in HP. (* Goal: @Bet Tn A' B' C' *) (* 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' *) (* Goal: @Bet Tn A' B' C *) ex_and H20 T. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C *) assert(T = B'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C *) (* Goal: @eq (@Tpoint Tn) T B' *) apply (l6_21 B B' A' C); Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C *) (* Goal: not (@eq (@Tpoint Tn) A' C) *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C *) (* Goal: False *) subst A'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C *) (* Goal: False *) apply between_identity in H21. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C *) (* Goal: False *) subst T. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C *) (* Goal: False *) contradiction. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C *) subst T. (* 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(Perp C C' O A'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn C C' O A' *) apply per_perp_in in H5; auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn C C' O A' *) apply perp_in_comm in H5. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn C C' O A' *) apply perp_in_perp_bis in H5. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn C C' O A' *) induction H5. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn C C' O A' *) (* Goal: @Perp Tn C C' O A' *) apply perp_sym. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn C C' O A' *) (* Goal: @Perp Tn O A' C C' *) apply (perp_col _ C'); finish. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn C C' O A' *) (* Goal: @Col Tn O C' A' *) ColR. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn C C' O A' *) apply perp_distinct in H5. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Perp Tn C C' O A' *) tauto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) assert(Par B B' C C'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Par Tn B B' C C' *) apply(l12_9 B B' C C' O A'); auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: @Coplanar Tn O A' B' C *) (* Goal: @Coplanar Tn O A' B C' *) (* Goal: @Coplanar Tn O A' B C *) exists O. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: @Coplanar Tn O A' B' C *) (* Goal: @Coplanar Tn O A' B C' *) (* Goal: or (and (@Col Tn O A' O) (@Col Tn B C O)) (or (and (@Col Tn O B O) (@Col Tn A' C O)) (and (@Col Tn O C O) (@Col Tn A' B O))) *) left. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: @Coplanar Tn O A' B' C *) (* Goal: @Coplanar Tn O A' B C' *) (* Goal: and (@Col Tn O A' O) (@Col Tn B C O) *) split; ColR. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: @Coplanar Tn O A' B' C *) (* Goal: @Coplanar Tn O A' B C' *) exists C'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: @Coplanar Tn O A' B' C *) (* Goal: or (and (@Col Tn O A' C') (@Col Tn B C' C')) (or (and (@Col Tn O B C') (@Col Tn A' C' C')) (and (@Col Tn O C' C') (@Col Tn A' B C'))) *) left. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: @Coplanar Tn O A' B' C *) (* Goal: and (@Col Tn O A' C') (@Col Tn B C' C') *) split; ColR. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: @Coplanar Tn O A' B' C *) exists B'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: or (and (@Col Tn O A' B') (@Col Tn B' C B')) (or (and (@Col Tn O B' B') (@Col Tn A' C B')) (and (@Col Tn O C B') (@Col Tn A' B' B'))) *) left. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: and (@Col Tn O A' B') (@Col Tn B' C B') *) split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Coplanar Tn O A' B' C' *) exists B'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: or (and (@Col Tn O A' B') (@Col Tn B' C' B')) (or (and (@Col Tn O B' B') (@Col Tn A' C' B')) (and (@Col Tn O C' B') (@Col Tn A' B' B'))) *) left. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: and (@Col Tn O A' B') (@Col Tn B' C' B') *) split; Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) induction H20. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) assert(HQ:=l12_6 B B' C C' H20). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) assert(TS B B' C' A'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @TS Tn B B' C' A' *) apply(l9_8_2 B B' C C' A'); auto. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @TS Tn B B' C A' *) apply l9_2. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @TS Tn B B' A' C *) assumption. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) unfold TS in H21. (* Goal: @Bet Tn A' B' C' *) (* 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' *) (* Goal: @Bet Tn A' B' C' *) ex_and H23 T. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) assert(T = B'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @eq (@Tpoint Tn) T B' *) apply (l6_21 B B' A' C'); Col. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) intro. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: False *) subst C'. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: False *) apply between_identity in H24. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: False *) subst T. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: False *) contradiction. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) subst T. (* 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' *) spliter. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) unfold TS in HP. (* 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' *) apply False_ind. (* Goal: @Bet Tn A' B' C' *) (* Goal: False *) apply H25. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Col Tn C B B' *) ColR. (* Goal: @Bet Tn A' B' C' *) spliter. (* Goal: @Bet Tn A' B' C' *) apply perp_left_comm in H13. (* Goal: @Bet Tn A' B' C' *) apply perp_not_col in H13. (* Goal: @Bet Tn A' B' C' *) apply False_ind. (* Goal: False *) apply H13. (* Goal: @Col Tn A' A O *) ColR. Qed. Lemma per3_preserves_bet2_aux : forall O A B C B' C', Col O A C -> A <> C' -> Bet A B' C' -> O <> A -> O <> B' -> O <> C' -> Per O B' B -> Per O C' C -> Col A B C -> Col O A C' -> Bet A B C. Proof. (* Goal: forall (O A B C B' C' : @Tpoint Tn) (_ : @Col Tn O A C) (_ : not (@eq (@Tpoint Tn) A C')) (_ : @Bet Tn A B' C') (_ : not (@eq (@Tpoint Tn) O A)) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O C')) (_ : @Per Tn O B' B) (_ : @Per Tn O C' C) (_ : @Col Tn A B C) (_ : @Col Tn O A C'), @Bet Tn A B C *) intros O A B C B' C'. (* Goal: forall (_ : @Col Tn O A C) (_ : not (@eq (@Tpoint Tn) A C')) (_ : @Bet Tn A B' C') (_ : not (@eq (@Tpoint Tn) O A)) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O C')) (_ : @Per Tn O B' B) (_ : @Per Tn O C' C) (_ : @Col Tn A B C) (_ : @Col Tn O A C'), @Bet Tn A B C *) intro HX. (* Goal: forall (_ : not (@eq (@Tpoint Tn) A C')) (_ : @Bet Tn A B' C') (_ : not (@eq (@Tpoint Tn) O A)) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O C')) (_ : @Per Tn O B' B) (_ : @Per Tn O C' C) (_ : @Col Tn A B C) (_ : @Col Tn O A C'), @Bet Tn A B C *) intros. (* Goal: @Bet Tn A B C *) induction(eq_dec_points A B). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) subst B. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A A C *) Between. (* Goal: @Bet Tn A B C *) induction(eq_dec_points B C). (* 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 B *) Between. (* Goal: @Bet Tn A B C *) assert(Col O A B'). (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn O A B' *) apply bet_col in H0. (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn O A B' *) ColR. (* Goal: @Bet Tn A B C *) assert(Col O B' C'). (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn O B' C' *) apply bet_col in H0. (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn O B' C' *) ColR. (* Goal: @Bet Tn A B C *) induction(eq_dec_points B B'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) subst B'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(Col O C C'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn O C C' *) apply bet_col in H0. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn O C C' *) ColR. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(C = C'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @eq (@Tpoint Tn) C C' *) apply(per_col_eq C C' O); finish. (* 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 *) apply per_not_col in H4; auto. (* Goal: @Bet Tn A B C *) (* Goal: False *) apply H4. (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn O B' B *) ColR. (* Goal: @Bet Tn A B C *) assert(Perp O A C C'). (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A C C' *) apply per_perp_in in H5; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A C C' *) apply perp_in_comm in H5. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A C C' *) apply perp_in_perp_bis in H5. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A C C' *) induction H5. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A C C' *) (* Goal: @Perp Tn O A C C' *) apply (perp_col _ C'); finish. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A C C' *) apply perp_distinct in H5. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A C C' *) tauto. (* Goal: @Bet Tn A B C *) assert(Perp O A B B'). (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A B B' *) apply per_perp_in in H4; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A B B' *) apply perp_in_comm in H4. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A B B' *) apply perp_in_perp_bis in H4. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A B B' *) induction H4. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A B B' *) (* Goal: @Perp Tn O A B B' *) apply (perp_col _ B'); finish. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A B B' *) apply perp_distinct in H4. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A B B' *) tauto. (* Goal: @Bet Tn A B C *) assert(Par B B' C C'). (* Goal: @Bet Tn A B C *) (* Goal: @Par Tn B B' C C' *) apply(l12_9 B B' C C' O A);finish. (* Goal: @Bet Tn A B C *) induction H16. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(HH:=l12_6 B B' C C' H16). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(TS B B' A C'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @TS Tn B B' A C' *) repeat split; finish. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B B') *) (* Goal: not (@Col Tn A B B') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B B') *) (* Goal: False *) assert(Per B B' A). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B B') *) (* Goal: False *) (* Goal: @Per Tn B B' A *) apply(per_col B B' O A); finish. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B B') *) (* Goal: False *) apply per_not_col in H18; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B B') *) (* Goal: not (@eq (@Tpoint Tn) B' A) *) (* Goal: False *) apply H18. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B B') *) (* Goal: not (@eq (@Tpoint Tn) B' A) *) (* Goal: @Col Tn B B' A *) Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B B') *) (* Goal: not (@eq (@Tpoint Tn) B' A) *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B B') *) (* Goal: False *) subst B'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B B') *) (* Goal: False *) clean_trivial_hyps. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B B') *) (* Goal: False *) apply H16. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B B') *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B A) (@Col Tn X C C')) *) exists C. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B B') *) (* Goal: and (@Col Tn C B A) (@Col Tn C C C') *) split; Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) (* Goal: not (@Col Tn C' B B') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) (* Goal: False *) apply H16. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X C C')) *) exists C'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) (* Goal: and (@Col Tn C' B B') (@Col Tn C' C C') *) split; Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A T C')) *) exists B'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: and (@Col Tn B' B B') (@Bet Tn A B' C') *) split; finish. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(TS B B' C A). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @TS Tn B B' C A *) apply(l9_8_2 B B' C' C A). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @OS Tn B B' C' C *) (* Goal: @TS Tn B B' C' A *) apply l9_2; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @OS Tn B B' C' C *) apply one_side_symmetry; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) unfold TS in H18. (* 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 *) ex_and H20 T. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(B = T). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @eq (@Tpoint Tn) B T *) apply (l6_21 A C B' B); Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: not (@Col Tn A C B') *) assert(A <> C). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: not (@Col Tn A C B') *) (* Goal: not (@eq (@Tpoint Tn) A C) *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: not (@Col Tn A C B') *) (* Goal: False *) subst C. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: not (@Col Tn A C B') *) (* Goal: False *) apply between_identity in H21. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: not (@Col Tn A C B') *) (* Goal: False *) subst T. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: not (@Col Tn A C B') *) (* Goal: False *) contradiction. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: not (@Col Tn A C B') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) apply bet_col in H0. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) apply H19. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn A B B' *) ColR. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) subst T. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) Between. (* Goal: @Bet Tn A B C *) spliter. (* Goal: @Bet Tn A B C *) assert(B' <> C'). (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: False *) subst C'. (* Goal: @Bet Tn A B C *) (* Goal: False *) clean_trivial_hyps. (* Goal: @Bet Tn A B C *) (* Goal: False *) assert(Perp O B' C B'). (* Goal: @Bet Tn A B C *) (* Goal: False *) (* Goal: @Perp Tn O B' C B' *) apply(perp_col O A C B' B'); Col. (* Goal: @Bet Tn A B C *) (* Goal: False *) apply perp_left_comm in H0. (* Goal: @Bet Tn A B C *) (* Goal: False *) apply perp_not_col in H0. (* Goal: @Bet Tn A B C *) (* Goal: False *) apply H0. (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn B' O C *) ColR. (* Goal: @Bet Tn A B C *) assert(Per C C' B'). (* Goal: @Bet Tn A B C *) (* Goal: @Per Tn C C' B' *) apply(per_col C C' O B'); finish. (* Goal: @Bet Tn A B C *) apply per_not_col in H21; auto. (* Goal: @Bet Tn A B C *) apply False_ind. (* Goal: False *) apply H21. (* Goal: @Col Tn C C' B' *) Col. Qed. Lemma per3_preserves_bet2 : forall O A B C A' B' C', Col O A C -> A' <> C' -> Bet A' B' C' -> O <> A' -> O <> B' -> O <> C' -> Per O A' A -> Per O B' B -> Per O C' C -> Col A B C -> Col O A' C' -> Bet A B C. Proof. (* Goal: forall (O A B C A' B' C' : @Tpoint Tn) (_ : @Col Tn O A C) (_ : not (@eq (@Tpoint Tn) A' C')) (_ : @Bet Tn A' B' C') (_ : not (@eq (@Tpoint Tn) O A')) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O C')) (_ : @Per Tn O A' A) (_ : @Per Tn O B' B) (_ : @Per Tn O C' C) (_ : @Col Tn A B C) (_ : @Col Tn O A' C'), @Bet Tn A B C *) intros O A B C A' B' C'. (* Goal: forall (_ : @Col Tn O A C) (_ : not (@eq (@Tpoint Tn) A' C')) (_ : @Bet Tn A' B' C') (_ : not (@eq (@Tpoint Tn) O A')) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O C')) (_ : @Per Tn O A' A) (_ : @Per Tn O B' B) (_ : @Per Tn O C' C) (_ : @Col Tn A B C) (_ : @Col Tn O A' C'), @Bet Tn A B C *) intro HX. (* Goal: forall (_ : not (@eq (@Tpoint Tn) A' C')) (_ : @Bet Tn A' B' C') (_ : not (@eq (@Tpoint Tn) O A')) (_ : not (@eq (@Tpoint Tn) O B')) (_ : not (@eq (@Tpoint Tn) O C')) (_ : @Per Tn O A' A) (_ : @Per Tn O B' B) (_ : @Per Tn O C' C) (_ : @Col Tn A B C) (_ : @Col Tn O A' C'), @Bet Tn A B C *) intros. (* 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 *) apply (per3_preserves_bet2_aux O A B C B' C');auto. (* Goal: @Bet Tn A B C *) induction(eq_dec_points C C'). (* 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 *) apply between_symmetry. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn C B A *) apply(per3_preserves_bet2_aux O C B A B' A'); finish. (* Goal: @Bet Tn A B C *) assert(Perp O A' C C'). (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' C C' *) apply per_perp_in in H6; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' C C' *) apply perp_in_comm in H6. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' C C' *) apply perp_in_perp_bis in H6. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' C C' *) induction H6. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' C C' *) (* Goal: @Perp Tn O A' C C' *) apply (perp_col _ C'); finish. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' C C' *) apply perp_distinct in H6. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' C C' *) tauto. (* Goal: @Bet Tn A B C *) assert(Perp O A' A A'). (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' A A' *) apply per_perp_in in H4; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' A A' *) apply perp_in_comm in H4. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' A A' *) apply perp_in_perp_bis in H4. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' A A' *) induction H4. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' A A' *) (* Goal: @Perp Tn O A' A A' *) finish. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' A A' *) apply perp_distinct in H4. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' A A' *) 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' O A');finish. (* Goal: @Bet Tn A B C *) induction H13. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(HH:=l12_6 A A' C C' H13). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) apply par_strict_symmetry in H13. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(HP:=l12_6 C C' A A' H13). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) induction(eq_dec_points B B'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) subst B'. (* Goal: @Bet Tn A B C *) (* 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: @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: @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')) *) right. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Out Tn A' B C' *) (* Goal: not (@Col Tn A' A C') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Out Tn A' B C' *) (* Goal: False *) apply H13. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Out Tn A' B C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X C C') (@Col Tn X A A')) *) exists C'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Out Tn A' B C' *) (* Goal: and (@Col Tn C' C C') (@Col Tn C' A A') *) split; Col. (* Goal: @Bet Tn A B C *) (* 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: @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: @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: @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 H13. (* Goal: @Bet Tn A B 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: not (@eq (@Tpoint Tn) C' A') *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X C C') (@Col Tn X A B)) *) exists C. (* Goal: @Bet Tn A B 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: not (@eq (@Tpoint Tn) C' A') *) (* Goal: and (@Col Tn C C C') (@Col Tn C A B) *) split; Col. (* Goal: @Bet Tn A B 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: not (@eq (@Tpoint Tn) C' A') *) auto. (* Goal: @Bet Tn A B 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) *) left; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) apply invert_one_side in H14. (* Goal: @Bet Tn A B C *) (* 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: @Bet Tn A B C *) (* Goal: @OS Tn A A' B C *) apply (one_side_transitivity _ _ _ C'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @OS Tn A A' C' C *) (* Goal: @OS Tn A A' B C' *) assumption. (* Goal: @Bet Tn A B C *) (* 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: @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 *) (* Goal: @Bet Tn A B C *) assert(Out A B C). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Out Tn A B C *) apply (col_one_side_out A A');auto. (* Goal: @Bet Tn A B C *) (* 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: @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: @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')) *) right. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Out Tn C' B A' *) (* Goal: not (@Col Tn C' C A') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Out Tn C' B A' *) (* Goal: False *) apply H13. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Out Tn C' B A' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X C C') (@Col Tn X A A')) *) exists A'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Out Tn C' B A' *) (* Goal: and (@Col Tn A' C C') (@Col Tn A' A A') *) split; Col. (* Goal: @Bet Tn A B C *) (* 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: @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: @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: @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 H13. (* Goal: @Bet Tn A B 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: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X C B) (@Col Tn X A A')) *) exists A. (* Goal: @Bet Tn A B 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: and (@Col Tn A C B) (@Col Tn A A A') *) split; Col. (* Goal: @Bet Tn A B 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') *) auto. (* Goal: @Bet Tn A B 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) *) left; Between. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) apply invert_one_side in H17. (* Goal: @Bet Tn A B C *) (* 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: @Bet Tn A B C *) (* Goal: @OS Tn C C' B A *) apply (one_side_transitivity _ _ _ A'). (* Goal: @Bet Tn A B C *) (* 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: @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: @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 *) (* Goal: @Bet Tn A B C *) apply one_side_symmetry in H18. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(Out C A B). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Out Tn C A B *) apply (col_one_side_out C C');Col. (* Goal: @Bet Tn A B C *) (* 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 *) (* Goal: @Bet Tn A B C *) spliter. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) induction H23; induction H21. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* 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 *) (* 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 *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(A = C). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @eq (@Tpoint Tn) A C *) apply (between_equality A C B); auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* 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 *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B A *) apply False_ind. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) apply H13. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A C') (@Col Tn X A A')) *) exists A. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: and (@Col Tn A A C') (@Col Tn A A A') *) split; Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(B = C). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @eq (@Tpoint Tn) B C *) apply (between_equality B C A); Between. (* Goal: @Bet Tn A B C *) (* 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 *) (* Goal: @Bet Tn A B B *) Between. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(Perp O A' B B'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' B B' *) apply per_perp_in in H5; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' B B' *) apply perp_in_comm in H5. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' B B' *) apply perp_in_perp_bis in H5. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' B B' *) induction H5. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' B B' *) (* Goal: @Perp Tn O A' B B' *) apply (perp_col _ B'); finish. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' B B' *) (* Goal: @Col Tn O B' A' *) apply bet_col in H0. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' B B' *) (* Goal: @Col Tn O B' A' *) ColR. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' B B' *) apply perp_distinct in H5. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn O A' B B' *) tauto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(Par B B' A A'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Par Tn B B' A A' *) apply(l12_9 B B' A A' O A'); Perp. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' A' *) (* Goal: @Coplanar Tn O A' B' A *) (* Goal: @Coplanar Tn O A' B A' *) (* Goal: @Coplanar Tn O A' B A *) exists O. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' A' *) (* Goal: @Coplanar Tn O A' B' A *) (* Goal: @Coplanar Tn O A' B A' *) (* Goal: or (and (@Col Tn O A' O) (@Col Tn B A O)) (or (and (@Col Tn O B O) (@Col Tn A' A O)) (and (@Col Tn O A O) (@Col Tn A' B O))) *) left. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' A' *) (* Goal: @Coplanar Tn O A' B' A *) (* Goal: @Coplanar Tn O A' B A' *) (* Goal: and (@Col Tn O A' O) (@Col Tn B A O) *) assert_diffs. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' A' *) (* Goal: @Coplanar Tn O A' B' A *) (* Goal: @Coplanar Tn O A' B A' *) (* Goal: and (@Col Tn O A' O) (@Col Tn B A O) *) split; ColR. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' A' *) (* Goal: @Coplanar Tn O A' B' A *) (* Goal: @Coplanar Tn O A' B A' *) exists A'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' A' *) (* Goal: @Coplanar Tn O A' B' A *) (* Goal: or (and (@Col Tn O A' A') (@Col Tn B A' A')) (or (and (@Col Tn O B A') (@Col Tn A' A' A')) (and (@Col Tn O A' A') (@Col Tn A' B A'))) *) left. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' A' *) (* Goal: @Coplanar Tn O A' B' A *) (* Goal: and (@Col Tn O A' A') (@Col Tn B A' A') *) split; Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' A' *) (* Goal: @Coplanar Tn O A' B' A *) exists B'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' A' *) (* Goal: or (and (@Col Tn O A' B') (@Col Tn B' A B')) (or (and (@Col Tn O B' B') (@Col Tn A' A B')) (and (@Col Tn O A B') (@Col Tn A' B' B'))) *) left. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' A' *) (* Goal: and (@Col Tn O A' B') (@Col Tn B' A B') *) split; ColR. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' A' *) exists A'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (and (@Col Tn O A' A') (@Col Tn B' A' A')) (or (and (@Col Tn O B' A') (@Col Tn A' A' A')) (and (@Col Tn O A' A') (@Col Tn A' B' A'))) *) left. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: and (@Col Tn O A' A') (@Col Tn B' A' A') *) split; Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) induction H16. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(HQ:=l12_6 B B' A A' H16). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(Par B B' C C'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Par Tn B B' C C' *) apply(l12_9 B B' C C' O A'); Perp. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: @Coplanar Tn O A' B' C *) (* Goal: @Coplanar Tn O A' B C' *) (* Goal: @Coplanar Tn O A' B C *) exists O. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: @Coplanar Tn O A' B' C *) (* Goal: @Coplanar Tn O A' B C' *) (* Goal: or (and (@Col Tn O A' O) (@Col Tn B C O)) (or (and (@Col Tn O B O) (@Col Tn A' C O)) (and (@Col Tn O C O) (@Col Tn A' B O))) *) left. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: @Coplanar Tn O A' B' C *) (* Goal: @Coplanar Tn O A' B C' *) (* Goal: and (@Col Tn O A' O) (@Col Tn B C O) *) assert_diffs. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: @Coplanar Tn O A' B' C *) (* Goal: @Coplanar Tn O A' B C' *) (* Goal: and (@Col Tn O A' O) (@Col Tn B C O) *) split; ColR. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: @Coplanar Tn O A' B' C *) (* Goal: @Coplanar Tn O A' B C' *) exists C'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: @Coplanar Tn O A' B' C *) (* Goal: or (and (@Col Tn O A' C') (@Col Tn B C' C')) (or (and (@Col Tn O B C') (@Col Tn A' C' C')) (and (@Col Tn O C' C') (@Col Tn A' B C'))) *) left. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: @Coplanar Tn O A' B' C *) (* Goal: and (@Col Tn O A' C') (@Col Tn B C' C') *) split; Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: @Coplanar Tn O A' B' C *) exists B'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: or (and (@Col Tn O A' B') (@Col Tn B' C B')) (or (and (@Col Tn O B' B') (@Col Tn A' C B')) (and (@Col Tn O C B') (@Col Tn A' B' B'))) *) left. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: and (@Col Tn O A' B') (@Col Tn B' C B') *) assert_diffs. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' C' *) (* Goal: and (@Col Tn O A' B') (@Col Tn B' C B') *) split; ColR. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Coplanar Tn O A' B' C' *) exists A'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (and (@Col Tn O A' A') (@Col Tn B' C' A')) (or (and (@Col Tn O B' A') (@Col Tn A' C' A')) (and (@Col Tn O C' A') (@Col Tn A' B' A'))) *) left. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: and (@Col Tn O A' A') (@Col Tn B' C' A') *) split; Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) induction H17. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(HR:=l12_6 B B' C C' H17). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(TS B B' A' C'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @TS Tn B B' A' C' *) repeat split; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *) (* Goal: not (@Col Tn C' B B') *) (* Goal: not (@Col Tn A' B B') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *) (* Goal: not (@Col Tn C' B B') *) (* Goal: False *) apply H16. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *) (* Goal: not (@Col Tn C' B B') *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X A A')) *) exists A'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *) (* Goal: not (@Col Tn C' B B') *) (* Goal: and (@Col Tn A' B B') (@Col Tn A' A A') *) split; Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *) (* Goal: not (@Col Tn C' B B') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *) (* Goal: False *) apply H17. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X C C')) *) exists C'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *) (* Goal: and (@Col Tn C' B B') (@Col Tn C' C C') *) split; Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T B B') (@Bet Tn A' T C')) *) exists B'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: and (@Col Tn B' B B') (@Bet Tn A' B' C') *) split; finish. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) apply one_side_symmetry in HQ. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(HH1:= l9_8_2 B B' A' A C' H18 HQ). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) apply l9_2 in HH1. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) apply one_side_symmetry in HR. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(HH2:= l9_8_2 B B' C' C A HH1 HR). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) unfold TS in HH2. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* 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 *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) ex_and H21 T. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(B = T). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @eq (@Tpoint Tn) B T *) apply (l6_21 B B' A C); Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) A C) *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) subst C. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) apply H13. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A C') (@Col Tn X A A')) *) exists A. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: and (@Col Tn A A C') (@Col Tn A A A') *) split; Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) subst T. (* Goal: @Bet Tn A B C *) (* 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 *) (* Goal: @Bet Tn A B C *) spliter. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) induction(eq_dec_points B C). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* 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 *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B B *) Between. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(Col A C C'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn A C C' *) ColR. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) apply False_ind. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) apply H13. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X C C') (@Col Tn X A A')) *) exists A. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: and (@Col Tn A C C') (@Col Tn A A A') *) split; Col. (* 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(eq_dec_points A B). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) subst B. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A A C *) Between. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(Col C A A'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn C A A' *) ColR. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) apply False_ind. (* Goal: @Bet Tn A B C *) (* Goal: False *) apply H13. (* Goal: @Bet Tn A B C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X C C') (@Col Tn X A A')) *) exists C. (* Goal: @Bet Tn A B C *) (* Goal: and (@Col Tn C C C') (@Col Tn C A A') *) split; Col. (* Goal: @Bet Tn A B C *) spliter. (* Goal: @Bet Tn A B C *) assert(A <> C). (* 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 H. (* Goal: @Bet Tn A B C *) (* Goal: @eq (@Tpoint Tn) A' C' *) apply(per2_col_eq O A' C' A); Col. (* Goal: @Bet Tn A B C *) assert(Col O C C'). (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn O C C' *) ColR. (* Goal: @Bet Tn A B C *) apply False_ind. (* Goal: False *) apply per_not_col in H6; auto. (* Goal: False *) apply H6. (* Goal: @Col Tn O C' C *) Col. Qed. Lemma symmetry_preserves_per : forall A P B A' P', Per B P A -> Midpoint B A A' -> Midpoint B P P' -> Per B P' A'. Proof. (* Goal: forall (A P B A' P' : @Tpoint Tn) (_ : @Per Tn B P A) (_ : @Midpoint Tn B A A') (_ : @Midpoint Tn B P P'), @Per Tn B P' A' *) intros. (* Goal: @Per Tn B P' A' *) assert(HS:=symmetric_point_construction A P). (* Goal: @Per Tn B P' A' *) ex_and HS C. (* Goal: @Per Tn B P' A' *) assert(HS:=symmetric_point_construction C B). (* Goal: @Per Tn B P' A' *) ex_and HS C'. (* Goal: @Per Tn B P' A' *) assert(HH:= symmetry_preserves_midpoint A P C A' P' C' B H0 H1 H3 H2). (* Goal: @Per Tn B P' A' *) unfold Per. (* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn P' A' C') (@Cong Tn B A' B C')) *) exists C'. (* Goal: and (@Midpoint Tn P' A' C') (@Cong Tn B A' B C') *) split. (* Goal: @Cong Tn B A' B C' *) (* Goal: @Midpoint Tn P' A' C' *) assumption. (* Goal: @Cong Tn B A' B C' *) unfold Per in H. (* Goal: @Cong Tn B A' B C' *) ex_and H X. (* Goal: @Cong Tn B A' B C' *) assert(X = C). (* Goal: @Cong Tn B A' B C' *) (* Goal: @eq (@Tpoint Tn) X C *) apply(symmetric_point_uniqueness A P X C); auto. (* Goal: @Cong Tn B A' B C' *) subst X. (* Goal: @Cong Tn B A' B C' *) unfold Midpoint in *. (* Goal: @Cong Tn B A' B C' *) spliter. (* Goal: @Cong Tn B A' B C' *) apply (cong_transitivity _ _ B A). (* Goal: @Cong Tn B A B C' *) (* Goal: @Cong Tn B A' B A *) Cong. (* Goal: @Cong Tn B A B C' *) apply(cong_transitivity _ _ B C). (* Goal: @Cong Tn B C B C' *) (* Goal: @Cong Tn B A B C *) assumption. (* Goal: @Cong Tn B C B C' *) Cong. Qed. Lemma l13_1_aux : forall A B C P Q R, ~ Col A B C -> Midpoint P B C -> Midpoint Q A C -> Midpoint R A B -> exists X, exists Y, Perp_at R X Y A B /\ Perp X Y P Q /\ Coplanar A B C X /\ Coplanar A B C Y. Proof. (* Goal: forall (A B C P Q R : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @Midpoint Tn P B C) (_ : @Midpoint Tn Q A C) (_ : @Midpoint Tn R A B), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) intros A B C P Q R HC MBC MAC MAB. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Q <> C). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@eq (@Tpoint Tn) Q C) *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) subst Q. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) unfold Midpoint in MAC. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) apply cong_identity in H0. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) subst C. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) apply HC. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A B A *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(P <> C). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@eq (@Tpoint Tn) P C) *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) subst P. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) unfold Midpoint in MBC. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) apply cong_identity in H1. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) subst C. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) apply HC. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A B B *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(D1:Q<>R). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@eq (@Tpoint Tn) Q R) *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) subst R. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) assert(B=C). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) (* Goal: @eq (@Tpoint Tn) B C *) apply(symmetric_point_uniqueness A Q); auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) subst C. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) apply l7_3 in MBC. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(D2:R <> B). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@eq (@Tpoint Tn) R B) *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) subst R. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) unfold Midpoint in MAB. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) apply cong_identity in H2. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) subst B. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) apply HC. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A A C *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(~Col P Q C). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@Col Tn P Q C) *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) apply HC. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A B C *) unfold Midpoint in *. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A B C *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A B C *) apply bet_col in H2. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A B C *) apply bet_col in H4. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A B C *) apply bet_col in H6. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A B C *) ColR. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(HH:= l8_18_existence P Q C H1). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) ex_and HH C'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(HS1:=symmetric_point_construction C' Q). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) ex_and HS1 A'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(HS1:=symmetric_point_construction C' P). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) ex_and HS1 B'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Cong C C' B B'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Cong Tn C C' B B' *) apply(l7_13 P C C' B B' MBC); finish. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Cong C C' A A'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Cong Tn C C' A A' *) apply(l7_13 Q C C' A A'); finish. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Per P B' B). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P B' B *) induction(eq_dec_points P C'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P B' B *) (* Goal: @Per Tn P B' B *) subst C'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P B' B *) (* Goal: @Per Tn P B' B *) unfold Midpoint in H5. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P B' B *) (* Goal: @Per Tn P B' B *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P B' B *) (* Goal: @Per Tn P B' B *) apply cong_symmetry in H8. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P B' B *) (* Goal: @Per Tn P B' B *) apply cong_identity in H8. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P B' B *) (* Goal: @Per Tn P B' B *) subst B'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P B' B *) (* Goal: @Per Tn P P B *) apply l8_2. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P B' B *) (* Goal: @Per Tn B P P *) apply l8_5. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P B' B *) apply(symmetry_preserves_per C C' P B B'); finish. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P C' C *) apply perp_in_per. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Perp_at Tn C' P C' C' C *) apply perp_in_comm. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Perp_at Tn C' C' P C C' *) apply perp_perp_in. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Perp Tn C' P C C' *) apply perp_left_comm. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Perp Tn P C' C C' *) apply (perp_col _ Q); Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Per Q A' A). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q A' A *) induction(eq_dec_points Q C'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q A' A *) (* Goal: @Per Tn Q A' A *) subst C'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q A' A *) (* Goal: @Per Tn Q A' A *) unfold Midpoint in H4. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q A' A *) (* Goal: @Per Tn Q A' A *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q A' A *) (* Goal: @Per Tn Q A' A *) apply cong_symmetry in H9. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q A' A *) (* Goal: @Per Tn Q A' A *) apply cong_identity in H9. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q A' A *) (* Goal: @Per Tn Q A' A *) subst A'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q A' A *) (* Goal: @Per Tn Q Q A *) apply l8_2. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q A' A *) (* Goal: @Per Tn A Q Q *) apply l8_5. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q A' A *) apply(symmetry_preserves_per C C' Q A A'); finish. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q C' C *) apply perp_in_per. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Perp_at Tn C' Q C' C' C *) apply perp_in_comm. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Perp_at Tn C' C' Q C C' *) apply perp_perp_in. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Perp Tn C' Q C C' *) apply perp_left_comm. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Perp Tn Q C' C C' *) apply (perp_col _ P); Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Perp Tn Q P C C' *) finish. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Cl1: Col A' C' Q). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' C' Q *) unfold Midpoint in H4. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' C' Q *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' C' Q *) apply bet_col in H4. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' C' Q *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Cl2: Col B' C' P). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn B' C' P *) unfold Midpoint in H5. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn B' C' P *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn B' C' P *) apply bet_col in H5. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn B' C' P *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(NE0: P <> Q). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@eq (@Tpoint Tn) P Q) *) apply perp_distinct in H3; tauto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(NE1 : A' <> B'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@eq (@Tpoint Tn) A' B') *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) subst B'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) apply NE0. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @eq (@Tpoint Tn) P Q *) apply (l7_17 C' A'); auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Cl3: Col A' B' P). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) induction(eq_dec_points P C'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) (* Goal: @Col Tn A' B' P *) subst P. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) (* Goal: @Col Tn A' B' C' *) unfold Midpoint in H5. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) (* Goal: @Col Tn A' B' C' *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) (* Goal: @Col Tn A' B' C' *) apply cong_symmetry in H10. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) (* Goal: @Col Tn A' B' C' *) apply cong_identity in H10. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) (* Goal: @Col Tn A' B' C' *) subst C'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) (* Goal: @Col Tn A' B' B' *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) induction(eq_dec_points Q C'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) (* Goal: @Col Tn A' B' P *) subst Q. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) (* Goal: @Col Tn A' B' P *) unfold Midpoint in H4. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) (* Goal: @Col Tn A' B' P *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) (* Goal: @Col Tn A' B' P *) apply cong_symmetry in H11. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) (* Goal: @Col Tn A' B' P *) apply cong_identity in H11. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) (* Goal: @Col Tn A' B' P *) subst C'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) (* Goal: @Col Tn A' B' P *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' P *) ColR. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Cl4: Col A' B' Q). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) induction(eq_dec_points P C'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) (* Goal: @Col Tn A' B' Q *) subst P. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) (* Goal: @Col Tn A' B' Q *) unfold Midpoint in H5. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) (* Goal: @Col Tn A' B' Q *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) (* Goal: @Col Tn A' B' Q *) apply cong_symmetry in H10. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) (* Goal: @Col Tn A' B' Q *) apply cong_identity in H10. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) (* Goal: @Col Tn A' B' Q *) subst C'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) (* Goal: @Col Tn A' B' Q *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) induction(eq_dec_points Q C'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) (* Goal: @Col Tn A' B' Q *) subst Q. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) (* Goal: @Col Tn A' B' C' *) unfold Midpoint in H4. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) (* Goal: @Col Tn A' B' C' *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) (* Goal: @Col Tn A' B' C' *) apply cong_symmetry in H11. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) (* Goal: @Col Tn A' B' C' *) apply cong_identity in H11. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) (* Goal: @Col Tn A' B' C' *) subst C'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) (* Goal: @Col Tn A' B' A' *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' Q *) ColR. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Cl5:Col A' B' C'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' C' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(NE2 : C <> C'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@eq (@Tpoint Tn) C C') *) apply perp_distinct in H3. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@eq (@Tpoint Tn) C C') *) tauto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(NE3: A <> A'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@eq (@Tpoint Tn) A A') *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) subst A'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) apply cong_identity in H7. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(NE4: B <> B'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@eq (@Tpoint Tn) B B') *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) subst B'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) apply cong_identity in H6. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Per P A' A). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P A' A *) induction(eq_dec_points A' Q). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P A' A *) (* Goal: @Per Tn P A' A *) subst Q. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P A' A *) (* Goal: @Per Tn P A' A *) unfold Midpoint in H4. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P A' A *) (* Goal: @Per Tn P A' A *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P A' A *) (* Goal: @Per Tn P A' A *) apply cong_identity in H10. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P A' A *) (* Goal: @Per Tn P A' A *) subst C'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P A' A *) (* Goal: @Per Tn P A' A *) clean_trivial_hyps. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P A' A *) (* Goal: @Per Tn P A' A *) apply perp_left_comm in H3. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P A' A *) (* Goal: @Per Tn P A' A *) apply perp_perp_in in H3. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P A' A *) (* Goal: @Per Tn P A' A *) apply perp_in_comm in H3. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P A' A *) (* Goal: @Per Tn P A' A *) apply perp_in_per in H3. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P A' A *) (* Goal: @Per Tn P A' A *) unfold Midpoint in MAC. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P A' A *) (* Goal: @Per Tn P A' A *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P A' A *) (* Goal: @Per Tn P A' A *) apply bet_col in H2. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P A' A *) (* Goal: @Per Tn P A' A *) apply (per_col P A' C A); Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn P A' A *) apply l8_2. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A A' P *) apply (per_col A A' Q P); finish. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' Q P *) ColR. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Per Q B' B). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q B' B *) induction(eq_dec_points B' P). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q B' B *) (* Goal: @Per Tn Q B' B *) subst P. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q B' B *) (* Goal: @Per Tn Q B' B *) unfold Midpoint in H5. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q B' B *) (* Goal: @Per Tn Q B' B *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q B' B *) (* Goal: @Per Tn Q B' B *) apply cong_identity in H11. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q B' B *) (* Goal: @Per Tn Q B' B *) subst C'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q B' B *) (* Goal: @Per Tn Q B' B *) clean_trivial_hyps. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q B' B *) (* Goal: @Per Tn Q B' B *) apply perp_perp_in in H3. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q B' B *) (* Goal: @Per Tn Q B' B *) apply perp_in_comm in H3. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q B' B *) (* Goal: @Per Tn Q B' B *) apply perp_in_per in H3. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q B' B *) (* Goal: @Per Tn Q B' B *) unfold Midpoint in MBC. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q B' B *) (* Goal: @Per Tn Q B' B *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q B' B *) (* Goal: @Per Tn Q B' B *) apply bet_col in H2. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q B' B *) (* Goal: @Per Tn Q B' B *) apply (per_col Q B' C B); Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn Q B' B *) apply l8_2. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn B B' Q *) apply (per_col B B' P Q); finish. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn B' P Q *) ColR. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Per A' B' B). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A' B' B *) apply l8_2. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn B B' A' *) induction(eq_dec_points B' P). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn B B' A' *) (* Goal: @Per Tn B B' A' *) subst P. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn B B' A' *) (* Goal: @Per Tn B B' A' *) unfold Midpoint in H5. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn B B' A' *) (* Goal: @Per Tn B B' A' *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn B B' A' *) (* Goal: @Per Tn B B' A' *) apply cong_identity in H12. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn B B' A' *) (* Goal: @Per Tn B B' A' *) subst C'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn B B' A' *) (* Goal: @Per Tn B B' A' *) clean_trivial_hyps. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn B B' A' *) (* Goal: @Per Tn B B' A' *) apply(per_col B B' Q A'); finish. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn B B' A' *) apply(per_col B B' P A'); finish. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Per B' A' A). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn B' A' A *) apply l8_2. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A A' B' *) induction(eq_dec_points A' Q). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A A' B' *) (* Goal: @Per Tn A A' B' *) subst Q. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A A' B' *) (* Goal: @Per Tn A A' B' *) unfold Midpoint in H4. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A A' B' *) (* Goal: @Per Tn A A' B' *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A A' B' *) (* Goal: @Per Tn A A' B' *) apply cong_identity in H13. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A A' B' *) (* Goal: @Per Tn A A' B' *) subst C'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A A' B' *) (* Goal: @Per Tn A A' B' *) clean_trivial_hyps. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A A' B' *) (* Goal: @Per Tn A A' B' *) apply(per_col A A' P B'); finish. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A A' B' *) apply(per_col A A' Q B'); finish. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(NC1 : ~Col A' B' A). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@Col Tn A' B' A) *) apply per_not_col in H13; auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@Col Tn A' B' A) *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) apply H13. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn B' A' A *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(NC2 : ~Col A' B' B). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@Col Tn A' B' B) *) apply per_not_col in H12; auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(HM:=midpoint_existence A' B'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) ex_and HM X. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(HP:=l10_15 A' B' X A). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) destruct HP as [y []]; Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(HH:=ex_sym X y A). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) ex_and HH B''. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert( X <> y). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@eq (@Tpoint Tn) X y) *) apply perp_distinct in H15. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@eq (@Tpoint Tn) X y) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@eq (@Tpoint Tn) X y) *) auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Reflect B'' A X y). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Reflect Tn B'' A X y *) unfold Reflect. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: or (and (not (@eq (@Tpoint Tn) X y)) (@ReflectL Tn B'' A X y)) (and (@eq (@Tpoint Tn) X y) (@Midpoint Tn X A B'')) *) left. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (not (@eq (@Tpoint Tn) X y)) (@ReflectL Tn B'' A X y) *) repeat split;auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Midpoint Tn X0 A B'') (@Col Tn X y X0)) *) ex_and H18 M. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Midpoint Tn X0 A B'') (@Col Tn X y X0)) *) exists M. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Midpoint Tn M A B'') (@Col Tn X y M) *) split; finish. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Reflect A' B' X y). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Reflect Tn A' B' X y *) unfold Reflect. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: or (and (not (@eq (@Tpoint Tn) X y)) (@ReflectL Tn A' B' X y)) (and (@eq (@Tpoint Tn) X y) (@Midpoint Tn X B' A')) *) left. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (not (@eq (@Tpoint Tn) X y)) (@ReflectL Tn A' B' X y) *) split; auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ReflectL Tn A' B' X y *) repeat split. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: or (@Perp Tn X y B' A') (@eq (@Tpoint Tn) B' A') *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Midpoint Tn X0 B' A') (@Col Tn X y X0)) *) exists X. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: or (@Perp Tn X y B' A') (@eq (@Tpoint Tn) B' A') *) (* Goal: and (@Midpoint Tn X B' A') (@Col Tn X y X) *) split; finish. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: or (@Perp Tn X y B' A') (@eq (@Tpoint Tn) B' A') *) left. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Perp Tn X y B' A' *) finish. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) apply l10_4 in H20. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(HH:= l10_10 X y B'' B' A A' H20 H21). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Per A' B' B''). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A' B' B'' *) unfold Reflect in *. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A' B' B'' *) induction H20; induction H21. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @Per Tn A' B' B'' *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @Per Tn A' B' B'' *) apply(image_spec_preserves_per B' A' A A' B' B'' X y); auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @ReflectL Tn B' A' X y *) apply l10_4_spec. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @ReflectL Tn A' B' X y *) assumption. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @Per Tn A' B' B'' *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @Per Tn A' B' B'' *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @Per Tn A' B' B'' *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A' B' B'' *) (* Goal: @Per Tn A' B' B'' *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A' B' B'' *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Per Tn A' B' B'' *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) unfold Reflect in H21. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) induction H21. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) unfold ReflectL in H23. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(OS A' B' A B''). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) induction H17. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) assert(Par A' B' A B''). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @Par Tn A' B' A B'' *) assert(Coplanar A y A' X). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @Par Tn A' B' A B'' *) (* Goal: @Coplanar Tn A y A' X *) apply col_cop__cop with B'; Col; Cop. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @Par Tn A' B' A B'' *) assert(Coplanar A y B' X). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @Par Tn A' B' A B'' *) (* Goal: @Coplanar Tn A y B' X *) apply col_cop__cop with A'; Col; Cop. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @Par Tn A' B' A B'' *) assert(~ Col A X y). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @Par Tn A' B' A B'' *) (* Goal: not (@Col Tn A X y) *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @Par Tn A' B' A B'' *) (* Goal: False *) assert(A=B''). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @Par Tn A' B' A B'' *) (* Goal: False *) (* Goal: @eq (@Tpoint Tn) A B'' *) apply (image_id X y); Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @Par Tn A' B' A B'' *) (* Goal: False *) assert_diffs. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @Par Tn A' B' A B'' *) (* Goal: False *) auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @Par Tn A' B' A B'' *) apply(l12_9 A' B' A B'' X y); Perp. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @Coplanar Tn X y B' B'' *) (* Goal: @Coplanar Tn X y B' A *) (* Goal: @Coplanar Tn X y A' B'' *) (* Goal: @Coplanar Tn X y A' A *) Cop. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @Coplanar Tn X y B' B'' *) (* Goal: @Coplanar Tn X y B' A *) (* Goal: @Coplanar Tn X y A' B'' *) apply coplanar_trans_1 with A; Cop. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @Coplanar Tn X y B' B'' *) (* Goal: @Coplanar Tn X y B' A *) Cop. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @Coplanar Tn X y B' B'' *) apply coplanar_trans_1 with A; Cop. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) induction H24. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) apply( l12_6 A' B' A B'' H24). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B'' *) apply per_not_col in H22; auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: not (@eq (@Tpoint Tn) B' B'') *) (* Goal: @OS Tn A' B' A B'' *) apply False_ind. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: not (@eq (@Tpoint Tn) B' B'') *) (* Goal: False *) apply H22. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: not (@eq (@Tpoint Tn) B' B'') *) (* Goal: @Col Tn A' B' B'' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: not (@eq (@Tpoint Tn) B' B'') *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: False *) subst B''. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: False *) apply cong_symmetry in HH. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: False *) apply cong_identity in HH. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: False *) subst A'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: False *) apply cong_identity in H7. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: False *) subst C'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: False *) tauto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) subst B''. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A A *) apply one_side_reflexivity. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: not (@Col Tn A A' B') *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: False *) apply NC1. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn A' B' A *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(OS A' B' A B). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B *) unfold OS. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun R : @Tpoint Tn => and (@TS Tn A' B' A R) (@TS Tn A' B' B R)) *) exists C. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@TS Tn A' B' A C) (@TS Tn A' B' B C) *) split. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @TS Tn A' B' B C *) (* Goal: @TS Tn A' B' A C *) unfold TS. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @TS Tn A' B' B C *) (* Goal: and (not (@Col Tn A A' B')) (and (not (@Col Tn C A' B')) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn A T C)))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @TS Tn A' B' B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn A T C)) *) (* Goal: not (@Col Tn C A' B') *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @TS Tn A' B' B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn A T C)) *) (* Goal: False *) apply H1. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @TS Tn A' B' B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn A T C)) *) (* Goal: @Col Tn P Q C *) ColR. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @TS Tn A' B' B C *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn A T C)) *) exists Q. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @TS Tn A' B' B C *) (* Goal: and (@Col Tn Q A' B') (@Bet Tn A Q C) *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @TS Tn A' B' B C *) (* Goal: @Bet Tn A Q C *) unfold Midpoint in MAC. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @TS Tn A' B' B C *) (* Goal: @Bet Tn A Q C *) tauto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @TS Tn A' B' B C *) unfold TS. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (not (@Col Tn B A' B')) (and (not (@Col Tn C A' B')) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T C)))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T C)) *) (* Goal: not (@Col Tn C A' B') *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T C)) *) (* Goal: False *) apply H1. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T C)) *) (* Goal: @Col Tn P Q C *) ColR. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T C)) *) exists P. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Col Tn P A' B') (@Bet Tn B P C) *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Bet Tn B P C *) unfold Midpoint in MBC. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Bet Tn B P C *) tauto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert( Col B B'' B'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Col Tn B B'' B' *) apply cop_per2__col with A'; Perp. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Coplanar Tn A' B B'' B' *) apply coplanar_perm_3. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Coplanar Tn A' B' B B'' *) apply coplanar_trans_1 with A; Col; Cop. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(Cong B B' A A'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Cong Tn B B' A A' *) apply cong_transitivity with C C'; Cong. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(B = B'' \/ Midpoint B' B B''). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: or (@eq (@Tpoint Tn) B B'') (@Midpoint Tn B' B B'') *) apply( l7_20); Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Cong Tn B' B B' B'' *) apply cong_transitivity with A A'; Cong. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) induction H28. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) subst B''. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) exists R. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R R Y A B) (and (@Perp Tn R Y P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C Y)))) *) exists X. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) ex_and H18 M. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) assert(R = M). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: @eq (@Tpoint Tn) R M *) apply (l7_17 A B); auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) subst M. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) assert(A <> B). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: not (@eq (@Tpoint Tn) A B) *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) subst B. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) apply HC; Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) assert(Col R A B). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: @Col Tn R A B *) unfold Midpoint in MAB. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: @Col Tn R A B *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: @Col Tn R A B *) apply bet_col in H31. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: @Col Tn R A B *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) assert(X <> R). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: not (@eq (@Tpoint Tn) X R) *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) subst X. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) assert(Par A B A' B'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Par Tn A B A' B' *) assert(Coplanar A y A' R). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Par Tn A B A' B' *) (* Goal: @Coplanar Tn A y A' R *) apply col_cop__cop with B'; Col; Cop. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Par Tn A B A' B' *) assert(Coplanar A y B' R). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Par Tn A B A' B' *) (* Goal: @Coplanar Tn A y B' R *) apply col_cop__cop with A'; Col; Cop. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Par Tn A B A' B' *) assert(~ Col A R y). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Par Tn A B A' B' *) (* Goal: not (@Col Tn A R y) *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Par Tn A B A' B' *) (* Goal: False *) assert(A=B). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Par Tn A B A' B' *) (* Goal: False *) (* Goal: @eq (@Tpoint Tn) A B *) apply (image_id R y); Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Par Tn A B A' B' *) (* Goal: False *) assert_diffs. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Par Tn A B A' B' *) (* Goal: False *) auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Par Tn A B A' B' *) apply(l12_9 A B A' B' R y); Perp. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Perp Tn A B R y *) (* Goal: @Coplanar Tn R y B B' *) (* Goal: @Coplanar Tn R y B A' *) (* Goal: @Coplanar Tn R y A B' *) (* Goal: @Coplanar Tn R y A A' *) Cop. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Perp Tn A B R y *) (* Goal: @Coplanar Tn R y B B' *) (* Goal: @Coplanar Tn R y B A' *) (* Goal: @Coplanar Tn R y A B' *) Cop. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Perp Tn A B R y *) (* Goal: @Coplanar Tn R y B B' *) (* Goal: @Coplanar Tn R y B A' *) apply coplanar_trans_1 with A; Cop. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Perp Tn A B R y *) (* Goal: @Coplanar Tn R y B B' *) apply coplanar_trans_1 with A; Cop. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Perp Tn A B R y *) induction H17. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Perp Tn A B R y *) (* Goal: @Perp Tn A B R y *) Perp. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @Perp Tn A B R y *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) induction H32. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: False *) apply H32. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A B) (@Col Tn X A' B')) *) exists R. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: and (@Col Tn R A B) (@Col Tn R A' B') *) unfold Midpoint in H14. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: and (@Col Tn R A B) (@Col Tn R A' B') *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: and (@Col Tn R A B) (@Col Tn R A' B') *) apply bet_col in H14. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) (* Goal: and (@Col Tn R A B) (@Col Tn R A' B') *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: False *) apply NC1. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) (* Goal: @Col Tn A' B' A *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp_at Tn R R X A B) (and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X))) *) split. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X)) *) (* Goal: @Perp_at Tn R R X A B *) apply(l8_14_2_1b_bis R X A B R); Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X)) *) (* Goal: @Perp Tn R X A B *) induction H17. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X)) *) (* Goal: @Perp Tn R X A B *) (* Goal: @Perp Tn R X A B *) apply perp_left_comm. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X)) *) (* Goal: @Perp Tn R X A B *) (* Goal: @Perp Tn X R A B *) apply(perp_col _ y); auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X)) *) (* Goal: @Perp Tn R X A B *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Perp Tn R X P Q) (and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X)) *) split. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *) (* Goal: @Perp Tn R X P Q *) apply perp_left_comm. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *) (* Goal: @Perp Tn X R P Q *) apply(perp_col _ y);auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *) (* Goal: @Perp Tn X y P Q *) apply perp_sym. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *) (* Goal: @Perp Tn P Q X y *) induction(eq_dec_points B' P). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *) (* Goal: @Perp Tn P Q X y *) (* Goal: @Perp Tn P Q X y *) subst P. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *) (* Goal: @Perp Tn P Q X y *) (* Goal: @Perp Tn B' Q X y *) apply(perp_col _ A');auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *) (* Goal: @Perp Tn P Q X y *) (* Goal: @Col Tn B' A' Q *) (* Goal: @Perp Tn B' A' X y *) Perp. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *) (* Goal: @Perp Tn P Q X y *) (* Goal: @Col Tn B' A' Q *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *) (* Goal: @Perp Tn P Q X y *) apply(perp_col _ B');auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *) (* Goal: @Col Tn P B' Q *) (* Goal: @Perp Tn P B' X y *) apply perp_left_comm. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *) (* Goal: @Col Tn P B' Q *) (* Goal: @Perp Tn B' P X y *) apply(perp_col _ A');auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *) (* Goal: @Col Tn P B' Q *) (* Goal: @Col Tn B' A' P *) (* Goal: @Perp Tn B' A' X y *) Perp. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *) (* Goal: @Col Tn P B' Q *) (* Goal: @Col Tn B' A' P *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *) (* Goal: @Col Tn P B' Q *) ColR. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Coplanar Tn A B C R) (@Coplanar Tn A B C X) *) split. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Coplanar Tn A B C X *) (* Goal: @Coplanar Tn A B C R *) exists R. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Coplanar Tn A B C X *) (* Goal: or (and (@Col Tn A B R) (@Col Tn C R R)) (or (and (@Col Tn A C R) (@Col Tn B R R)) (and (@Col Tn A R R) (@Col Tn B C R))) *) left. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Coplanar Tn A B C X *) (* Goal: and (@Col Tn A B R) (@Col Tn C R R) *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Coplanar Tn A B C X *) assert(Col P Q X). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Coplanar Tn A B C X *) (* Goal: @Col Tn P Q X *) ColR. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Coplanar Tn A B C X *) apply coplanar_pseudo_trans with P Q C; Cop. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(TS A' B' B B''). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @TS Tn A' B' B B'' *) unfold TS. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (not (@Col Tn B A' B')) (and (not (@Col Tn B'' A' B')) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')))) *) repeat split; auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: not (@Col Tn B'' A' B') *) (* Goal: not (@Col Tn B A' B') *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: not (@Col Tn B'' A' B') *) (* Goal: False *) apply NC2; Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: not (@Col Tn B'' A' B') *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: False *) apply per_not_col in H22; auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: not (@eq (@Tpoint Tn) B' B'') *) (* Goal: False *) apply H22. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: not (@eq (@Tpoint Tn) B' B'') *) (* Goal: @Col Tn A' B' B'' *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: not (@eq (@Tpoint Tn) B' B'') *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: False *) subst B''. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: False *) unfold Midpoint in H28. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: False *) apply cong_identity in H30. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: False *) subst B'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: False *) unfold OS in H24. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: False *) ex_and H24 T. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: False *) unfold TS in H30. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: False *) apply H30. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) (* Goal: @Col Tn B A' B *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A' B') (@Bet Tn B T B'')) *) exists B'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: and (@Col Tn B' A' B') (@Bet Tn B B' B'') *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Bet Tn B B' B'' *) unfold Midpoint in H28. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @Bet Tn B B' B'' *) tauto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) assert(OS A' B' B B''). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' B B'' *) apply (one_side_transitivity A' B' B A ). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' B A *) apply one_side_symmetry. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) (* Goal: @OS Tn A' B' A B *) assumption. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @OS Tn A' B' A B'' *) assumption. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) apply l9_9 in H29. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (and (@Perp Tn X Y P Q) (and (@Coplanar Tn A B C X) (@Coplanar Tn A B C Y))))) *) contradiction. Qed. Lemma l13_1 : forall A B C P Q R, ~ Col A B C -> Midpoint P B C -> Midpoint Q A C -> Midpoint R A B -> exists X, exists Y, Perp_at R X Y A B /\ Perp X Y P Q. Proof. (* Goal: forall (A B C P Q R : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @Midpoint Tn P B C) (_ : @Midpoint Tn Q A C) (_ : @Midpoint Tn R A B), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (@Perp Tn X Y P Q))) *) intros. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (@Perp Tn X Y P Q))) *) destruct (l13_1_aux A B C P Q R) as [X [Y]]; trivial. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (@Perp Tn X Y P Q))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (@Perp Tn X Y P Q))) *) exists X. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Perp_at Tn R X Y A B) (@Perp Tn X Y P Q)) *) exists Y. (* Goal: and (@Perp_at Tn R X Y A B) (@Perp Tn X Y P Q) *) split; assumption. Qed. Lemma per_lt : forall A B C, A <> B -> C <> B -> Per A B C -> Lt A B A C /\ Lt C B A C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) C B)) (_ : @Per Tn A B C), and (@Lt Tn A B A C) (@Lt Tn C B A C) *) intros. (* Goal: and (@Lt Tn A B A C) (@Lt Tn C B A C) *) assert(Lt B A A C /\ Lt B C A C). (* Goal: and (@Lt Tn A B A C) (@Lt Tn C B A C) *) (* Goal: and (@Lt Tn B A A C) (@Lt Tn B C A C) *) apply( l11_46 A B C); auto. (* Goal: and (@Lt Tn A B A C) (@Lt Tn C B A C) *) spliter. (* Goal: and (@Lt Tn A B A C) (@Lt Tn C B A C) *) split; apply lt_left_comm; assumption. Qed. Lemma cong_perp_conga : forall A B C P, Cong A B C B -> Perp A C B P -> CongA A B P C B P /\ TS B P A C. Lemma perp_per_bet : forall A B C P, ~Col A B C -> Col A P C -> Per A B C -> Perp_at P P B A C -> Bet A P C. Proof. (* Goal: forall (A B C P : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @Col Tn A P C) (_ : @Per Tn A B C) (_ : @Perp_at Tn P P B A C), @Bet Tn A P C *) intros. (* Goal: @Bet Tn A P C *) assert( A <> C). (* Goal: @Bet Tn A P C *) (* Goal: not (@eq (@Tpoint Tn) A C) *) intro. (* Goal: @Bet Tn A P C *) (* Goal: False *) subst C. (* Goal: @Bet Tn A P C *) (* Goal: False *) apply H. (* Goal: @Bet Tn A P C *) (* Goal: @Col Tn A B A *) Col. (* Goal: @Bet Tn A P C *) assert(Bet A P C /\ A <> P /\ C <> P). (* Goal: @Bet Tn A P C *) (* Goal: and (@Bet Tn A P C) (and (not (@eq (@Tpoint Tn) A P)) (not (@eq (@Tpoint Tn) C P))) *) apply(l11_47 A C B P); auto. (* Goal: @Bet Tn A P C *) (* Goal: @Perp_at Tn P B P A C *) Perp. (* Goal: @Bet Tn A P C *) tauto. Qed. Lemma ts_per_per_ts : forall A B C D, TS A B C D -> Per B C A -> Per B D A -> TS C D A B. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @TS Tn A B C D) (_ : @Per Tn B C A) (_ : @Per Tn B D A), @TS Tn C D A B *) intros. (* Goal: @TS Tn C D A B *) assert(HTS:= H). (* Goal: @TS Tn C D A B *) unfold TS in H. (* Goal: @TS Tn C D A B *) assert (~ Col C A B). (* Goal: @TS Tn C D A B *) (* Goal: not (@Col Tn C A B) *) spliter. (* Goal: @TS Tn C D A B *) (* Goal: not (@Col Tn C A B) *) assumption. (* Goal: @TS Tn C D A B *) spliter. (* Goal: @TS Tn C D A B *) clear H. (* Goal: @TS Tn C D A B *) assert (A <> B). (* Goal: @TS Tn C D A B *) (* Goal: not (@eq (@Tpoint Tn) A B) *) intro. (* Goal: @TS Tn C D A B *) (* Goal: False *) subst B. (* Goal: @TS Tn C D A B *) (* Goal: False *) Col. (* Goal: @TS Tn C D A B *) ex_and H4 P. (* Goal: @TS Tn C D A B *) assert_diffs. (* Goal: @TS Tn C D A B *) show_distinct C D. (* Goal: @TS Tn C D A B *) (* Goal: False *) contradiction. (* Goal: @TS Tn C D A B *) unfold TS. (* Goal: and (not (@Col Tn A C D)) (and (not (@Col Tn B C D)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)))) *) repeat split; auto. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *) (* Goal: not (@Col Tn B C D) *) (* Goal: not (@Col Tn A C D) *) intro. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *) (* Goal: not (@Col Tn B C D) *) (* Goal: False *) assert(A = P). (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *) (* Goal: not (@Col Tn B C D) *) (* Goal: False *) (* Goal: @eq (@Tpoint Tn) A P *) apply bet_col in H5. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *) (* Goal: not (@Col Tn B C D) *) (* Goal: False *) (* Goal: @eq (@Tpoint Tn) A P *) apply (l6_21 A B C D); Col. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *) (* Goal: not (@Col Tn B C D) *) (* Goal: False *) subst P. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *) (* Goal: not (@Col Tn B C D) *) (* Goal: False *) apply H6. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *) (* Goal: not (@Col Tn B C D) *) (* Goal: @eq (@Tpoint Tn) C D *) apply(per2_col_eq A C D B); finish. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *) (* Goal: not (@Col Tn B C D) *) intro. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *) (* Goal: False *) assert(B = P). (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *) (* Goal: False *) (* Goal: @eq (@Tpoint Tn) B P *) apply bet_col in H5. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *) (* Goal: False *) (* Goal: @eq (@Tpoint Tn) B P *) apply (l6_21 A B C D); Col. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *) (* Goal: False *) subst P. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *) (* Goal: False *) apply H6. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *) (* Goal: @eq (@Tpoint Tn) C D *) apply(per2_col_eq B C D A); finish. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T C D) (@Bet Tn A T B)) *) exists P. (* Goal: and (@Col Tn P C D) (@Bet Tn A P B) *) split. (* Goal: @Bet Tn A P B *) (* Goal: @Col Tn P C D *) finish. (* Goal: @Bet Tn A P B *) assert(exists X : Tpoint, Col A B X /\ Perp A B C X). (* Goal: @Bet Tn A P B *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn A B X) (@Perp Tn A B C X)) *) apply(l8_18_existence A B C); Col. (* Goal: @Bet Tn A P B *) ex_and H7 C'. (* Goal: @Bet Tn A P B *) assert(exists X : Tpoint, Col A B X /\ Perp A B D X). (* Goal: @Bet Tn A P B *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn A B X) (@Perp Tn A B D X)) *) apply(l8_18_existence A B D); Col. (* Goal: @Bet Tn A P B *) ex_and H12 D'. (* Goal: @Bet Tn A P B *) assert( A <> C'). (* Goal: @Bet Tn A P B *) (* Goal: not (@eq (@Tpoint Tn) A C') *) intro. (* Goal: @Bet Tn A P B *) (* Goal: False *) subst C'. (* Goal: @Bet Tn A P B *) (* Goal: False *) apply perp_perp_in in H8. (* Goal: @Bet Tn A P B *) (* Goal: False *) apply perp_in_comm in H8. (* Goal: @Bet Tn A P B *) (* Goal: False *) apply perp_in_per in H8. (* Goal: @Bet Tn A P B *) (* Goal: False *) assert(A = C). (* Goal: @Bet Tn A P B *) (* Goal: False *) (* Goal: @eq (@Tpoint Tn) A C *) apply (l8_7 B); Perp. (* Goal: @Bet Tn A P B *) (* Goal: False *) subst C. (* Goal: @Bet Tn A P B *) (* Goal: False *) tauto. (* Goal: @Bet Tn A P B *) assert( A <> D'). (* Goal: @Bet Tn A P B *) (* Goal: not (@eq (@Tpoint Tn) A D') *) intro. (* Goal: @Bet Tn A P B *) (* Goal: False *) subst D'. (* Goal: @Bet Tn A P B *) (* Goal: False *) apply perp_perp_in in H14. (* Goal: @Bet Tn A P B *) (* Goal: False *) apply perp_in_comm in H14. (* Goal: @Bet Tn A P B *) (* Goal: False *) apply perp_in_per in H14. (* Goal: @Bet Tn A P B *) (* Goal: False *) assert(A = D). (* Goal: @Bet Tn A P B *) (* Goal: False *) (* Goal: @eq (@Tpoint Tn) A D *) apply (l8_7 B); Perp. (* Goal: @Bet Tn A P B *) (* Goal: False *) subst D. (* Goal: @Bet Tn A P B *) (* Goal: False *) tauto. (* Goal: @Bet Tn A P B *) assert(Bet A C' B). (* Goal: @Bet Tn A P B *) (* Goal: @Bet Tn A C' B *) apply(perp_per_bet A C B C'); Col. (* Goal: @Bet Tn A P B *) (* Goal: @Perp_at Tn C' C' C A B *) (* Goal: @Per Tn A C B *) Perp. (* Goal: @Bet Tn A P B *) (* Goal: @Perp_at Tn C' C' C A B *) assert(Perp A C' C' C). (* Goal: @Bet Tn A P B *) (* Goal: @Perp_at Tn C' C' C A B *) (* Goal: @Perp Tn A C' C' C *) apply(perp_col _ B); Col; Perp. (* Goal: @Bet Tn A P B *) (* Goal: @Perp_at Tn C' C' C A B *) apply perp_in_sym. (* Goal: @Bet Tn A P B *) (* Goal: @Perp_at Tn C' A B C' C *) apply perp_in_right_comm. (* Goal: @Bet Tn A P B *) (* Goal: @Perp_at Tn C' A B C C' *) apply(l8_15_1 A B C C'); auto. (* Goal: @Bet Tn A P B *) assert(Bet A D' B). (* Goal: @Bet Tn A P B *) (* Goal: @Bet Tn A D' B *) apply(perp_per_bet A D B D'); Col. (* Goal: @Bet Tn A P B *) (* Goal: @Perp_at Tn D' D' D A B *) (* Goal: @Per Tn A D B *) Perp. (* Goal: @Bet Tn A P B *) (* Goal: @Perp_at Tn D' D' D A B *) assert(Perp A D' D' D). (* Goal: @Bet Tn A P B *) (* Goal: @Perp_at Tn D' D' D A B *) (* Goal: @Perp Tn A D' D' D *) apply(perp_col _ B); Col; Perp. (* Goal: @Bet Tn A P B *) (* Goal: @Perp_at Tn D' D' D A B *) apply perp_in_sym. (* Goal: @Bet Tn A P B *) (* Goal: @Perp_at Tn D' A B D' D *) apply perp_in_right_comm. (* Goal: @Bet Tn A P B *) (* Goal: @Perp_at Tn D' A B D D' *) apply(l8_15_1 A B D D'); auto. (* Goal: @Bet Tn A P B *) induction(eq_dec_points C' P). (* Goal: @Bet Tn A P B *) (* Goal: @Bet Tn A P B *) subst C'. (* Goal: @Bet Tn A P B *) (* Goal: @Bet Tn A P B *) assumption. (* Goal: @Bet Tn A P B *) induction(eq_dec_points D' P). (* Goal: @Bet Tn A P B *) (* Goal: @Bet Tn A P B *) subst D'. (* Goal: @Bet Tn A P B *) (* Goal: @Bet Tn A P B *) assumption. (* Goal: @Bet Tn A P B *) induction(eq_dec_points A P). (* Goal: @Bet Tn A P B *) (* Goal: @Bet Tn A P B *) subst P. (* Goal: @Bet Tn A P B *) (* Goal: @Bet Tn A A B *) Between. (* Goal: @Bet Tn A P B *) induction(eq_dec_points B P). (* Goal: @Bet Tn A P B *) (* Goal: @Bet Tn A P B *) subst P. (* Goal: @Bet Tn A P B *) (* Goal: @Bet Tn A B B *) Between. (* Goal: @Bet Tn A P B *) assert(Bet C' P D'). (* Goal: @Bet Tn A P B *) (* Goal: @Bet Tn C' P D' *) apply(per13_preserves_bet C P D C' D'); Col. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Per Tn P C' C *) (* Goal: @Col Tn C' P D' *) ColR. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Per Tn P C' C *) assert(Perp P C' C' C). (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Per Tn P C' C *) (* Goal: @Perp Tn P C' C' C *) apply(perp_col _ A);auto. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Per Tn P C' C *) (* Goal: @Col Tn P A C' *) (* Goal: @Perp Tn P A C' C *) apply perp_left_comm. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Per Tn P C' C *) (* Goal: @Col Tn P A C' *) (* Goal: @Perp Tn A P C' C *) apply(perp_col _ B);Perp. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Per Tn P C' C *) (* Goal: @Col Tn P A C' *) (* Goal: @Col Tn A B P *) Col. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Per Tn P C' C *) (* Goal: @Col Tn P A C' *) ColR. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Per Tn P C' C *) apply perp_comm in H24. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Per Tn P C' C *) apply perp_perp_in in H24. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Per Tn P C' C *) apply perp_in_comm in H24. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Per Tn P C' C *) apply perp_in_per in H24. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Per Tn P C' C *) assumption. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) assert(Perp P D' D' D). (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Perp Tn P D' D' D *) apply(perp_col _ A);auto. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Col Tn P A D' *) (* Goal: @Perp Tn P A D' D *) apply perp_left_comm. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Col Tn P A D' *) (* Goal: @Perp Tn A P D' D *) apply(perp_col _ B);Perp. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Col Tn P A D' *) (* Goal: @Col Tn A B P *) Col. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) (* Goal: @Col Tn P A D' *) ColR. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) apply perp_comm in H24. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) apply perp_perp_in in H24. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) apply perp_in_comm in H24. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) apply perp_in_per in H24. (* Goal: @Bet Tn A P B *) (* Goal: @Per Tn P D' D *) assumption. (* Goal: @Bet Tn A P B *) assert(HH:= l5_3 A C' D' B H18 H19). (* Goal: @Bet Tn A P B *) induction HH. (* Goal: @Bet Tn A P B *) (* Goal: @Bet Tn A P B *) eBetween. (* Goal: @Bet Tn A P B *) apply between_symmetry in H24. (* Goal: @Bet Tn A P B *) eBetween. Qed. Lemma l13_2_1 : forall A B C D E, TS A B C D -> Per B C A -> Per B D A -> Col C D E -> Perp A E C D -> CongA C A B D A B -> CongA B A C D A E /\ CongA B A D C A E /\ Bet C E D. Lemma triangle_mid_par : forall A B C P Q, ~Col A B C -> Midpoint P B C -> Midpoint Q A C -> Par_strict A B Q P. Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @Midpoint Tn P B C) (_ : @Midpoint Tn Q A C), @Par_strict Tn A B Q P *) intros. (* Goal: @Par_strict Tn A B Q P *) assert(HM:= midpoint_existence A B). (* Goal: @Par_strict Tn A B Q P *) ex_and HM R. (* Goal: @Par_strict Tn A B Q P *) assert(HH:= l13_1_aux A B C P Q R H H0 H1 H2). (* Goal: @Par_strict Tn A B Q P *) ex_and HH X. (* Goal: @Par_strict Tn A B Q P *) ex_and H3 Y. (* Goal: @Par_strict Tn A B Q P *) assert(Coplanar X Y A P /\ Coplanar X Y A Q /\ Coplanar X Y B P /\ Coplanar X Y B Q). (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) assert(Coplanar A B C A). (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) (* Goal: @Coplanar Tn A B C A *) exists A. (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) (* Goal: or (and (@Col Tn A B A) (@Col Tn C A A)) (or (and (@Col Tn A C A) (@Col Tn B A A)) (and (@Col Tn A A A) (@Col Tn B C A))) *) left. (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) (* Goal: and (@Col Tn A B A) (@Col Tn C A A) *) split; Col. (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) assert(Coplanar A B C B). (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) (* Goal: @Coplanar Tn A B C B *) exists B. (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) (* Goal: or (and (@Col Tn A B B) (@Col Tn C B B)) (or (and (@Col Tn A C B) (@Col Tn B B B)) (and (@Col Tn A B B) (@Col Tn B C B))) *) left. (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) (* Goal: and (@Col Tn A B B) (@Col Tn C B B) *) split; Col. (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) assert(Coplanar A B C P). (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) (* Goal: @Coplanar Tn A B C P *) exists B. (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) (* Goal: or (and (@Col Tn A B B) (@Col Tn C P B)) (or (and (@Col Tn A C B) (@Col Tn B P B)) (and (@Col Tn A P B) (@Col Tn B C B))) *) left. (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) (* Goal: and (@Col Tn A B B) (@Col Tn C P B) *) split; Col. (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) assert(Coplanar A B C Q). (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) (* Goal: @Coplanar Tn A B C Q *) exists A. (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) (* Goal: or (and (@Col Tn A B A) (@Col Tn C Q A)) (or (and (@Col Tn A C A) (@Col Tn B Q A)) (and (@Col Tn A Q A) (@Col Tn B C A))) *) left. (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) (* Goal: and (@Col Tn A B A) (@Col Tn C Q A) *) split; Col. (* Goal: @Par_strict Tn A B Q P *) (* Goal: and (@Coplanar Tn X Y A P) (and (@Coplanar Tn X Y A Q) (and (@Coplanar Tn X Y B P) (@Coplanar Tn X Y B Q))) *) repeat split; apply coplanar_pseudo_trans with A B C; assumption. (* Goal: @Par_strict Tn A B Q P *) spliter. (* Goal: @Par_strict Tn A B Q P *) assert(HH:= perp_in_col X Y A B R H3). (* Goal: @Par_strict Tn A B Q P *) spliter. (* Goal: @Par_strict Tn A B Q P *) apply perp_in_perp_bis in H3. (* Goal: @Par_strict Tn A B Q P *) unfold Midpoint in H2. (* Goal: @Par_strict Tn A B Q P *) spliter. (* Goal: @Par_strict Tn A B Q P *) apply bet_col in H2. (* Goal: @Par_strict Tn A B Q P *) assert(X <> Y). (* Goal: @Par_strict Tn A B Q P *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) apply perp_distinct in H4. (* Goal: @Par_strict Tn A B Q P *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) tauto. (* Goal: @Par_strict Tn A B Q P *) induction H3. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) assert(Perp Y X A B). (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Perp Tn Y X A B *) apply (perp_col _ R); Perp. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Col Tn Y R X *) Col. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) apply perp_left_comm in H15. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) assert(Par A B P Q). (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par Tn A B P Q *) apply(l12_9 A B P Q X Y);Perp. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) induction H16. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) finish. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) spliter. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) assert(Col A B P). (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Col Tn A B P *) ColR. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) assert(P = B). (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) (* Goal: @eq (@Tpoint Tn) P B *) apply (l6_21 A B C P); Col. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) (* Goal: not (@eq (@Tpoint Tn) C P) *) unfold Midpoint in H0. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) (* Goal: not (@eq (@Tpoint Tn) C P) *) spliter. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) (* Goal: not (@eq (@Tpoint Tn) C P) *) apply bet_col in H0. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) (* Goal: not (@eq (@Tpoint Tn) C P) *) Col. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) (* Goal: not (@eq (@Tpoint Tn) C P) *) intro. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) (* Goal: False *) subst P. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) (* Goal: False *) contradiction. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) subst P. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q B *) unfold Midpoint in H0. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q B *) spliter. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q B *) apply cong_symmetry in H21. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q B *) apply cong_identity in H21. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q B *) subst C. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q B *) contradiction. (* Goal: @Par_strict Tn A B Q P *) assert(Perp X Y A B). (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Perp Tn X Y A B *) apply (perp_col _ R); Perp. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Col Tn X R Y *) Col. (* Goal: @Par_strict Tn A B Q P *) assert(Par A B P Q). (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par Tn A B P Q *) apply(l12_9 A B P Q X Y);Perp. (* Goal: @Par_strict Tn A B Q P *) induction H16. (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Par_strict Tn A B Q P *) finish. (* Goal: @Par_strict Tn A B Q P *) spliter. (* Goal: @Par_strict Tn A B Q P *) assert(Col A B P). (* Goal: @Par_strict Tn A B Q P *) (* Goal: @Col Tn A B P *) ColR. (* Goal: @Par_strict Tn A B Q P *) assert(P = B). (* Goal: @Par_strict Tn A B Q P *) (* Goal: @eq (@Tpoint Tn) P B *) apply (l6_21 A B C P); Col. (* Goal: @Par_strict Tn A B Q P *) (* Goal: not (@eq (@Tpoint Tn) C P) *) unfold Midpoint in H0. (* Goal: @Par_strict Tn A B Q P *) (* Goal: not (@eq (@Tpoint Tn) C P) *) spliter. (* Goal: @Par_strict Tn A B Q P *) (* Goal: not (@eq (@Tpoint Tn) C P) *) apply bet_col in H0. (* Goal: @Par_strict Tn A B Q P *) (* Goal: not (@eq (@Tpoint Tn) C P) *) Col. (* Goal: @Par_strict Tn A B Q P *) (* Goal: not (@eq (@Tpoint Tn) C P) *) intro. (* Goal: @Par_strict Tn A B Q P *) (* Goal: False *) subst P. (* Goal: @Par_strict Tn A B Q P *) (* Goal: False *) contradiction. (* Goal: @Par_strict Tn A B Q P *) subst P. (* Goal: @Par_strict Tn A B Q B *) unfold Midpoint in H0. (* Goal: @Par_strict Tn A B Q B *) spliter. (* Goal: @Par_strict Tn A B Q B *) apply cong_symmetry in H21. (* Goal: @Par_strict Tn A B Q B *) apply cong_identity in H21. (* Goal: @Par_strict Tn A B Q B *) subst C. (* Goal: @Par_strict Tn A B Q B *) contradiction. Qed. Lemma cop4_perp_in2__col : forall A B A' B' X Y P, Coplanar X Y A A' -> Coplanar X Y A B' -> Coplanar X Y B A' -> Coplanar X Y B B' -> Perp_at P A B X Y -> Perp_at P A' B' X Y -> Col A B A'. Proof. (* Goal: forall (A B A' B' X Y P : @Tpoint Tn) (_ : @Coplanar Tn X Y A A') (_ : @Coplanar Tn X Y A B') (_ : @Coplanar Tn X Y B A') (_ : @Coplanar Tn X Y B B') (_ : @Perp_at Tn P A B X Y) (_ : @Perp_at Tn P A' B' X Y), @Col Tn A B A' *) intros. (* Goal: @Col Tn A B A' *) assert(HP1:= H3). (* Goal: @Col Tn A B A' *) assert(HP2:=H4). (* Goal: @Col Tn A B A' *) assert(Col A B P /\ Col X Y P). (* Goal: @Col Tn A B A' *) (* Goal: and (@Col Tn A B P) (@Col Tn X Y P) *) apply perp_in_col in H3. (* Goal: @Col Tn A B A' *) (* Goal: and (@Col Tn A B P) (@Col Tn X Y P) *) spliter. (* Goal: @Col Tn A B A' *) (* Goal: and (@Col Tn A B P) (@Col Tn X Y P) *) split; Col. (* Goal: @Col Tn A B A' *) spliter. (* Goal: @Col Tn A B A' *) unfold Perp_at in H3. (* Goal: @Col Tn A B A' *) unfold Perp_at in H4. (* Goal: @Col Tn A B A' *) spliter. (* Goal: @Col Tn A B A' *) induction(eq_dec_points A P); induction(eq_dec_points P X). (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) subst A. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn P B A' *) subst X. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn P B A' *) assert(Per B P Y). (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn P B A' *) (* Goal: @Per Tn B P Y *) apply(H14 B Y); Col. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn P B A' *) assert(Per A' P Y). (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn P B A' *) (* Goal: @Per Tn A' P Y *) apply(H10 A' Y); Col. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn P B A' *) apply col_permutation_2. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn B A' P *) apply cop_per2__col with Y; Cop. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) subst A. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn P B A' *) assert(Per B P X). (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn P B A' *) (* Goal: @Per Tn B P X *) apply(H14 B X); Col. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn P B A' *) assert(Per A' P X). (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn P B A' *) (* Goal: @Per Tn A' P X *) apply(H10 A' X); Col. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn P B A' *) apply col_permutation_2. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn B A' P *) apply cop_per2__col with X; auto. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Coplanar Tn X B A' P *) apply coplanar_perm_12. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Coplanar Tn B A' X P *) apply col_cop__cop with Y; Col; Cop. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) subst X. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) assert(Per A P Y). (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Per Tn A P Y *) apply(H14 A Y); Col. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) induction(eq_dec_points P A'). (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) subst A'. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B P *) assert(Per B' P Y). (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B P *) (* Goal: @Per Tn B' P Y *) apply(H10 B' Y); Col. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B P *) assert(Col A B' P). (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B P *) (* Goal: @Col Tn A B' P *) apply cop_per2__col with Y; Cop. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B P *) ColR. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) assert(Per A' P Y). (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Per Tn A' P Y *) apply(H10 A' Y); Col. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) assert(Col A A' P). (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A A' P *) apply cop_per2__col with Y; Cop. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) ColR. (* Goal: @Col Tn A B A' *) assert(Per A P X). (* Goal: @Col Tn A B A' *) (* Goal: @Per Tn A P X *) apply(H14 A X); Col. (* Goal: @Col Tn A B A' *) induction(eq_dec_points P A'). (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B A' *) subst A'. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B P *) assert(Per B' P X). (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B P *) (* Goal: @Per Tn B' P X *) apply(H10 B' X); Col. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B P *) assert(Col A B' P). (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B P *) (* Goal: @Col Tn A B' P *) apply cop_per2__col with X; auto. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B P *) (* Goal: @Coplanar Tn X A B' P *) apply coplanar_perm_12. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B P *) (* Goal: @Coplanar Tn A B' X P *) apply col_cop__cop with Y; Col; Cop. (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A B P *) ColR. (* Goal: @Col Tn A B A' *) assert(Per A' P X). (* Goal: @Col Tn A B A' *) (* Goal: @Per Tn A' P X *) apply(H10 A' X); Col. (* Goal: @Col Tn A B A' *) assert(Col A A' P). (* Goal: @Col Tn A B A' *) (* Goal: @Col Tn A A' P *) apply cop_per2__col with X; auto. (* Goal: @Col Tn A B A' *) (* Goal: @Coplanar Tn X A A' P *) apply coplanar_perm_12. (* Goal: @Col Tn A B A' *) (* Goal: @Coplanar Tn A A' X P *) apply col_cop__cop with Y; Col; Cop. (* Goal: @Col Tn A B A' *) ColR. Qed. Lemma l13_2 : forall A B C D E, TS A B C D -> Per B C A -> Per B D A -> Col C D E -> Perp A E C D -> CongA B A C D A E /\ CongA B A D C A E /\ Bet C E D. Lemma perp2_refl : forall A B P, A <> B -> Perp2 A B A B P. Proof. (* Goal: forall (A B P : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)), @Perp2 Tn A B A B P *) intros. (* Goal: @Perp2 Tn A B A B P *) induction(col_dec A B P). (* Goal: @Perp2 Tn A B A B P *) (* Goal: @Perp2 Tn A B A B P *) assert(HH:=not_col_exists A B H). (* Goal: @Perp2 Tn A B A B P *) (* Goal: @Perp2 Tn A B A B P *) ex_and HH X. (* Goal: @Perp2 Tn A B A B P *) (* Goal: @Perp2 Tn A B A B P *) assert(HH:=l10_15 A B P X H0 H1). (* Goal: @Perp2 Tn A B A B P *) (* Goal: @Perp2 Tn A B A B P *) ex_and HH Q. (* Goal: @Perp2 Tn A B A B P *) (* Goal: @Perp2 Tn A B A B P *) unfold Perp2. (* Goal: @Perp2 Tn A B A B P *) (* 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 A B)))) *) exists Q. (* Goal: @Perp2 Tn A B A B P *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P Q Y) (and (@Perp Tn Q Y A B) (@Perp Tn Q Y A B))) *) exists P. (* Goal: @Perp2 Tn A B A B P *) (* Goal: and (@Col Tn P Q P) (and (@Perp Tn Q P A B) (@Perp Tn Q P A B)) *) split; Perp. (* Goal: @Perp2 Tn A B A B P *) (* Goal: @Col Tn P Q P *) Col. (* Goal: @Perp2 Tn A B A B P *) assert(HH:=l8_18_existence A B P H0). (* Goal: @Perp2 Tn A B A B P *) ex_and HH Q. (* Goal: @Perp2 Tn A B A B 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 A B)))) *) 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 A B))) *) exists Q. (* Goal: and (@Col Tn P P Q) (and (@Perp Tn P Q A B) (@Perp Tn P Q A B)) *) split; Perp. (* Goal: @Col Tn P P Q *) Col. Qed. Lemma perp2_sym : forall A B C D P, Perp2 A B C D P -> Perp2 C D A B P. Proof. (* Goal: forall (A B C D P : @Tpoint Tn) (_ : @Perp2 Tn A B C D P), @Perp2 Tn C D A B P *) unfold Perp2. (* Goal: forall (A B C D P : @Tpoint Tn) (_ : @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 (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y C D) (@Perp Tn X Y A B)))) *) intros. (* 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 C D) (@Perp Tn X Y A B)))) *) ex_and H X. (* 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 C D) (@Perp Tn X Y A B)))) *) ex_and H0 Y. (* 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 C D) (@Perp Tn X Y A B)))) *) exists X. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y C D) (@Perp Tn X Y A B))) *) exists Y. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y C D) (@Perp Tn X Y A B)) *) repeat split; Perp. Qed. Lemma perp2_left_comm : forall A B C D P, Perp2 A B C D P -> Perp2 B A C D P. Proof. (* Goal: forall (A B C D P : @Tpoint Tn) (_ : @Perp2 Tn A B C D P), @Perp2 Tn B A C D P *) unfold Perp2. (* Goal: forall (A B C D P : @Tpoint Tn) (_ : @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 (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y B A) (@Perp Tn X Y C D)))) *) intros. (* 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 B A) (@Perp Tn X Y C D)))) *) ex_and H X. (* 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 B A) (@Perp Tn X Y C D)))) *) ex_and H0 Y. (* 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 B A) (@Perp Tn X Y C D)))) *) exists X. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y B A) (@Perp Tn X Y C D))) *) exists Y. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y B A) (@Perp Tn X Y C D)) *) repeat split; Perp. Qed. Lemma perp2_right_comm : forall A B C D P, Perp2 A B C D P -> Perp2 A B D C P. Proof. (* Goal: forall (A B C D P : @Tpoint Tn) (_ : @Perp2 Tn A B C D P), @Perp2 Tn A B D C P *) unfold Perp2. (* Goal: forall (A B C D P : @Tpoint Tn) (_ : @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 (@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 D C)))) *) intros. (* 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 D C)))) *) ex_and H X. (* 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 D C)))) *) ex_and H0 Y. (* 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 D C)))) *) exists X. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y D C))) *) exists Y. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y D C)) *) repeat split; Perp. Qed. Lemma perp2_comm : forall A B C D P, Perp2 A B C D P -> Perp2 B A D C P. Proof. (* Goal: forall (A B C D P : @Tpoint Tn) (_ : @Perp2 Tn A B C D P), @Perp2 Tn B A D C P *) unfold Perp2. (* Goal: forall (A B C D P : @Tpoint Tn) (_ : @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 (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y B A) (@Perp Tn X Y D C)))) *) intros. (* 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 B A) (@Perp Tn X Y D C)))) *) ex_and H X. (* 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 B A) (@Perp Tn X Y D C)))) *) ex_and H0 Y. (* 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 B A) (@Perp Tn X Y D C)))) *) exists X. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y B A) (@Perp Tn X Y D C))) *) exists Y. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y B A) (@Perp Tn X Y D C)) *) repeat split; Perp. Qed. Lemma perp2_pseudo_trans : forall A B C D E F P, Perp2 A B C D P -> Perp2 C D E F P -> ~ Col C D P -> Perp2 A B E F P. Proof. (* Goal: forall (A B C D E F P : @Tpoint Tn) (_ : @Perp2 Tn A B C D P) (_ : @Perp2 Tn C D E F P) (_ : not (@Col Tn C D P)), @Perp2 Tn A B E F P *) intros. (* Goal: @Perp2 Tn A B E F P *) unfold Perp2 in *. (* 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 E F)))) *) ex_and H X. (* 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 E F)))) *) ex_and H2 Y. (* 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 E F)))) *) ex_and H0 X'. (* 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 E F)))) *) ex_and H4 Y'. (* 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 E F)))) *) assert(Par X Y X' Y'). (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) assert(Coplanar P C D X). (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D X *) induction(eq_dec_points X P). (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D X *) (* Goal: @Coplanar Tn P C D X *) subst. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D X *) (* Goal: @Coplanar Tn P C D P *) exists P. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D X *) (* Goal: or (and (@Col Tn P C P) (@Col Tn D P P)) (or (and (@Col Tn P D P) (@Col Tn C P P)) (and (@Col Tn P P P) (@Col Tn C D P))) *) left. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D X *) (* Goal: and (@Col Tn P C P) (@Col Tn D P P) *) split; Col. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D X *) apply coplanar_perm_9. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn X P C D *) apply perp__coplanar. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Perp Tn X P C D *) apply perp_col with Y; Col. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) assert(Coplanar P C D Y). (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D Y *) induction(eq_dec_points Y P). (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D Y *) (* Goal: @Coplanar Tn P C D Y *) subst. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D Y *) (* Goal: @Coplanar Tn P C D P *) exists P. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D Y *) (* Goal: or (and (@Col Tn P C P) (@Col Tn D P P)) (or (and (@Col Tn P D P) (@Col Tn C P P)) (and (@Col Tn P P P) (@Col Tn C D P))) *) left. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D Y *) (* Goal: and (@Col Tn P C P) (@Col Tn D P P) *) split; Col. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D Y *) apply coplanar_perm_9. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn Y P C D *) apply perp__coplanar. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Perp Tn Y P C D *) apply perp_col with X; Perp; Col. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) assert(Coplanar P C D X'). (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D X' *) induction(eq_dec_points X' P). (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D X' *) (* Goal: @Coplanar Tn P C D X' *) subst. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D X' *) (* Goal: @Coplanar Tn P C D P *) exists P. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D X' *) (* Goal: or (and (@Col Tn P C P) (@Col Tn D P P)) (or (and (@Col Tn P D P) (@Col Tn C P P)) (and (@Col Tn P P P) (@Col Tn C D P))) *) left. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D X' *) (* Goal: and (@Col Tn P C P) (@Col Tn D P P) *) split; Col. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D X' *) apply coplanar_perm_9. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn X' P C D *) apply perp__coplanar. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Perp Tn X' P C D *) apply perp_col with Y'; Col. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) assert(Coplanar P C D Y'). (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D Y' *) induction(eq_dec_points Y' P). (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D Y' *) (* Goal: @Coplanar Tn P C D Y' *) subst. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D Y' *) (* Goal: @Coplanar Tn P C D P *) exists P. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D Y' *) (* Goal: or (and (@Col Tn P C P) (@Col Tn D P P)) (or (and (@Col Tn P D P) (@Col Tn C P P)) (and (@Col Tn P P P) (@Col Tn C D P))) *) left. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D Y' *) (* Goal: and (@Col Tn P C P) (@Col Tn D P P) *) split; Col. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn P C D Y' *) apply coplanar_perm_9. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Coplanar Tn Y' P C D *) apply perp__coplanar. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) (* Goal: @Perp Tn Y' P C D *) apply perp_col with X'; Perp; Col. (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) apply (l12_9 _ _ _ _ C D); Perp; apply coplanar_trans_1 with P; Col. (* 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 E F)))) *) exists X. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F))) *) exists Y. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) assert(Col X X' Y'). (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) induction H6. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) (* Goal: @Col Tn X X' Y' *) unfold Par_strict in H6. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) (* Goal: @Col Tn X X' Y' *) spliter. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) (* Goal: @Col Tn X X' Y' *) apply False_ind. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) (* Goal: False *) apply H9. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X Y) (@Col Tn X0 X' Y')) *) exists P. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) (* Goal: and (@Col Tn P X Y) (@Col Tn P X' Y') *) split; Col. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) spliter. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) auto. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) assert(Col Y X' Y'). (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) induction H6. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) (* Goal: @Col Tn Y X' Y' *) unfold Par_strict in H6. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) (* Goal: @Col Tn Y X' Y' *) spliter. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) (* Goal: @Col Tn Y X' Y' *) apply False_ind. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) (* Goal: False *) apply H10. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X Y) (@Col Tn X0 X' Y')) *) exists P. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) (* Goal: and (@Col Tn P X Y) (@Col Tn P X' Y') *) split; Col. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) spliter. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) auto. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) repeat split; auto. (* Goal: @Perp Tn X Y E F *) assert(X <> Y). (* Goal: @Perp Tn X Y E F *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) apply perp_not_eq_1 in H2. (* Goal: @Perp Tn X Y E F *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) auto. (* Goal: @Perp Tn X Y E F *) induction(eq_dec_points X Y'). (* Goal: @Perp Tn X Y E F *) (* Goal: @Perp Tn X Y E F *) subst Y'. (* Goal: @Perp Tn X Y E F *) (* Goal: @Perp Tn X Y E F *) apply (perp_col _ X'). (* Goal: @Perp Tn X Y E F *) (* Goal: @Col Tn X X' Y *) (* Goal: @Perp Tn X X' E F *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) auto. (* Goal: @Perp Tn X Y E F *) (* Goal: @Col Tn X X' Y *) (* Goal: @Perp Tn X X' E F *) Perp. (* Goal: @Perp Tn X Y E F *) (* Goal: @Col Tn X X' Y *) ColR. (* Goal: @Perp Tn X Y E F *) apply (perp_col _ Y'). (* Goal: @Col Tn X Y' Y *) (* Goal: @Perp Tn X Y' E F *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) auto. (* Goal: @Col Tn X Y' Y *) (* Goal: @Perp Tn X Y' E F *) apply perp_left_comm. (* Goal: @Col Tn X Y' Y *) (* Goal: @Perp Tn Y' X E F *) apply(perp_col _ X'). (* Goal: @Col Tn X Y' Y *) (* Goal: @Col Tn Y' X' X *) (* Goal: @Perp Tn Y' X' E F *) (* Goal: not (@eq (@Tpoint Tn) Y' X) *) auto. (* Goal: @Col Tn X Y' Y *) (* Goal: @Col Tn Y' X' X *) (* Goal: @Perp Tn Y' X' E F *) Perp. (* Goal: @Col Tn X Y' Y *) (* Goal: @Col Tn Y' X' X *) ColR. (* Goal: @Col Tn X Y' Y *) apply par_symmetry in H6. (* Goal: @Col Tn X Y' Y *) induction H6. (* Goal: @Col Tn X Y' Y *) (* Goal: @Col Tn X Y' Y *) unfold Par_strict in H6. (* Goal: @Col Tn X Y' Y *) (* Goal: @Col Tn X Y' Y *) spliter. (* Goal: @Col Tn X Y' Y *) (* Goal: @Col Tn X Y' Y *) apply False_ind. (* Goal: @Col Tn X Y' Y *) (* Goal: False *) apply H13. (* Goal: @Col Tn X Y' Y *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *) exists P. (* Goal: @Col Tn X Y' Y *) (* Goal: and (@Col Tn P X' Y') (@Col Tn P X Y) *) split; Col. (* Goal: @Col Tn X Y' Y *) spliter. (* Goal: @Col Tn X Y' Y *) Col. Qed. Lemma perp2_preserves_bet23 : forall O A B A' B', Bet O A B -> Col O A' B' -> ~Col O A A' -> Perp2 A A' B B' O -> Bet O A' B'. Proof. (* Goal: forall (O A B A' B' : @Tpoint Tn) (_ : @Bet Tn O A B) (_ : @Col Tn O A' B') (_ : not (@Col Tn O A A')) (_ : @Perp2 Tn A A' B B' O), @Bet Tn O A' B' *) intros. (* Goal: @Bet Tn O A' B' *) assert(HD1: A <> A'). (* Goal: @Bet Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) A A') *) intro. (* Goal: @Bet Tn O A' B' *) (* Goal: False *) subst A'. (* Goal: @Bet Tn O A' B' *) (* Goal: False *) apply H1. (* Goal: @Bet Tn O A' B' *) (* Goal: @Col Tn O A A *) Col. (* Goal: @Bet Tn O A' B' *) induction(eq_dec_points A' B'). (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) subst B'. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' A' *) Between. (* Goal: @Bet Tn O A' B' *) assert(A <> B). (* Goal: @Bet Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) A B) *) intro. (* Goal: @Bet Tn O A' B' *) (* Goal: False *) subst B. (* Goal: @Bet Tn O A' B' *) (* Goal: False *) unfold Perp2 in H2. (* Goal: @Bet Tn O A' B' *) (* Goal: False *) ex_and H2 X. (* Goal: @Bet Tn O A' B' *) (* Goal: False *) ex_and H4 Y. (* Goal: @Bet Tn O A' B' *) (* Goal: False *) assert(Col A A' B'). (* Goal: @Bet Tn O A' B' *) (* Goal: False *) (* Goal: @Col Tn A A' B' *) apply(cop_perp2__col A A' B' X Y); Perp. (* Goal: @Bet Tn O A' B' *) (* Goal: False *) (* Goal: @Coplanar Tn X Y A' B' *) exists O. (* Goal: @Bet Tn O A' B' *) (* Goal: False *) (* 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: @Bet Tn O A' B' *) (* Goal: False *) (* Goal: and (@Col Tn X Y O) (@Col Tn A' B' O) *) split; Col. (* Goal: @Bet Tn O A' B' *) (* Goal: False *) apply H1. (* Goal: @Bet Tn O A' B' *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Bet Tn O A' B' *) assert(Par A A' B B'). (* Goal: @Bet Tn O A' B' *) (* Goal: @Par Tn A A' B B' *) unfold Perp2 in H2. (* Goal: @Bet Tn O A' B' *) (* Goal: @Par Tn A A' B B' *) ex_and H2 X. (* Goal: @Bet Tn O A' B' *) (* Goal: @Par Tn A A' B B' *) ex_and H5 Y. (* Goal: @Bet Tn O A' B' *) (* Goal: @Par Tn A A' B B' *) assert(Coplanar X Y A B). (* Goal: @Bet Tn O A' B' *) (* Goal: @Par Tn A A' B B' *) (* Goal: @Coplanar Tn X Y A B *) exists O. (* Goal: @Bet Tn O A' B' *) (* Goal: @Par Tn A A' B 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: @Bet Tn O A' B' *) (* Goal: @Par Tn A A' B B' *) (* Goal: and (@Col Tn X Y O) (@Col Tn A B O) *) split; Col. (* Goal: @Bet Tn O A' B' *) (* Goal: @Par Tn A A' B B' *) apply (l12_9 _ _ _ _ X Y); Perp. (* Goal: @Bet Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) (* Goal: @Coplanar Tn X Y A' B *) (* Goal: @Coplanar Tn X Y A B' *) induction(col_dec B X Y). (* Goal: @Bet Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) (* Goal: @Coplanar Tn X Y A' B *) (* Goal: @Coplanar Tn X Y A B' *) (* Goal: @Coplanar Tn X Y A B' *) exists A. (* Goal: @Bet Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) (* Goal: @Coplanar Tn X Y A' B *) (* Goal: @Coplanar Tn X Y A B' *) (* Goal: or (and (@Col Tn X Y A) (@Col Tn A B' A)) (or (and (@Col Tn X A A) (@Col Tn Y B' A)) (and (@Col Tn X B' A) (@Col Tn Y A A))) *) left. (* Goal: @Bet Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) (* Goal: @Coplanar Tn X Y A' B *) (* Goal: @Coplanar Tn X Y A B' *) (* Goal: and (@Col Tn X Y A) (@Col Tn A B' A) *) assert_diffs. (* Goal: @Bet Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) (* Goal: @Coplanar Tn X Y A' B *) (* Goal: @Coplanar Tn X Y A B' *) (* Goal: and (@Col Tn X Y A) (@Col Tn A B' A) *) split; ColR. (* Goal: @Bet Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) (* Goal: @Coplanar Tn X Y A' B *) (* Goal: @Coplanar Tn X Y A B' *) apply coplanar_trans_1 with B; Cop. (* Goal: @Bet Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) (* Goal: @Coplanar Tn X Y A' B *) induction(col_dec A X Y). (* Goal: @Bet Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) (* Goal: @Coplanar Tn X Y A' B *) (* Goal: @Coplanar Tn X Y A' B *) exists B. (* Goal: @Bet Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) (* Goal: @Coplanar Tn X Y A' B *) (* Goal: or (and (@Col Tn X Y B) (@Col Tn A' B B)) (or (and (@Col Tn X A' B) (@Col Tn Y B B)) (and (@Col Tn X B B) (@Col Tn Y A' B))) *) left. (* Goal: @Bet Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) (* Goal: @Coplanar Tn X Y A' B *) (* Goal: and (@Col Tn X Y B) (@Col Tn A' B B) *) assert_diffs. (* Goal: @Bet Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) (* Goal: @Coplanar Tn X Y A' B *) (* Goal: and (@Col Tn X Y B) (@Col Tn A' B B) *) split; ColR. (* Goal: @Bet Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) (* Goal: @Coplanar Tn X Y A' B *) apply coplanar_trans_1 with A; Cop. (* Goal: @Bet Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) exists O. (* Goal: @Bet 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: @Bet Tn O A' B' *) (* Goal: and (@Col Tn X Y O) (@Col Tn A' B' O) *) split; Col. (* Goal: @Bet Tn O A' B' *) induction H5. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) assert(OS A A' B B'). (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: @OS Tn A A' B B' *) apply l12_6; Par. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) assert(TS A A' O B). (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: @TS Tn A A' O B *) repeat split; Col. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *) (* Goal: not (@Col Tn B A A') *) intro. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *) (* Goal: False *) apply H5. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A A') (@Col Tn X B B')) *) exists B. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *) (* Goal: and (@Col Tn B A A') (@Col Tn B B B') *) split; Col. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A A') (@Bet Tn O T B)) *) exists A. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: and (@Col Tn A A A') (@Bet Tn O A B) *) split; Col. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) assert(TS A A' B' O). (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: @TS Tn A A' B' O *) apply( l9_8_2 A A' B B' O); auto. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: @TS Tn A A' B O *) apply l9_2. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: @TS Tn A A' O B *) auto. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) unfold TS in H8. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) spliter. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) ex_and H10 T. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) assert(T = A'). (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: @eq (@Tpoint Tn) T A' *) apply (l6_21 A A' O B'); Col. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) O B') *) intro. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: False *) subst B'. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: False *) apply between_identity in H11. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: False *) subst T. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) (* Goal: False *) contradiction. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) subst T. (* Goal: @Bet Tn O A' B' *) (* Goal: @Bet Tn O A' B' *) Between. (* Goal: @Bet Tn O A' B' *) spliter. (* Goal: @Bet Tn O A' B' *) apply False_ind. (* Goal: False *) apply H1. (* Goal: @Col Tn O A A' *) ColR. Qed. Lemma perp2_preserves_bet13 : forall O B C B' C', Bet B O C -> Col O B' C' -> ~Col O B B' -> Perp2 B C' C B' O -> Bet B' O C'. Proof. (* Goal: forall (O B C B' C' : @Tpoint Tn) (_ : @Bet Tn B O C) (_ : @Col Tn O B' C') (_ : not (@Col Tn O B B')) (_ : @Perp2 Tn B C' C B' O), @Bet Tn B' O C' *) intros. (* Goal: @Bet Tn B' O C' *) induction(eq_dec_points C' O). (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) subst C'. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O O *) Between. (* Goal: @Bet Tn B' O C' *) induction(eq_dec_points B' O). (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) Between. (* Goal: @Bet Tn B' O C' *) assert(B <> O). (* Goal: @Bet Tn B' O C' *) (* Goal: not (@eq (@Tpoint Tn) B O) *) intro. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) subst B. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) apply H1. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn O O B' *) Col. (* Goal: @Bet Tn B' O C' *) assert(B' <> O). (* Goal: @Bet Tn B' O C' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) subst B'. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) apply H1. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn O B O *) Col. (* Goal: @Bet Tn B' O C' *) assert(Col B O C). (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn B O C *) apply bet_col. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B O C *) Between. (* Goal: @Bet Tn B' O C' *) induction(eq_dec_points B C). (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) subst C. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) apply between_identity in H. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) contradiction. (* Goal: @Bet Tn B' O C' *) assert(Par B C' C B'). (* Goal: @Bet Tn B' O C' *) (* Goal: @Par Tn B C' C B' *) unfold Perp2 in H2. (* Goal: @Bet Tn B' O C' *) (* Goal: @Par Tn B C' C B' *) ex_and H2 X. (* Goal: @Bet Tn B' O C' *) (* Goal: @Par Tn B C' C B' *) ex_and H9 Y. (* Goal: @Bet Tn B' O C' *) (* Goal: @Par Tn B C' C B' *) assert(Coplanar X Y B C). (* Goal: @Bet Tn B' O C' *) (* Goal: @Par Tn B C' C B' *) (* Goal: @Coplanar Tn X Y B C *) exists O. (* Goal: @Bet Tn B' O C' *) (* Goal: @Par Tn B C' C B' *) (* Goal: or (and (@Col Tn X Y O) (@Col Tn B C O)) (or (and (@Col Tn X B O) (@Col Tn Y C O)) (and (@Col Tn X C O) (@Col Tn Y B O))) *) left. (* Goal: @Bet Tn B' O C' *) (* Goal: @Par Tn B C' C B' *) (* Goal: and (@Col Tn X Y O) (@Col Tn B C O) *) split; Col. (* Goal: @Bet Tn B' O C' *) (* Goal: @Par Tn B C' C B' *) assert(Coplanar X Y C' B'). (* Goal: @Bet Tn B' O C' *) (* Goal: @Par Tn B C' C B' *) (* Goal: @Coplanar Tn X Y C' B' *) exists O. (* Goal: @Bet Tn B' O C' *) (* Goal: @Par Tn B C' C B' *) (* Goal: or (and (@Col Tn X Y O) (@Col Tn C' B' O)) (or (and (@Col Tn X C' O) (@Col Tn Y B' O)) (and (@Col Tn X B' O) (@Col Tn Y C' O))) *) left. (* Goal: @Bet Tn B' O C' *) (* Goal: @Par Tn B C' C B' *) (* Goal: and (@Col Tn X Y O) (@Col Tn C' B' O) *) split; Col. (* Goal: @Bet Tn B' O C' *) (* Goal: @Par Tn B C' C B' *) apply (l12_9 _ _ _ _ X Y); Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Coplanar Tn X Y C' C *) (* Goal: @Coplanar Tn X Y B B' *) induction(col_dec C' X Y). (* Goal: @Bet Tn B' O C' *) (* Goal: @Coplanar Tn X Y C' C *) (* Goal: @Coplanar Tn X Y B B' *) (* Goal: @Coplanar Tn X Y B B' *) exists B'. (* Goal: @Bet Tn B' O C' *) (* Goal: @Coplanar Tn X Y C' C *) (* Goal: @Coplanar Tn X Y B B' *) (* Goal: or (and (@Col Tn X Y B') (@Col Tn B B' B')) (or (and (@Col Tn X B B') (@Col Tn Y B' B')) (and (@Col Tn X B' B') (@Col Tn Y B B'))) *) left. (* Goal: @Bet Tn B' O C' *) (* Goal: @Coplanar Tn X Y C' C *) (* Goal: @Coplanar Tn X Y B B' *) (* Goal: and (@Col Tn X Y B') (@Col Tn B B' B') *) assert_diffs. (* Goal: @Bet Tn B' O C' *) (* Goal: @Coplanar Tn X Y C' C *) (* Goal: @Coplanar Tn X Y B B' *) (* Goal: and (@Col Tn X Y B') (@Col Tn B B' B') *) split; ColR. (* Goal: @Bet Tn B' O C' *) (* Goal: @Coplanar Tn X Y C' C *) (* Goal: @Coplanar Tn X Y B B' *) apply coplanar_trans_1 with C'; Cop. (* Goal: @Bet Tn B' O C' *) (* Goal: @Coplanar Tn X Y C' C *) induction(col_dec B X Y). (* Goal: @Bet Tn B' O C' *) (* Goal: @Coplanar Tn X Y C' C *) (* Goal: @Coplanar Tn X Y C' C *) exists C. (* Goal: @Bet Tn B' O C' *) (* Goal: @Coplanar Tn X Y C' C *) (* Goal: or (and (@Col Tn X Y C) (@Col Tn C' C C)) (or (and (@Col Tn X C' C) (@Col Tn Y C C)) (and (@Col Tn X C C) (@Col Tn Y C' C))) *) left. (* Goal: @Bet Tn B' O C' *) (* Goal: @Coplanar Tn X Y C' C *) (* Goal: and (@Col Tn X Y C) (@Col Tn C' C C) *) assert_diffs. (* Goal: @Bet Tn B' O C' *) (* Goal: @Coplanar Tn X Y C' C *) (* Goal: and (@Col Tn X Y C) (@Col Tn C' C C) *) split; ColR. (* Goal: @Bet Tn B' O C' *) (* Goal: @Coplanar Tn X Y C' C *) apply coplanar_trans_1 with B; Cop. (* Goal: @Bet Tn B' O C' *) assert(Par_strict B C' C B'). (* Goal: @Bet Tn B' O C' *) (* Goal: @Par_strict Tn B C' C B' *) induction H9. (* Goal: @Bet Tn B' O C' *) (* Goal: @Par_strict Tn B C' C B' *) (* Goal: @Par_strict Tn B C' C B' *) assumption. (* Goal: @Bet Tn B' O C' *) (* Goal: @Par_strict Tn B C' C B' *) spliter. (* Goal: @Bet Tn B' O C' *) (* Goal: @Par_strict Tn B C' C B' *) apply False_ind. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) apply H1. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn O B B' *) ColR. (* Goal: @Bet Tn B' O C' *) assert(C<> O). (* Goal: @Bet Tn B' O C' *) (* Goal: not (@eq (@Tpoint Tn) C O) *) intro. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) subst C. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) assert(Par_strict B C' O C'). (* Goal: @Bet Tn B' O C' *) (* Goal: False *) (* Goal: @Par_strict Tn B C' O C' *) apply(par_strict_col_par_strict _ _ _ B'); auto. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) apply H11. (* Goal: @Bet Tn B' O C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C') (@Col Tn X O C')) *) exists C'. (* Goal: @Bet Tn B' O C' *) (* Goal: and (@Col Tn C' B C') (@Col Tn C' O C') *) Col. (* Goal: @Bet Tn B' O C' *) assert(B' <> O). (* Goal: @Bet Tn B' O C' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) subst B'. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) assert(Par_strict B C' O B). (* Goal: @Bet Tn B' O C' *) (* Goal: False *) (* Goal: @Par_strict Tn B C' O B *) apply(par_strict_col_par_strict _ _ _ C); auto. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) (* Goal: @Col Tn O C B *) (* Goal: @Par_strict Tn B C' O C *) apply par_strict_right_comm. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) (* Goal: @Col Tn O C B *) (* Goal: @Par_strict Tn B C' C O *) assumption. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) (* Goal: @Col Tn O C B *) Col. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) apply H12. (* Goal: @Bet Tn B' O C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C') (@Col Tn X O B)) *) exists B. (* Goal: @Bet Tn B' O C' *) (* Goal: and (@Col Tn B B C') (@Col Tn B O B) *) split; Col. (* Goal: @Bet Tn B' O C' *) unfold Perp2 in H2. (* Goal: @Bet Tn B' O C' *) ex_and H2 X. (* Goal: @Bet Tn B' O C' *) ex_and H13 Y. (* Goal: @Bet Tn B' O C' *) assert(X <> Y). (* Goal: @Bet Tn B' O C' *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) apply perp_distinct in H13. (* Goal: @Bet Tn B' O C' *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) tauto. (* Goal: @Bet Tn B' O C' *) induction(col_dec X Y B). (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) assert(Col X Y C). (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn X Y C *) ColR. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) apply(per13_preserves_bet_inv B' O C' C B); Between. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) (* Goal: @Per Tn O C B' *) (* Goal: @Col Tn B' O C' *) Col. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) (* Goal: @Per Tn O C B' *) apply perp_in_per. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) (* Goal: @Perp_at Tn C O C C B' *) induction(eq_dec_points X C). (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) (* Goal: @Perp_at Tn C O C C B' *) (* Goal: @Perp_at Tn C O C C B' *) subst X. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) (* Goal: @Perp_at Tn C O C C B' *) (* Goal: @Perp_at Tn C O C C B' *) assert(Perp C O B' C). (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) (* Goal: @Perp_at Tn C O C C B' *) (* Goal: @Perp_at Tn C O C C B' *) (* Goal: @Perp Tn C O B' C *) apply(perp_col _ Y); Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) (* Goal: @Perp_at Tn C O C C B' *) (* Goal: @Perp_at Tn C O C C B' *) (* Goal: @Col Tn C Y O *) ColR. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) (* Goal: @Perp_at Tn C O C C B' *) (* Goal: @Perp_at Tn C O C C B' *) apply perp_perp_in in H18. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) (* Goal: @Perp_at Tn C O C C B' *) (* Goal: @Perp_at Tn C O C C B' *) Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) (* Goal: @Perp_at Tn C O C C B' *) assert(Perp X C C B'). (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) (* Goal: @Perp_at Tn C O C C B' *) (* Goal: @Perp Tn X C C B' *) apply(perp_col _ Y); Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) (* Goal: @Perp_at Tn C O C C B' *) assert(Perp C O B' C). (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) (* Goal: @Perp_at Tn C O C C B' *) (* Goal: @Perp Tn C O B' C *) apply(perp_col _ X); Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) (* Goal: @Perp_at Tn C O C C B' *) (* Goal: @Col Tn C X O *) ColR. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) (* Goal: @Perp_at Tn C O C C B' *) apply perp_perp_in in H20. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) (* Goal: @Perp_at Tn C O C C B' *) Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O B C' *) apply perp_in_per. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn B O B B C' *) induction(eq_dec_points X B). (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn B O B B C' *) (* Goal: @Perp_at Tn B O B B C' *) subst X. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn B O B B C' *) (* Goal: @Perp_at Tn B O B B C' *) assert(Perp B O C' B). (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn B O B B C' *) (* Goal: @Perp_at Tn B O B B C' *) (* Goal: @Perp Tn B O C' B *) apply(perp_col _ Y); Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn B O B B C' *) (* Goal: @Perp_at Tn B O B B C' *) (* Goal: @Col Tn B Y O *) ColR. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn B O B B C' *) (* Goal: @Perp_at Tn B O B B C' *) apply perp_perp_in in H18. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn B O B B C' *) (* Goal: @Perp_at Tn B O B B C' *) Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn B O B B C' *) assert(Perp X B C' B). (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn B O B B C' *) (* Goal: @Perp Tn X B C' B *) apply(perp_col _ Y); Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn B O B B C' *) assert(Perp B O C' B). (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn B O B B C' *) (* Goal: @Perp Tn B O C' B *) apply(perp_col _ X); Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn B O B B C' *) (* Goal: @Col Tn B X O *) ColR. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn B O B B C' *) apply perp_perp_in in H20. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn B O B B C' *) Perp. (* Goal: @Bet Tn B' O C' *) assert(HP1:=l8_18_existence X Y B H16). (* Goal: @Bet Tn B' O C' *) ex_and HP1 B0. (* Goal: @Bet Tn B' O C' *) assert(~Col X Y C). (* Goal: @Bet Tn B' O C' *) (* Goal: not (@Col Tn X Y C) *) intro. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) apply H16. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn X Y B *) ColR. (* Goal: @Bet Tn B' O C' *) assert(HP1:=l8_18_existence X Y C H19). (* Goal: @Bet Tn B' O C' *) ex_and HP1 C0. (* Goal: @Bet Tn B' O C' *) assert(B0 <> O). (* Goal: @Bet Tn B' O C' *) (* Goal: not (@eq (@Tpoint Tn) B0 O) *) intro. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) subst B0. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) assert(Par B O B C'). (* Goal: @Bet Tn B' O C' *) (* Goal: False *) (* Goal: @Par Tn B O B C' *) apply(l12_9 B O B C' X Y); Perp; Cop. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) induction H22. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) (* Goal: False *) apply H22. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B O) (@Col Tn X B C')) *) exists B. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) (* Goal: and (@Col Tn B B O) (@Col Tn B B C') *) split; Col. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) spliter. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) apply H1. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn O B B' *) ColR. (* Goal: @Bet Tn B' O C' *) assert(C0 <> O). (* Goal: @Bet Tn B' O C' *) (* Goal: not (@eq (@Tpoint Tn) C0 O) *) intro. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) subst C0. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) assert(Par C O C B'). (* Goal: @Bet Tn B' O C' *) (* Goal: False *) (* Goal: @Par Tn C O C B' *) apply(l12_9 C O C B' X Y); Perp; Cop. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) induction H23. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) (* Goal: False *) apply H23. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X C O) (@Col Tn X C B')) *) exists C. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) (* Goal: and (@Col Tn C C O) (@Col Tn C C B') *) split; Col. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) spliter. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) apply H1. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn O B B' *) ColR. (* Goal: @Bet Tn B' O C' *) assert(Bet B0 O C0). (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B0 O C0 *) apply(per13_preserves_bet B O C B0 C0); auto. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Per Tn O B0 B *) (* Goal: @Col Tn B0 O C0 *) Between. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Per Tn O B0 B *) (* Goal: @Col Tn B0 O C0 *) ColR. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Per Tn O B0 B *) apply perp_in_per. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) induction(eq_dec_points X B0). (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) subst X. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) assert(Perp B0 O B B0). (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) (* Goal: @Perp Tn B0 O B B0 *) apply(perp_col _ Y); Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) (* Goal: @Col Tn B0 Y O *) Col. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) apply perp_perp_in in H24. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) assert(Perp X B0 B B0). (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) (* Goal: @Perp Tn X B0 B B0 *) apply(perp_col _ Y); Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) assert(Perp B0 O B B0). (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) (* Goal: @Perp Tn B0 O B B0 *) apply (perp_col _ X); Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) (* Goal: @Col Tn B0 X O *) ColR. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) apply perp_perp_in in H26. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) (* Goal: @Perp_at Tn B0 O B0 B0 B *) Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Per Tn O C0 C *) apply perp_in_per. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) induction(eq_dec_points X C0). (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) subst X. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) assert(Perp C0 O C C0). (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) (* Goal: @Perp Tn C0 O C C0 *) apply(perp_col _ Y); Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) (* Goal: @Col Tn C0 Y O *) Col. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) apply perp_perp_in in H24. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) assert(Perp X C0 C C0). (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) (* Goal: @Perp Tn X C0 C C0 *) apply(perp_col _ Y); Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) assert(Perp C0 O C C0). (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) (* Goal: @Perp Tn C0 O C C0 *) apply (perp_col _ X); Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) (* Goal: @Col Tn C0 X O *) ColR. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) apply perp_perp_in in H26. (* Goal: @Bet Tn B' O C' *) (* Goal: @Perp_at Tn C0 O C0 C0 C *) Perp. (* Goal: @Bet Tn B' O C' *) induction(eq_dec_points C' B0). (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) subst B0. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) assert(B' = C0). (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @eq (@Tpoint Tn) B' C0 *) apply bet_col in H24. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @eq (@Tpoint Tn) B' C0 *) apply (l6_21 C' O C C0); Col. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) (* Goal: not (@eq (@Tpoint Tn) C C0) *) (* Goal: not (@Col Tn C' O C) *) assert(Par C B' C C0). (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) (* Goal: not (@eq (@Tpoint Tn) C C0) *) (* Goal: not (@Col Tn C' O C) *) (* Goal: @Par Tn C B' C C0 *) apply(l12_9 C B' C C0 X Y); Perp; Cop. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) (* Goal: not (@eq (@Tpoint Tn) C C0) *) (* Goal: not (@Col Tn C' O C) *) induction H25. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) (* Goal: not (@eq (@Tpoint Tn) C C0) *) (* Goal: not (@Col Tn C' O C) *) (* Goal: not (@Col Tn C' O C) *) apply False_ind. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) (* Goal: not (@eq (@Tpoint Tn) C C0) *) (* Goal: not (@Col Tn C' O C) *) (* Goal: False *) apply H25. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) (* Goal: not (@eq (@Tpoint Tn) C C0) *) (* Goal: not (@Col Tn C' O C) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X C B') (@Col Tn X C C0)) *) exists C. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) (* Goal: not (@eq (@Tpoint Tn) C C0) *) (* Goal: not (@Col Tn C' O C) *) (* Goal: and (@Col Tn C C B') (@Col Tn C C C0) *) split; Col. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) (* Goal: not (@eq (@Tpoint Tn) C C0) *) (* Goal: not (@Col Tn C' O C) *) spliter. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) (* Goal: not (@eq (@Tpoint Tn) C C0) *) (* Goal: not (@Col Tn C' O C) *) Col. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) (* Goal: not (@eq (@Tpoint Tn) C C0) *) (* Goal: not (@Col Tn C' O C) *) intro. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) (* Goal: not (@eq (@Tpoint Tn) C C0) *) (* Goal: False *) apply H1. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) (* Goal: not (@eq (@Tpoint Tn) C C0) *) (* Goal: @Col Tn O B B' *) ColR. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) (* Goal: not (@eq (@Tpoint Tn) C C0) *) intro. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) (* Goal: False *) subst C0. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) (* Goal: False *) apply H1. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) (* Goal: @Col Tn O B B' *) ColR. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) apply(cop_perp2__col C C0 B' X Y); Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Coplanar Tn X Y C0 B' *) exists C0. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: or (and (@Col Tn X Y C0) (@Col Tn C0 B' C0)) (or (and (@Col Tn X C0 C0) (@Col Tn Y B' C0)) (and (@Col Tn X B' C0) (@Col Tn Y C0 C0))) *) left. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) (* Goal: and (@Col Tn X Y C0) (@Col Tn C0 B' C0) *) split; Col. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) subst C0. (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn B' O C' *) Between. (* Goal: @Bet Tn B' O C' *) assert(B' <> C0). (* Goal: @Bet Tn B' O C' *) (* Goal: not (@eq (@Tpoint Tn) B' C0) *) intro. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) subst C0. (* Goal: @Bet Tn B' O C' *) (* Goal: False *) apply H25. (* Goal: @Bet Tn B' O C' *) (* Goal: @eq (@Tpoint Tn) C' B0 *) apply (l6_21 B' O B B0); Col. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn B B0 C' *) (* Goal: not (@eq (@Tpoint Tn) B B0) *) intro. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn B B0 C' *) (* Goal: False *) subst B0. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn B B0 C' *) (* Goal: False *) Col. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn B B0 C' *) assert(Par B C' B B0). (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn B B0 C' *) (* Goal: @Par Tn B C' B B0 *) apply(l12_9 B C' B B0 X Y); Perp; Cop. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn B B0 C' *) induction H26. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn B B0 C' *) (* Goal: @Col Tn B B0 C' *) apply False_ind. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn B B0 C' *) (* Goal: False *) apply H26. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn B B0 C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C') (@Col Tn X B B0)) *) exists B. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn B B0 C' *) (* Goal: and (@Col Tn B B C') (@Col Tn B B B0) *) split; Col. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn B B0 C' *) spliter. (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn B B0 C' *) Col. (* Goal: @Bet Tn B' O C' *) assert(Col C C0 B'). (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn C C0 B' *) apply(cop_perp2__col C C0 B' X Y); Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Coplanar Tn X Y C0 B' *) exists C0. (* Goal: @Bet Tn B' O C' *) (* Goal: or (and (@Col Tn X Y C0) (@Col Tn C0 B' C0)) (or (and (@Col Tn X C0 C0) (@Col Tn Y B' C0)) (and (@Col Tn X B' C0) (@Col Tn Y C0 C0))) *) left. (* Goal: @Bet Tn B' O C' *) (* Goal: and (@Col Tn X Y C0) (@Col Tn C0 B' C0) *) split; Col. (* Goal: @Bet Tn B' O C' *) assert(Col B B0 C'). (* Goal: @Bet Tn B' O C' *) (* Goal: @Col Tn B B0 C' *) apply(cop_perp2__col B B0 C' X Y); Perp. (* Goal: @Bet Tn B' O C' *) (* Goal: @Coplanar Tn X Y B0 C' *) exists B0. (* Goal: @Bet Tn B' O C' *) (* Goal: or (and (@Col Tn X Y B0) (@Col Tn B0 C' B0)) (or (and (@Col Tn X B0 B0) (@Col Tn Y C' B0)) (and (@Col Tn X C' B0) (@Col Tn Y B0 B0))) *) left. (* Goal: @Bet Tn B' O C' *) (* Goal: and (@Col Tn X Y B0) (@Col Tn B0 C' B0) *) split; Col. (* Goal: @Bet Tn B' O C' *) apply(per13_preserves_bet_inv B' O C' C0 B0); Between. (* Goal: @Per Tn O B0 C' *) (* Goal: @Per Tn O C0 B' *) (* Goal: @Col Tn B' O C' *) Col. (* Goal: @Per Tn O B0 C' *) (* Goal: @Per Tn O C0 B' *) apply perp_in_per. (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) induction(eq_dec_points X C0). (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) subst X. (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) assert(Perp C0 O C B'). (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Perp Tn C0 O C B' *) apply (perp_col _ Y); Perp. (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Col Tn C0 Y O *) Col. (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) assert(Perp B' C0 C0 O). (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Perp Tn B' C0 C0 O *) apply(perp_col _ C); Perp. (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Col Tn B' C C0 *) Col. (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) apply perp_comm in H30. (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) apply perp_perp_in in H30. (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) Perp. (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) assert(Perp X C0 C B'). (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Perp Tn X C0 C B' *) apply(perp_col _ Y); Perp. (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) assert(Perp C0 O C B'). (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Perp Tn C0 O C B' *) apply (perp_col _ X); Perp. (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Col Tn C0 X O *) ColR. (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) assert(Perp B' C0 C0 O). (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Perp Tn B' C0 C0 O *) apply(perp_col _ C); Perp. (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) (* Goal: @Col Tn B' C C0 *) Col. (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) apply perp_comm in H32. (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) apply perp_perp_in in H32. (* Goal: @Per Tn O B0 C' *) (* Goal: @Perp_at Tn C0 O C0 C0 B' *) Perp. (* Goal: @Per Tn O B0 C' *) apply perp_in_per. (* Goal: @Perp_at Tn B0 O B0 B0 C' *) assert(Perp C' B0 X Y). (* Goal: @Perp_at Tn B0 O B0 B0 C' *) (* Goal: @Perp Tn C' B0 X Y *) apply (perp_col _ B); Perp. (* Goal: @Perp_at Tn B0 O B0 B0 C' *) (* Goal: @Col Tn C' B B0 *) Col. (* Goal: @Perp_at Tn B0 O B0 B0 C' *) induction (eq_dec_points X O). (* Goal: @Perp_at Tn B0 O B0 B0 C' *) (* Goal: @Perp_at Tn B0 O B0 B0 C' *) subst X. (* Goal: @Perp_at Tn B0 O B0 B0 C' *) (* Goal: @Perp_at Tn B0 O B0 B0 C' *) assert(Perp O B0 B0 C'). (* Goal: @Perp_at Tn B0 O B0 B0 C' *) (* Goal: @Perp_at Tn B0 O B0 B0 C' *) (* Goal: @Perp Tn O B0 B0 C' *) apply(perp_col _ Y);Perp. (* Goal: @Perp_at Tn B0 O B0 B0 C' *) (* Goal: @Perp_at Tn B0 O B0 B0 C' *) apply perp_comm in H30. (* Goal: @Perp_at Tn B0 O B0 B0 C' *) (* Goal: @Perp_at Tn B0 O B0 B0 C' *) apply perp_perp_in in H30. (* Goal: @Perp_at Tn B0 O B0 B0 C' *) (* Goal: @Perp_at Tn B0 O B0 B0 C' *) Perp. (* Goal: @Perp_at Tn B0 O B0 B0 C' *) assert(Perp X O C' B0). (* Goal: @Perp_at Tn B0 O B0 B0 C' *) (* Goal: @Perp Tn X O C' B0 *) apply(perp_col _ Y); Perp. (* Goal: @Perp_at Tn B0 O B0 B0 C' *) (* Goal: @Col Tn X Y O *) Col. (* Goal: @Perp_at Tn B0 O B0 B0 C' *) assert(Perp O B0 B0 C'). (* Goal: @Perp_at Tn B0 O B0 B0 C' *) (* Goal: @Perp Tn O B0 B0 C' *) apply(perp_col _ X); Perp. (* Goal: @Perp_at Tn B0 O B0 B0 C' *) (* Goal: @Col Tn O X B0 *) ColR. (* Goal: @Perp_at Tn B0 O B0 B0 C' *) apply perp_comm in H32. (* Goal: @Perp_at Tn B0 O B0 B0 C' *) apply perp_perp_in in H32. (* Goal: @Perp_at Tn B0 O B0 B0 C' *) Perp. Qed. Lemma is_image_perp_in : forall A A' X Y, A <> A' -> X <> Y -> Reflect A A' X Y -> exists P, Perp_at P A A' X Y. Proof. (* Goal: forall (A A' X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A A')) (_ : not (@eq (@Tpoint Tn) X Y)) (_ : @Reflect Tn A A' X Y), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) intros. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) unfold Reflect in H. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) induction H1. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) unfold ReflectL in H2. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) ex_and H2 P. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) induction H3. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) exists P. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @Perp_at Tn P A A' X Y *) apply perp_in_sym. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @Perp_at Tn P X Y A A' *) apply perp_in_right_comm. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @Perp_at Tn P X Y A' A *) apply(l8_14_2_1b_bis X Y A' A P); Col. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) assert_cols. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) Col. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) subst A'. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A X Y) *) tauto. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Perp_at Tn P A A' X Y) *) contradiction. Qed. Lemma perp_inter_perp_in_n : forall A B C D : Tpoint, Perp A B C D -> exists P : Tpoint, Col A B P /\ Col C D P /\ Perp_at P A B C D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @Perp Tn A B C D), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *) intros. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *) assert(A <> B /\ C <> D). (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *) (* Goal: and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C D)) *) apply perp_distinct in H. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *) (* Goal: and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C D)) *) tauto. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *) induction(col_dec A B C). (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *) (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *) exists C. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *) (* Goal: and (@Col Tn A B C) (and (@Col Tn C D C) (@Perp_at Tn C A B C D)) *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *) (* Goal: and (@Col Tn C D C) (@Perp_at Tn C A B C D) *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *) (* Goal: @Perp_at Tn C A B C D *) apply(l8_14_2_1b_bis A B C D C); Col. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *) assert(HH:=l8_18_existence A B C H2). (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *) ex_and HH P. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D))) *) exists P. (* Goal: and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D)) *) assert(Col C D P). (* Goal: and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D)) *) (* Goal: @Col Tn C D P *) apply(cop_perp2__col C D P A B); Perp. (* Goal: and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D)) *) (* Goal: @Coplanar Tn A B D P *) exists P. (* Goal: and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D)) *) (* Goal: or (and (@Col Tn A B P) (@Col Tn D P P)) (or (and (@Col Tn A D P) (@Col Tn B P P)) (and (@Col Tn A P P) (@Col Tn B D P))) *) left. (* Goal: and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D)) *) (* Goal: and (@Col Tn A B P) (@Col Tn D P P) *) split; Col. (* Goal: and (@Col Tn A B P) (and (@Col Tn C D P) (@Perp_at Tn P A B C D)) *) split; Col. (* Goal: and (@Col Tn C D P) (@Perp_at Tn P A B C D) *) split; Col. (* Goal: @Perp_at Tn P A B C D *) apply(l8_14_2_1b_bis A B C D P); Col. Qed. Lemma perp2_perp_in : forall A B C D O, Perp2 A B C D O -> ~Col O A B /\ ~Col O C D -> exists P, exists Q, Col A B P /\ Col C D Q /\ Col O P Q /\ Perp_at P O P A B /\ Perp_at Q O Q C D. Proof. (* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O) (_ : and (not (@Col Tn O A B)) (not (@Col Tn O C D))), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *) intros. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *) unfold Perp2 in H. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *) ex_and H X. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *) ex_and H1 Y. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *) assert(X <> Y). (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) apply perp_not_eq_1 in H2. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) auto. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *) assert(HH:= perp_inter_perp_in_n X Y A B H2). (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *) ex_and HH P. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *) assert(HH:= perp_inter_perp_in_n X Y C D H3). (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *) ex_and HH Q. (* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))))) *) exists P. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D))))) *) exists Q. (* Goal: and (@Col Tn A B P) (and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)))) *) split; auto. (* Goal: and (@Col Tn C D Q) (and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D))) *) split; auto. (* Goal: and (@Col Tn O P Q) (and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D)) *) split. (* Goal: and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D) *) (* Goal: @Col Tn O P Q *) apply (col3 X Y); Col. (* Goal: and (@Perp_at Tn P O P A B) (@Perp_at Tn Q O Q C D) *) split. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) induction(eq_dec_points X O). (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) (* Goal: @Perp_at Tn P O P A B *) subst X. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) (* Goal: @Perp_at Tn P O P A B *) apply perp_in_sym. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) (* Goal: @Perp_at Tn P A B O P *) apply(perp_in_col_perp_in A B O Y P P). (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) (* Goal: @Perp_at Tn P A B O Y *) (* Goal: @Col Tn O Y P *) (* Goal: not (@eq (@Tpoint Tn) O P) *) intro. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) (* Goal: @Perp_at Tn P A B O Y *) (* Goal: @Col Tn O Y P *) (* Goal: False *) subst P. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) (* Goal: @Perp_at Tn P A B O Y *) (* Goal: @Col Tn O Y P *) (* Goal: False *) apply H. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) (* Goal: @Perp_at Tn P A B O Y *) (* Goal: @Col Tn O Y P *) (* Goal: @Col Tn O A B *) Col. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) (* Goal: @Perp_at Tn P A B O Y *) (* Goal: @Col Tn O Y P *) Col. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) (* Goal: @Perp_at Tn P A B O Y *) apply perp_in_sym. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) (* Goal: @Perp_at Tn P O Y A B *) auto. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) assert(Perp_at P A B X O). (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) (* Goal: @Perp_at Tn P A B X O *) apply(perp_in_col_perp_in A B X Y O P H11). (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) (* Goal: @Perp_at Tn P A B X Y *) (* Goal: @Col Tn X Y O *) Col. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) (* Goal: @Perp_at Tn P A B X Y *) apply perp_in_sym. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) (* Goal: @Perp_at Tn P X Y A B *) auto. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) apply perp_in_right_comm in H12. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn P O P A B *) eapply (perp_in_col_perp_in _ _ _ _ P) in H12 . (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Col Tn O X P *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: @Perp_at Tn P O P A B *) apply perp_in_sym. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Col Tn O X P *) (* Goal: not (@eq (@Tpoint Tn) O P) *) (* Goal: @Perp_at Tn P A B O P *) auto. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Col Tn O X P *) (* Goal: not (@eq (@Tpoint Tn) O P) *) intro. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Col Tn O X P *) (* Goal: False *) subst P. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Col Tn O X P *) (* Goal: False *) apply H. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Col Tn O X P *) (* Goal: @Col Tn O A B *) Col. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Col Tn O X P *) ColR. (* Goal: @Perp_at Tn Q O Q C D *) induction(eq_dec_points X O). (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn Q O Q C D *) subst X. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn Q O Q C D *) apply perp_in_sym. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn Q C D O Q *) apply(perp_in_col_perp_in C D O Y Q Q). (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn Q C D O Y *) (* Goal: @Col Tn O Y Q *) (* Goal: not (@eq (@Tpoint Tn) O Q) *) intro. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn Q C D O Y *) (* Goal: @Col Tn O Y Q *) (* Goal: False *) subst Q. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn Q C D O Y *) (* Goal: @Col Tn O Y Q *) (* Goal: False *) apply H0. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn Q C D O Y *) (* Goal: @Col Tn O Y Q *) (* Goal: @Col Tn O C D *) Col. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn Q C D O Y *) (* Goal: @Col Tn O Y Q *) Col. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn Q C D O Y *) apply perp_in_sym. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn Q O Y C D *) auto. (* Goal: @Perp_at Tn Q O Q C D *) assert(Perp_at Q C D X O). (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn Q C D X O *) apply(perp_in_col_perp_in C D X Y O Q H11). (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn Q C D X Y *) (* Goal: @Col Tn X Y O *) Col. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn Q C D X Y *) apply perp_in_sym. (* Goal: @Perp_at Tn Q O Q C D *) (* Goal: @Perp_at Tn Q X Y C D *) auto. (* Goal: @Perp_at Tn Q O Q C D *) apply perp_in_right_comm in H12. (* Goal: @Perp_at Tn Q O Q C D *) eapply (perp_in_col_perp_in _ _ _ _ Q) in H12 . (* Goal: @Col Tn O X Q *) (* Goal: not (@eq (@Tpoint Tn) O Q) *) (* Goal: @Perp_at Tn Q O Q C D *) apply perp_in_sym. (* Goal: @Col Tn O X Q *) (* Goal: not (@eq (@Tpoint Tn) O Q) *) (* Goal: @Perp_at Tn Q C D O Q *) auto. (* Goal: @Col Tn O X Q *) (* Goal: not (@eq (@Tpoint Tn) O Q) *) intro. (* Goal: @Col Tn O X Q *) (* Goal: False *) subst Q. (* Goal: @Col Tn O X Q *) (* Goal: False *) apply H0. (* Goal: @Col Tn O X Q *) (* Goal: @Col Tn O C D *) Col. (* Goal: @Col Tn O X Q *) ColR. Qed. Lemma l13_8 : forall O P Q U V, U <> O -> V <> O -> Col O P Q -> Col O U V -> Per P U O -> Per Q V O -> (Out O P Q <-> Out O U V). Proof. (* Goal: forall (O P Q U V : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) U O)) (_ : not (@eq (@Tpoint Tn) V O)) (_ : @Col Tn O P Q) (_ : @Col Tn O U V) (_ : @Per Tn P U O) (_ : @Per Tn Q V O), iff (@Out Tn O P Q) (@Out Tn O U V) *) intros. (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) induction(eq_dec_points P U). (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) subst P. (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) (* Goal: iff (@Out Tn O U Q) (@Out Tn O U V) *) assert(Col Q V O). (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) (* Goal: iff (@Out Tn O U Q) (@Out Tn O U V) *) (* Goal: @Col Tn Q V O *) ColR. (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) (* Goal: iff (@Out Tn O U Q) (@Out Tn O U V) *) assert(HH:= l8_9 Q V O H4 H5). (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) (* Goal: iff (@Out Tn O U Q) (@Out Tn O U V) *) induction HH. (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) (* Goal: iff (@Out Tn O U Q) (@Out Tn O U V) *) (* Goal: iff (@Out Tn O U Q) (@Out Tn O U V) *) subst Q. (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) (* Goal: iff (@Out Tn O U Q) (@Out Tn O U V) *) (* Goal: iff (@Out Tn O U V) (@Out Tn O U V) *) tauto. (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) (* Goal: iff (@Out Tn O U Q) (@Out Tn O U V) *) subst V. (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) (* Goal: iff (@Out Tn O U Q) (@Out Tn O U O) *) tauto. (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) assert(Q <> V). (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) (* Goal: not (@eq (@Tpoint Tn) Q V) *) intro. (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) (* Goal: False *) subst Q. (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) (* Goal: False *) assert(HH:= per_not_col P U O H5 H H3). (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) (* Goal: False *) apply HH. (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) (* Goal: @Col Tn P U O *) ColR. (* Goal: iff (@Out Tn O P Q) (@Out Tn O U V) *) split. (* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *) (* Goal: forall _ : @Out Tn O P Q, @Out Tn O U V *) intro. (* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *) (* Goal: @Out Tn O U V *) unfold Out in H7. (* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *) (* Goal: @Out Tn O U V *) spliter. (* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *) (* Goal: @Out Tn O U V *) induction H9. (* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *) (* Goal: @Out Tn O U V *) (* Goal: @Out Tn O U V *) assert(HH:= per23_preserves_bet O P Q U V). (* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *) (* Goal: @Out Tn O U V *) (* Goal: @Out Tn O U V *) repeat split; auto. (* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *) (* Goal: @Out Tn O U V *) (* Goal: or (@Bet Tn O U V) (@Bet Tn O V U) *) left. (* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *) (* Goal: @Out Tn O U V *) (* Goal: @Bet Tn O U V *) apply(per23_preserves_bet O P Q U V); auto. (* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *) (* Goal: @Out Tn O U V *) (* Goal: @Per Tn O V Q *) (* Goal: @Per Tn O U P *) Perp. (* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *) (* Goal: @Out Tn O U V *) (* Goal: @Per Tn O V Q *) Perp. (* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *) (* Goal: @Out Tn O U V *) repeat split; auto. (* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *) (* Goal: or (@Bet Tn O U V) (@Bet Tn O V U) *) right. (* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *) (* Goal: @Bet Tn O V U *) apply(per23_preserves_bet O Q P V U); Col. (* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *) (* Goal: @Per Tn O U P *) (* Goal: @Per Tn O V Q *) Perp. (* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *) (* Goal: @Per Tn O U P *) Perp. (* Goal: forall _ : @Out Tn O U V, @Out Tn O P Q *) intro. (* Goal: @Out Tn O P Q *) unfold Out in H7. (* Goal: @Out Tn O P Q *) spliter. (* Goal: @Out Tn O P Q *) repeat split. (* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *) (* Goal: not (@eq (@Tpoint Tn) Q O) *) (* Goal: not (@eq (@Tpoint Tn) P O) *) intro. (* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *) (* Goal: not (@eq (@Tpoint Tn) Q O) *) (* Goal: False *) subst P. (* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *) (* Goal: not (@eq (@Tpoint Tn) Q O) *) (* Goal: False *) apply l8_8 in H3. (* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *) (* Goal: not (@eq (@Tpoint Tn) Q O) *) (* Goal: False *) contradiction. (* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *) (* Goal: not (@eq (@Tpoint Tn) Q O) *) intro. (* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *) (* Goal: False *) subst Q. (* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *) (* Goal: False *) apply l8_8 in H4. (* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *) (* Goal: False *) contradiction. (* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *) induction H9. (* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *) (* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *) left. (* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *) (* Goal: @Bet Tn O P Q *) apply(per23_preserves_bet_inv O P Q U V); Perp. (* Goal: or (@Bet Tn O P Q) (@Bet Tn O Q P) *) right. (* Goal: @Bet Tn O Q P *) apply(per23_preserves_bet_inv O Q P V U); Perp. (* Goal: @Col Tn O Q P *) Col. Qed. Lemma perp_in_rewrite : forall A B C D P, Perp_at P A B C D -> Perp_at P A P P C \/ Perp_at P A P P D \/ Perp_at P B P P C \/ Perp_at P B P P D. Proof. (* Goal: forall (A B C D P : @Tpoint Tn) (_ : @Perp_at Tn P A B C D), or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) intros. (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) assert(HH:= perp_in_col A B C D P H). (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) spliter. (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) induction(eq_dec_points A P); induction(eq_dec_points C P). (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) subst A . (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P P P P C) (or (@Perp_at Tn P P P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) subst C. (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P P P P P) (or (@Perp_at Tn P P P P D) (or (@Perp_at Tn P B P P P) (@Perp_at Tn P B P P D))) *) right;right;right. (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: @Perp_at Tn P B P P D *) Perp. (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) subst A. (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P P P P C) (or (@Perp_at Tn P P P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) right; right; left. (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: @Perp_at Tn P B P P C *) apply perp_in_right_comm. (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: @Perp_at Tn P B P C P *) assert(HP:=perp_in_col_perp_in P B C D P P H3 H1 H). (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: @Perp_at Tn P B P C P *) Perp. (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) subst C. (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: or (@Perp_at Tn P A P P P) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P P) (@Perp_at Tn P B P P D))) *) right; left. (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: @Perp_at Tn P A P P D *) apply perp_in_sym. (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: @Perp_at Tn P P D A P *) apply(perp_in_col_perp_in P D A B P P H2 H0). (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) (* Goal: @Perp_at Tn P P D A B *) Perp. (* Goal: or (@Perp_at Tn P A P P C) (or (@Perp_at Tn P A P P D) (or (@Perp_at Tn P B P P C) (@Perp_at Tn P B P P D))) *) left. (* Goal: @Perp_at Tn P A P P C *) assert(HP:= perp_in_col_perp_in A B C D P P H3 H1 H). (* Goal: @Perp_at Tn P A P P C *) apply perp_in_sym. (* Goal: @Perp_at Tn P P C A P *) apply perp_in_left_comm. (* Goal: @Perp_at Tn P C P A P *) apply(perp_in_col_perp_in C P A B P P H2 H0). (* Goal: @Perp_at Tn P C P A B *) Perp. Qed. Lemma gta_to_lta : forall A B C D E F, GtA A B C D E F -> LtA D E F A B C. Proof. (* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @GtA Tn A B C D E F), @LtA Tn D E F A B C *) unfold GtA. (* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @LtA Tn D E F A B C), @LtA Tn D E F A B C *) tauto. Qed. Lemma lta_to_gta : forall A B C D E F, LtA A B C D E F -> GtA D E F A B C. Proof. (* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @LtA Tn A B C D E F), @GtA Tn D E F A B C *) unfold GtA. (* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @LtA Tn A B C D E F), @LtA Tn A B C D E F *) tauto. Qed. Lemma perp_out_acute : forall A B C C', Out B A C' -> Perp A B C C' -> Acute A B C. Proof. (* Goal: forall (A B C C' : @Tpoint Tn) (_ : @Out Tn B A C') (_ : @Perp Tn A B C C'), @Acute Tn A B C *) intros. (* Goal: @Acute Tn A B C *) assert(A <> B /\ C' <> B). (* Goal: @Acute Tn A B C *) (* Goal: and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C' B)) *) apply out_distinct. (* Goal: @Acute Tn A B C *) (* Goal: @Out Tn B A C' *) assumption. (* Goal: @Acute Tn A B C *) spliter. (* Goal: @Acute Tn A B C *) assert(Perp B C' C C'). (* Goal: @Acute Tn A B C *) (* Goal: @Perp Tn B C' C C' *) apply(perp_col _ A); Perp. (* Goal: @Acute Tn A B C *) (* Goal: @Col Tn B A C' *) apply out_col in H. (* Goal: @Acute Tn A B C *) (* Goal: @Col Tn B A C' *) Col. (* Goal: @Acute Tn A B C *) assert(Per C C' B). (* Goal: @Acute Tn A B C *) (* Goal: @Per Tn C C' B *) apply perp_in_per. (* Goal: @Acute Tn A B C *) (* Goal: @Perp_at Tn C' C C' C' B *) apply perp_sym in H3. (* Goal: @Acute Tn A B C *) (* Goal: @Perp_at Tn C' C C' C' B *) apply perp_left_comm in H3. (* Goal: @Acute Tn A B C *) (* Goal: @Perp_at Tn C' C C' C' B *) apply perp_perp_in in H3. (* Goal: @Acute Tn A B C *) (* Goal: @Perp_at Tn C' C C' C' B *) apply perp_in_comm. (* Goal: @Acute Tn A B C *) (* Goal: @Perp_at Tn C' C' C B C' *) assumption. (* Goal: @Acute Tn A B C *) assert(Acute C' C B /\ Acute C' B C). (* Goal: @Acute Tn A B C *) (* Goal: and (@Acute Tn C' C B) (@Acute Tn C' B C) *) apply( l11_43 C' C B). (* Goal: @Acute Tn A B C *) (* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' C) *) assert_diffs. (* Goal: @Acute Tn A B C *) (* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' C) *) auto. (* Goal: @Acute Tn A B C *) (* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' B) *) assumption. (* Goal: @Acute Tn A B C *) (* Goal: or (@Per Tn C C' B) (@Obtuse Tn C C' B) *) left. (* Goal: @Acute Tn A B C *) (* Goal: @Per Tn C C' B *) assumption. (* Goal: @Acute Tn A B C *) spliter. (* Goal: @Acute Tn A B C *) assert(C <> B). (* Goal: @Acute Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) C B) *) intro. (* Goal: @Acute Tn A B C *) (* Goal: False *) subst C. (* Goal: @Acute Tn A B C *) (* Goal: False *) apply l8_8 in H4. (* Goal: @Acute Tn A B C *) (* Goal: False *) subst C'. (* Goal: @Acute Tn A B C *) (* Goal: False *) apply perp_distinct in H0. (* Goal: @Acute Tn A B C *) (* Goal: False *) tauto. (* Goal: @Acute Tn A B C *) assert(CongA C' B C A B C ). (* Goal: @Acute Tn A B C *) (* Goal: @CongA Tn C' B C A B C *) apply(out_conga A B C A B C C' C A C); auto. (* Goal: @Acute Tn A B C *) (* Goal: @Out Tn B C C *) (* Goal: @Out Tn B A A *) (* Goal: @Out Tn B C C *) (* Goal: @CongA Tn A B C A B C *) apply conga_refl; auto. (* Goal: @Acute Tn A B C *) (* Goal: @Out Tn B C C *) (* Goal: @Out Tn B A A *) (* Goal: @Out Tn B C C *) apply out_trivial; auto. (* Goal: @Acute Tn A B C *) (* Goal: @Out Tn B C C *) (* Goal: @Out Tn B A A *) apply out_trivial; auto. (* Goal: @Acute Tn A B C *) (* Goal: @Out Tn B C C *) apply out_trivial; auto. (* Goal: @Acute Tn A B C *) apply (acute_conga__acute C' B C); auto. Qed. Lemma flat_all_lea : forall A B C, A <> B -> C <> B -> Bet A B C -> forall P, P <> B -> LeA A B P A B C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) C B)) (_ : @Bet Tn A B C) (P : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) P B)), @LeA Tn A B P A B C *) intros. (* Goal: @LeA Tn A B P A B C *) unfold LeA. (* Goal: @ex (@Tpoint Tn) (fun P0 : @Tpoint Tn => and (@InAngle Tn P0 A B C) (@CongA Tn A B P A B P0)) *) exists P. (* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *) spliter. (* Goal: and (@InAngle Tn P A B C) (@CongA Tn A B P A B P) *) split. (* Goal: @CongA Tn A B P A B P *) (* Goal: @InAngle Tn P A B C *) unfold InAngle. (* Goal: @CongA Tn A B P A B P *) (* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C B)) (and (not (@eq (@Tpoint Tn) P B)) (@ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P)))))) *) repeat split; auto. (* Goal: @CongA Tn A B P A B P *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Bet Tn A X C) (or (@eq (@Tpoint Tn) X B) (@Out Tn B X P))) *) exists B. (* Goal: @CongA Tn A B P A B P *) (* Goal: and (@Bet Tn A B C) (or (@eq (@Tpoint Tn) B B) (@Out Tn B B P)) *) split; auto. (* Goal: @CongA Tn A B P A B P *) apply conga_refl; auto. Qed. Lemma perp_bet_obtuse : forall A B C C', B <> C' -> Perp A B C C' -> Bet A B C' -> Obtuse A B C. Proof. (* Goal: forall (A B C C' : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) B C')) (_ : @Perp Tn A B C C') (_ : @Bet Tn A B C'), @Obtuse Tn A B C *) intros. (* Goal: @Obtuse Tn A B C *) assert(HPO:=perp_out_acute). (* Goal: @Obtuse Tn A B C *) assert(HBO:=acute_bet__obtuse). (* Goal: @Obtuse Tn A B C *) assert(Col A B C'). (* Goal: @Obtuse Tn A B C *) (* Goal: @Col Tn A B C' *) apply bet_col in H1. (* Goal: @Obtuse Tn A B C *) (* Goal: @Col Tn A B C' *) Col. (* Goal: @Obtuse Tn A B C *) assert(Acute C' B C). (* Goal: @Obtuse Tn A B C *) (* Goal: @Acute Tn C' B C *) apply (HPO _ _ _ C'). (* Goal: @Obtuse Tn A B C *) (* Goal: @Perp Tn C' B C C' *) (* Goal: @Out Tn B C' C' *) apply out_trivial; auto. (* Goal: @Obtuse Tn A B C *) (* Goal: @Perp Tn C' B C C' *) apply perp_left_comm. (* Goal: @Obtuse Tn A B C *) (* Goal: @Perp Tn B C' C C' *) apply(perp_col _ A); Perp. (* Goal: @Obtuse Tn A B C *) (* Goal: @Col Tn B A C' *) Col. (* Goal: @Obtuse Tn A B C *) apply (HBO C'). (* Goal: @Acute Tn C' B C *) (* Goal: not (@eq (@Tpoint Tn) A B) *) (* Goal: @Bet Tn C' B A *) Between. (* Goal: @Acute Tn C' B C *) (* Goal: not (@eq (@Tpoint Tn) A B) *) intro. (* Goal: @Acute Tn C' B C *) (* Goal: False *) subst B. (* Goal: @Acute Tn C' B C *) (* Goal: False *) apply perp_distinct in H0. (* Goal: @Acute Tn C' B C *) (* Goal: False *) tauto. (* Goal: @Acute Tn C' B C *) assumption. Qed. End L13_1. Section L13_1_2D. Context `{T2D:Tarski_2D}. Lemma perp_in2__col : forall A B A' B' X Y P, Perp_at P A B X Y -> Perp_at P A' B' X Y -> Col A B A'. Proof. (* Goal: forall (A B A' B' X Y P : @Tpoint Tn) (_ : @Perp_at Tn P A B X Y) (_ : @Perp_at Tn P A' B' X Y), @Col Tn A B A' *) intros A B A' B' X Y P. (* Goal: forall (_ : @Perp_at Tn P A B X Y) (_ : @Perp_at Tn P A' B' X Y), @Col Tn A B A' *) apply cop4_perp_in2__col; apply all_coplanar. Qed. Lemma perp2_trans : forall A B C D E F P, Perp2 A B C D P -> Perp2 C D E F P -> Perp2 A B E F P. Proof. (* Goal: forall (A B C D E F P : @Tpoint Tn) (_ : @Perp2 Tn A B C D P) (_ : @Perp2 Tn C D E F P), @Perp2 Tn A B E F P *) intros. (* Goal: @Perp2 Tn A B E F P *) unfold Perp2 in *. (* 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 E F)))) *) ex_and H X. (* 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 E F)))) *) ex_and H1 Y. (* 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 E F)))) *) ex_and H0 X'. (* 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 E F)))) *) ex_and H3 Y'. (* 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 E F)))) *) assert(Par X Y X' Y'). (* 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 E F)))) *) (* Goal: @Par Tn X Y X' Y' *) apply (l12_9_2D _ _ _ _ C D); Perp. (* 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 E F)))) *) exists X. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F))) *) exists Y. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) assert(Col X X' Y'). (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) induction H5. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) (* Goal: @Col Tn X X' Y' *) unfold Par_strict in H5. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) (* Goal: @Col Tn X X' Y' *) spliter. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) (* Goal: @Col Tn X X' Y' *) apply False_ind. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) (* Goal: False *) apply H8. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X Y) (@Col Tn X0 X' Y')) *) exists P. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) (* Goal: and (@Col Tn P X Y) (@Col Tn P X' Y') *) split; Col. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) spliter. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn X X' Y' *) auto. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) assert(Col Y X' Y'). (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) induction H5. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) (* Goal: @Col Tn Y X' Y' *) unfold Par_strict in H5. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) (* Goal: @Col Tn Y X' Y' *) spliter. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) (* Goal: @Col Tn Y X' Y' *) apply False_ind. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) (* Goal: False *) apply H9. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X Y) (@Col Tn X0 X' Y')) *) exists P. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) (* Goal: and (@Col Tn P X Y) (@Col Tn P X' Y') *) split; Col. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) spliter. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) (* Goal: @Col Tn Y X' Y' *) auto. (* Goal: and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y E F)) *) repeat split; auto. (* Goal: @Perp Tn X Y E F *) assert(X <> Y). (* Goal: @Perp Tn X Y E F *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) apply perp_not_eq_1 in H1. (* Goal: @Perp Tn X Y E F *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) assert(X' <> Y'). (* Goal: @Perp Tn X Y E F *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) (* Goal: not (@eq (@Tpoint Tn) X' Y') *) apply perp_not_eq_1 in H3. (* Goal: @Perp Tn X Y E F *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) (* Goal: not (@eq (@Tpoint Tn) X' Y') *) auto. (* Goal: @Perp Tn X Y E F *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) auto. (* Goal: @Perp Tn X Y E F *) induction(eq_dec_points X Y'). (* Goal: @Perp Tn X Y E F *) (* Goal: @Perp Tn X Y E F *) subst Y'. (* Goal: @Perp Tn X Y E F *) (* Goal: @Perp Tn X Y E F *) apply (perp_col _ X'). (* Goal: @Perp Tn X Y E F *) (* Goal: @Col Tn X X' Y *) (* Goal: @Perp Tn X X' E F *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) auto. (* Goal: @Perp Tn X Y E F *) (* Goal: @Col Tn X X' Y *) (* Goal: @Perp Tn X X' E F *) Perp. (* Goal: @Perp Tn X Y E F *) (* Goal: @Col Tn X X' Y *) ColR. (* Goal: @Perp Tn X Y E F *) apply (perp_col _ Y'). (* Goal: @Col Tn X Y' Y *) (* Goal: @Perp Tn X Y' E F *) (* Goal: not (@eq (@Tpoint Tn) X Y) *) auto. (* Goal: @Col Tn X Y' Y *) (* Goal: @Perp Tn X Y' E F *) apply perp_left_comm. (* Goal: @Col Tn X Y' Y *) (* Goal: @Perp Tn Y' X E F *) apply(perp_col _ X'). (* Goal: @Col Tn X Y' Y *) (* Goal: @Col Tn Y' X' X *) (* Goal: @Perp Tn Y' X' E F *) (* Goal: not (@eq (@Tpoint Tn) Y' X) *) auto. (* Goal: @Col Tn X Y' Y *) (* Goal: @Col Tn Y' X' X *) (* Goal: @Perp Tn Y' X' E F *) Perp. (* Goal: @Col Tn X Y' Y *) (* Goal: @Col Tn Y' X' X *) ColR. (* Goal: @Col Tn X Y' Y *) apply par_symmetry in H5. (* Goal: @Col Tn X Y' Y *) induction H5. (* Goal: @Col Tn X Y' Y *) (* Goal: @Col Tn X Y' Y *) unfold Par_strict in H5. (* Goal: @Col Tn X Y' Y *) (* Goal: @Col Tn X Y' Y *) spliter. (* Goal: @Col Tn X Y' Y *) (* Goal: @Col Tn X Y' Y *) apply False_ind. (* Goal: @Col Tn X Y' Y *) (* Goal: False *) apply H12. (* Goal: @Col Tn X Y' Y *) (* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => and (@Col Tn X0 X' Y') (@Col Tn X0 X Y)) *) exists P. (* Goal: @Col Tn X Y' Y *) (* Goal: and (@Col Tn P X' Y') (@Col Tn P X Y) *) split; Col. (* Goal: @Col Tn X Y' Y *) spliter. (* Goal: @Col Tn X Y' Y *) Col. Qed. Lemma perp2_par : forall A B C D O, Perp2 A B C D O -> Par A B C D. Proof. (* Goal: forall (A B C D O : @Tpoint Tn) (_ : @Perp2 Tn A B C D O), @Par Tn A B C D *) intros. (* Goal: @Par Tn A B C D *) unfold Perp2 in H. (* Goal: @Par Tn A B C D *) ex_and H X. (* Goal: @Par Tn A B C D *) ex_and H0 Y. (* Goal: @Par Tn A B C D *) apply (l12_9_2D _ _ _ _ X Y). (* Goal: @Perp Tn C D X Y *) (* Goal: @Perp Tn A B X Y *) Perp. (* Goal: @Perp Tn C D X Y *) Perp. Qed. End L13_1_2D.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrfun ssrbool eqtype ssrnat seq choice path. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Module Finite. Section RawMixin. Variable T : eqType. Definition axiom e := forall x : T, count_mem x e = 1. Lemma uniq_enumP e : uniq e -> e =i T -> axiom e. Proof. (* Goal: forall (_ : is_true (@uniq T e)) (_ : @eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) e) (@mem (Equality.sort T) (predPredType (Equality.sort T)) (@sort_of_simpl_pred (Equality.sort T) (pred_of_argType (Equality.sort T))))), axiom e *) by move=> Ue sT x; rewrite count_uniq_mem ?sT. Qed. Record mixin_of := Mixin { mixin_base : Countable.mixin_of T; mixin_enum : seq T; _ : axiom mixin_enum }. End RawMixin. Section Mixins. Variable T : countType. Definition EnumMixin := let: Countable.Pack _ (Countable.Class _ m) as cT := T return forall e : seq cT, axiom e -> mixin_of cT in @Mixin (EqType _ _) m. Definition UniqMixin e Ue eT := @EnumMixin e (uniq_enumP Ue eT). Variable n : nat. Definition count_enum := pmap (@pickle_inv T) (iota 0 n). Hypothesis ubT : forall x : T, pickle x < n. Lemma count_enumP : axiom count_enum. Proof. (* Goal: @axiom (Countable.eqType T) count_enum *) apply: uniq_enumP (pmap_uniq (@pickle_invK T) (iota_uniq _ _)) _ => x. (* Goal: @eq bool (@in_mem (Equality.sort (Countable.eqType T)) x (@mem (Equality.sort (Countable.eqType T)) (seq_predType (Countable.eqType T)) (@pmap (Equality.sort nat_eqType) (Equality.sort (Countable.eqType T)) (@pickle_inv T) (iota O n)))) (@in_mem (Equality.sort (Countable.eqType T)) x (@mem (Equality.sort (Countable.eqType T)) (predPredType (Equality.sort (Countable.eqType T))) (@sort_of_simpl_pred (Equality.sort (Countable.eqType T)) (pred_of_argType (Equality.sort (Countable.eqType T)))))) *) by rewrite mem_pmap -pickleK_inv map_f // mem_iota ubT. Qed. Definition CountMixin := EnumMixin count_enumP. End Mixins. Section ClassDef. Record class_of T := Class { base : Choice.class_of T; mixin : mixin_of (Equality.Pack base) }. Definition base2 T c := Countable.Class (@base T c) (mixin_base (mixin c)). Local Coercion base : class_of >-> Choice.class_of. Structure type : 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 (EqType T b0)) := fun bT b & phant_id (Choice.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 countType := @Countable.Pack cT (base2 xclass). End ClassDef. Module Import Exports. Coercion mixin_base : mixin_of >-> Countable.mixin_of. Coercion base : class_of >-> Choice.class_of. Coercion mixin : class_of >-> mixin_of. Coercion base2 : class_of >-> Countable.class_of. Coercion sort : type >-> Sortclass. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion countType : type >-> Countable.type. Canonical countType. Notation finType := type. Notation FinType T m := (@pack T _ m _ _ id _ id). Notation FinMixin := EnumMixin. Notation UniqFinMixin := UniqMixin. Notation "[ 'finType' 'of' T 'for' cT ]" := (@clone T cT _ idfun) (at level 0, format "[ 'finType' 'of' T 'for' cT ]") : form_scope. Notation "[ 'finType' 'of' T ]" := (@clone T _ _ id) (at level 0, format "[ 'finType' 'of' T ]") : form_scope. End Exports. Module Type EnumSig. Parameter enum : forall cT : type, seq cT. Axiom enumDef : enum = fun cT => mixin_enum (class cT). End EnumSig. Module EnumDef : EnumSig. Definition enum cT := mixin_enum (class cT). Definition enumDef := erefl enum. End EnumDef. Notation enum := EnumDef.enum. End Finite. Export Finite.Exports. Canonical finEnum_unlock := Unlockable Finite.EnumDef.enumDef. Definition fin_pred_sort (T : finType) (pT : predType T) := pred_sort pT. Identity Coercion pred_sort_of_fin : fin_pred_sort >-> pred_sort. Definition enum_mem T (mA : mem_pred _) := filter mA (Finite.enum T). Notation enum A := (enum_mem (mem A)). Definition pick (T : finType) (P : pred T) := ohead (enum P). Notation "[ 'pick' x | P ]" := (pick (fun x => P%B)) (at level 0, x ident, format "[ 'pick' x | P ]") : form_scope. Notation "[ 'pick' x : T | P ]" := (pick (fun x : T => P%B)) (at level 0, x ident, only parsing) : form_scope. Definition pick_true T (x : T) := true. Notation "[ 'pick' x : T ]" := [pick x : T | pick_true x] (at level 0, x ident, only parsing). Notation "[ 'pick' x ]" := [pick x : _] (at level 0, x ident, only parsing) : form_scope. Notation "[ 'pic' 'k' x : T ]" := [pick x : T | pick_true _] (at level 0, x ident, format "[ 'pic' 'k' x : T ]") : form_scope. Notation "[ 'pick' x | P & Q ]" := [pick x | P && Q ] (at level 0, x ident, format "[ '[hv ' 'pick' x | P '/ ' & Q ] ']'") : form_scope. Notation "[ 'pick' x : T | P & Q ]" := [pick x : T | P && Q ] (at level 0, x ident, only parsing) : form_scope. Notation "[ 'pick' x 'in' A ]" := [pick x | x \in A] (at level 0, x ident, format "[ 'pick' x 'in' A ]") : form_scope. Notation "[ 'pick' x : T 'in' A ]" := [pick x : T | x \in A] (at level 0, x ident, only parsing) : form_scope. Notation "[ 'pick' x 'in' A | P ]" := [pick x | x \in A & P ] (at level 0, x ident, format "[ '[hv ' 'pick' x 'in' A '/ ' | P ] ']'") : form_scope. Notation "[ 'pick' x : T 'in' A | P ]" := [pick x : T | x \in A & P ] (at level 0, x ident, only parsing) : form_scope. Notation "[ 'pick' x 'in' A | P & Q ]" := [pick x in A | P && Q] (at level 0, x ident, format "[ '[hv ' 'pick' x 'in' A '/ ' | P '/ ' & Q ] ']'") : form_scope. Notation "[ 'pick' x : T 'in' A | P & Q ]" := [pick x : T in A | P && Q] (at level 0, x ident, only parsing) : form_scope. Local Notation card_type := (forall T : finType, mem_pred T -> nat). Local Notation card_def := (fun T mA => size (enum_mem mA)). Module Type CardDefSig. Parameter card : card_type. Axiom cardEdef : card = card_def. End CardDefSig. Module CardDef : CardDefSig. Definition card : card_type := card_def. Definition cardEdef := erefl card. End CardDef. Export CardDef. Canonical card_unlock := Unlockable cardEdef. Notation "#| A |" := (card (mem A)) (at level 0, A at level 99, format "#| A |") : nat_scope. Definition pred0b (T : finType) (P : pred T) := #|P| == 0. Prenex Implicits pred0b. Module FiniteQuant. Variant quantified := Quantified of bool. Delimit Scope fin_quant_scope with Q. Bind Scope fin_quant_scope with quantified. Notation "F ^*" := (Quantified F) (at level 2). Notation "F ^~" := (~~ F) (at level 2). Section Definitions. Variable T : finType. Implicit Types (B : quantified) (x y : T). Definition quant0b Bp := pred0b [pred x : T | let: F^* := Bp x x in F]. Definition ex B x y := B. Definition all B x y := let: F^* := B in F^~^*. Definition all_in C B x y := let: F^* := B in (C ==> F)^~^*. Definition ex_in C B x y := let: F^* := B in (C && F)^*. End Definitions. Notation "[ x | B ]" := (quant0b (fun x => B x)) (at level 0, x ident). Notation "[ x : T | B ]" := (quant0b (fun x : T => B x)) (at level 0, x ident). Module Exports. Notation ", F" := F^* (at level 200, format ", '/ ' F") : fin_quant_scope. Notation "[ 'forall' x B ]" := [x | all B] (at level 0, x at level 99, B at level 200, format "[ '[hv' 'forall' x B ] ']'") : bool_scope. Notation "[ 'forall' x : T B ]" := [x : T | all B] (at level 0, x at level 99, B at level 200, only parsing) : bool_scope. Notation "[ 'forall' ( x | C ) B ]" := [x | all_in C B] (at level 0, x at level 99, B at level 200, format "[ '[hv' '[' 'forall' ( x '/ ' | C ) ']' B ] ']'") : bool_scope. Notation "[ 'forall' ( x : T | C ) B ]" := [x : T | all_in C B] (at level 0, x at level 99, B at level 200, only parsing) : bool_scope. Notation "[ 'forall' x 'in' A B ]" := [x | all_in (x \in A) B] (at level 0, x at level 99, B at level 200, format "[ '[hv' '[' 'forall' x '/ ' 'in' A ']' B ] ']'") : bool_scope. Notation "[ 'forall' x : T 'in' A B ]" := [x : T | all_in (x \in A) B] (at level 0, x at level 99, B at level 200, only parsing) : bool_scope. Notation ", 'forall' x B" := [x | all B]^* (at level 200, x at level 99, B at level 200, format ", '/ ' 'forall' x B") : fin_quant_scope. Notation ", 'forall' x : T B" := [x : T | all B]^* (at level 200, x at level 99, B at level 200, only parsing) : fin_quant_scope. Notation ", 'forall' ( x | C ) B" := [x | all_in C B]^* (at level 200, x at level 99, B at level 200, format ", '/ ' '[' 'forall' ( x '/ ' | C ) ']' B") : fin_quant_scope. Notation ", 'forall' ( x : T | C ) B" := [x : T | all_in C B]^* (at level 200, x at level 99, B at level 200, only parsing) : fin_quant_scope. Notation ", 'forall' x 'in' A B" := [x | all_in (x \in A) B]^* (at level 200, x at level 99, B at level 200, format ", '/ ' '[' 'forall' x '/ ' 'in' A ']' B") : bool_scope. Notation ", 'forall' x : T 'in' A B" := [x : T | all_in (x \in A) B]^* (at level 200, x at level 99, B at level 200, only parsing) : bool_scope. Notation "[ 'exists' x B ]" := [x | ex B]^~ (at level 0, x at level 99, B at level 200, format "[ '[hv' 'exists' x B ] ']'") : bool_scope. Notation "[ 'exists' x : T B ]" := [x : T | ex B]^~ (at level 0, x at level 99, B at level 200, only parsing) : bool_scope. Notation "[ 'exists' ( x | C ) B ]" := [x | ex_in C B]^~ (at level 0, x at level 99, B at level 200, format "[ '[hv' '[' 'exists' ( x '/ ' | C ) ']' B ] ']'") : bool_scope. Notation "[ 'exists' ( x : T | C ) B ]" := [x : T | ex_in C B]^~ (at level 0, x at level 99, B at level 200, only parsing) : bool_scope. Notation "[ 'exists' x 'in' A B ]" := [x | ex_in (x \in A) B]^~ (at level 0, x at level 99, B at level 200, format "[ '[hv' '[' 'exists' x '/ ' 'in' A ']' B ] ']'") : bool_scope. Notation "[ 'exists' x : T 'in' A B ]" := [x : T | ex_in (x \in A) B]^~ (at level 0, x at level 99, B at level 200, only parsing) : bool_scope. Notation ", 'exists' x B" := [x | ex B]^~^* (at level 200, x at level 99, B at level 200, format ", '/ ' 'exists' x B") : fin_quant_scope. Notation ", 'exists' x : T B" := [x : T | ex B]^~^* (at level 200, x at level 99, B at level 200, only parsing) : fin_quant_scope. Notation ", 'exists' ( x | C ) B" := [x | ex_in C B]^~^* (at level 200, x at level 99, B at level 200, format ", '/ ' '[' 'exists' ( x '/ ' | C ) ']' B") : fin_quant_scope. Notation ", 'exists' ( x : T | C ) B" := [x : T | ex_in C B]^~^* (at level 200, x at level 99, B at level 200, only parsing) : fin_quant_scope. Notation ", 'exists' x 'in' A B" := [x | ex_in (x \in A) B]^~^* (at level 200, x at level 99, B at level 200, format ", '/ ' '[' 'exists' x '/ ' 'in' A ']' B") : bool_scope. Notation ", 'exists' x : T 'in' A B" := [x : T | ex_in (x \in A) B]^~^* (at level 200, x at level 99, B at level 200, only parsing) : bool_scope. End Exports. End FiniteQuant. Export FiniteQuant.Exports. Definition disjoint T (A B : mem_pred _) := @pred0b T (predI A B). Notation "[ 'disjoint' A & B ]" := (disjoint (mem A) (mem B)) (at level 0, format "'[hv' [ 'disjoint' '/ ' A '/' & B ] ']'") : bool_scope. Local Notation subset_type := (forall (T : finType) (A B : mem_pred T), bool). Local Notation subset_def := (fun T A B => pred0b (predD A B)). Module Type SubsetDefSig. Parameter subset : subset_type. Axiom subsetEdef : subset = subset_def. End SubsetDefSig. Module Export SubsetDef : SubsetDefSig. Definition subset : subset_type := subset_def. Definition subsetEdef := erefl subset. End SubsetDef. Canonical subset_unlock := Unlockable subsetEdef. Notation "A \subset B" := (subset (mem A) (mem B)) (at level 70, no associativity) : bool_scope. Definition proper T A B := @subset T A B && ~~ subset B A. Notation "A \proper B" := (proper (mem A) (mem B)) (at level 70, no associativity) : bool_scope. Section OpsTheory. Variable T : finType. Implicit Types A B C P Q : pred T. Implicit Types x y : T. Implicit Type s : seq T. Lemma enumP : Finite.axiom (Finite.enum T). Proof. (* Goal: @Finite.axiom (Finite.eqType T) (Finite.EnumDef.enum T) *) by rewrite unlock; case T => ? [? []]. Qed. Section EnumPick. Variable P : pred T. Lemma enumT : enum T = Finite.enum T. Proof. (* Goal: @eq (list (Finite.sort T)) (@enum_mem 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)))))) (Finite.EnumDef.enum T) *) exact: filter_predT. Qed. Lemma mem_enum A : enum A =i A. Proof. (* Goal: @eq_mem (Equality.sort (Finite.eqType T)) (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@enum_mem T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) *) by move=> x; rewrite mem_filter andbC -has_pred1 has_count enumP. Qed. Lemma enum_uniq : uniq (enum P). Proof. (* Goal: is_true (@uniq (Finite.eqType T) (@enum_mem T (@mem (Finite.sort T) (predPredType (Finite.sort T)) P))) *) by apply/filter_uniq/count_mem_uniq => x; rewrite enumP -enumT mem_enum. Qed. Lemma enum1 x : enum (pred1 x) = [:: x]. Proof. (* Goal: @eq (list (Finite.sort T)) (@enum_mem T (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@pred1 (Finite.eqType T) x))) (@cons (Finite.sort T) x (@nil (Finite.sort T))) *) rewrite [enum _](all_pred1P x _ _); first by rewrite size_filter enumP. (* Goal: is_true (@all (Equality.sort (Finite.eqType T)) (@pred_of_simpl (Equality.sort (Finite.eqType T)) (@pred1 (Finite.eqType T) x)) (@enum_mem T (@mem (Finite.sort T) (simplPredType (Equality.sort (Finite.eqType T))) (@pred1 (Finite.eqType T) x)))) *) by apply/allP=> y; rewrite mem_enum. Qed. Variant pick_spec : option T -> Type := | Pick x of P x : pick_spec (Some x) | Nopick of P =1 xpred0 : pick_spec None. Lemma pickP : pick_spec (pick P). Proof. (* Goal: pick_spec (@pick T P) *) rewrite /pick; case: (enum _) (mem_enum P) => [|x s] Pxs /=. (* Goal: pick_spec (@Some (Finite.sort T) x) *) (* Goal: pick_spec (@None (Finite.sort T)) *) by right; apply: fsym. (* Goal: pick_spec (@Some (Finite.sort T) x) *) by left; rewrite -[P _]Pxs mem_head. Qed. End EnumPick. Lemma eq_enum P Q : P =i Q -> enum P = enum Q. Proof. (* Goal: forall _ : @eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) P) (@mem (Finite.sort T) (predPredType (Finite.sort T)) Q), @eq (list (Finite.sort T)) (@enum_mem T (@mem (Finite.sort T) (predPredType (Finite.sort T)) P)) (@enum_mem T (@mem (Finite.sort T) (predPredType (Finite.sort T)) Q)) *) by move=> eqPQ; apply: eq_filter. Qed. Lemma eq_pick P Q : P =1 Q -> pick P = pick Q. Proof. (* Goal: forall _ : @eqfun bool (Finite.sort T) P Q, @eq (option (Finite.sort T)) (@pick T P) (@pick T Q) *) by move=> eqPQ; rewrite /pick (eq_enum eqPQ). Qed. Lemma cardE A : #|A| = size (enum A). Proof. (* Goal: @eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@size (Finite.sort T) (@enum_mem T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) *) by rewrite unlock. Qed. Lemma eq_card A B : A =i B -> #|A| = #|B|. Proof. (* Goal: forall _ : @eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B), @eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) *) by move=> eqAB; rewrite !cardE (eq_enum eqAB). Qed. Lemma eq_card_trans A B n : #|A| = n -> B =i A -> #|B| = n. Proof. (* Goal: forall (_ : @eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) n) (_ : @eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)), @eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) n *) by move <-; apply: eq_card. Qed. Lemma card0 : #|@pred0 T| = 0. Proof. by rewrite cardE enum0. Qed. Proof. (* Goal: @eq nat (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@pred0 (Finite.sort T)))) O *) by rewrite cardE enum0. Qed. Lemma card1 x : #|pred1 x| = 1. Proof. (* Goal: @eq nat (@card T (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@pred1 (Finite.eqType T) x))) (S O) *) by rewrite cardE enum1. Qed. Lemma eq_card0 A : A =i pred0 -> #|A| = 0. Proof. (* Goal: forall _ : @eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@pred0 (Finite.sort T))), @eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) O *) exact: eq_card_trans card0. Qed. Lemma eq_cardT A : A =i predT -> #|A| = size (enum T). Proof. (* Goal: forall _ : @eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predT (Finite.sort T))), @eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@size (Finite.sort T) (@enum_mem 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))))))) *) exact: eq_card_trans cardT. Qed. Lemma eq_card1 x A : A =i pred1 x -> #|A| = 1. Proof. (* Goal: forall _ : @eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@pred1 (Finite.eqType T) x)), @eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (S O) *) exact: eq_card_trans (card1 x). Qed. Lemma cardUI A B : #|[predU A & B]| + #|[predI A & B]| = #|A| + #|B|. Proof. (* Goal: @eq nat (addn (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predU (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)))))) (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predI (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))))))) (addn (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) *) by rewrite !cardE !size_filter count_predUI. Qed. Lemma cardID B A : #|[predI A & B]| + #|[predD A & B]| = #|A|. Proof. (* Goal: @eq nat (addn (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predI (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)))))) (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predD (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))))))) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) *) rewrite -cardUI addnC [#|predI _ _|]eq_card0 => [|x] /=. (* Goal: @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@predI (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@predI (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)))))))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@predD (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)))))))))))) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@pred0 (Finite.sort T)))) *) (* Goal: @eq nat (addn O (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predU (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@predI (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)))))))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@predD (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)))))))))))) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) *) by apply: eq_card => x; rewrite !inE andbC -andb_orl orbN. (* Goal: @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@predI (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@predI (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)))))))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@predD (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)))))))))))) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@pred0 (Finite.sort T)))) *) by rewrite !inE -!andbA andbC andbA andbN. Qed. Lemma cardC A : #|A| + #|[predC A]| = #|T|. Proof. (* Goal: @eq nat (addn (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predC (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))))))) (@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 rewrite !cardE !size_filter count_predC. Qed. Lemma cardU1 x A : #|[predU1 x & A]| = (x \notin A) + #|A|. Proof. (* Goal: @eq nat (@card T (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@predU1 (Finite.eqType T) x (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))))) (addn (nat_of_bool (negb (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) *) case Ax: (x \in A). (* Goal: @eq nat (@card T (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@predU1 (Finite.eqType T) x (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))))) (addn (nat_of_bool (negb false)) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) *) (* Goal: @eq nat (@card T (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@predU1 (Finite.eqType T) x (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))))) (addn (nat_of_bool (negb true)) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) *) by apply: eq_card => y; rewrite inE /=; case: eqP => // ->. (* Goal: @eq nat (@card T (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@predU1 (Finite.eqType T) x (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))))) (addn (nat_of_bool (negb false)) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) *) rewrite /= -(card1 x) -cardUI addnC. (* Goal: @eq nat (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predU1 (Finite.eqType T) x (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))))) (addn (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predI (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Equality.sort (Finite.eqType T)) (@pred1 (Finite.eqType T) x))))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))))) (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predU (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Equality.sort (Finite.eqType T)) (@pred1 (Finite.eqType T) x))))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))))))) *) rewrite [#|predI _ _|]eq_card0 => [|y /=]; first exact: eq_card. (* Goal: @eq bool (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@predI (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@pred1 (Finite.eqType T) x))))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))))))) (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@pred0 (Finite.sort T)))) *) by rewrite !inE; case: eqP => // ->. Qed. Lemma card2 x y : #|pred2 x y| = (x != y).+1. Proof. (* Goal: @eq nat (@card T (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@pred2 (Finite.eqType T) x y))) (S (nat_of_bool (negb (@eq_op (Finite.eqType T) x y)))) *) by rewrite cardU1 card1 addn1. Qed. Lemma cardC1 x : #|predC1 x| = #|T|.-1. Proof. (* Goal: @eq nat (@card T (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@predC1 (Finite.eqType T) x))) (Nat.pred (@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 rewrite -(cardC (pred1 x)) card1. Qed. Lemma cardD1 x A : #|A| = (x \in A) + #|[predD1 A & x]|. Proof. (* Goal: @eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (addn (nat_of_bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@card T (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@predD1 (Finite.eqType T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) x)))) *) case Ax: (x \in A); last first. (* Goal: @eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (addn (nat_of_bool true) (@card T (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@predD1 (Finite.eqType T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) x)))) *) (* Goal: @eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (addn (nat_of_bool false) (@card T (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@predD1 (Finite.eqType T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) x)))) *) by apply: eq_card => y; rewrite !inE /=; case: eqP => // ->. (* Goal: @eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (addn (nat_of_bool true) (@card T (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@predD1 (Finite.eqType T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) x)))) *) rewrite /= -(card1 x) -cardUI addnC /=. (* Goal: @eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (addn (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predI (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@pred1 (Finite.eqType T) x))))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@predD1 (Finite.eqType T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) x)))))))) (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predU (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@pred1 (Finite.eqType T) x))))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@predD1 (Finite.eqType T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) x))))))))) *) rewrite [#|predI _ _|]eq_card0 => [|y]; last by rewrite !inE; case: eqP. (* Goal: @eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (addn O (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predU (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@pred1 (Finite.eqType T) x))))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@predD1 (Finite.eqType T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) x))))))))) *) by apply: eq_card => y; rewrite !inE; case: eqP => // ->. Qed. Lemma max_card A : #|A| <= #|T|. Proof. (* Goal: is_true (leq (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@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 rewrite -(cardC A) leq_addr. Qed. Lemma card_size s : #|s| <= size s. Proof. (* Goal: is_true (leq (@card T (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) s)) (@size (Finite.sort T) s)) *) elim: s => [|x s IHs] /=; first by rewrite card0. (* Goal: is_true (leq (@card T (@mem (Finite.sort T) (seq_predType (Finite.eqType T)) (@cons (Finite.sort T) x s))) (S (@size (Finite.sort T) s))) *) by rewrite cardU1 /=; case: (~~ _) => //; apply: leqW. Qed. Lemma card_uniqP s : reflect (#|s| = size s) (uniq s). Proof. (* Goal: Bool.reflect (@eq nat (@card T (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) s)) (@size (Finite.sort T) s)) (@uniq (Finite.eqType T) s) *) elim: s => [|x s IHs]; first by left; apply: card0. (* Goal: Bool.reflect (@eq nat (@card T (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@cons (Finite.sort T) x s))) (@size (Finite.sort T) (@cons (Finite.sort T) x s))) (@uniq (Finite.eqType T) (@cons (Finite.sort T) x s)) *) rewrite cardU1 /= /addn; case: {+}(x \in s) => /=. (* Goal: Bool.reflect (@eq nat (S (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) ((fix mem_seq (s : list (Finite.sort T)) : forall _ : Finite.sort T, bool := match s with | nil => fun _ : Finite.sort T => false | cons y s' => fun x : Finite.sort T => orb (@eq_op (Finite.eqType T) x y) (mem_seq s' x) end) s)))) (S (@size (Finite.sort T) s))) (@uniq (Finite.eqType T) s) *) (* Goal: Bool.reflect (@eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) ((fix mem_seq (s : list (Finite.sort T)) : forall _ : Finite.sort T, bool := match s with | nil => fun _ : Finite.sort T => false | cons y s' => fun x : Finite.sort T => orb (@eq_op (Finite.eqType T) x y) (mem_seq s' x) end) s))) (S (@size (Finite.sort T) s))) false *) by right=> card_Ssz; have:= card_size s; rewrite card_Ssz ltnn. (* Goal: Bool.reflect (@eq nat (S (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) ((fix mem_seq (s : list (Finite.sort T)) : forall _ : Finite.sort T, bool := match s with | nil => fun _ : Finite.sort T => false | cons y s' => fun x : Finite.sort T => orb (@eq_op (Finite.eqType T) x y) (mem_seq s' x) end) s)))) (S (@size (Finite.sort T) s))) (@uniq (Finite.eqType T) s) *) by apply: (iffP IHs) => [<-| [<-]]. Qed. Lemma card0_eq A : #|A| = 0 -> A =i pred0. Proof. (* Goal: forall _ : @eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) O, @eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@pred0 (Finite.sort T))) *) by move=> A0 x; apply/idP => Ax; rewrite (cardD1 x) Ax in A0. Qed. Lemma pred0P P : reflect (P =1 pred0) (pred0b P). Proof. (* Goal: Bool.reflect (@eqfun bool (Finite.sort T) P (@pred_of_simpl (Finite.sort T) (@pred0 (Finite.sort T)))) (@pred0b T P) *) by apply: (iffP eqP); [apply: card0_eq | apply: eq_card0]. Qed. Lemma pred0Pn P : reflect (exists x, P x) (~~ pred0b P). Proof. (* Goal: Bool.reflect (@ex (Finite.sort T) (fun x : Finite.sort T => is_true (P x))) (negb (@pred0b T P)) *) case: (pickP P) => [x Px | P0]. (* Goal: Bool.reflect (@ex (Finite.sort T) (fun x : Finite.sort T => is_true (P x))) (negb (@pred0b T P)) *) (* Goal: Bool.reflect (@ex (Finite.sort T) (fun x : Finite.sort T => is_true (P x))) (negb (@pred0b T P)) *) by rewrite (introN (pred0P P)) => [|P0]; [left; exists x | rewrite P0 in Px]. (* Goal: Bool.reflect (@ex (Finite.sort T) (fun x : Finite.sort T => is_true (P x))) (negb (@pred0b T P)) *) by rewrite -lt0n eq_card0 //; right=> [[x]]; rewrite P0. Qed. Lemma card_gt0P A : reflect (exists i, i \in A) (#|A| > 0). Proof. (* Goal: Bool.reflect (@ex (Finite.sort T) (fun i : Finite.sort T => is_true (@in_mem (Finite.sort T) i (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))) (leq (S O) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) *) by rewrite lt0n; apply: pred0Pn. Qed. Lemma subsetE A B : (A \subset B) = pred0b [predD A & B]. Proof. (* Goal: @eq bool (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) (@pred0b T (@pred_of_simpl (Finite.sort T) (@predD (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)))))) *) by rewrite unlock. Qed. Lemma subsetP A B : reflect {subset A <= B} (A \subset B). Proof. (* Goal: Bool.reflect (@sub_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) *) rewrite unlock; apply: (iffP (pred0P _)) => [AB0 x | sAB x /=]. (* Goal: @eq bool (andb (negb (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) false *) (* Goal: forall _ : is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)), is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) *) by apply/implyP; apply/idPn; rewrite negb_imply andbC [_ && _]AB0. (* Goal: @eq bool (andb (negb (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) false *) by rewrite andbC -negb_imply; apply/negbF/implyP; apply: sAB. Qed. Lemma subsetPn A B : reflect (exists2 x, x \in A & x \notin B) (~~ (A \subset B)). Proof. (* Goal: Bool.reflect (@ex2 (Finite.sort T) (fun x : Finite.sort T => is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (fun x : Finite.sort T => is_true (negb (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))))) (negb (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) *) rewrite unlock; apply: (iffP (pred0Pn _)) => [[x] | [x Ax nBx]]. (* Goal: @ex (Finite.sort T) (fun x : Finite.sort T => is_true (@pred_of_simpl (Finite.sort T) (@predD (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)))) x)) *) (* Goal: forall _ : is_true (@pred_of_simpl (Finite.sort T) (@predD (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)))) x), @ex2 (Finite.sort T) (fun x : Finite.sort T => is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (fun x : Finite.sort T => is_true (negb (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)))) *) by case/andP; exists x. (* Goal: @ex (Finite.sort T) (fun x : Finite.sort T => is_true (@pred_of_simpl (Finite.sort T) (@predD (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)))) x)) *) by exists x; rewrite /= nBx. Qed. Lemma subset_leq_card A B : A \subset B -> #|A| <= #|B|. Proof. (* Goal: forall _ : is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)), is_true (leq (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) *) move=> sAB. (* Goal: is_true (leq (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) *) rewrite -(cardID A B) [#|predI _ _|](@eq_card _ A) ?leq_addr //= => x. (* Goal: @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@predI (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))))))) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) *) by rewrite !inE andbC; case Ax: (x \in A) => //; apply: subsetP Ax. Qed. Lemma subxx_hint (mA : mem_pred T) : subset mA mA. Proof. (* Goal: is_true (@subset T mA mA) *) by case: mA => A; have:= introT (subsetP A A); rewrite !unlock => ->. Qed. Hint Resolve subxx_hint : core. Lemma subxx (pT : predType T) (pA : pT) : pA \subset pA. Proof. (* Goal: is_true (@subset T (@mem (Finite.sort T) pT pA) (@mem (Finite.sort T) pT pA)) *) by []. Qed. Lemma eq_subset A1 A2 : A1 =i A2 -> subset (mem A1) =1 subset (mem A2). Lemma eq_subset_r B1 B2 : B1 =i B2 -> (@subset T)^~ (mem B1) =1 (@subset T)^~ (mem B2). Lemma eq_subxx A B : A =i B -> A \subset B. Proof. (* Goal: forall _ : @eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B), is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) *) by move/eq_subset->. Qed. Lemma subset_predT A : A \subset T. Proof. (* Goal: is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@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/subsetP. Qed. Lemma predT_subset A : T \subset A -> forall x, x \in A. Proof. (* Goal: forall (_ : is_true (@subset 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))))) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (x : Finite.sort T), is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) *) by move/subsetP=> allA x; apply: allA. Qed. Lemma subset_pred1 A x : (pred1 x \subset A) = (x \in A). Proof. (* Goal: @eq bool (@subset T (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@pred1 (Finite.eqType T) x)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) *) by apply/subsetP/idP=> [-> // | Ax y /eqP-> //]; apply: eqxx. Qed. Lemma subset_eqP A B : reflect (A =i B) ((A \subset B) && (B \subset A)). Proof. (* Goal: Bool.reflect (@eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) (andb (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) *) apply: (iffP andP) => [[sAB sBA] x| eqAB]; last by rewrite !eq_subxx. (* Goal: @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) *) by apply/idP/idP; apply: subsetP. Qed. Lemma subset_cardP A B : #|A| = #|B| -> reflect (A =i B) (A \subset B). Proof. (* Goal: forall _ : @eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)), Bool.reflect (@eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) *) move=> eqcAB; case: (subsetP A B) (subset_eqP A B) => //= sAB. (* Goal: forall _ : Bool.reflect (@eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)), Bool.reflect (@eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) true *) case: (subsetP B A) => [//|[]] x Bx; apply/idPn => Ax. (* Goal: False *) case/idP: (ltnn #|A|); rewrite {2}eqcAB (cardD1 x B) Bx /=. (* Goal: is_true (leq (S (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (addn (S O) (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predD1 (Finite.eqType T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) x))))) *) apply: subset_leq_card; apply/subsetP=> y Ay; rewrite inE /= andbC. (* Goal: is_true (andb (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) (negb (@eq_op (Finite.eqType T) y x))) *) by rewrite sAB //; apply/eqP => eqyx; rewrite -eqyx Ay in Ax. Qed. Lemma subset_leqif_card A B : A \subset B -> #|A| <= #|B| ?= iff (B \subset A). Lemma subset_trans A B C : A \subset B -> B \subset C -> A \subset C. Proof. (* Goal: forall (_ : is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) (_ : is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C))), is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C)) *) by move/subsetP=> sAB /subsetP=> sBC; apply/subsetP=> x /sAB; apply: sBC. Qed. Lemma subset_all s A : (s \subset A) = all (mem A) s. Proof. (* Goal: @eq bool (@subset T (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) s) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@all (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) s) *) exact: (sameP (subsetP _ _) allP). Qed. Lemma properE A B : A \proper B = (A \subset B) && ~~(B \subset A). Proof. (* Goal: @eq bool (@proper T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) (andb (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) (negb (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))) *) by []. Qed. Lemma properP A B : reflect (A \subset B /\ (exists2 x, x \in B & x \notin A)) (A \proper B). Proof. (* Goal: Bool.reflect (and (is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) (@ex2 (Finite.sort T) (fun x : Finite.sort T => is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) (fun x : Finite.sort T => is_true (negb (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))))) (@proper T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) *) by rewrite properE; apply: (iffP andP) => [] [-> /subsetPn]. Qed. Lemma proper_sub A B : A \proper B -> A \subset B. Proof. (* Goal: forall _ : is_true (@proper T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)), is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) *) by case/andP. Qed. Lemma proper_subn A B : A \proper B -> ~~ (B \subset A). Proof. (* Goal: forall _ : is_true (@proper T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)), is_true (negb (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) *) by case/andP. Qed. Lemma proper_trans A B C : A \proper B -> B \proper C -> A \proper C. Proof. (* Goal: forall (_ : is_true (@proper T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) (_ : is_true (@proper T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C))), is_true (@proper T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C)) *) case/properP=> sAB [x Bx nAx] /properP[sBC [y Cy nBy]]. (* Goal: is_true (@proper T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C)) *) rewrite properE (subset_trans sAB) //=; apply/subsetPn; exists y => //. (* Goal: is_true (negb (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) *) by apply: contra nBy; apply: subsetP. Qed. Lemma proper_sub_trans A B C : A \proper B -> B \subset C -> A \proper C. Proof. (* Goal: forall (_ : is_true (@proper T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) (_ : is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C))), is_true (@proper T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C)) *) case/properP=> sAB [x Bx nAx] sBC; rewrite properE (subset_trans sAB) //. (* Goal: is_true (andb true (negb (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) C) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))) *) by apply/subsetPn; exists x; rewrite ?(subsetP _ _ sBC). Qed. Lemma sub_proper_trans A B C : A \subset B -> B \proper C -> A \proper C. Proof. (* Goal: forall (_ : is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) (_ : is_true (@proper T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C))), is_true (@proper T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C)) *) move=> sAB /properP[sBC [x Cx nBx]]; rewrite properE (subset_trans sAB) //. (* Goal: is_true (andb true (negb (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) C) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))) *) by apply/subsetPn; exists x => //; apply: contra nBx; apply: subsetP. Qed. Lemma proper_card A B : A \proper B -> #|A| < #|B|. Proof. (* Goal: forall _ : is_true (@proper T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)), is_true (leq (S (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) *) by case/andP=> sAB nsBA; rewrite ltn_neqAle !(subset_leqif_card sAB) andbT. Qed. Lemma proper_irrefl A : ~~ (A \proper A). Proof. (* Goal: is_true (negb (@proper T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) *) by rewrite properE subxx. Qed. Lemma properxx A : (A \proper A) = false. Proof. (* Goal: @eq bool (@proper T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) false *) by rewrite properE subxx. Qed. Lemma eq_proper A B : A =i B -> proper (mem A) =1 proper (mem B). Lemma eq_proper_r A B : A =i B -> (@proper T)^~ (mem A) =1 (@proper T)^~ (mem B). Lemma disjoint_sym A B : [disjoint A & B] = [disjoint B & A]. Proof. (* Goal: @eq bool (@disjoint T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) (@disjoint T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) *) by congr (_ == 0); apply: eq_card => x; apply: andbC. Qed. Lemma eq_disjoint A1 A2 : A1 =i A2 -> disjoint (mem A1) =1 disjoint (mem A2). Proof. (* Goal: forall _ : @eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A1) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A2), @eqfun bool (mem_pred (Finite.sort T)) (@disjoint T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A1)) (@disjoint T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A2)) *) by move=> eqA12 [B]; congr (_ == 0); apply: eq_card => x; rewrite !inE eqA12. Qed. Lemma eq_disjoint_r B1 B2 : B1 =i B2 -> (@disjoint T)^~ (mem B1) =1 (@disjoint T)^~ (mem B2). Proof. (* Goal: forall _ : @eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B1) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B2), @eqfun bool (mem_pred (Finite.sort T)) (fun x : mem_pred (Finite.sort T) => @disjoint T x (@mem (Finite.sort T) (predPredType (Finite.sort T)) B1)) (fun x : mem_pred (Finite.sort T) => @disjoint T x (@mem (Finite.sort T) (predPredType (Finite.sort T)) B2)) *) by move=> eqB12 [A]; congr (_ == 0); apply: eq_card => x; rewrite !inE eqB12. Qed. Lemma subset_disjoint A B : (A \subset B) = [disjoint A & [predC B]]. Proof. (* Goal: @eq bool (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) (@disjoint T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predC (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)))))) *) by rewrite disjoint_sym unlock. Qed. Lemma disjoint_subset A B : [disjoint A & B] = (A \subset [predC B]). Proof. (* Goal: @eq bool (@disjoint T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predC (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)))))) *) by rewrite subset_disjoint; apply: eq_disjoint_r => x; rewrite !inE /= negbK. Qed. Lemma disjoint_trans A B C : A \subset B -> [disjoint B & C] -> [disjoint A & C]. Proof. (* Goal: forall (_ : is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) (_ : is_true (@disjoint T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C))), is_true (@disjoint T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C)) *) by rewrite 2!disjoint_subset; apply: subset_trans. Qed. Lemma disjoint0 A : [disjoint pred0 & A]. Proof. (* Goal: is_true (@disjoint T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@pred0 (Finite.sort T))) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) *) exact/pred0P. Qed. Lemma eq_disjoint0 A B : A =i pred0 -> [disjoint A & B]. Proof. (* Goal: forall _ : @eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@pred0 (Finite.sort T))), is_true (@disjoint T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) *) by move/eq_disjoint->; apply: disjoint0. Qed. Lemma disjoint1 x A : [disjoint pred1 x & A] = (x \notin A). Lemma eq_disjoint1 x A B : A =i pred1 x -> [disjoint A & B] = (x \notin B). Proof. (* Goal: forall _ : @eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@pred1 (Finite.eqType T) x)), @eq bool (@disjoint T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) (negb (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) *) by move/eq_disjoint->; apply: disjoint1. Qed. Lemma disjointU A B C : [disjoint predU A B & C] = [disjoint A & C] && [disjoint B & C]. Proof. (* Goal: @eq bool (@disjoint T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predU (Finite.sort T) A B)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C)) (andb (@disjoint T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C)) (@disjoint T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C))) *) case: [disjoint A & C] / (pred0P (xpredI A C)) => [A0 | nA0] /=. (* Goal: @eq bool (@disjoint T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predU (Finite.sort T) A B)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C)) false *) (* Goal: @eq bool (@disjoint T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predU (Finite.sort T) A B)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C)) (@disjoint T (@mem (Finite.sort T) (predPredType (Finite.sort T)) B) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C)) *) by congr (_ == 0); apply: eq_card => x; rewrite [x \in _]andb_orl A0. (* Goal: @eq bool (@disjoint T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predU (Finite.sort T) A B)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C)) false *) apply/pred0P=> nABC; case: nA0 => x; apply/idPn=> /=; move/(_ x): nABC. (* Goal: forall _ : @eq bool (@pred_of_simpl (Finite.sort T) (@predI (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@predU (Finite.sort T) A B)))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) C)))) x) (@pred_of_simpl (Finite.sort T) (@pred0 (Finite.sort T)) x), is_true (negb (andb (A x) (C x))) *) by rewrite [_ x]andb_orl; case/norP. Qed. Lemma disjointU1 x A B : [disjoint predU1 x A & B] = (x \notin B) && [disjoint A & B]. Proof. (* Goal: @eq bool (@disjoint T (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@predU1 (Finite.eqType T) x A)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) (andb (negb (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) (@disjoint T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) *) by rewrite disjointU disjoint1. Qed. Lemma disjoint_cons x s B : [disjoint x :: s & B] = (x \notin B) && [disjoint s & B]. Proof. (* Goal: @eq bool (@disjoint T (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@cons (Finite.sort T) x s)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) (andb (negb (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) (@disjoint T (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) s) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B))) *) exact: disjointU1. Qed. Lemma disjoint_has s A : [disjoint s & A] = ~~ has (mem A) s. Proof. (* Goal: @eq bool (@disjoint T (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) s) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (negb (@has (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) s)) *) rewrite -(@eq_has _ (mem (enum A))) => [|x]; last exact: mem_enum. (* Goal: @eq bool (@disjoint T (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) s) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (negb (@has (Equality.sort (Finite.eqType T)) (@pred_of_simpl (Equality.sort (Finite.eqType T)) (@pred_of_mem_pred (Equality.sort (Finite.eqType T)) (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@enum_mem T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))))) s)) *) rewrite has_sym has_filter -filter_predI -has_filter has_count -eqn0Ngt. (* Goal: @eq bool (@disjoint T (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) s) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@eq_op nat_eqType (@count (Equality.sort (Finite.eqType T)) (@pred_of_simpl (Equality.sort (Finite.eqType T)) (@predI (Equality.sort (Finite.eqType T)) (@pred_of_simpl (Equality.sort (Finite.eqType T)) (@pred_of_mem_pred (Equality.sort (Finite.eqType T)) (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) s))) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))))) (Finite.EnumDef.enum T)) O) *) by rewrite -size_filter /disjoint /pred0b unlock. Qed. Lemma disjoint_cat s1 s2 A : [disjoint s1 ++ s2 & A] = [disjoint s1 & A] && [disjoint s2 & A]. Proof. (* Goal: @eq bool (@disjoint T (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@cat (Finite.sort T) s1 s2)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (andb (@disjoint T (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) s1) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@disjoint T (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) s2) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) *) by rewrite !disjoint_has has_cat negb_or. Qed. End OpsTheory. Hint Resolve subxx_hint : core. Arguments pred0P {T P}. Arguments pred0Pn {T P}. Arguments subsetP {T A B}. Arguments subsetPn {T A B}. Arguments subset_eqP {T A B}. Arguments card_uniqP {T s}. Arguments properP {T A B}. Section QuantifierCombinators. Variables (T : finType) (P : pred T) (PP : T -> Prop). Hypothesis viewP : forall x, reflect (PP x) (P x). Lemma existsPP : reflect (exists x, PP x) [exists x, P x]. Proof. (* Goal: Bool.reflect (@ex (Finite.sort T) (fun x : Finite.sort T => PP x)) (negb (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.ex T (FiniteQuant.Quantified (P x)) x))) *) by apply: (iffP pred0Pn) => -[x /viewP]; exists x. Qed. Lemma forallPP : reflect (forall x, PP x) [forall x, P x]. Proof. (* Goal: Bool.reflect (forall x : Finite.sort T, PP x) (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.all T (FiniteQuant.Quantified (P x)) x)) *) by apply: (iffP pred0P) => /= allP x; have /viewP//=-> := allP x. Qed. End QuantifierCombinators. Notation "'exists_ view" := (existsPP (fun _ => view)) (at level 4, right associativity, format "''exists_' view"). Notation "'forall_ view" := (forallPP (fun _ => view)) (at level 4, right associativity, format "''forall_' view"). Section Quantifiers. Variables (T : finType) (rT : T -> eqType). Implicit Type (D P : pred T) (f : forall x, rT x). Lemma forallP P : reflect (forall x, P x) [forall x, P x]. Proof. (* Goal: Bool.reflect (forall x : Finite.sort T, is_true (P x)) (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.all T (FiniteQuant.Quantified (P x)) x)) *) exact: 'forall_idP. Qed. Lemma eqfunP f1 f2 : reflect (forall x, f1 x = f2 x) [forall x, f1 x == f2 x]. Proof. (* Goal: Bool.reflect (forall x : Finite.sort T, @eq (Equality.sort (rT x)) (f1 x) (f2 x)) (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.all T (FiniteQuant.Quantified (@eq_op (rT x) (f1 x) (f2 x))) x)) *) exact: 'forall_eqP. Qed. Lemma forall_inP D P : reflect (forall x, D x -> P x) [forall (x | D x), P x]. Proof. (* Goal: Bool.reflect (forall (x : Finite.sort T) (_ : is_true (D x)), is_true (P x)) (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.all_in T (D x) (FiniteQuant.Quantified (P x)) x)) *) exact: 'forall_implyP. Qed. Lemma forall_inPP D P PP : (forall x, reflect (PP x) (P x)) -> reflect (forall x, D x -> PP x) [forall (x | D x), P x]. Proof. (* Goal: forall _ : forall x : Finite.sort T, Bool.reflect (PP x) (P x), Bool.reflect (forall (x : Finite.sort T) (_ : is_true (D x)), PP x) (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.all_in T (D x) (FiniteQuant.Quantified (P x)) x)) *) by move=> vP; apply: (iffP (forall_inP _ _)) => /(_ _ _) /vP. Qed. Lemma eqfun_inP D f1 f2 : reflect {in D, forall x, f1 x = f2 x} [forall (x | x \in D), f1 x == f2 x]. Proof. (* Goal: Bool.reflect (@prop_in1 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) D) (fun x : Finite.sort T => @eq (Equality.sort (rT x)) (f1 x) (f2 x)) (inPhantom (forall x : Finite.sort T, @eq (Equality.sort (rT x)) (f1 x) (f2 x)))) (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.all_in T (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) D)) (FiniteQuant.Quantified (@eq_op (rT x) (f1 x) (f2 x))) x)) *) exact: (forall_inPP _ (fun=> eqP)). Qed. Lemma existsP P : reflect (exists x, P x) [exists x, P x]. Proof. (* Goal: Bool.reflect (@ex (Finite.sort T) (fun x : Finite.sort T => is_true (P x))) (negb (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.ex T (FiniteQuant.Quantified (P x)) x))) *) exact: 'exists_idP. Qed. Lemma exists_eqP f1 f2 : reflect (exists x, f1 x = f2 x) [exists x, f1 x == f2 x]. Proof. (* Goal: Bool.reflect (@ex (Finite.sort T) (fun x : Finite.sort T => @eq (Equality.sort (rT x)) (f1 x) (f2 x))) (negb (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.ex T (FiniteQuant.Quantified (@eq_op (rT x) (f1 x) (f2 x))) x))) *) exact: 'exists_eqP. Qed. Lemma exists_inP D P : reflect (exists2 x, D x & P x) [exists (x | D x), P x]. Proof. (* Goal: Bool.reflect (@ex2 (Finite.sort T) (fun x : Finite.sort T => is_true (D x)) (fun x : Finite.sort T => is_true (P x))) (negb (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.ex_in T (D x) (FiniteQuant.Quantified (P x)) x))) *) by apply: (iffP 'exists_andP) => [[x []] | [x]]; exists x. Qed. Lemma exists_inPP D P PP : (forall x, reflect (PP x) (P x)) -> reflect (exists2 x, D x & PP x) [exists (x | D x), P x]. Proof. (* Goal: forall _ : forall x : Finite.sort T, Bool.reflect (PP x) (P x), Bool.reflect (@ex2 (Finite.sort T) (fun x : Finite.sort T => is_true (D x)) (fun x : Finite.sort T => PP x)) (negb (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.ex_in T (D x) (FiniteQuant.Quantified (P x)) x))) *) by move=> vP; apply: (iffP (exists_inP _ _)) => -[x?/vP]; exists x. Qed. Lemma exists_eq_inP D f1 f2 : reflect (exists2 x, D x & f1 x = f2 x) [exists (x | D x), f1 x == f2 x]. Proof. (* Goal: Bool.reflect (@ex2 (Finite.sort T) (fun x : Finite.sort T => is_true (D x)) (fun x : Finite.sort T => @eq (Equality.sort (rT x)) (f1 x) (f2 x))) (negb (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.ex_in T (D x) (FiniteQuant.Quantified (@eq_op (rT x) (f1 x) (f2 x))) x))) *) exact: (exists_inPP _ (fun=> eqP)). Qed. Lemma eq_existsb P1 P2 : P1 =1 P2 -> [exists x, P1 x] = [exists x, P2 x]. Proof. (* Goal: forall _ : @eqfun bool (Finite.sort T) P1 P2, @eq bool (negb (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.ex T (FiniteQuant.Quantified (P1 x)) x))) (negb (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.ex T (FiniteQuant.Quantified (P2 x)) x))) *) by move=> eqP12; congr (_ != 0); apply: eq_card. Qed. Lemma eq_existsb_in D P1 P2 : (forall x, D x -> P1 x = P2 x) -> [exists (x | D x), P1 x] = [exists (x | D x), P2 x]. Proof. (* Goal: forall _ : forall (x : Finite.sort T) (_ : is_true (D x)), @eq bool (P1 x) (P2 x), @eq bool (negb (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.ex_in T (D x) (FiniteQuant.Quantified (P1 x)) x))) (negb (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.ex_in T (D x) (FiniteQuant.Quantified (P2 x)) x))) *) by move=> eqP12; apply: eq_existsb => x; apply: andb_id2l => /eqP12. Qed. Lemma eq_forallb P1 P2 : P1 =1 P2 -> [forall x, P1 x] = [forall x, P2 x]. Proof. (* Goal: forall _ : @eqfun bool (Finite.sort T) P1 P2, @eq bool (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.all T (FiniteQuant.Quantified (P1 x)) x)) (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.all T (FiniteQuant.Quantified (P2 x)) x)) *) by move=> eqP12; apply/negb_inj/eq_existsb=> /= x; rewrite eqP12. Qed. Lemma eq_forallb_in D P1 P2 : (forall x, D x -> P1 x = P2 x) -> [forall (x | D x), P1 x] = [forall (x | D x), P2 x]. Proof. (* Goal: forall _ : forall (x : Finite.sort T) (_ : is_true (D x)), @eq bool (P1 x) (P2 x), @eq bool (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.all_in T (D x) (FiniteQuant.Quantified (P1 x)) x)) (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.all_in T (D x) (FiniteQuant.Quantified (P2 x)) x)) *) by move=> eqP12; apply: eq_forallb => i; case Di: (D i); rewrite // eqP12. Qed. Lemma negb_forall P : ~~ [forall x, P x] = [exists x, ~~ P x]. Proof. (* Goal: @eq bool (negb (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.all T (FiniteQuant.Quantified (P x)) x))) (negb (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.ex T (FiniteQuant.Quantified (negb (P x))) x))) *) by []. Qed. Lemma negb_forall_in D P : ~~ [forall (x | D x), P x] = [exists (x | D x), ~~ P x]. Proof. (* Goal: @eq bool (negb (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.all_in T (D x) (FiniteQuant.Quantified (P x)) x))) (negb (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.ex_in T (D x) (FiniteQuant.Quantified (negb (P x))) x))) *) by apply: eq_existsb => x; rewrite negb_imply. Qed. Lemma negb_exists P : ~~ [exists x, P x] = [forall x, ~~ P x]. Proof. (* Goal: @eq bool (negb (negb (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.ex T (FiniteQuant.Quantified (P x)) x)))) (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.all T (FiniteQuant.Quantified (negb (P x))) x)) *) by apply/negbLR/esym/eq_existsb=> x; apply: negbK. Qed. Lemma negb_exists_in D P : ~~ [exists (x | D x), P x] = [forall (x | D x), ~~ P x]. Proof. (* Goal: @eq bool (negb (negb (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.ex_in T (D x) (FiniteQuant.Quantified (P x)) x)))) (@FiniteQuant.quant0b T (fun x : Finite.sort T => @FiniteQuant.all_in T (D x) (FiniteQuant.Quantified (negb (P x))) x)) *) by rewrite negb_exists; apply/eq_forallb => x; rewrite [~~ _]fun_if. Qed. End Quantifiers. Arguments forallP {T P}. Arguments eqfunP {T rT f1 f2}. Arguments forall_inP {T D P}. Arguments eqfun_inP {T rT D f1 f2}. Arguments existsP {T P}. Arguments exists_eqP {T rT f1 f2}. Arguments exists_inP {T D P}. Arguments exists_eq_inP {T rT D f1 f2}. Notation "'exists_in_ view" := (exists_inPP _ (fun _ => view)) (at level 4, right associativity, format "''exists_in_' view"). Notation "'forall_in_ view" := (forall_inPP _ (fun _ => view)) (at level 4, right associativity, format "''forall_in_' view"). Section Extrema. Variant extremum_spec {T : eqType} (ord : rel T) {I : finType} (P : pred I) (F : I -> T) : I -> Type := ExtremumSpec (i : I) of P i & (forall j : I, P j -> ord (F i) (F j)) : extremum_spec ord P F i. Let arg_pred {T : eqType} ord {I : finType} (P : pred I) (F : I -> T) := [pred i | P i & [forall (j | P j), ord (F i) (F j)]]. Section Extremum. Context {T : eqType} {I : finType} (ord : rel T). Context (i0 : I) (P : pred I) (F : I -> T). Hypothesis ord_refl : reflexive ord. Hypothesis ord_trans : transitive ord. Hypothesis ord_total : total ord. Definition extremum := odflt i0 (pick (arg_pred ord P F)). Hypothesis Pi0 : P i0. Lemma extremumP : extremum_spec ord P F extremum. Proof. (* Goal: @extremum_spec T ord I P F extremum *) rewrite /extremum; case: pickP => [i /andP[Pi /'forall_implyP/= min_i] | no_i]. (* Goal: @extremum_spec T ord I P F (@Option.default (Finite.sort I) i0 (@None (Finite.sort I))) *) (* Goal: @extremum_spec T ord I P F i *) by split=> // j; apply/implyP. (* Goal: @extremum_spec T ord I P F (@Option.default (Finite.sort I) i0 (@None (Finite.sort I))) *) have := sort_sorted ord_total [seq F i | i <- enum P]. (* Goal: forall _ : is_true (@sorted T ord (@sort T ord (@map (Finite.sort I) (Equality.sort T) (fun i : Finite.sort I => F i) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) P))))), @extremum_spec T ord I P F (@Option.default (Finite.sort I) i0 (@None (Finite.sort I))) *) set s := sort _ _ => ss; have s_gt0 : size s > 0 by rewrite size_sort size_map -cardE; apply/card_gt0P; exists i0. (* Goal: @extremum_spec T ord I P F (@Option.default (Finite.sort I) i0 (@None (Finite.sort I))) *) pose t0 := nth (F i0) s 0; have: t0 \in s by rewrite mem_nth. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) t0 (@mem (Equality.sort T) (seq_predType T) s)), @extremum_spec T ord I P F (@Option.default (Finite.sort I) i0 (@None (Finite.sort I))) *) rewrite mem_sort => /mapP/sig2_eqW[it0]; rewrite mem_enum => it0P def_t0. (* Goal: @extremum_spec T ord I P F (@Option.default (Finite.sort I) i0 (@None (Finite.sort I))) *) have /negP[/=] := no_i it0; rewrite [P _]it0P/=; apply/'forall_implyP=> j Pj. (* Goal: is_true (ord (F it0) (F j)) *) have /(nthP (F i0))[k g_lt <-] : F j \in s by rewrite mem_sort map_f ?mem_enum. (* Goal: is_true (ord (F it0) (@nth (Equality.sort T) (F i0) s k)) *) by rewrite -def_t0 sorted_le_nth. Qed. End Extremum. Notation "[ 'arg[' ord ]_( i < i0 | P ) F ]" := (extremum ord i0 (fun i => P%B) (fun i => F)) (at level 0, ord, i, i0 at level 10, format "[ 'arg[' ord ]_( i < i0 | P ) F ]") : form_scope. Notation "[ 'arg[' ord ]_( i < i0 'in' A ) F ]" := [arg[ord]_(i < i0 | i \in A) F] (at level 0, ord, i, i0 at level 10, format "[ 'arg[' ord ]_( i < i0 'in' A ) F ]") : form_scope. Notation "[ 'arg[' ord ]_( i < i0 ) F ]" := [arg[ord]_(i < i0 | true) F] (at level 0, ord, i, i0 at level 10, format "[ 'arg[' ord ]_( i < i0 ) F ]") : form_scope. Section ArgMinMax. Variables (I : finType) (i0 : I) (P : pred I) (F : I -> nat) (Pi0 : P i0). Definition arg_min := extremum leq i0 P F. Definition arg_max := extremum geq i0 P F. Lemma arg_minP : extremum_spec leq P F arg_min. Proof. (* Goal: @extremum_spec nat_eqType leq I P F arg_min *) by apply: extremumP => //; [apply: leq_trans|apply: leq_total]. Qed. Lemma arg_maxP : extremum_spec geq P F arg_max. End ArgMinMax. End Extrema. Notation "[ 'arg' 'min_' ( i < i0 | P ) F ]" := (arg_min i0 (fun i => P%B) (fun i => F)) (at level 0, i, i0 at level 10, format "[ 'arg' 'min_' ( i < i0 | P ) F ]") : form_scope. Notation "[ 'arg' 'min_' ( i < i0 'in' A ) F ]" := [arg min_(i < i0 | i \in A) F] (at level 0, i, i0 at level 10, format "[ 'arg' 'min_' ( i < i0 'in' A ) F ]") : form_scope. Notation "[ 'arg' 'min_' ( i < i0 ) F ]" := [arg min_(i < i0 | true) F] (at level 0, i, i0 at level 10, format "[ 'arg' 'min_' ( i < i0 ) F ]") : form_scope. Notation "[ 'arg' 'max_' ( i > i0 | P ) F ]" := (arg_max i0 (fun i => P%B) (fun i => F)) (at level 0, i, i0 at level 10, format "[ 'arg' 'max_' ( i > i0 | P ) F ]") : form_scope. Notation "[ 'arg' 'max_' ( i > i0 'in' A ) F ]" := [arg max_(i > i0 | i \in A) F] (at level 0, i, i0 at level 10, format "[ 'arg' 'max_' ( i > i0 'in' A ) F ]") : form_scope. Notation "[ 'arg' 'max_' ( i > i0 ) F ]" := [arg max_(i > i0 | true) F] (at level 0, i, i0 at level 10, format "[ 'arg' 'max_' ( i > i0 ) F ]") : form_scope. Section Injectiveb. Variables (aT : finType) (rT : eqType) (f : aT -> rT). Implicit Type D : pred aT. Definition dinjectiveb D := uniq (map f (enum D)). Definition injectiveb := dinjectiveb aT. Lemma dinjectivePn D : reflect (exists2 x, x \in D & exists2 y, y \in [predD1 D & x] & f x = f y) (~~ dinjectiveb D). Proof. (* Goal: Bool.reflect (@ex2 (Finite.sort aT) (fun x : Finite.sort aT => is_true (@in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (fun x : Finite.sort aT => @ex2 (Equality.sort (Finite.eqType aT)) (fun y : Equality.sort (Finite.eqType aT) => is_true (@in_mem (Equality.sort (Finite.eqType aT)) y (@mem (Equality.sort (Finite.eqType aT)) (simplPredType (Equality.sort (Finite.eqType aT))) (@predD1 (Finite.eqType aT) (@pred_of_simpl (Finite.sort aT) (@pred_of_mem_pred (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) x)))) (fun y : Equality.sort (Finite.eqType aT) => @eq (Equality.sort rT) (f x) (f y)))) (negb (dinjectiveb D)) *) apply: (iffP idP) => [injf | [x Dx [y Dxy eqfxy]]]; last first. (* Goal: @ex2 (Finite.sort aT) (fun x : Finite.sort aT => is_true (@in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (fun x : Finite.sort aT => @ex2 (Equality.sort (Finite.eqType aT)) (fun y : Equality.sort (Finite.eqType aT) => is_true (@in_mem (Equality.sort (Finite.eqType aT)) y (@mem (Equality.sort (Finite.eqType aT)) (simplPredType (Equality.sort (Finite.eqType aT))) (@predD1 (Finite.eqType aT) (@pred_of_simpl (Finite.sort aT) (@pred_of_mem_pred (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) x)))) (fun y : Equality.sort (Finite.eqType aT) => @eq (Equality.sort rT) (f x) (f y))) *) (* Goal: is_true (negb (dinjectiveb D)) *) move: Dx; rewrite -(mem_enum D) => /rot_to[i E defE]. (* Goal: @ex2 (Finite.sort aT) (fun x : Finite.sort aT => is_true (@in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (fun x : Finite.sort aT => @ex2 (Equality.sort (Finite.eqType aT)) (fun y : Equality.sort (Finite.eqType aT) => is_true (@in_mem (Equality.sort (Finite.eqType aT)) y (@mem (Equality.sort (Finite.eqType aT)) (simplPredType (Equality.sort (Finite.eqType aT))) (@predD1 (Finite.eqType aT) (@pred_of_simpl (Finite.sort aT) (@pred_of_mem_pred (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) x)))) (fun y : Equality.sort (Finite.eqType aT) => @eq (Equality.sort rT) (f x) (f y))) *) (* Goal: is_true (negb (dinjectiveb D)) *) rewrite /dinjectiveb -(rot_uniq i) -map_rot defE /=; apply/nandP; left. (* Goal: @ex2 (Finite.sort aT) (fun x : Finite.sort aT => is_true (@in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (fun x : Finite.sort aT => @ex2 (Equality.sort (Finite.eqType aT)) (fun y : Equality.sort (Finite.eqType aT) => is_true (@in_mem (Equality.sort (Finite.eqType aT)) y (@mem (Equality.sort (Finite.eqType aT)) (simplPredType (Equality.sort (Finite.eqType aT))) (@predD1 (Finite.eqType aT) (@pred_of_simpl (Finite.sort aT) (@pred_of_mem_pred (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) x)))) (fun y : Equality.sort (Finite.eqType aT) => @eq (Equality.sort rT) (f x) (f y))) *) (* Goal: is_true (negb (negb (@in_mem (Equality.sort rT) (f x) (@mem (Equality.sort rT) (seq_predType rT) (@map (Finite.sort aT) (Equality.sort rT) f E))))) *) rewrite inE /= -(mem_enum D) -(mem_rot i) defE inE in Dxy. (* Goal: @ex2 (Finite.sort aT) (fun x : Finite.sort aT => is_true (@in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (fun x : Finite.sort aT => @ex2 (Equality.sort (Finite.eqType aT)) (fun y : Equality.sort (Finite.eqType aT) => is_true (@in_mem (Equality.sort (Finite.eqType aT)) y (@mem (Equality.sort (Finite.eqType aT)) (simplPredType (Equality.sort (Finite.eqType aT))) (@predD1 (Finite.eqType aT) (@pred_of_simpl (Finite.sort aT) (@pred_of_mem_pred (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) x)))) (fun y : Equality.sort (Finite.eqType aT) => @eq (Equality.sort rT) (f x) (f y))) *) (* Goal: is_true (negb (negb (@in_mem (Equality.sort rT) (f x) (@mem (Equality.sort rT) (seq_predType rT) (@map (Finite.sort aT) (Equality.sort rT) f E))))) *) rewrite andb_orr andbC andbN in Dxy. (* Goal: @ex2 (Finite.sort aT) (fun x : Finite.sort aT => is_true (@in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (fun x : Finite.sort aT => @ex2 (Equality.sort (Finite.eqType aT)) (fun y : Equality.sort (Finite.eqType aT) => is_true (@in_mem (Equality.sort (Finite.eqType aT)) y (@mem (Equality.sort (Finite.eqType aT)) (simplPredType (Equality.sort (Finite.eqType aT))) (@predD1 (Finite.eqType aT) (@pred_of_simpl (Finite.sort aT) (@pred_of_mem_pred (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) x)))) (fun y : Equality.sort (Finite.eqType aT) => @eq (Equality.sort rT) (f x) (f y))) *) (* Goal: is_true (negb (negb (@in_mem (Equality.sort rT) (f x) (@mem (Equality.sort rT) (seq_predType rT) (@map (Finite.sort aT) (Equality.sort rT) f E))))) *) by rewrite eqfxy map_f //; case/andP: Dxy. (* Goal: @ex2 (Finite.sort aT) (fun x : Finite.sort aT => is_true (@in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (fun x : Finite.sort aT => @ex2 (Equality.sort (Finite.eqType aT)) (fun y : Equality.sort (Finite.eqType aT) => is_true (@in_mem (Equality.sort (Finite.eqType aT)) y (@mem (Equality.sort (Finite.eqType aT)) (simplPredType (Equality.sort (Finite.eqType aT))) (@predD1 (Finite.eqType aT) (@pred_of_simpl (Finite.sort aT) (@pred_of_mem_pred (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) x)))) (fun y : Equality.sort (Finite.eqType aT) => @eq (Equality.sort rT) (f x) (f y))) *) pose p := [pred x in D | [exists (y | y \in [predD1 D & x]), f x == f y]]. (* Goal: @ex2 (Finite.sort aT) (fun x : Finite.sort aT => is_true (@in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (fun x : Finite.sort aT => @ex2 (Equality.sort (Finite.eqType aT)) (fun y : Equality.sort (Finite.eqType aT) => is_true (@in_mem (Equality.sort (Finite.eqType aT)) y (@mem (Equality.sort (Finite.eqType aT)) (simplPredType (Equality.sort (Finite.eqType aT))) (@predD1 (Finite.eqType aT) (@pred_of_simpl (Finite.sort aT) (@pred_of_mem_pred (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) x)))) (fun y : Equality.sort (Finite.eqType aT) => @eq (Equality.sort rT) (f x) (f y))) *) case: (pickP p) => [x /= /andP[Dx /exists_inP[y Dxy /eqP eqfxy]] | no_p]. (* Goal: @ex2 (Finite.sort aT) (fun x : Finite.sort aT => is_true (@in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (fun x : Finite.sort aT => @ex2 (Equality.sort (Finite.eqType aT)) (fun y : Equality.sort (Finite.eqType aT) => is_true (@in_mem (Equality.sort (Finite.eqType aT)) y (@mem (Equality.sort (Finite.eqType aT)) (simplPredType (Equality.sort (Finite.eqType aT))) (@predD1 (Finite.eqType aT) (@pred_of_simpl (Finite.sort aT) (@pred_of_mem_pred (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) x)))) (fun y : Equality.sort (Finite.eqType aT) => @eq (Equality.sort rT) (f x) (f y))) *) (* Goal: @ex2 (Finite.sort aT) (fun x : Finite.sort aT => is_true (@in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (fun x : Finite.sort aT => @ex2 (Finite.sort aT) (fun y : Finite.sort aT => is_true (@in_mem (Finite.sort aT) y (@mem (Finite.sort aT) (simplPredType (Finite.sort aT)) (@predD1 (Finite.eqType aT) (@pred_of_simpl (Finite.sort aT) (@pred_of_mem_pred (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) x)))) (fun y : Finite.sort aT => @eq (Equality.sort rT) (f x) (f y))) *) by exists x; last exists y. (* Goal: @ex2 (Finite.sort aT) (fun x : Finite.sort aT => is_true (@in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (fun x : Finite.sort aT => @ex2 (Equality.sort (Finite.eqType aT)) (fun y : Equality.sort (Finite.eqType aT) => is_true (@in_mem (Equality.sort (Finite.eqType aT)) y (@mem (Equality.sort (Finite.eqType aT)) (simplPredType (Equality.sort (Finite.eqType aT))) (@predD1 (Finite.eqType aT) (@pred_of_simpl (Finite.sort aT) (@pred_of_mem_pred (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) x)))) (fun y : Equality.sort (Finite.eqType aT) => @eq (Equality.sort rT) (f x) (f y))) *) rewrite /dinjectiveb map_inj_in_uniq ?enum_uniq // in injf => x y Dx Dy eqfxy. (* Goal: @eq (Equality.sort (Finite.eqType aT)) x y *) apply: contraNeq (negbT (no_p x)) => ne_xy /=; rewrite -mem_enum Dx. (* Goal: is_true (andb true (negb (@FiniteQuant.quant0b aT (fun y : Finite.sort aT => @FiniteQuant.ex_in aT (@in_mem (Finite.sort aT) y (@mem (Finite.sort aT) (simplPredType (Finite.sort aT)) (@predD1 (Finite.eqType aT) (@pred_of_simpl (Finite.sort aT) (@pred_of_mem_pred (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) x))) (FiniteQuant.Quantified (@eq_op rT (f x) (f y))) y)))) *) by apply/existsP; exists y; rewrite /= !inE eq_sym ne_xy -mem_enum Dy eqfxy /=. Qed. Lemma dinjectiveP D : reflect {in D &, injective f} (dinjectiveb D). Proof. (* Goal: Bool.reflect (@prop_in2 (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) (fun x1 x2 : Finite.sort aT => forall _ : @eq (Equality.sort rT) (f x1) (f x2), @eq (Finite.sort aT) x1 x2) (inPhantom (@injective (Equality.sort rT) (Finite.sort aT) f))) (dinjectiveb D) *) rewrite -[dinjectiveb D]negbK. (* Goal: Bool.reflect (@prop_in2 (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) (fun x1 x2 : Finite.sort aT => forall _ : @eq (Equality.sort rT) (f x1) (f x2), @eq (Finite.sort aT) x1 x2) (inPhantom (@injective (Equality.sort rT) (Finite.sort aT) f))) (negb (negb (dinjectiveb D))) *) case: dinjectivePn=> [noinjf | injf]; constructor. (* Goal: @prop_in2 (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) (fun x1 x2 : Finite.sort aT => forall _ : @eq (Equality.sort rT) (f x1) (f x2), @eq (Finite.sort aT) x1 x2) (inPhantom (@injective (Equality.sort rT) (Finite.sort aT) f)) *) (* Goal: not (@prop_in2 (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) (fun x1 x2 : Finite.sort aT => forall _ : @eq (Equality.sort rT) (f x1) (f x2), @eq (Finite.sort aT) x1 x2) (inPhantom (@injective (Equality.sort rT) (Finite.sort aT) f))) *) case: noinjf => x Dx [y /andP[neqxy /= Dy] eqfxy] injf. (* Goal: @prop_in2 (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) (fun x1 x2 : Finite.sort aT => forall _ : @eq (Equality.sort rT) (f x1) (f x2), @eq (Finite.sort aT) x1 x2) (inPhantom (@injective (Equality.sort rT) (Finite.sort aT) f)) *) (* Goal: False *) by case/eqP: neqxy; apply: injf. (* Goal: @prop_in2 (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D) (fun x1 x2 : Finite.sort aT => forall _ : @eq (Equality.sort rT) (f x1) (f x2), @eq (Finite.sort aT) x1 x2) (inPhantom (@injective (Equality.sort rT) (Finite.sort aT) f)) *) move=> x y Dx Dy /= eqfxy; apply/eqP; apply/idPn=> nxy; case: injf. (* Goal: @ex2 (Finite.sort aT) (fun x : Finite.sort aT => is_true (@in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) (fun x : Finite.sort aT => @ex2 (Equality.sort (Finite.eqType aT)) (fun y : Equality.sort (Finite.eqType aT) => is_true (@in_mem (Equality.sort (Finite.eqType aT)) y (@mem (Equality.sort (Finite.eqType aT)) (simplPredType (Equality.sort (Finite.eqType aT))) (@predD1 (Finite.eqType aT) (@pred_of_simpl (Finite.sort aT) (@pred_of_mem_pred (Finite.sort aT) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) D))) x)))) (fun y : Equality.sort (Finite.eqType aT) => @eq (Equality.sort rT) (f x) (f y))) *) by exists x => //; exists y => //=; rewrite inE /= eq_sym nxy. Qed. Lemma injectivePn : reflect (exists x, exists2 y, x != y & f x = f y) (~~ injectiveb). Proof. (* Goal: Bool.reflect (@ex (Equality.sort (Finite.eqType aT)) (fun x : Equality.sort (Finite.eqType aT) => @ex2 (Equality.sort (Finite.eqType aT)) (fun y : Equality.sort (Finite.eqType aT) => is_true (negb (@eq_op (Finite.eqType aT) x y))) (fun y : Equality.sort (Finite.eqType aT) => @eq (Equality.sort rT) (f x) (f y)))) (negb injectiveb) *) apply: (iffP (dinjectivePn _)) => [[x _ [y nxy eqfxy]] | [x [y nxy eqfxy]]]; by exists x => //; exists y => //; rewrite inE /= andbT eq_sym in nxy *. Qed. Qed. Lemma injectiveP : reflect (injective f) injectiveb. Proof. (* Goal: Bool.reflect (@injective (Equality.sort rT) (Finite.sort aT) f) injectiveb *) by apply: (iffP (dinjectiveP _)) => injf x y => [|_ _]; apply: injf. Qed. End Injectiveb. Definition image_mem T T' f mA : seq T' := map f (@enum_mem T mA). Notation image f A := (image_mem f (mem A)). Notation "[ 'seq' F | x 'in' A ]" := (image (fun x => F) A) (at level 0, F at level 99, x ident, format "'[hv' [ 'seq' F '/ ' | x 'in' A ] ']'") : seq_scope. Notation "[ 'seq' F | x : T 'in' A ]" := (image (fun x : T => F) A) (at level 0, F at level 99, x ident, only parsing) : seq_scope. Notation "[ 'seq' F | x : T ]" := [seq F | x : T in sort_of_simpl_pred (@pred_of_argType T)] (at level 0, F at level 99, x ident, format "'[hv' [ 'seq' F '/ ' | x : T ] ']'") : seq_scope. Notation "[ 'seq' F , x ]" := [seq F | x : _ ] (at level 0, F at level 99, x ident, only parsing) : seq_scope. Definition codom T T' f := @image_mem T T' f (mem T). Section Image. Variable T : finType. Implicit Type A : pred T. Section SizeImage. Variables (T' : Type) (f : T -> T'). Lemma size_image A : size (image f A) = #|A|. Proof. (* Goal: @eq nat (@size T' (@image_mem T T' f (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) *) by rewrite size_map -cardE. Qed. Lemma size_codom : size (codom f) = #|T|. Proof. (* Goal: @eq nat (@size T' (@codom T T' f)) (@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)))))) *) exact: size_image. Qed. Lemma codomE : codom f = map f (enum T). Proof. (* Goal: @eq (list T') (@codom T T' f) (@map (Finite.sort T) T' f (@enum_mem 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 []. Qed. End SizeImage. Variables (T' : eqType) (f : T -> T'). Lemma imageP A y : reflect (exists2 x, x \in A & y = f x) (y \in image f A). Proof. (* Goal: Bool.reflect (@ex2 (Finite.sort T) (fun x : Finite.sort T => is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (fun x : Finite.sort T => @eq (Equality.sort T') y (f x))) (@in_mem (Equality.sort T') y (@mem (Equality.sort T') (seq_predType T') (@image_mem T (Equality.sort T') f (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))) *) by apply: (iffP mapP) => [] [x Ax y_fx]; exists x; rewrite // mem_enum in Ax *. Qed. Qed. Lemma codomP y : reflect (exists x, y = f x) (y \in codom f). Proof. (* Goal: Bool.reflect (@ex (Finite.sort T) (fun x : Finite.sort T => @eq (Equality.sort T') y (f x))) (@in_mem (Equality.sort T') y (@mem (Equality.sort T') (seq_predType T') (@codom T (Equality.sort T') f))) *) by apply: (iffP (imageP _ y)) => [][x]; exists x. Qed. Remark iinv_proof A y : y \in image f A -> {x | x \in A & f x = y}. Proof. (* Goal: forall _ : is_true (@in_mem (Equality.sort T') y (@mem (Equality.sort T') (seq_predType T') (@image_mem T (Equality.sort T') f (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))), @sig2 (Finite.sort T) (fun x : Finite.sort T => is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (fun x : Finite.sort T => @eq (Equality.sort T') (f x) y) *) move=> fy; pose b x := A x && (f x == y). (* Goal: @sig2 (Finite.sort T) (fun x : Finite.sort T => is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (fun x : Finite.sort T => @eq (Equality.sort T') (f x) y) *) case: (pickP b) => [x /andP[Ax /eqP] | nfy]; first by exists x. (* Goal: @sig2 (Finite.sort T) (fun x : Finite.sort T => is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (fun x : Finite.sort T => @eq (Equality.sort T') (f x) y) *) by case/negP: fy => /imageP[x Ax fx_y]; case/andP: (nfy x); rewrite fx_y. Qed. Definition iinv A y fAy := s2val (@iinv_proof A y fAy). Lemma f_iinv A y fAy : f (@iinv A y fAy) = y. Proof. (* Goal: @eq (Equality.sort T') (f (@iinv A y fAy)) y *) exact: s2valP' (iinv_proof fAy). Qed. Lemma mem_iinv A y fAy : @iinv A y fAy \in A. Proof. (* Goal: is_true (@in_mem (Finite.sort T) (@iinv A y fAy) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) *) exact: s2valP (iinv_proof fAy). Qed. Lemma in_iinv_f A : {in A &, injective f} -> forall x fAfx, x \in A -> @iinv A (f x) fAfx = x. Proof. (* Goal: forall (_ : @prop_in2 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (fun x1 x2 : Finite.sort T => forall _ : @eq (Equality.sort T') (f x1) (f x2), @eq (Finite.sort T) x1 x2) (inPhantom (@injective (Equality.sort T') (Finite.sort T) f))) (x : Finite.sort T) (fAfx : is_true (@in_mem (Equality.sort T') (f x) (@mem (Equality.sort T') (seq_predType T') (@image_mem T (Equality.sort T') f (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))))) (_ : is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))), @eq (Finite.sort T) (@iinv A (f x) fAfx) x *) by move=> injf x fAfx Ax; apply: injf => //; [apply: mem_iinv | apply: f_iinv]. Qed. Lemma preim_iinv A B y fAy : preim f B (@iinv A y fAy) = B y. Proof. (* Goal: @eq bool (@pred_of_simpl (Finite.sort T) (@preim (Finite.sort T) (Equality.sort T') f B) (@iinv A y fAy)) (B y) *) by rewrite /= f_iinv. Qed. Lemma image_f A x : x \in A -> f x \in image f A. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)), is_true (@in_mem (Equality.sort T') (f x) (@mem (Equality.sort T') (seq_predType T') (@image_mem T (Equality.sort T') f (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))) *) by move=> Ax; apply/imageP; exists x. Qed. Lemma codom_f x : f x \in codom f. Proof. (* Goal: is_true (@in_mem (Equality.sort T') (f x) (@mem (Equality.sort T') (seq_predType T') (@codom T (Equality.sort T') f))) *) by apply: image_f. Qed. Lemma image_codom A : {subset image f A <= codom f}. Proof. (* Goal: @sub_mem (Equality.sort T') (@mem (Equality.sort T') (seq_predType T') (@image_mem T (Equality.sort T') f (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@mem (Equality.sort T') (seq_predType T') (@codom T (Equality.sort T') f)) *) by move=> _ /imageP[x _ ->]; apply: codom_f. Qed. Lemma image_pred0 : image f pred0 =i pred0. Proof. (* Goal: @eq_mem (Equality.sort T') (@mem (Equality.sort T') (seq_predType T') (@image_mem T (Equality.sort T') f (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@pred0 (Finite.sort T))))) (@mem (Equality.sort T') (simplPredType (Equality.sort T')) (@pred0 (Equality.sort T'))) *) by move=> x; rewrite /image_mem /= enum0. Qed. Section Injective. Hypothesis injf : injective f. Lemma mem_image A x : (f x \in image f A) = (x \in A). Proof. (* Goal: @eq bool (@in_mem (Equality.sort T') (f x) (@mem (Equality.sort T') (seq_predType T') (@image_mem T (Equality.sort T') f (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) *) by rewrite mem_map ?mem_enum. Qed. Lemma pre_image A : [preim f of image f A] =i A. Proof. (* Goal: @eq_mem (Finite.sort T) (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@preim (Finite.sort T) (Equality.sort T') f (@pred_of_simpl (Equality.sort T') (@pred_of_mem_pred (Equality.sort T') (@mem (Equality.sort T') (seq_predType T') (@image_mem T (Equality.sort T') f (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))))))) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) *) by move=> x; rewrite inE /= mem_image. Qed. Lemma image_iinv A y (fTy : y \in codom f) : (y \in image f A) = (iinv fTy \in A). Proof. (* Goal: @eq bool (@in_mem (Equality.sort T') y (@mem (Equality.sort T') (seq_predType T') (@image_mem T (Equality.sort T') f (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))) (@in_mem (Finite.sort T) (@iinv (@sort_of_simpl_pred (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T)))) y fTy) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) *) by rewrite -mem_image ?f_iinv. Qed. Lemma iinv_f x fTfx : @iinv T (f x) fTfx = x. Proof. (* Goal: @eq (Finite.sort T) (@iinv (@pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T)))) (f x) fTfx) x *) by apply: in_iinv_f; first apply: in2W. Qed. Lemma image_pre (B : pred T') : image f [preim f of B] =i [predI B & codom f]. Proof. (* Goal: @eq_mem (Equality.sort T') (@mem (Equality.sort T') (seq_predType T') (@image_mem T (Equality.sort T') f (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@preim (Finite.sort T) (Equality.sort T') f (@pred_of_simpl (Equality.sort T') (@pred_of_mem_pred (Equality.sort T') (@mem (Equality.sort T') (predPredType (Equality.sort T')) B))))))) (@mem (Equality.sort T') (simplPredType (Equality.sort T')) (@predI (Equality.sort T') (@pred_of_simpl (Equality.sort T') (@pred_of_mem_pred (Equality.sort T') (@mem (Equality.sort T') (predPredType (Equality.sort T')) B))) (@pred_of_simpl (Equality.sort T') (@pred_of_mem_pred (Equality.sort T') (@mem (Equality.sort T') (seq_predType T') (@codom T (Equality.sort T') f)))))) *) by move=> y; rewrite /image_mem -filter_map /= mem_filter -enumT. Qed. Lemma bij_on_codom (x0 : T) : {on [pred y in codom f], bijective f}. Proof. (* Goal: @bijective_on (Finite.sort T) (Equality.sort T') (@mem (Equality.sort T') (simplPredType (Equality.sort T')) (@SimplPred (Equality.sort T') (fun y : Equality.sort T' => @in_mem (Equality.sort T') y (@mem (Equality.sort T') (seq_predType T') (@codom T (Equality.sort T') f))))) f *) pose g y := iinv (valP (insigd (codom_f x0) y)). (* Goal: @bijective_on (Finite.sort T) (Equality.sort T') (@mem (Equality.sort T') (simplPredType (Equality.sort T')) (@SimplPred (Equality.sort T') (fun y : Equality.sort T' => @in_mem (Equality.sort T') y (@mem (Equality.sort T') (seq_predType T') (@codom T (Equality.sort T') f))))) f *) by exists g => [x fAfx | y fAy]; first apply: injf; rewrite f_iinv insubdK. Qed. Lemma bij_on_image A (x0 : T) : {on [pred y in image f A], bijective f}. Proof. (* Goal: @bijective_on (Finite.sort T) (Equality.sort T') (@mem (Equality.sort T') (simplPredType (Equality.sort T')) (@SimplPred (Equality.sort T') (fun y : Equality.sort T' => @in_mem (Equality.sort T') y (@mem (Equality.sort T') (seq_predType T') (@image_mem T (Equality.sort T') f (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))))) f *) exact: subon_bij (@image_codom A) (bij_on_codom x0). Qed. End Injective. Fixpoint preim_seq s := if s is y :: s' then (if pick (preim f (pred1 y)) is Some x then cons x else id) (preim_seq s') else [::]. Lemma map_preim (s : seq T') : {subset s <= codom f} -> map f (preim_seq s) = s. Proof. (* Goal: forall _ : @sub_mem (Equality.sort T') (@mem (Equality.sort T') (seq_predType T') s) (@mem (Equality.sort T') (seq_predType T') (@codom T (Equality.sort T') f)), @eq (list (Equality.sort T')) (@map (Finite.sort T) (Equality.sort T') f (preim_seq s)) s *) elim: s => //= y s IHs; case: pickP => [x /eqP fx_y | nfTy] fTs. (* Goal: @eq (list (Equality.sort T')) (@map (Finite.sort T) (Equality.sort T') f (preim_seq s)) (@cons (Equality.sort T') y s) *) (* Goal: @eq (list (Equality.sort T')) (@map (Finite.sort T) (Equality.sort T') f (@cons (Finite.sort T) x (preim_seq s))) (@cons (Equality.sort T') y s) *) by rewrite /= fx_y IHs // => z s_z; apply: fTs; apply: predU1r. (* Goal: @eq (list (Equality.sort T')) (@map (Finite.sort T) (Equality.sort T') f (preim_seq s)) (@cons (Equality.sort T') y s) *) by case/imageP: (fTs y (mem_head y s)) => x _ fx_y; case/eqP: (nfTy x). Qed. End Image. Prenex Implicits codom iinv. Arguments imageP {T T' f A y}. Arguments codomP {T T' f y}. Lemma flatten_imageP (aT : finType) (rT : eqType) A (P : pred aT) (y : rT) : reflect (exists2 x, x \in P & y \in A x) (y \in flatten [seq A x | x in P]). Proof. (* Goal: Bool.reflect (@ex2 (Finite.sort aT) (fun x : Finite.sort aT => is_true (@in_mem (Finite.sort aT) x (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) P))) (fun x : Finite.sort aT => is_true (@in_mem (Equality.sort rT) y (@mem (Equality.sort rT) (seq_predType rT) (A x))))) (@in_mem (Equality.sort rT) y (@mem (Equality.sort rT) (seq_predType rT) (@flatten (Equality.sort rT) (@image_mem aT (@pred_sort (Equality.sort rT) (seq_predType rT)) (fun x : Finite.sort aT => A x) (@mem (Finite.sort aT) (predPredType (Finite.sort aT)) P))))) *) by apply: (iffP flatten_mapP) => [][x Px]; exists x; rewrite ?mem_enum in Px *. Qed. Qed. Arguments flatten_imageP {aT rT A P y}. Section CardFunImage. Variables (T T' : finType) (f : T -> T'). Implicit Type A : pred T. Lemma leq_image_card A : #|image f A| <= #|A|. Proof. (* Goal: is_true (leq (@card T' (@mem (Equality.sort (Finite.eqType T')) (seq_predType (Finite.eqType T')) (@image_mem T (Finite.sort T') f (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) *) by rewrite (cardE A) -(size_map f) card_size. Qed. Lemma card_in_image A : {in A &, injective f} -> #|image f A| = #|A|. Lemma image_injP A : reflect {in A &, injective f} (#|image f A| == #|A|). Proof. (* Goal: Bool.reflect (@prop_in2 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (fun x1 x2 : Finite.sort T => forall _ : @eq (Finite.sort T') (f x1) (f x2), @eq (Finite.sort T) x1 x2) (inPhantom (@injective (Finite.sort T') (Finite.sort T) f))) (@eq_op nat_eqType (@card T' (@mem (Equality.sort (Finite.eqType T')) (seq_predType (Finite.eqType T')) (@image_mem T (Finite.sort T') f (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) *) apply: (iffP eqP) => [eqfA |]; last exact: card_in_image. (* Goal: @prop_in2 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (fun x1 x2 : Finite.sort T => forall _ : @eq (Finite.sort T') (f x1) (f x2), @eq (Finite.sort T) x1 x2) (inPhantom (@injective (Finite.sort T') (Finite.sort T) f)) *) by apply/dinjectiveP; apply/card_uniqP; rewrite size_map -cardE. Qed. Hypothesis injf : injective f. Lemma card_image A : #|image f A| = #|A|. Proof. (* Goal: @eq nat (@card T' (@mem (Equality.sort (Finite.eqType T')) (seq_predType (Finite.eqType T')) (@image_mem T (Finite.sort T') f (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)))) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) *) by apply: card_in_image; apply: in2W. Qed. Lemma card_codom : #|codom f| = #|T|. Proof. (* Goal: @eq nat (@card T' (@mem (Equality.sort (Finite.eqType T')) (seq_predType (Finite.eqType T')) (@codom T (Finite.sort T') f))) (@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)))))) *) exact: card_image. Qed. Lemma card_preim (B : pred T') : #|[preim f of B]| = #|[predI codom f & B]|. Proof. (* Goal: @eq nat (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@preim (Finite.sort T) (Finite.sort T') f (@pred_of_simpl (Finite.sort T') (@pred_of_mem_pred (Finite.sort T') (@mem (Finite.sort T') (predPredType (Finite.sort T')) B)))))) (@card T' (@mem (Equality.sort (Finite.eqType T')) (simplPredType (Equality.sort (Finite.eqType T'))) (@predI (Equality.sort (Finite.eqType T')) (@pred_of_simpl (Equality.sort (Finite.eqType T')) (@pred_of_mem_pred (Equality.sort (Finite.eqType T')) (@mem (Equality.sort (Finite.eqType T')) (seq_predType (Finite.eqType T')) (@codom T (Finite.sort T') f)))) (@pred_of_simpl (Finite.sort T') (@pred_of_mem_pred (Finite.sort T') (@mem (Finite.sort T') (predPredType (Finite.sort T')) B)))))) *) rewrite -card_image /=; apply: eq_card => y. (* Goal: @eq bool (@in_mem (Finite.sort T') y (@mem (Finite.sort T') (predPredType (Finite.sort T')) (@pred_of_eq_seq (Finite.eqType T') (@image_mem T (Finite.sort T') f (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@preim (Finite.sort T) (Finite.sort T') f (@pred_of_simpl (Finite.sort T') (@pred_of_mem_pred (Finite.sort T') (@mem (Finite.sort T') (predPredType (Finite.sort T')) B)))))))))) (@in_mem (Finite.sort T') y (@mem (Finite.sort T') (predPredType (Finite.sort T')) (@pred_of_simpl (Finite.sort T') (@predI (Finite.sort T') (@pred_of_simpl (Finite.sort T') (@pred_of_mem_pred (Finite.sort T') (@mem (Finite.sort T') (seq_predType (Finite.eqType T')) (@codom T (Finite.sort T') f)))) (@pred_of_simpl (Finite.sort T') (@pred_of_mem_pred (Finite.sort T') (@mem (Finite.sort T') (predPredType (Finite.sort T')) B))))))) *) by rewrite [y \in _]image_pre !inE andbC. Qed. Hypothesis card_range : #|T| = #|T'|. Lemma inj_card_onto y : y \in codom f. Proof. (* Goal: is_true (@in_mem (Equality.sort (Finite.eqType T')) y (@mem (Equality.sort (Finite.eqType T')) (seq_predType (Finite.eqType T')) (@codom T (Finite.sort T') f))) *) by move: y; apply/subset_cardP; rewrite ?card_codom ?subset_predT. Qed. Lemma inj_card_bij : bijective f. Proof. (* Goal: @bijective (Finite.sort T') (Finite.sort T) f *) by exists (fun y => iinv (inj_card_onto y)) => y; rewrite ?iinv_f ?f_iinv. Qed. Definition invF y := iinv (injF_onto y). Lemma f_invF : cancel invF f. Proof. by move=> y; apply: f_iinv. Qed. Proof. (* Goal: @cancel (Finite.sort T) (Equality.sort (Finite.eqType T)) invF f *) by move=> y; apply: f_iinv. Qed. End Inv. Hypothesis fK : cancel f g. Lemma canF_sym : cancel g f. Proof. (* Goal: @cancel (Finite.sort T) (Finite.sort T) g f *) exact/(bij_can_sym (injF_bij (can_inj fK))). Qed. Lemma canF_LR x y : x = g y -> f x = y. Proof. (* Goal: forall _ : @eq (Finite.sort T) x (g y), @eq (Finite.sort T) (f x) y *) exact: canLR canF_sym. Qed. Lemma canF_RL x y : g x = y -> x = f y. Proof. (* Goal: forall _ : @eq (Finite.sort T) (g x) y, @eq (Finite.sort T) x (f y) *) exact: canRL canF_sym. Qed. Lemma canF_eq x y : (f x == y) = (x == g y). Proof. (* Goal: @eq bool (@eq_op (Finite.eqType T) (f x) y) (@eq_op (Finite.eqType T) x (g y)) *) exact: (can2_eq fK canF_sym). Qed. Lemma canF_invF : g =1 invF (can_inj fK). Proof. (* Goal: @eqfun (Finite.sort T) (Finite.sort T) g (invF (@can_inj (Finite.sort T) (Finite.sort T) f g fK)) *) by move=> y; apply: (canLR fK); rewrite f_invF. Qed. End FinCancel. Section EqImage. Variables (T : finType) (T' : Type). Lemma eq_image (A B : pred T) (f g : T -> T') : A =i B -> f =1 g -> image f A = image g B. Proof. (* Goal: forall (_ : @eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) (_ : @eqfun T' (Finite.sort T) f g), @eq (list T') (@image_mem T T' f (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@image_mem T T' g (@mem (Finite.sort T) (predPredType (Finite.sort T)) B)) *) by move=> eqAB eqfg; rewrite /image_mem (eq_enum eqAB) (eq_map eqfg). Qed. Lemma eq_codom (f g : T -> T') : f =1 g -> codom f = codom g. Proof. (* Goal: forall _ : @eqfun T' (Finite.sort T) f g, @eq (list T') (@codom T T' f) (@codom T T' g) *) exact: eq_image. Qed. Lemma eq_invF f g injf injg : f =1 g -> @invF T f injf =1 @invF T g injg. Proof. (* Goal: forall _ : @eqfun (Finite.sort T) (Finite.sort T) f g, @eqfun (Finite.sort T) (Equality.sort (Finite.eqType T)) (@invF T f injf) (@invF T g injg) *) by move=> eq_fg x; apply: (canLR (invF_f injf)); rewrite eq_fg f_invF. Qed. Definition unit_finMixin := Eval hnf in FinMixin unit_enumP. Canonical unit_finType := Eval hnf in FinType unit unit_finMixin. Lemma card_unit : #|{: unit}| = 1. Proof. by rewrite cardT enumT unlock. Qed. Proof. (* Goal: @eq nat (@card unit_finType (@mem unit (predPredType (unit : predArgType)) (@sort_of_simpl_pred (unit : predArgType) (pred_of_argType (unit : predArgType))))) (S O) *) by rewrite cardT enumT unlock. Qed. Definition bool_finMixin := Eval hnf in FinMixin bool_enumP. Local Notation enumF T := (Finite.enum T). Section OptionFinType. Variable T : finType. Definition option_enum := None :: map some (enumF T). Lemma option_enumP : Finite.axiom option_enum. Proof. (* Goal: @Finite.axiom (option_eqType (Finite.eqType T)) option_enum *) by case=> [x|]; rewrite /= count_map (count_pred0, enumP). Qed. Definition option_finMixin := Eval hnf in FinMixin option_enumP. Canonical option_finType := Eval hnf in FinType (option T) option_finMixin. Lemma card_option : #|{: option T}| = #|T|.+1. Proof. (* Goal: @eq nat (@card option_finType (@mem (option (Finite.sort T)) (predPredType (option (Finite.sort T) : predArgType)) (@sort_of_simpl_pred (option (Finite.sort T) : predArgType) (pred_of_argType (option (Finite.sort T) : predArgType))))) (S (@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 rewrite !cardT !enumT {1}unlock /= !size_map. Qed. End OptionFinType. Section TransferFinType. Variables (eT : countType) (fT : finType) (f : eT -> fT). Lemma pcan_enumP g : pcancel f g -> Finite.axiom (undup (pmap g (enumF fT))). Proof. (* Goal: forall _ : @pcancel (Finite.sort fT) (Countable.sort eT) f g, @Finite.axiom (Countable.eqType eT) (@undup (Countable.eqType eT) (@pmap (Finite.sort fT) (Countable.sort eT) g (Finite.EnumDef.enum fT))) *) move=> fK x; rewrite count_uniq_mem ?undup_uniq // mem_undup. (* Goal: @eq nat (nat_of_bool (@in_mem (Equality.sort (Countable.eqType eT)) x (@mem (Equality.sort (Countable.eqType eT)) (seq_predType (Countable.eqType eT)) (@pmap (Finite.sort fT) (Countable.sort eT) g (Finite.EnumDef.enum fT))))) (S O) *) by rewrite mem_pmap -fK map_f // -enumT mem_enum. Qed. Definition PcanFinMixin g fK := FinMixin (@pcan_enumP g fK). Definition CanFinMixin g (fK : cancel f g) := PcanFinMixin (can_pcan fK). End TransferFinType. Section SubFinType. Variables (T : choiceType) (P : pred T). Import Finite. Structure subFinType := SubFinType { subFin_sort :> subType P; _ : mixin_of (sub_eqType subFin_sort) }. Definition pack_subFinType U := fun cT b m & phant_id (class cT) (@Class U b m) => fun sT m' & phant_id m' m => @SubFinType sT m'. Implicit Type sT : subFinType. Definition subFin_mixin sT := let: SubFinType _ m := sT return mixin_of (sub_eqType sT) in m. Coercion subFinType_subCountType sT := @SubCountType _ _ sT (subFin_mixin sT). Canonical subFinType_subCountType. Coercion subFinType_finType sT := Pack (@Class sT (sub_choiceClass sT) (subFin_mixin sT)). Canonical subFinType_finType. Lemma codom_val sT x : (x \in codom (val : sT -> T)) = P x. Proof. (* Goal: @eq bool (@in_mem (Equality.sort (Choice.eqType T)) x (@mem (Equality.sort (Choice.eqType T)) (seq_predType (Choice.eqType T)) (@codom (subFinType_finType sT) (Choice.sort T) (@val (Choice.sort T) P (subFin_sort sT) : forall _ : @sub_sort (Choice.sort T) P (subFin_sort sT), Choice.sort T)))) (P x) *) by apply/codomP/idP=> [[u ->]|Px]; last exists (Sub x Px); rewrite ?valP ?SubK. Qed. End SubFinType. Notation "[ 'subFinType' 'of' T ]" := (@pack_subFinType _ _ T _ _ _ id _ _ id) (at level 0, format "[ 'subFinType' 'of' T ]") : form_scope. Section FinTypeForSub. Variables (T : finType) (P : pred T) (sT : subCountType P). Definition sub_enum : seq sT := pmap insub (enumF T). Lemma mem_sub_enum u : u \in sub_enum. Proof. (* Goal: is_true (@in_mem (Equality.sort (@sub_eqType (Choice.eqType (Finite.choiceType T)) P (@subCount_sort (Finite.choiceType T) P sT))) u (@mem (Equality.sort (@sub_eqType (Choice.eqType (Finite.choiceType T)) P (@subCount_sort (Finite.choiceType T) P sT))) (seq_predType (@sub_eqType (Choice.eqType (Finite.choiceType T)) P (@subCount_sort (Finite.choiceType T) P sT))) sub_enum)) *) by rewrite mem_pmap_sub -enumT mem_enum. Qed. Lemma sub_enum_uniq : uniq sub_enum. Proof. (* Goal: is_true (@uniq (@sub_eqType (Choice.eqType (Finite.choiceType T)) P (@subCount_sort (Finite.choiceType T) P sT)) sub_enum) *) by rewrite pmap_sub_uniq // -enumT enum_uniq. Qed. Lemma val_sub_enum : map val sub_enum = enum P. Proof. (* Goal: @eq (list (Choice.sort (Finite.choiceType T))) (@map (@sub_sort (Choice.sort (Finite.choiceType T)) P (@subCount_sort (Finite.choiceType T) P sT)) (Choice.sort (Finite.choiceType T)) (@val (Choice.sort (Finite.choiceType T)) P (@subCount_sort (Finite.choiceType T) P sT)) sub_enum) (@enum_mem T (@mem (Finite.sort T) (predPredType (Finite.sort T)) P)) *) rewrite pmap_filter; last exact: insubK. (* Goal: @eq (list (Choice.sort (Finite.choiceType T))) (@filter (Choice.sort (Finite.choiceType T)) (fun x : Choice.sort (Finite.choiceType T) => @isSome (@sub_sort (Choice.sort (Finite.choiceType T)) P (@subCount_sort (Finite.choiceType T) P sT)) (@insub (Finite.sort T) P (@subCount_sort (Finite.choiceType T) P sT) x)) (Finite.EnumDef.enum T)) (@enum_mem T (@mem (Finite.sort T) (predPredType (Finite.sort T)) P)) *) by apply: eq_filter => x; apply: isSome_insub. Qed. Definition SubFinMixin := UniqFinMixin sub_enum_uniq mem_sub_enum. Definition SubFinMixin_for (eT : eqType) of phant eT := eq_rect _ Finite.mixin_of SubFinMixin eT. Variable sfT : subFinType P. Lemma card_sub : #|sfT| = #|[pred x | P x]|. Proof. (* Goal: @eq nat (@card (@subFinType_finType (Finite.choiceType T) P sfT) (@mem (Equality.sort (Countable.eqType (@sub_countType (Finite.choiceType T) P (@subFinType_subCountType (Finite.choiceType T) P sfT)))) (predPredType (Equality.sort (Countable.eqType (@sub_countType (Finite.choiceType T) P (@subFinType_subCountType (Finite.choiceType T) P sfT))))) (@sort_of_simpl_pred (Equality.sort (Countable.eqType (@sub_countType (Finite.choiceType T) P (@subFinType_subCountType (Finite.choiceType T) P sfT)))) (pred_of_argType (Equality.sort (Countable.eqType (@sub_countType (Finite.choiceType T) P (@subFinType_subCountType (Finite.choiceType T) P sfT)))))))) (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@SimplPred (Finite.sort T) (fun x : Finite.sort T => P x)))) *) by rewrite -(eq_card (codom_val sfT)) (card_image val_inj). Qed. Lemma eq_card_sub (A : pred sfT) : A =i predT -> #|A| = #|[pred x | P x]|. Proof. (* Goal: forall _ : @eq_mem (@sub_sort (Choice.sort (Finite.choiceType T)) P (@subFin_sort (Finite.choiceType T) P sfT)) (@mem (@sub_sort (Choice.sort (Finite.choiceType T)) P (@subFin_sort (Finite.choiceType T) P sfT)) (predPredType (@sub_sort (Choice.sort (Finite.choiceType T)) P (@subFin_sort (Finite.choiceType T) P sfT))) A) (@mem (@sub_sort (Choice.sort (Finite.choiceType T)) P (@subFin_sort (Finite.choiceType T) P sfT)) (simplPredType (@sub_sort (Choice.sort (Finite.choiceType T)) P (@subFin_sort (Finite.choiceType T) P sfT))) (@predT (@sub_sort (Choice.sort (Finite.choiceType T)) P (@subFin_sort (Finite.choiceType T) P sfT)))), @eq nat (@card (@subFinType_finType (Finite.choiceType T) P sfT) (@mem (@sub_sort (Choice.sort (Finite.choiceType T)) P (@subFin_sort (Finite.choiceType T) P sfT)) (predPredType (@sub_sort (Choice.sort (Finite.choiceType T)) P (@subFin_sort (Finite.choiceType T) P sfT))) A)) (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@SimplPred (Finite.sort T) (fun x : Finite.sort T => P x)))) *) exact: eq_card_trans card_sub. Qed. End FinTypeForSub. Notation "[ 'finMixin' 'of' T 'by' <: ]" := (SubFinMixin_for (Phant T) (erefl _)) (at level 0, format "[ 'finMixin' 'of' T 'by' <: ]") : form_scope. Section CardSig. Variables (T : finType) (P : pred T). Definition sig_finMixin := [finMixin of {x | P x} by <:]. Canonical sig_finType := Eval hnf in FinType {x | P x} sig_finMixin. Canonical sig_subFinType := Eval hnf in [subFinType of {x | P x}]. Lemma card_sig : #|{: {x | P x}}| = #|[pred x | P x]|. Proof. (* Goal: @eq nat (@card sig_finType (@mem (@sig (Finite.sort T) (fun x : Finite.sort T => is_true (P x))) (predPredType (@sig (Finite.sort T) (fun x : Finite.sort T => is_true (P x)) : predArgType)) (@sort_of_simpl_pred (@sig (Finite.sort T) (fun x : Finite.sort T => is_true (P x)) : predArgType) (pred_of_argType (@sig (Finite.sort T) (fun x : Finite.sort T => is_true (P x)) : predArgType))))) (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@SimplPred (Finite.sort T) (fun x : Finite.sort T => P x)))) *) exact: card_sub. Qed. End CardSig. Section SeqSubType. Variables (T : eqType) (s : seq T). Record seq_sub : Type := SeqSub {ssval : T; ssvalP : in_mem ssval (@mem T _ s)}. Canonical seq_sub_subType := Eval hnf in [subType for ssval]. Definition seq_sub_eqMixin := Eval hnf in [eqMixin of seq_sub by <:]. Canonical seq_sub_eqType := Eval hnf in EqType seq_sub seq_sub_eqMixin. Definition seq_sub_enum : seq seq_sub := undup (pmap insub s). Lemma mem_seq_sub_enum x : x \in seq_sub_enum. Proof. (* Goal: is_true (@in_mem (Equality.sort seq_sub_eqType) x (@mem (Equality.sort seq_sub_eqType) (seq_predType seq_sub_eqType) seq_sub_enum)) *) by rewrite mem_undup mem_pmap -valK map_f ?ssvalP. Qed. Lemma val_seq_sub_enum : uniq s -> map val seq_sub_enum = s. Definition seq_sub_pickle x := index x seq_sub_enum. Definition seq_sub_unpickle n := nth None (map some seq_sub_enum) n. Lemma seq_sub_pickleK : pcancel seq_sub_pickle seq_sub_unpickle. Proof. (* Goal: @pcancel nat (Equality.sort seq_sub_eqType) seq_sub_pickle seq_sub_unpickle *) rewrite /seq_sub_unpickle => x. (* Goal: @eq (option (Equality.sort seq_sub_eqType)) (@nth (option seq_sub) (@None seq_sub) (@map seq_sub (option seq_sub) (@Some seq_sub) seq_sub_enum) (seq_sub_pickle x)) (@Some (Equality.sort seq_sub_eqType) x) *) by rewrite (nth_map x) ?nth_index ?index_mem ?mem_seq_sub_enum. Qed. Definition seq_sub_countMixin := CountMixin seq_sub_pickleK. Fact seq_sub_axiom : Finite.axiom seq_sub_enum. Proof. (* Goal: @Finite.axiom seq_sub_eqType seq_sub_enum *) exact: Finite.uniq_enumP (undup_uniq _) mem_seq_sub_enum. Qed. Definition seq_sub_finMixin := Finite.Mixin seq_sub_countMixin seq_sub_axiom. Definition adhoc_seq_sub_choiceMixin := PcanChoiceMixin seq_sub_pickleK. Definition adhoc_seq_sub_choiceType := Eval hnf in ChoiceType seq_sub adhoc_seq_sub_choiceMixin. Definition adhoc_seq_sub_finType := [finType of seq_sub for FinType adhoc_seq_sub_choiceType seq_sub_finMixin]. End SeqSubType. Section SeqFinType. Variables (T : choiceType) (s : seq T). Local Notation sT := (seq_sub s). Definition seq_sub_choiceMixin := [choiceMixin of sT by <:]. Canonical seq_sub_choiceType := Eval hnf in ChoiceType sT seq_sub_choiceMixin. Canonical seq_sub_countType := Eval hnf in CountType sT (seq_sub_countMixin s). Canonical seq_sub_subCountType := Eval hnf in [subCountType of sT]. Canonical seq_sub_finType := Eval hnf in FinType sT (seq_sub_finMixin s). Canonical seq_sub_subFinType := Eval hnf in [subFinType of sT]. Lemma card_seq_sub : uniq s -> #|{:sT}| = size s. Proof. (* Goal: forall _ : is_true (@uniq (Choice.eqType T) s), @eq nat (@card seq_sub_finType (@mem (@seq_sub (Choice.eqType T) s) (predPredType (@seq_sub (Choice.eqType T) s : predArgType)) (@sort_of_simpl_pred (@seq_sub (Choice.eqType T) s : predArgType) (pred_of_argType (@seq_sub (Choice.eqType T) s : predArgType))))) (@size (Choice.sort T) s) *) by move=> Us; rewrite cardE enumT -(size_map val) unlock val_seq_sub_enum. Qed. End SeqFinType. Section OrdinalSub. Variable n : nat. Inductive ordinal : predArgType := Ordinal m of m < n. Coercion nat_of_ord i := let: Ordinal m _ := i in m. Canonical ordinal_subType := [subType for nat_of_ord]. Definition ordinal_eqMixin := Eval hnf in [eqMixin of ordinal by <:]. Canonical ordinal_eqType := Eval hnf in EqType ordinal ordinal_eqMixin. Definition ordinal_choiceMixin := [choiceMixin of ordinal by <:]. Canonical ordinal_choiceType := Eval hnf in ChoiceType ordinal ordinal_choiceMixin. Definition ordinal_countMixin := [countMixin of ordinal by <:]. Canonical ordinal_countType := Eval hnf in CountType ordinal ordinal_countMixin. Canonical ordinal_subCountType := [subCountType of ordinal]. Lemma ltn_ord (i : ordinal) : i < n. Proof. exact: valP i. Qed. Proof. (* Goal: is_true (leq (S (nat_of_ord i)) n) *) exact: valP i. Qed. Definition ord_enum : seq ordinal := pmap insub (iota 0 n). Lemma val_ord_enum : map val ord_enum = iota 0 n. Proof. (* Goal: @eq (list nat) (@map (@sub_sort nat (fun x : nat => leq (S x) n) ordinal_subType) nat (@val nat (fun x : nat => leq (S x) n) ordinal_subType) ord_enum) (iota O n) *) rewrite pmap_filter; last exact: insubK. (* Goal: @eq (list nat) (@filter nat (fun x : nat => @isSome (@sub_sort nat (fun x0 : nat => leq (S x0) n) ordinal_subType) (@insub nat (fun x0 : nat => leq (S x0) n) ordinal_subType x)) (iota O n)) (iota O n) *) by apply/all_filterP; apply/allP=> i; rewrite mem_iota isSome_insub. Qed. Lemma ord_enum_uniq : uniq ord_enum. Proof. (* Goal: is_true (@uniq ordinal_eqType ord_enum) *) by rewrite pmap_sub_uniq ?iota_uniq. Qed. Lemma mem_ord_enum i : i \in ord_enum. Proof. (* Goal: is_true (@in_mem (Equality.sort ordinal_eqType) i (@mem (Equality.sort ordinal_eqType) (seq_predType ordinal_eqType) ord_enum)) *) by rewrite -(mem_map ord_inj) val_ord_enum mem_iota ltn_ord. Qed. Definition ordinal_finMixin := Eval hnf in UniqFinMixin ord_enum_uniq mem_ord_enum. Canonical ordinal_finType := Eval hnf in FinType ordinal ordinal_finMixin. Canonical ordinal_subFinType := Eval hnf in [subFinType of ordinal]. End OrdinalSub. Notation "''I_' n" := (ordinal n) (at level 8, n at level 2, format "''I_' n"). Hint Resolve ltn_ord : core. Section OrdinalEnum. Variable n : nat. Lemma val_enum_ord : map val (enum 'I_n) = iota 0 n. Proof. (* Goal: @eq (list (Choice.sort nat_choiceType)) (@map (@sub_sort (Choice.sort nat_choiceType) (fun x : nat => leq (S x) n) (@subFin_sort nat_choiceType (fun x : nat => leq (S x) n) (ordinal_subFinType n))) (Choice.sort nat_choiceType) (@val (Choice.sort nat_choiceType) (fun x : nat => leq (S x) n) (@subFin_sort nat_choiceType (fun x : nat => leq (S x) n) (ordinal_subFinType n))) (@enum_mem (ordinal_finType n) (@mem (ordinal n) (predPredType (ordinal n)) (@sort_of_simpl_pred (ordinal n) (pred_of_argType (ordinal n)))))) (iota O n) *) by rewrite enumT unlock val_ord_enum. Qed. Lemma size_enum_ord : size (enum 'I_n) = n. Proof. (* Goal: @eq nat (@size (Finite.sort (ordinal_finType n)) (@enum_mem (ordinal_finType n) (@mem (ordinal n) (predPredType (ordinal n)) (@sort_of_simpl_pred (ordinal n) (pred_of_argType (ordinal n)))))) n *) by rewrite -(size_map val) val_enum_ord size_iota. Qed. Lemma card_ord : #|'I_n| = n. Proof. (* Goal: @eq nat (@card (ordinal_finType n) (@mem (ordinal n) (predPredType (ordinal n)) (@sort_of_simpl_pred (ordinal n) (pred_of_argType (ordinal n))))) n *) by rewrite cardE size_enum_ord. Qed. Lemma nth_enum_ord i0 m : m < n -> nth i0 (enum 'I_n) m = m :> nat. Proof. (* Goal: forall _ : is_true (leq (S m) n), @eq nat (@nat_of_ord n (@nth (Finite.sort (ordinal_finType n)) i0 (@enum_mem (ordinal_finType n) (@mem (ordinal n) (predPredType (ordinal n)) (@sort_of_simpl_pred (ordinal n) (pred_of_argType (ordinal n))))) m)) m *) by move=> ?; rewrite -(nth_map _ 0) (size_enum_ord, val_enum_ord) // nth_iota. Qed. Lemma nth_ord_enum (i0 i : 'I_n) : nth i0 (enum 'I_n) i = i. Proof. (* Goal: @eq (ordinal n) (@nth (ordinal n) i0 (@enum_mem (ordinal_finType n) (@mem (ordinal n) (predPredType (ordinal n)) (@sort_of_simpl_pred (ordinal n) (pred_of_argType (ordinal n))))) (@nat_of_ord n i)) i *) by apply: val_inj; apply: nth_enum_ord. Qed. Lemma index_enum_ord (i : 'I_n) : index i (enum 'I_n) = i. Proof. (* Goal: @eq nat (@index (ordinal_eqType n) i (@enum_mem (ordinal_finType n) (@mem (ordinal n) (predPredType (ordinal n)) (@sort_of_simpl_pred (ordinal n) (pred_of_argType (ordinal n)))))) (@nat_of_ord n i) *) by rewrite -{1}(nth_ord_enum i i) index_uniq ?(enum_uniq, size_enum_ord). Qed. End OrdinalEnum. Lemma widen_ord_proof n m (i : 'I_n) : n <= m -> i < m. Proof. (* Goal: forall _ : is_true (leq n m), is_true (leq (S (@nat_of_ord n i)) m) *) exact: leq_trans. Qed. Definition widen_ord n m le_n_m i := Ordinal (@widen_ord_proof n m i le_n_m). Lemma cast_ord_proof n m (i : 'I_n) : n = m -> i < m. Proof. (* Goal: forall _ : @eq nat n m, is_true (leq (S (@nat_of_ord n i)) m) *) by move <-. Qed. Definition cast_ord n m eq_n_m i := Ordinal (@cast_ord_proof n m i eq_n_m). Lemma cast_ord_id n eq_n i : cast_ord eq_n i = i :> 'I_n. Proof. (* Goal: @eq (ordinal n) (@cast_ord n n eq_n i) i *) exact: val_inj. Qed. Lemma cast_ord_comp n1 n2 n3 eq_n2 eq_n3 i : @cast_ord n2 n3 eq_n3 (@cast_ord n1 n2 eq_n2 i) = cast_ord (etrans eq_n2 eq_n3) i. Proof. (* Goal: @eq (ordinal n3) (@cast_ord n2 n3 eq_n3 (@cast_ord n1 n2 eq_n2 i)) (@cast_ord n1 n3 (@etrans nat n1 n2 n3 eq_n2 eq_n3) i) *) exact: val_inj. Qed. Lemma cast_ordK n1 n2 eq_n : cancel (@cast_ord n1 n2 eq_n) (cast_ord (esym eq_n)). Proof. (* Goal: @cancel (ordinal n2) (ordinal n1) (@cast_ord n1 n2 eq_n) (@cast_ord n2 n1 (@esym nat n1 n2 eq_n)) *) by move=> i; apply: val_inj. Qed. Lemma cast_ordKV n1 n2 eq_n : cancel (cast_ord (esym eq_n)) (@cast_ord n1 n2 eq_n). Proof. (* Goal: @cancel (ordinal n1) (ordinal n2) (@cast_ord n2 n1 (@esym nat n1 n2 eq_n)) (@cast_ord n1 n2 eq_n) *) by move=> i; apply: val_inj. Qed. Lemma cast_ord_inj n1 n2 eq_n : injective (@cast_ord n1 n2 eq_n). Proof. (* Goal: @injective (ordinal n2) (ordinal n1) (@cast_ord n1 n2 eq_n) *) exact: can_inj (cast_ordK eq_n). Qed. Lemma rev_ord_proof n (i : 'I_n) : n - i.+1 < n. Proof. (* Goal: is_true (leq (S (subn n (S (@nat_of_ord n i)))) n) *) by case: n i => [|n] [i lt_i_n] //; rewrite ltnS subSS leq_subr. Qed. Definition rev_ord n i := Ordinal (@rev_ord_proof n i). Lemma rev_ordK {n} : involutive (@rev_ord n). Proof. (* Goal: @involutive (ordinal n) (@rev_ord n) *) by case: n => [|n] [i lti] //; apply: val_inj; rewrite /= !subSS subKn. Qed. Lemma rev_ord_inj {n} : injective (@rev_ord n). Proof. (* Goal: @injective (ordinal n) (ordinal n) (@rev_ord n) *) exact: inv_inj rev_ordK. Qed. Section EnumRank. Variable T : finType. Implicit Type A : pred T. Lemma enum_rank_subproof x0 A : x0 \in A -> 0 < #|A|. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort T) x0 (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)), is_true (leq (S O) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) *) by move=> Ax0; rewrite (cardD1 x0) Ax0. Qed. Definition enum_rank_in x0 A (Ax0 : x0 \in A) x := insubd (Ordinal (@enum_rank_subproof x0 [eta A] Ax0)) (index x (enum A)). Definition enum_rank x := @enum_rank_in x T (erefl true) x. Lemma enum_default A : 'I_(#|A|) -> T. Proof. (* Goal: forall _ : ordinal (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)), Finite.sort T *) by rewrite cardE; case: (enum A) => [|//] []. Qed. Definition enum_val A i := nth (@enum_default [eta A] i) (enum A) i. Prenex Implicits enum_val. Lemma enum_valP A i : @enum_val A i \in A. Proof. (* Goal: is_true (@in_mem (Finite.sort T) (@enum_val A i) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) *) by rewrite -mem_enum mem_nth -?cardE. Qed. Lemma enum_val_nth A x i : @enum_val A i = nth x (enum A) i. Proof. (* Goal: @eq (Finite.sort T) (@enum_val A i) (@nth (Finite.sort T) x (@enum_mem T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@nat_of_ord (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => A x))) i)) *) by apply: set_nth_default; rewrite cardE in i *; apply: ltn_ord. Qed. Lemma nth_image T' y0 (f : T -> T') A (i : 'I_#|A|) : nth y0 (image f A) i = f (enum_val i). Proof. (* Goal: @eq T' (@nth T' y0 (@image_mem T T' f (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@nat_of_ord (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) i)) (f (@enum_val A i)) *) by rewrite -(nth_map _ y0) // -cardE. Qed. Lemma nth_codom T' y0 (f : T -> T') (i : 'I_#|T|) : nth y0 (codom f) i = f (enum_val i). Proof. (* Goal: @eq T' (@nth T' y0 (@codom T T' f) (@nat_of_ord (@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)))))) i)) (f (@enum_val (fun _ : Equality.sort (Finite.eqType T) => true) i)) *) exact: nth_image. Qed. Lemma nth_enum_rank_in x00 x0 A Ax0 : {in A, cancel (@enum_rank_in x0 A Ax0) (nth x00 (enum A))}. Proof. (* Goal: @prop_in1 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (fun x : Equality.sort (Finite.eqType T) => @eq (Equality.sort (Finite.eqType T)) ((fun n : @sub_sort nat (fun x0 : nat => leq (S x0) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x1 : Finite.sort T => A x1)))) (ordinal_subType (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x0 : Finite.sort T => A x0)))) => @nth (Finite.sort T) x00 (@enum_mem T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@nat_of_ord (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x0 : Finite.sort T => A x0))) n)) (@enum_rank_in x0 A Ax0 x)) x) (inPhantom (@cancel (@sub_sort nat (fun x : nat => leq (S x) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x0 : Finite.sort T => A x0)))) (ordinal_subType (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => A x))))) (Equality.sort (Finite.eqType T)) (@enum_rank_in x0 A Ax0) (fun n : @sub_sort nat (fun x : nat => leq (S x) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x0 : Finite.sort T => A x0)))) (ordinal_subType (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => A x)))) => @nth (Finite.sort T) x00 (@enum_mem T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)) (@nat_of_ord (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => A x))) n)))) *) move=> x Ax; rewrite /= insubdK ?nth_index ?mem_enum //. (* Goal: is_true (@in_mem nat (@index (Finite.eqType T) x (@enum_mem T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@mem nat (predPredType nat) (fun x : nat => leq (S x) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x0 : Finite.sort T => A x0)))))) *) by rewrite cardE [_ \in _]index_mem mem_enum. Qed. Lemma nth_enum_rank x0 : cancel enum_rank (nth x0 (enum T)). Proof. (* Goal: @cancel (@sub_sort nat (fun x : nat => leq (S x) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x0 : Finite.sort T => @pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T))) x0)))) (ordinal_subType (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => @pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T))) x))))) (Finite.sort T) enum_rank (fun n : @sub_sort nat (fun x : nat => leq (S x) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x0 : Finite.sort T => @pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T))) x0)))) (ordinal_subType (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => @pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T))) x)))) => @nth (Finite.sort T) x0 (@enum_mem 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)))))) (@nat_of_ord (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => @pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T))) x))) n)) *) by move=> x; apply: nth_enum_rank_in. Qed. Lemma enum_rankK_in x0 A Ax0 : {in A, cancel (@enum_rank_in x0 A Ax0) enum_val}. Proof. (* Goal: @prop_in1 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (fun x : Equality.sort (Finite.eqType T) => @eq (Equality.sort (Finite.eqType T)) (@enum_val A (@enum_rank_in x0 A Ax0 x)) x) (inPhantom (@cancel (@sub_sort nat (fun x : nat => leq (S x) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x0 : Finite.sort T => A x0)))) (ordinal_subType (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => A x))))) (Equality.sort (Finite.eqType T)) (@enum_rank_in x0 A Ax0) (@enum_val A))) *) by move=> x; apply: nth_enum_rank_in. Qed. Lemma enum_rankK : cancel enum_rank enum_val. Proof. (* Goal: @cancel (@sub_sort nat (fun x : nat => leq (S x) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x0 : Finite.sort T => @pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T))) x0)))) (ordinal_subType (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => @pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T))) x))))) (Finite.sort T) enum_rank (@enum_val (@pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T))))) *) by move=> x; apply: enum_rankK_in. Qed. Lemma enum_valK_in x0 A Ax0 : cancel enum_val (@enum_rank_in x0 A Ax0). Proof. (* Goal: @cancel (Finite.sort T) (ordinal (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => A x)))) (@enum_val A) (@enum_rank_in x0 A Ax0) *) move=> x; apply: ord_inj; rewrite insubdK; last first. (* Goal: @eq nat (@index (Finite.eqType T) (@enum_val A x) (@enum_mem T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@nat_of_ord (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => A x))) x) *) (* Goal: is_true (@in_mem nat (@index (Finite.eqType T) (@enum_val A x) (@enum_mem T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@mem nat (predPredType nat) (fun x : nat => leq (S x) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x0 : Finite.sort T => A x0)))))) *) by rewrite cardE [_ \in _]index_mem mem_nth // -cardE. (* Goal: @eq nat (@index (Finite.eqType T) (@enum_val A x) (@enum_mem T (@mem (Finite.sort T) (predPredType (Finite.sort T)) A))) (@nat_of_ord (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => A x))) x) *) by rewrite index_uniq ?enum_uniq // -cardE. Qed. Lemma enum_valK : cancel enum_val enum_rank. Proof. (* Goal: @cancel (Finite.sort T) (ordinal (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => @pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T))) x)))) (@enum_val (@pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T))))) enum_rank *) by move=> x; apply: enum_valK_in. Qed. Lemma enum_rank_inj : injective enum_rank. Proof. (* Goal: @injective (@sub_sort nat (fun x : nat => leq (S x) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x0 : Finite.sort T => @pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T))) x0)))) (ordinal_subType (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => @pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T))) x))))) (Finite.sort T) enum_rank *) exact: can_inj enum_rankK. Qed. Lemma enum_val_inj A : injective (@enum_val A). Proof. (* Goal: @injective (Finite.sort T) (ordinal (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => A x)))) (@enum_val A) *) by move=> i; apply: can_inj (enum_valK_in (enum_valP i)) (i). Qed. Lemma enum_val_bij_in x0 A : x0 \in A -> {on A, bijective (@enum_val A)}. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort T) x0 (@mem (Finite.sort T) (predPredType (Finite.sort T)) A)), @bijective_on (ordinal (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => A x)))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) A) (@enum_val A) *) move=> Ax0; exists (enum_rank_in Ax0) => [i _|]; last exact: enum_rankK_in. (* Goal: @eq (ordinal (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => A x)))) (@enum_rank_in x0 A Ax0 (@enum_val A i)) i *) exact: enum_valK_in. Qed. Lemma enum_rank_bij : bijective enum_rank. Proof. (* Goal: @bijective (@sub_sort nat (fun x : nat => leq (S x) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x0 : Finite.sort T => @pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T))) x0)))) (ordinal_subType (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => @pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T))) x))))) (Finite.sort T) enum_rank *) by move: enum_rankK enum_valK; exists (@enum_val T). Qed. Lemma enum_val_bij : bijective (@enum_val T). Proof. (* Goal: @bijective (Finite.sort T) (ordinal (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (fun x : Finite.sort T => @pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T))) x)))) (@enum_val (@pred_of_simpl (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T))))) *) by move: enum_rankK enum_valK; exists enum_rank. Qed. Lemma fin_all_exists U (P : forall x : T, U x -> Prop) : (forall x, exists u, P x u) -> (exists u, forall x, P x (u x)). Proof. (* Goal: forall _ : forall x : Finite.sort T, @ex (U x) (fun u : U x => P x u), @ex (forall x : Finite.sort T, U x) (fun u : forall x : Finite.sort T, U x => forall x : Finite.sort T, P x (u x)) *) move=> ex_u; pose Q m x := enum_rank x < m -> {ux | P x ux}. (* Goal: @ex (forall x : Finite.sort T, U x) (fun u : forall x : Finite.sort T, U x => forall x : Finite.sort T, P x (u x)) *) suffices: forall m, m <= #|T| -> exists w : forall x, Q m x, True. (* Goal: forall (m : nat) (_ : is_true (leq m (@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)))))))), @ex (forall x : Finite.sort T, Q m x) (fun _ : forall x : Finite.sort T, Q m x => True) *) (* Goal: forall _ : forall (m : nat) (_ : is_true (leq m (@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)))))))), @ex (forall x : Finite.sort T, Q m x) (fun _ : forall x : Finite.sort T, Q m x => True), @ex (forall x0 : Finite.sort T, U x0) (fun u : forall x0 : Finite.sort T, U x0 => forall x0 : Finite.sort T, P x0 (u x0)) *) case/(_ #|T|)=> // w _; pose u x := sval (w x (ltn_ord _)). (* Goal: forall (m : nat) (_ : is_true (leq m (@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)))))))), @ex (forall x : Finite.sort T, Q m x) (fun _ : forall x : Finite.sort T, Q m x => True) *) (* Goal: @ex (forall x : Finite.sort T, U x) (fun u : forall x : Finite.sort T, U x => forall x : Finite.sort T, P x (u x)) *) by exists u => x; rewrite {}/u; case: (w x _). (* Goal: forall (m : nat) (_ : is_true (leq m (@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)))))))), @ex (forall x : Finite.sort T, Q m x) (fun _ : forall x : Finite.sort T, Q m x => True) *) elim=> [|m IHm] ltmX; first by have w x: Q 0 x by []; exists w. (* Goal: @ex (forall x : Finite.sort T, Q (S m) x) (fun _ : forall x : Finite.sort T, Q (S m) x => True) *) have{IHm} [w _] := IHm (ltnW ltmX); pose i := Ordinal ltmX. (* Goal: @ex (forall x : Finite.sort T, Q (S m) x) (fun _ : forall x : Finite.sort T, Q (S m) x => True) *) have [u Pu] := ex_u (enum_val i); suffices w' x: Q m.+1 x by exists w'. (* Goal: Q (S m) x *) rewrite /Q ltnS leq_eqVlt (val_eqE _ i); case: eqP => [def_i _ | _ /w //]. (* Goal: @sig (U x) (fun ux : U x => P x ux) *) by rewrite -def_i enum_rankK in u Pu; exists u. Qed. Lemma fin_all_exists2 U (P Q : forall x : T, U x -> Prop) : (forall x, exists2 u, P x u & Q x u) -> (exists2 u, forall x, P x (u x) & forall x, Q x (u x)). Proof. (* Goal: forall _ : forall x : Finite.sort T, @ex2 (U x) (fun u : U x => P x u) (fun u : U x => Q x u), @ex2 (forall x : Finite.sort T, U x) (fun u : forall x : Finite.sort T, U x => forall x : Finite.sort T, P x (u x)) (fun u : forall x : Finite.sort T, U x => forall x : Finite.sort T, Q x (u x)) *) move=> ex_u; have (x): exists u, P x u /\ Q x u by have [u] := ex_u x; exists u. (* Goal: forall _ : forall x : Finite.sort T, @ex (U x) (fun u : U x => and (P x u) (Q x u)), @ex2 (forall x0 : Finite.sort T, U x0) (fun u : forall x0 : Finite.sort T, U x0 => forall x0 : Finite.sort T, P x0 (u x0)) (fun u : forall x0 : Finite.sort T, U x0 => forall x0 : Finite.sort T, Q x0 (u x0)) *) by case/fin_all_exists=> u /all_and2[]; exists u. Qed. End EnumRank. Arguments enum_val_inj {T A} [i1 i2] : rename. Arguments enum_rank_inj {T} [x1 x2]. Prenex Implicits enum_val enum_rank enum_valK enum_rankK. Lemma enum_rank_ord n i : enum_rank i = cast_ord (esym (card_ord n)) i. Proof. (* Goal: @eq (@sub_sort nat (fun x : nat => leq (S x) (@card (ordinal_finType n) (@mem (Finite.sort (ordinal_finType n)) (predPredType (Finite.sort (ordinal_finType n))) (fun x0 : Finite.sort (ordinal_finType n) => @pred_of_simpl (Equality.sort (Finite.eqType (ordinal_finType n))) (pred_of_argType (Equality.sort (Finite.eqType (ordinal_finType n)))) x0)))) (ordinal_subType (@card (ordinal_finType n) (@mem (Finite.sort (ordinal_finType n)) (predPredType (Finite.sort (ordinal_finType n))) (fun x : Finite.sort (ordinal_finType n) => @pred_of_simpl (Equality.sort (Finite.eqType (ordinal_finType n))) (pred_of_argType (Equality.sort (Finite.eqType (ordinal_finType n)))) x))))) (@enum_rank (ordinal_finType n) i) (@cast_ord n (@card (ordinal_finType n) (@mem (ordinal n) (predPredType (ordinal n)) (@sort_of_simpl_pred (ordinal n) (pred_of_argType (ordinal n))))) (@esym nat (@card (ordinal_finType n) (@mem (ordinal n) (predPredType (ordinal n)) (@sort_of_simpl_pred (ordinal n) (pred_of_argType (ordinal n))))) n (card_ord n)) i) *) by apply: val_inj; rewrite insubdK ?index_enum_ord // card_ord [_ \in _]ltn_ord. Qed. Lemma enum_val_ord n i : enum_val i = cast_ord (card_ord n) i. Proof. (* Goal: @eq (Finite.sort (ordinal_finType n)) (@enum_val (ordinal_finType n) (fun _ : Finite.sort (ordinal_finType n) => true) i) (@cast_ord (@card (ordinal_finType n) (@mem (ordinal n) (predPredType (ordinal n)) (@sort_of_simpl_pred (ordinal n) (pred_of_argType (ordinal n))))) n (card_ord n) i) *) by apply: canLR (@enum_rankK _) _; apply: val_inj; rewrite enum_rank_ord. Qed. Definition bump h i := (h <= i) + i. Definition unbump h i := i - (h < i). Lemma bumpK h : cancel (bump h) (unbump h). Proof. (* Goal: @cancel nat nat (bump h) (unbump h) *) rewrite /bump /unbump => i. (* Goal: @eq nat (subn (addn (nat_of_bool (leq h i)) i) (nat_of_bool (leq (S h) (addn (nat_of_bool (leq h i)) i)))) i *) have [le_hi | lt_ih] := leqP h i; first by rewrite ltnS le_hi subn1. (* Goal: @eq nat (subn (addn (nat_of_bool false) i) (nat_of_bool (leq (S h) (addn (nat_of_bool false) i)))) i *) by rewrite ltnNge ltnW ?subn0. Qed. Lemma neq_bump h i : h != bump h i. Proof. (* Goal: is_true (negb (@eq_op nat_eqType h (bump h i))) *) rewrite /bump eqn_leq; have [le_hi | lt_ih] := leqP h i. (* Goal: is_true (negb (andb (leq h (addn (nat_of_bool false) i)) (leq (addn (nat_of_bool false) i) h))) *) (* Goal: is_true (negb (andb (leq h (addn (nat_of_bool true) i)) (leq (addn (nat_of_bool true) i) h))) *) by rewrite ltnNge le_hi andbF. (* Goal: is_true (negb (andb (leq h (addn (nat_of_bool false) i)) (leq (addn (nat_of_bool false) i) h))) *) by rewrite leqNgt lt_ih. Qed. Lemma unbumpKcond h i : bump h (unbump h i) = (i == h) + i. Proof. (* Goal: @eq nat (bump h (unbump h i)) (addn (nat_of_bool (@eq_op nat_eqType i h)) i) *) rewrite /bump /unbump leqNgt -subSKn. (* Goal: @eq nat (addn (nat_of_bool (negb (leq (S (Nat.pred (subn (S i) (nat_of_bool (leq (S h) i))))) h))) (Nat.pred (subn (S i) (nat_of_bool (leq (S h) i))))) (addn (nat_of_bool (@eq_op nat_eqType i h)) i) *) case: (ltngtP i h) => /= [-> | ltih | ->] //; last by rewrite ltnn. (* Goal: @eq nat (addn (nat_of_bool (negb (leq (S (Nat.pred (subn (S i) (S O)))) h))) (Nat.pred (subn (S i) (S O)))) (addn O i) *) by rewrite subn1 /= leqNgt !(ltn_predK ltih, ltih, add1n). Qed. Lemma unbumpK {h} : {in predC1 h, cancel (unbump h) (bump h)}. Proof. (* Goal: @prop_in1 (Equality.sort nat_eqType) (@mem (Equality.sort nat_eqType) (simplPredType (Equality.sort nat_eqType)) (@predC1 nat_eqType h)) (fun x : nat => @eq nat (bump h (unbump h x)) x) (inPhantom (@cancel nat nat (unbump h) (bump h))) *) by move=> i /negbTE-neq_h_i; rewrite unbumpKcond neq_h_i. Qed. Lemma bump_addl h i k : bump (k + h) (k + i) = k + bump h i. Proof. (* Goal: @eq nat (bump (addn k h) (addn k i)) (addn k (bump h i)) *) by rewrite /bump leq_add2l addnCA. Qed. Lemma bumpS h i : bump h.+1 i.+1 = (bump h i).+1. Proof. (* Goal: @eq nat (bump (S h) (S i)) (S (bump h i)) *) exact: addnS. Qed. Lemma unbump_addl h i k : unbump (k + h) (k + i) = k + unbump h i. Lemma unbumpS h i : unbump h.+1 i.+1 = (unbump h i).+1. Proof. (* Goal: @eq nat (unbump (S h) (S i)) (S (unbump h i)) *) exact: unbump_addl 1. Qed. Lemma leq_bump h i j : (i <= bump h j) = (unbump h i <= j). Proof. (* Goal: @eq bool (leq i (bump h j)) (leq (unbump h i) j) *) rewrite /bump leq_subLR. (* Goal: @eq bool (leq i (addn (nat_of_bool (leq h j)) j)) (leq i (addn (nat_of_bool (leq (S h) i)) j)) *) case: (leqP i h) (leqP h j) => [le_i_h | lt_h_i] [le_h_j | lt_j_h] //. (* Goal: @eq bool (leq i (addn (nat_of_bool false) j)) (leq i (addn (nat_of_bool true) j)) *) (* Goal: @eq bool (leq i (addn (nat_of_bool true) j)) (leq i (addn (nat_of_bool false) j)) *) by rewrite leqW (leq_trans le_i_h). (* Goal: @eq bool (leq i (addn (nat_of_bool false) j)) (leq i (addn (nat_of_bool true) j)) *) by rewrite !(leqNgt i) ltnW (leq_trans _ lt_h_i). Qed. Lemma leq_bump2 h i j : (bump h i <= bump h j) = (i <= j). Proof. (* Goal: @eq bool (leq (bump h i) (bump h j)) (leq i j) *) by rewrite leq_bump bumpK. Qed. Lemma bumpC h1 h2 i : bump h1 (bump h2 i) = bump (bump h1 h2) (bump (unbump h2 h1) i). Lemma lift_subproof n h (i : 'I_n.-1) : bump h i < n. Proof. (* Goal: is_true (leq (S (bump h (@nat_of_ord (Nat.pred n) i))) n) *) by case: n i => [[]|n] //= i; rewrite -addnS (leq_add (leq_b1 _)). Qed. Definition lift n (h : 'I_n) (i : 'I_n.-1) := Ordinal (lift_subproof h i). Lemma unlift_subproof n (h : 'I_n) (u : {j | j != h}) : unbump h (val u) < n.-1. Proof. (* Goal: is_true (leq (S (unbump (@nat_of_ord n h) (@nat_of_ord n (@val (Equality.sort (ordinal_eqType n)) (fun x : Equality.sort (ordinal_eqType n) => (fun j : Equality.sort (ordinal_eqType n) => negb (@eq_op (ordinal_eqType n) j h)) x) (@sig_subType (Equality.sort (ordinal_eqType n)) (fun j : Equality.sort (ordinal_eqType n) => negb (@eq_op (ordinal_eqType n) j h))) u)))) (Nat.pred n)) *) case: n h u => [|n h] [] //= j ne_jh. (* Goal: is_true (leq (S (unbump (@nat_of_ord (S n) h) (@nat_of_ord (S n) j))) n) *) rewrite -(leq_bump2 h.+1) bumpS unbumpK // /bump. (* Goal: is_true (leq (S (@nat_of_ord (S n) j)) (addn (nat_of_bool (leq (S (@nat_of_ord (S n) h)) n)) n)) *) case: (ltngtP n h) => [|_|eq_nh]; rewrite ?(leqNgt _ h) ?ltn_ord //. (* Goal: is_true (leq (S (@nat_of_ord (S n) j)) (addn (nat_of_bool false) n)) *) by rewrite ltn_neqAle [j <= _](valP j) {2}eq_nh andbT. Qed. Definition unlift n (h i : 'I_n) := omap (fun u : {j | j != h} => Ordinal (unlift_subproof u)) (insub i). Variant unlift_spec n h i : option 'I_n.-1 -> Type := | UnliftSome j of i = lift h j : unlift_spec h i (Some j) | UnliftNone of i = h : unlift_spec h i None. Lemma unliftP n (h i : 'I_n) : unlift_spec h i (unlift h i). Proof. (* Goal: @unlift_spec n h i (@unlift n h i) *) rewrite /unlift; case: insubP => [u nhi | ] def_i /=; constructor. (* Goal: @eq (ordinal n) i h *) (* Goal: @eq (ordinal n) i (@lift n h (@Ordinal (Nat.pred n) (unbump (@nat_of_ord n h) (@nat_of_ord n (@proj1_sig (ordinal n) (fun x : ordinal n => is_true (negb (@eq_op (ordinal_eqType n) x h))) u))) (@unlift_subproof n h u))) *) by apply: val_inj; rewrite /= def_i unbumpK. (* Goal: @eq (ordinal n) i h *) by rewrite negbK in def_i; apply/eqP. Qed. Lemma neq_lift n (h : 'I_n) i : h != lift h i. Proof. (* Goal: is_true (negb (@eq_op (ordinal_eqType n) h (@lift n h i))) *) exact: neq_bump. Qed. Lemma unlift_none n (h : 'I_n) : unlift h h = None. Proof. (* Goal: @eq (option (ordinal (Nat.pred n))) (@unlift n h h) (@None (ordinal (Nat.pred n))) *) by case: unliftP => // j Dh; case/eqP: (neq_lift h j). Qed. Lemma unlift_some n (h i : 'I_n) : h != i -> {j | i = lift h j & unlift h i = Some j}. Proof. (* Goal: forall _ : is_true (negb (@eq_op (ordinal_eqType n) h i)), @sig2 (ordinal (Nat.pred n)) (fun j : ordinal (Nat.pred n) => @eq (ordinal n) i (@lift n h j)) (fun j : ordinal (Nat.pred n) => @eq (option (ordinal (Nat.pred n))) (@unlift n h i) (@Some (ordinal (Nat.pred n)) j)) *) rewrite eq_sym => /eqP neq_ih. (* Goal: @sig2 (ordinal (Nat.pred n)) (fun j : ordinal (Nat.pred n) => @eq (ordinal n) i (@lift n h j)) (fun j : ordinal (Nat.pred n) => @eq (option (ordinal (Nat.pred n))) (@unlift n h i) (@Some (ordinal (Nat.pred n)) j)) *) by case Dui: (unlift h i) / (unliftP h i) => [j Dh|//]; exists j. Qed. Lemma lift_inj n (h : 'I_n) : injective (lift h). Proof. (* Goal: @injective (ordinal n) (ordinal (Nat.pred n)) (@lift n h) *) by move=> i1 i2 [/(can_inj (bumpK h))/val_inj]. Qed. Arguments lift_inj {n h} [i1 i2] eq_i12h : rename. Lemma liftK n (h : 'I_n) : pcancel (lift h) (unlift h). Proof. (* Goal: @pcancel (ordinal n) (ordinal (Nat.pred n)) (@lift n h) (@unlift n h) *) by move=> i; case: (unlift_some (neq_lift h i)) => j /lift_inj->. Qed. Lemma lshift_subproof m n (i : 'I_m) : i < m + n. Proof. (* Goal: is_true (leq (S (@nat_of_ord m i)) (addn m n)) *) by apply: leq_trans (valP i) _; apply: leq_addr. Qed. Lemma rshift_subproof m n (i : 'I_n) : m + i < m + n. Proof. (* Goal: is_true (leq (S (addn m (@nat_of_ord n i))) (addn m n)) *) by rewrite ltn_add2l. Qed. Definition lshift m n (i : 'I_m) := Ordinal (lshift_subproof n i). Definition rshift m n (i : 'I_n) := Ordinal (rshift_subproof m i). Lemma split_subproof m n (i : 'I_(m + n)) : i >= m -> i - m < n. Proof. (* Goal: forall _ : is_true (leq m (@nat_of_ord (addn m n) i)), is_true (leq (S (subn (@nat_of_ord (addn m n) i) m)) n) *) by move/subSn <-; rewrite leq_subLR. Qed. Definition split {m n} (i : 'I_(m + n)) : 'I_m + 'I_n := match ltnP (i) m with | LtnNotGeq lt_i_m => inl _ (Ordinal lt_i_m) | GeqNotLtn ge_i_m => inr _ (Ordinal (split_subproof ge_i_m)) end. Variant split_spec m n (i : 'I_(m + n)) : 'I_m + 'I_n -> bool -> Type := | SplitLo (j : 'I_m) of i = j :> nat : split_spec i (inl _ j) true | SplitHi (k : 'I_n) of i = m + k :> nat : split_spec i (inr _ k) false. Lemma splitP m n (i : 'I_(m + n)) : split_spec i (split i) (i < m). Proof. (* Goal: @split_spec m n i (@split m n i) (leq (S (@nat_of_ord (addn m n) i)) m) *) rewrite /split {-3}/leq. (* Goal: @split_spec m n i match ltnP (@nat_of_ord (addn m n) i) m with | LtnNotGeq lt_i_m => @inl (ordinal m) (ordinal n) (@Ordinal m (@nat_of_ord (addn m n) i) lt_i_m) | GeqNotLtn ge_i_m => @inr (ordinal m) (ordinal n) (@Ordinal n (subn (@nat_of_ord (addn m n) i) m) (@split_subproof m n i ge_i_m)) end (leq (S (@nat_of_ord (addn m n) i)) m) *) by case: (@ltnP i m) => cmp_i_m //=; constructor; rewrite ?subnKC. Qed. Definition unsplit {m n} (jk : 'I_m + 'I_n) := match jk with inl j => lshift n j | inr k => rshift m k end. Lemma ltn_unsplit m n (jk : 'I_m + 'I_n) : (unsplit jk < m) = jk. Proof. (* Goal: @eq bool (leq (S (@nat_of_ord (addn m n) (@unsplit m n jk))) m) (@is_inl (ordinal m) (ordinal n) jk) *) by case: jk => [j|k]; rewrite /= ?ltn_ord // ltnNge leq_addr. Qed. Lemma splitK {m n} : cancel (@split m n) unsplit. Proof. (* Goal: @cancel (sum (ordinal m) (ordinal n)) (ordinal (addn m n)) (@split m n) (@unsplit m n) *) by move=> i; apply: val_inj; case: splitP. Qed. Lemma unsplitK {m n} : cancel (@unsplit m n) split. Proof. (* Goal: @cancel (ordinal (addn m n)) (sum (ordinal m) (ordinal n)) (@unsplit m n) (@split m n) *) move=> jk; have:= ltn_unsplit jk. (* Goal: forall _ : @eq bool (leq (S (@nat_of_ord (addn m n) (@unsplit m n jk))) m) (@is_inl (ordinal m) (ordinal n) jk), @eq (sum (ordinal m) (ordinal n)) (@split m n (@unsplit m n jk)) jk *) by do [case: splitP; case: jk => //= i j] => [|/addnI] => /ord_inj->. Qed. Section OrdinalPos. Variable n' : nat. Local Notation n := n'.+1. Definition ord0 := Ordinal (ltn0Sn n'). Definition ord_max := Ordinal (ltnSn n'). Lemma sub_ord_proof m : n' - m < n. Proof. (* Goal: is_true (leq (S (subn n' m)) (S n')) *) by rewrite ltnS leq_subr. Qed. Definition sub_ord m := Ordinal (sub_ord_proof m). Lemma sub_ordK (i : 'I_n) : n' - (n' - i) = i. Proof. (* Goal: @eq nat (subn n' (subn n' (@nat_of_ord (S n') i))) (@nat_of_ord (S n') i) *) by rewrite subKn ?leq_ord. Qed. Definition inord m : 'I_n := insubd ord0 m. Lemma inordK m : m < n -> inord m = m :> nat. Proof. (* Goal: forall _ : is_true (leq (S m) (S n')), @eq nat (@nat_of_ord (S n') (inord m)) m *) by move=> lt_m; rewrite val_insubd lt_m. Qed. Lemma inord_val (i : 'I_n) : inord i = i. Proof. (* Goal: @eq (ordinal (S n')) (inord (@nat_of_ord (S n') i)) i *) by rewrite /inord /insubd valK. Qed. Lemma enum_ordS : enum 'I_n = ord0 :: map (lift ord0) (enum 'I_n'). Proof. (* Goal: @eq (list (Finite.sort (ordinal_finType (S n')))) (@enum_mem (ordinal_finType (S n')) (@mem (ordinal (S n')) (predPredType (ordinal (S n'))) (@sort_of_simpl_pred (ordinal (S n')) (pred_of_argType (ordinal (S n')))))) (@cons (ordinal (S n')) ord0 (@map (ordinal (Nat.pred (S n'))) (ordinal (S n')) (@lift (S n') ord0) (@enum_mem (ordinal_finType n') (@mem (ordinal n') (predPredType (ordinal n')) (@sort_of_simpl_pred (ordinal n') (pred_of_argType (ordinal n'))))))) *) apply: (inj_map val_inj); rewrite val_enum_ord /= -map_comp. (* Goal: @eq (list nat) (@cons nat O (iota (S O) n')) (@cons nat O (@map (ordinal n') nat (@funcomp nat (ordinal (S n')) (ordinal n') tt (@nat_of_ord (S n')) (@lift (S n') ord0)) (@enum_mem (ordinal_finType n') (@mem (ordinal n') (predPredType (ordinal n')) (@sort_of_simpl_pred (ordinal n') (pred_of_argType (ordinal n'))))))) *) by rewrite (map_comp (addn 1)) val_enum_ord -iota_addl. Qed. Lemma lift_max (i : 'I_n') : lift ord_max i = i :> nat. Proof. (* Goal: @eq nat (@nat_of_ord (S n') (@lift (S n') ord_max i)) (@nat_of_ord n' i) *) by rewrite /= /bump leqNgt ltn_ord. Qed. End OrdinalPos. Arguments ord0 {n'}. Arguments ord_max {n'}. Arguments inord {n'}. Arguments sub_ord {n'}. Arguments sub_ordK {n'}. Arguments inord_val {n'}. Section ProdFinType. Variable T1 T2 : finType. Definition prod_enum := [seq (x1, x2) | x1 <- enum T1, x2 <- enum T2]. Lemma predX_prod_enum (A1 : pred T1) (A2 : pred T2) : count [predX A1 & A2] prod_enum = #|A1| * #|A2|. Proof. (* Goal: @eq nat (@count (prod (Finite.sort T1) (Finite.sort T2)) (@pred_of_simpl (prod (Finite.sort T1) (Finite.sort T2)) (@predX (Finite.sort T1) (Finite.sort T2) (@pred_of_simpl (Finite.sort T1) (@pred_of_mem_pred (Finite.sort T1) (@mem (Finite.sort T1) (predPredType (Finite.sort T1)) A1))) (@pred_of_simpl (Finite.sort T2) (@pred_of_mem_pred (Finite.sort T2) (@mem (Finite.sort T2) (predPredType (Finite.sort T2)) A2))))) prod_enum) (muln (@card T1 (@mem (Finite.sort T1) (predPredType (Finite.sort T1)) A1)) (@card T2 (@mem (Finite.sort T2) (predPredType (Finite.sort T2)) A2))) *) rewrite !cardE !size_filter -!enumT /prod_enum. (* Goal: @eq nat (@count (prod (Finite.sort T1) (Finite.sort T2)) (@pred_of_simpl (prod (Finite.sort T1) (Finite.sort T2)) (@predX (Finite.sort T1) (Finite.sort T2) (@pred_of_simpl (Finite.sort T1) (@pred_of_mem_pred (Finite.sort T1) (@mem (Finite.sort T1) (predPredType (Finite.sort T1)) A1))) (@pred_of_simpl (Finite.sort T2) (@pred_of_mem_pred (Finite.sort T2) (@mem (Finite.sort T2) (predPredType (Finite.sort T2)) A2))))) (@allpairs (Finite.sort T1) (Finite.sort T2) (prod (Finite.sort T1) (Finite.sort T2)) (fun (x1 : Finite.sort T1) (x2 : Finite.sort T2) => @pair (Finite.sort T1) (Finite.sort T2) x1 x2) (@enum_mem T1 (@mem (Equality.sort (Finite.eqType T1)) (predPredType (Equality.sort (Finite.eqType T1))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType T1)) (pred_of_argType (Equality.sort (Finite.eqType T1)))))) (@enum_mem T2 (@mem (Equality.sort (Finite.eqType T2)) (predPredType (Equality.sort (Finite.eqType T2))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType T2)) (pred_of_argType (Equality.sort (Finite.eqType T2)))))))) (muln (@count (Finite.sort T1) (@pred_of_simpl (Finite.sort T1) (@pred_of_mem_pred (Finite.sort T1) (@mem (Finite.sort T1) (predPredType (Finite.sort T1)) A1))) (@enum_mem T1 (@mem (Equality.sort (Finite.eqType T1)) (predPredType (Equality.sort (Finite.eqType T1))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType T1)) (pred_of_argType (Equality.sort (Finite.eqType T1))))))) (@count (Finite.sort T2) (@pred_of_simpl (Finite.sort T2) (@pred_of_mem_pred (Finite.sort T2) (@mem (Finite.sort T2) (predPredType (Finite.sort T2)) A2))) (@enum_mem T2 (@mem (Equality.sort (Finite.eqType T2)) (predPredType (Equality.sort (Finite.eqType T2))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType T2)) (pred_of_argType (Equality.sort (Finite.eqType T2)))))))) *) elim: (enum T1) => //= x1 s1 IHs; rewrite count_cat {}IHs count_map /preim /=. (* Goal: @eq nat (addn (@count (Finite.sort T2) (@pred_of_simpl (Finite.sort T2) (@SimplPred (Finite.sort T2) (fun x : Finite.sort T2 => andb (@in_mem (Finite.sort T1) x1 (@mem (Finite.sort T1) (predPredType (Finite.sort T1)) A1)) (@in_mem (Finite.sort T2) x (@mem (Finite.sort T2) (predPredType (Finite.sort T2)) A2))))) (@enum_mem T2 (@mem (Finite.sort T2) (predPredType (Finite.sort T2)) (@sort_of_simpl_pred (Finite.sort T2) (pred_of_argType (Finite.sort T2)))))) (muln (@count (Finite.sort T1) (@pred_of_simpl (Finite.sort T1) (@pred_of_mem_pred (Finite.sort T1) (@mem (Finite.sort T1) (predPredType (Finite.sort T1)) A1))) s1) (@count (Finite.sort T2) (@pred_of_simpl (Finite.sort T2) (@pred_of_mem_pred (Finite.sort T2) (@mem (Finite.sort T2) (predPredType (Finite.sort T2)) A2))) (@enum_mem T2 (@mem (Finite.sort T2) (predPredType (Finite.sort T2)) (@sort_of_simpl_pred (Finite.sort T2) (pred_of_argType (Finite.sort T2)))))))) (muln (addn (nat_of_bool (@in_mem (Finite.sort T1) x1 (@mem (Finite.sort T1) (predPredType (Finite.sort T1)) A1))) (@count (Finite.sort T1) (@pred_of_simpl (Finite.sort T1) (@pred_of_mem_pred (Finite.sort T1) (@mem (Finite.sort T1) (predPredType (Finite.sort T1)) A1))) s1)) (@count (Finite.sort T2) (@pred_of_simpl (Finite.sort T2) (@pred_of_mem_pred (Finite.sort T2) (@mem (Finite.sort T2) (predPredType (Finite.sort T2)) A2))) (@enum_mem T2 (@mem (Finite.sort T2) (predPredType (Finite.sort T2)) (@sort_of_simpl_pred (Finite.sort T2) (pred_of_argType (Finite.sort T2))))))) *) by case: (x1 \in A1); rewrite ?count_pred0. Qed. Lemma prod_enumP : Finite.axiom prod_enum. Proof. (* Goal: @Finite.axiom (prod_eqType (Finite.eqType T1) (Finite.eqType T2)) prod_enum *) by case=> x1 x2; rewrite (predX_prod_enum (pred1 x1) (pred1 x2)) !card1. Qed. Definition prod_finMixin := Eval hnf in FinMixin prod_enumP. Canonical prod_finType := Eval hnf in FinType (T1 * T2) prod_finMixin. Lemma cardX (A1 : pred T1) (A2 : pred T2) : #|[predX A1 & A2]| = #|A1| * #|A2|. Proof. (* Goal: @eq nat (@card prod_finType (@mem (prod (Finite.sort T1) (Finite.sort T2)) (simplPredType (prod (Finite.sort T1) (Finite.sort T2))) (@predX (Finite.sort T1) (Finite.sort T2) (@pred_of_simpl (Finite.sort T1) (@pred_of_mem_pred (Finite.sort T1) (@mem (Finite.sort T1) (predPredType (Finite.sort T1)) A1))) (@pred_of_simpl (Finite.sort T2) (@pred_of_mem_pred (Finite.sort T2) (@mem (Finite.sort T2) (predPredType (Finite.sort T2)) A2)))))) (muln (@card T1 (@mem (Finite.sort T1) (predPredType (Finite.sort T1)) A1)) (@card T2 (@mem (Finite.sort T2) (predPredType (Finite.sort T2)) A2))) *) by rewrite -predX_prod_enum unlock size_filter unlock. Qed. Lemma card_prod : #|{: T1 * T2}| = #|T1| * #|T2|. Proof. (* Goal: @eq nat (@card prod_finType (@mem (prod (Finite.sort T1) (Finite.sort T2)) (predPredType (prod (Finite.sort T1) (Finite.sort T2) : predArgType)) (@sort_of_simpl_pred (prod (Finite.sort T1) (Finite.sort T2) : predArgType) (pred_of_argType (prod (Finite.sort T1) (Finite.sort T2) : predArgType))))) (muln (@card T1 (@mem (Equality.sort (Finite.eqType T1)) (predPredType (Equality.sort (Finite.eqType T1))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType T1)) (pred_of_argType (Equality.sort (Finite.eqType T1)))))) (@card T2 (@mem (Equality.sort (Finite.eqType T2)) (predPredType (Equality.sort (Finite.eqType T2))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType T2)) (pred_of_argType (Equality.sort (Finite.eqType T2))))))) *) by rewrite -cardX; apply: eq_card; case. Qed. Lemma eq_card_prod (A : pred (T1 * T2)) : A =i predT -> #|A| = #|T1| * #|T2|. Proof. (* Goal: forall _ : @eq_mem (prod (Finite.sort T1) (Finite.sort T2)) (@mem (prod (Finite.sort T1) (Finite.sort T2)) (predPredType (prod (Finite.sort T1) (Finite.sort T2))) A) (@mem (prod (Finite.sort T1) (Finite.sort T2)) (simplPredType (prod (Finite.sort T1) (Finite.sort T2))) (@predT (prod (Finite.sort T1) (Finite.sort T2)))), @eq nat (@card prod_finType (@mem (prod (Finite.sort T1) (Finite.sort T2)) (predPredType (prod (Finite.sort T1) (Finite.sort T2))) A)) (muln (@card T1 (@mem (Equality.sort (Finite.eqType T1)) (predPredType (Equality.sort (Finite.eqType T1))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType T1)) (pred_of_argType (Equality.sort (Finite.eqType T1)))))) (@card T2 (@mem (Equality.sort (Finite.eqType T2)) (predPredType (Equality.sort (Finite.eqType T2))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType T2)) (pred_of_argType (Equality.sort (Finite.eqType T2))))))) *) exact: eq_card_trans card_prod. Qed. End ProdFinType. Section TagFinType. Variables (I : finType) (T_ : I -> finType). Definition tag_enum := flatten [seq [seq Tagged T_ x | x <- enumF (T_ i)] | i <- enumF I]. Lemma tag_enumP : Finite.axiom tag_enum. Definition tag_finMixin := Eval hnf in FinMixin tag_enumP. Canonical tag_finType := Eval hnf in FinType {i : I & T_ i} tag_finMixin. Lemma card_tagged : #|{: {i : I & T_ i}}| = sumn (map (fun i => #|T_ i|) (enum I)). Proof. (* Goal: @eq nat (@card tag_finType (@mem (@sigT (Finite.sort I) (fun i : Finite.sort I => Finite.sort (T_ i))) (predPredType (@sigT (Finite.sort I) (fun i : Finite.sort I => Finite.sort (T_ i)) : predArgType)) (@sort_of_simpl_pred (@sigT (Finite.sort I) (fun i : Finite.sort I => Finite.sort (T_ i)) : predArgType) (pred_of_argType (@sigT (Finite.sort I) (fun i : Finite.sort I => Finite.sort (T_ i)) : predArgType))))) (sumn (@map (Finite.sort I) nat (fun i : Finite.sort I => @card (T_ i) (@mem (Equality.sort (Finite.eqType (T_ i))) (predPredType (Equality.sort (Finite.eqType (T_ i)))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType (T_ i))) (pred_of_argType (Equality.sort (Finite.eqType (T_ 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)))))))) *) rewrite cardE !enumT {1}unlock size_flatten /shape -map_comp. (* Goal: @eq nat (sumn (@map (Finite.sort I) nat (@funcomp nat (list (Finite.sort tag_finType)) (Finite.sort I) tt (@size (Finite.sort tag_finType)) (fun i : Finite.sort I => @map (Finite.sort (T_ i)) (@sigT (Finite.sort I) (fun x : Finite.sort I => Finite.sort (T_ x))) (fun x : Finite.sort (T_ i) => @Tagged (Finite.sort I) i (fun x0 : Finite.sort I => Finite.sort (T_ x0)) x) (Finite.EnumDef.enum (T_ i)))) (Finite.EnumDef.enum I))) (sumn (@map (Finite.sort I) nat (fun i : Finite.sort I => @card (T_ i) (@mem (Equality.sort (Finite.eqType (T_ i))) (predPredType (Equality.sort (Finite.eqType (T_ i)))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType (T_ i))) (pred_of_argType (Equality.sort (Finite.eqType (T_ i))))))) (Finite.EnumDef.enum I))) *) by congr (sumn _); apply: eq_map => i; rewrite /= size_map -enumT -cardE. Qed. End TagFinType. Section SumFinType. Variables T1 T2 : finType. Definition sum_enum := [seq inl _ x | x <- enumF T1] ++ [seq inr _ y | y <- enumF T2]. Lemma sum_enum_uniq : uniq sum_enum. Proof. (* Goal: is_true (@uniq (sum_eqType (Finite.eqType T1) (Finite.eqType T2)) sum_enum) *) rewrite cat_uniq -!enumT !(enum_uniq, map_inj_uniq); try by move=> ? ? []. (* Goal: is_true (andb true (andb (negb (@has (Equality.sort (sum_eqType (Finite.eqType T1) (Finite.eqType T2))) (@pred_of_simpl (Equality.sort (sum_eqType (Finite.eqType T1) (Finite.eqType T2))) (@pred_of_mem_pred (Equality.sort (sum_eqType (Finite.eqType T1) (Finite.eqType T2))) (@mem (Equality.sort (sum_eqType (Finite.eqType T1) (Finite.eqType T2))) (seq_predType (sum_eqType (Finite.eqType T1) (Finite.eqType T2))) (@map (Finite.sort T1) (sum (Finite.sort T1) (Finite.sort T2)) (fun x : Finite.sort T1 => @inl (Finite.sort T1) (Finite.sort T2) x) (@enum_mem T1 (@mem (Equality.sort (Finite.eqType T1)) (predPredType (Equality.sort (Finite.eqType T1))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType T1)) (pred_of_argType (Equality.sort (Finite.eqType T1)))))))))) (@map (Finite.sort T2) (sum (Finite.sort T1) (Finite.sort T2)) (fun y : Finite.sort T2 => @inr (Finite.sort T1) (Finite.sort T2) y) (@enum_mem T2 (@mem (Equality.sort (Finite.eqType T2)) (predPredType (Equality.sort (Finite.eqType T2))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType T2)) (pred_of_argType (Equality.sort (Finite.eqType T2))))))))) true)) *) by rewrite andbT; apply/hasP=> [[_ /mapP[x _ ->] /mapP[]]]. Qed. Lemma mem_sum_enum u : u \in sum_enum. Proof. (* Goal: is_true (@in_mem (Equality.sort (sum_eqType (Finite.eqType T1) (Finite.eqType T2))) u (@mem (Equality.sort (sum_eqType (Finite.eqType T1) (Finite.eqType T2))) (seq_predType (sum_eqType (Finite.eqType T1) (Finite.eqType T2))) sum_enum)) *) by case: u => x; rewrite mem_cat -!enumT map_f ?mem_enum ?orbT. Qed. Definition sum_finMixin := Eval hnf in UniqFinMixin sum_enum_uniq mem_sum_enum. Canonical sum_finType := Eval hnf in FinType (T1 + T2) sum_finMixin. Lemma card_sum : #|{: T1 + T2}| = #|T1| + #|T2|. Proof. (* Goal: @eq nat (@card sum_finType (@mem (sum (Finite.sort T1) (Finite.sort T2)) (predPredType (sum (Finite.sort T1) (Finite.sort T2) : predArgType)) (@sort_of_simpl_pred (sum (Finite.sort T1) (Finite.sort T2) : predArgType) (pred_of_argType (sum (Finite.sort T1) (Finite.sort T2) : predArgType))))) (addn (@card T1 (@mem (Equality.sort (Finite.eqType T1)) (predPredType (Equality.sort (Finite.eqType T1))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType T1)) (pred_of_argType (Equality.sort (Finite.eqType T1)))))) (@card T2 (@mem (Equality.sort (Finite.eqType T2)) (predPredType (Equality.sort (Finite.eqType T2))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType T2)) (pred_of_argType (Equality.sort (Finite.eqType T2))))))) *) by rewrite !cardT !enumT {1}unlock size_cat !size_map. Qed. End SumFinType.
Require Export Linear_Structures. Require Export Factorization. Section Factorization_for_Verification. Variable A : Set. Variable BASE : BT. Let b := base BASE. Let Num := num BASE. Let Digit := digit BASE. Let Val_bound := val_bound BASE. Variable R : forall n : nat, A -> inf n -> inf n -> A -> Prop. Definition Connection := connection A Digit Digit (R b). Notation Factorizable := (factorizable _) (only parsing). Notation Proper := (proper _) (only parsing). Theorem factorization_for_verification : factorizable _ R -> proper _ BASE R -> forall (n : nat) (X Y : Num n) (a a' : A), Connection n a X Y a' -> R (exp b n) a (Val_bound n X) (Val_bound n Y) a'. Proof. (* Goal: forall (_ : factorizable A R) (_ : proper A BASE R) (n : nat) (X Y : Num n) (a a' : A) (_ : Connection n a X Y a'), R (exp b n) a (Val_bound n X) (Val_bound n Y) a' *) intros F P. (* Goal: forall (n : nat) (X Y : Num n) (a a' : A) (_ : Connection n a X Y a'), R (exp b n) a (Val_bound n X) (Val_bound n Y) a' *) simple induction 1. (* Goal: forall (n : nat) (a a1 a' : A) (b0 c : Digit) (lb lc : list Digit n) (_ : R b a b0 c a1) (_ : connection A Digit Digit (R b) n a1 lb lc a') (_ : R (exp b n) a1 (Val_bound n lb) (Val_bound n lc) a'), R (exp b (S n)) a (Val_bound (S n) (cons Digit n b0 lb)) (Val_bound (S n) (cons Digit n c lc)) a' *) (* Goal: forall a : A, R (exp b O) a (Val_bound O (nil Digit)) (Val_bound O (nil Digit)) a *) unfold proper in P; auto. (* Goal: forall (n : nat) (a a1 a' : A) (b0 c : Digit) (lb lc : list Digit n) (_ : R b a b0 c a1) (_ : connection A Digit Digit (R b) n a1 lb lc a') (_ : R (exp b n) a1 (Val_bound n lb) (Val_bound n lc) a'), R (exp b (S n)) a (Val_bound (S n) (cons Digit n b0 lb)) (Val_bound (S n) (cons Digit n c lc)) a' *) clear H X Y n a a'. (* Goal: forall (n : nat) (a a1 a' : A) (b0 c : Digit) (lb lc : list Digit n) (_ : R b a b0 c a1) (_ : connection A Digit Digit (R b) n a1 lb lc a') (_ : R (exp b n) a1 (Val_bound n lb) (Val_bound n lc) a'), R (exp b (S n)) a (Val_bound (S n) (cons Digit n b0 lb)) (Val_bound (S n) (cons Digit n c lc)) a' *) intros n a a1 a' d d' D D' H C H_rec. (* Goal: R (exp b (S n)) a (Val_bound (S n) (cons Digit n d D)) (Val_bound (S n) (cons Digit n d' D')) a' *) simpl in |- *. (* Goal: R (Init.Nat.mul b (exp b n)) a (Val_bound (S n) (cons Digit n d D)) (Val_bound (S n) (cons Digit n d' D')) a' *) apply F with d d' (Val_bound n D) (Val_bound n D') a1; try trivial; unfold Diveucl in |- *; split; simpl in |- *. (* Goal: lt (Val BASE n D') (exp (base BASE) n) *) (* Goal: @eq nat (Init.Nat.add (Init.Nat.mul (val BASE d') (exp (base BASE) n)) (Val BASE n D')) (Init.Nat.add (Init.Nat.mul (exp (base BASE) n) (val_inf (base BASE) d')) (Val BASE n D')) *) (* Goal: lt (Val BASE n D) (exp (base BASE) n) *) (* Goal: @eq nat (Init.Nat.add (Init.Nat.mul (val BASE d) (exp (base BASE) n)) (Val BASE n D)) (Init.Nat.add (Init.Nat.mul (exp (base BASE) n) (val_inf (base BASE) d)) (Val BASE n D)) *) elim (mult_comm (exp (base BASE) n) (val BASE d)); unfold val in |- *; unfold val_inf in |- *; auto. (* Goal: lt (Val BASE n D') (exp (base BASE) n) *) (* Goal: @eq nat (Init.Nat.add (Init.Nat.mul (val BASE d') (exp (base BASE) n)) (Val BASE n D')) (Init.Nat.add (Init.Nat.mul (exp (base BASE) n) (val_inf (base BASE) d')) (Val BASE n D')) *) (* Goal: lt (Val BASE n D) (exp (base BASE) n) *) unfold b in |- *; apply upper_bound. (* Goal: lt (Val BASE n D') (exp (base BASE) n) *) (* Goal: @eq nat (Init.Nat.add (Init.Nat.mul (val BASE d') (exp (base BASE) n)) (Val BASE n D')) (Init.Nat.add (Init.Nat.mul (exp (base BASE) n) (val_inf (base BASE) d')) (Val BASE n D')) *) elim (mult_comm (exp (base BASE) n) (val BASE d')); unfold val in |- *; unfold val_inf in |- *; auto. (* Goal: lt (Val BASE n D') (exp (base BASE) n) *) unfold b in |- *; apply upper_bound. Qed. End Factorization_for_Verification.
Require Export Bool. Require Export Arith. Require Export Compare_dec. Require Export Peano_dec. Require Export MyList. Require Export MyRelations. Set Implicit Arguments. Unset Strict Implicit. Definition max_nat (n m : nat) := match le_gt_dec n m with | left _ => m | right _ => n end. Lemma least_upper_bound_max_nat : forall n m p : nat, n <= p -> m <= p -> max_nat n m <= p. Proof. (* Goal: forall (n m p : nat) (_ : le n p) (_ : le m p), le (max_nat n m) p *) intros. (* Goal: le (max_nat n m) p *) unfold max_nat in |- *. (* Goal: le (if le_gt_dec n m then m else n) p *) elim (le_gt_dec n m); auto with arith. Qed. Require Export Relation_Definitions. Definition decide (P : Prop) := {P} + {~ P}. Hint Unfold decide: core. Inductive Acc3 (A B C : Set) (R : relation (A * (B * C))) : A -> B -> C -> Prop := Acc3_intro : forall (x : A) (x0 : B) (x1 : C), (forall (y : A) (y0 : B) (y1 : C), R (y, (y0, y1)) (x, (x0, x1)) -> Acc3 R y y0 y1) -> Acc3 R x x0 x1. Lemma Acc3_rec : forall (A B C : Set) (R : relation (A * (B * C))) (P : A -> B -> C -> Set), (forall (x : A) (x0 : B) (x1 : C), (forall (y : A) (y0 : B) (y1 : C), R (y, (y0, y1)) (x, (x0, x1)) -> P y y0 y1) -> P x x0 x1) -> forall (x : A) (x0 : B) (x1 : C), Acc3 R x x0 x1 -> P x x0 x1. Proof. (* Goal: forall (A B C : Set) (R : relation (prod A (prod B C))) (P : forall (_ : A) (_ : B) (_ : C), Set) (_ : forall (x : A) (x0 : B) (x1 : C) (_ : forall (y : A) (y0 : B) (y1 : C) (_ : R (@pair A (prod B C) y (@pair B C y0 y1)) (@pair A (prod B C) x (@pair B C x0 x1))), P y y0 y1), P x x0 x1) (x : A) (x0 : B) (x1 : C) (_ : @Acc3 A B C R x x0 x1), P x x0 x1 *) do 6 intro. (* Goal: forall (x : A) (x0 : B) (x1 : C) (_ : @Acc3 A B C R x x0 x1), P x x0 x1 *) fix F 4. (* Goal: forall (x : A) (x0 : B) (x1 : C) (_ : @Acc3 A B C R x x0 x1), P x x0 x1 *) intros. (* Goal: P x x0 x1 *) apply H; intros. (* Goal: P y y0 y1 *) apply F. (* Goal: @Acc3 A B C R y y0 y1 *) generalize H1. (* Goal: forall _ : R (@pair A (prod B C) y (@pair B C y0 y1)) (@pair A (prod B C) x (@pair B C x0 x1)), @Acc3 A B C R y y0 y1 *) case H0; intros. (* Goal: @Acc3 A B C R y y0 y1 *) apply H2. (* Goal: R (@pair A (prod B C) y (@pair B C y0 y1)) (@pair A (prod B C) x2 (@pair B C x3 x4)) *) exact H3. Qed. Lemma Acc_Acc3 : forall (A B C : Set) (R : relation (A * (B * C))) (x : A) (y : B) (z : C), Acc R (x, (y, z)) -> Acc3 R x y z. Proof. (* Goal: forall (A B C : Set) (R : relation (prod A (prod B C))) (x : A) (y : B) (z : C) (_ : @Acc (prod A (prod B C)) R (@pair A (prod B C) x (@pair B C y z))), @Acc3 A B C R x y z *) intros. (* Goal: @Acc3 A B C R x y z *) change ((fun p : A * (B * C) => match p with | (x2, (x3, x4)) => Acc3 R x2 x3 x4 end) (x, (y, z))) in |- *. (* Goal: (fun p : prod A (prod B C) => let (x2, p0) := p in let (x3, x4) := p0 in @Acc3 A B C R x2 x3 x4) (@pair A (prod B C) x (@pair B C y z)) *) elim H. (* Goal: forall (x : prod A (prod B C)) (_ : forall (y : prod A (prod B C)) (_ : R y x), @Acc (prod A (prod B C)) R y) (_ : forall (y : prod A (prod B C)) (_ : R y x), let (x2, p) := y in let (x3, x4) := p in @Acc3 A B C R x2 x3 x4), let (x2, p) := x in let (x3, x4) := p in @Acc3 A B C R x2 x3 x4 *) simple destruct x0. (* Goal: forall (a : A) (p : prod B C) (_ : forall (y : prod A (prod B C)) (_ : R y (@pair A (prod B C) a p)), @Acc (prod A (prod B C)) R y) (_ : forall (y : prod A (prod B C)) (_ : R y (@pair A (prod B C) a p)), let (x2, p0) := y in let (x3, x4) := p0 in @Acc3 A B C R x2 x3 x4), let (x3, x4) := p in @Acc3 A B C R a x3 x4 *) simple destruct p; intros. (* Goal: @Acc3 A B C R a b c *) apply Acc3_intro; intros. (* Goal: @Acc3 A B C R y0 y1 y2 *) apply (H1 (y0, (y1, y2))); auto. Qed. Section Principal. Variables (A : Set) (P : A -> Prop) (R : A -> A -> Prop). Record ppal (x : A) : Prop := Pp_intro {pp_ok : P x; pp_least : forall y : A, P y -> R x y}. Definition ppal_dec : Set := {x : A | ppal x} + {(forall x : A, ~ P x)}. End Principal.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrfun ssrbool eqtype ssrnat. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Delimit Scope seq_scope with SEQ. Open Scope seq_scope. Notation seq := list. Prenex Implicits cons. Notation Cons T := (@cons T) (only parsing). Notation Nil T := (@nil T) (only parsing). Bind Scope seq_scope with list. Arguments cons _%type _ _%SEQ. Infix "::" := cons : seq_scope. Notation "[ :: ]" := nil (at level 0, format "[ :: ]") : seq_scope. Notation "[ :: x1 ]" := (x1 :: [::]) (at level 0, format "[ :: x1 ]") : seq_scope. Notation "[ :: x & s ]" := (x :: s) (at level 0, only parsing) : seq_scope. Notation "[ :: x1 , x2 , .. , xn & s ]" := (x1 :: x2 :: .. (xn :: s) ..) (at level 0, format "'[hv' [ :: '[' x1 , '/' x2 , '/' .. , '/' xn ']' '/ ' & s ] ']'" ) : seq_scope. Notation "[ :: x1 ; x2 ; .. ; xn ]" := (x1 :: x2 :: .. [:: xn] ..) (at level 0, format "[ :: '[' x1 ; '/' x2 ; '/' .. ; '/' xn ']' ]" ) : seq_scope. Section Sequences. Variable n0 : nat. Variable T : Type. Variable x0 : T. Implicit Types x y z : T. Implicit Types m n : nat. Implicit Type s : seq T. Fixpoint size s := if s is _ :: s' then (size s').+1 else 0. Definition nilp s := size s == 0. Lemma nilP s : reflect (s = [::]) (nilp s). Proof. (* Goal: Bool.reflect (@eq (list T) s (@nil T)) (nilp s) *) by case: s => [|x s]; constructor. Qed. Definition ohead s := if s is x :: _ then Some x else None. Definition head s := if s is x :: _ then x else x0. Definition behead s := if s is _ :: s' then s' else [::]. Lemma size_behead s : size (behead s) = (size s).-1. Proof. (* Goal: @eq nat (size (behead s)) (Nat.pred (size s)) *) by case: s. Qed. Definition ncons n x := iter n (cons x). Definition nseq n x := ncons n x [::]. Lemma size_ncons n x s : size (ncons n x s) = n + size s. Proof. (* Goal: @eq nat (size (ncons n x s)) (addn n (size s)) *) by elim: n => //= n ->. Qed. Lemma size_nseq n x : size (nseq n x) = n. Proof. (* Goal: @eq nat (size (nseq n x)) n *) by rewrite size_ncons addn0. Qed. Fixpoint seqn_type n := if n is n'.+1 then T -> seqn_type n' else seq T. Fixpoint seqn_rec f n : seqn_type n := if n is n'.+1 return seqn_type n then fun x => seqn_rec (fun s => f (x :: s)) n' else f [::]. Definition seqn := seqn_rec id. Fixpoint cat s1 s2 := if s1 is x :: s1' then x :: s1' ++ s2 else s2 where "s1 ++ s2" := (cat s1 s2) : seq_scope. Lemma cat1s x s : [:: x] ++ s = x :: s. Proof. by []. Qed. Proof. (* Goal: @eq (list T) (cat (@cons T x (@nil T)) s) (@cons T x s) *) by []. Qed. Lemma cat_nseq n x s : nseq n x ++ s = ncons n x s. Proof. (* Goal: @eq (list T) (cat (nseq n x) s) (ncons n x s) *) by elim: n => //= n ->. Qed. Lemma cats0 s : s ++ [::] = s. Proof. (* Goal: @eq (list T) (cat s (@nil T)) s *) by elim: s => //= x s ->. Qed. Lemma catA s1 s2 s3 : s1 ++ s2 ++ s3 = (s1 ++ s2) ++ s3. Proof. (* Goal: @eq (list T) (cat s1 (cat s2 s3)) (cat (cat s1 s2) s3) *) by elim: s1 => //= x s1 ->. Qed. Lemma size_cat s1 s2 : size (s1 ++ s2) = size s1 + size s2. Proof. (* Goal: @eq nat (size (cat s1 s2)) (addn (size s1) (size s2)) *) by elim: s1 => //= x s1 ->. Qed. Fixpoint rcons s z := if s is x :: s' then x :: rcons s' z else [:: z]. Lemma rcons_cons x s z : rcons (x :: s) z = x :: rcons s z. Proof. (* Goal: @eq (list T) (rcons (@cons T x s) z) (@cons T x (rcons s z)) *) by []. Qed. Lemma cats1 s z : s ++ [:: z] = rcons s z. Proof. (* Goal: @eq (list T) (cat s (@cons T z (@nil T))) (rcons s z) *) by elim: s => //= x s ->. Qed. Fixpoint last x s := if s is x' :: s' then last x' s' else x. Fixpoint belast x s := if s is x' :: s' then x :: (belast x' s') else [::]. Lemma lastI x s : x :: s = rcons (belast x s) (last x s). Proof. (* Goal: @eq (list T) (@cons T x s) (rcons (belast x s) (last x s)) *) by elim: s x => [|y s IHs] x //=; rewrite IHs. Qed. Lemma last_cons x y s : last x (y :: s) = last y s. Proof. (* Goal: @eq T (last x (@cons T y s)) (last y s) *) by []. Qed. Lemma size_rcons s x : size (rcons s x) = (size s).+1. Proof. (* Goal: @eq nat (size (rcons s x)) (S (size s)) *) by rewrite -cats1 size_cat addnC. Qed. Lemma size_belast x s : size (belast x s) = size s. Proof. (* Goal: @eq nat (size (belast x s)) (size s) *) by elim: s x => [|y s IHs] x //=; rewrite IHs. Qed. Lemma last_cat x s1 s2 : last x (s1 ++ s2) = last (last x s1) s2. Proof. (* Goal: @eq T (last x (cat s1 s2)) (last (last x s1) s2) *) by elim: s1 x => [|y s1 IHs] x //=; rewrite IHs. Qed. Lemma last_rcons x s z : last x (rcons s z) = z. Proof. (* Goal: @eq T (last x (rcons s z)) z *) by rewrite -cats1 last_cat. Qed. Lemma belast_cat x s1 s2 : belast x (s1 ++ s2) = belast x s1 ++ belast (last x s1) s2. Proof. (* Goal: @eq (list T) (belast x (cat s1 s2)) (cat (belast x s1) (belast (last x s1) s2)) *) by elim: s1 x => [|y s1 IHs] x //=; rewrite IHs. Qed. Lemma belast_rcons x s z : belast x (rcons s z) = x :: s. Proof. (* Goal: @eq (list T) (belast x (rcons s z)) (@cons T x s) *) by rewrite lastI -!cats1 belast_cat. Qed. Lemma cat_rcons x s1 s2 : rcons s1 x ++ s2 = s1 ++ x :: s2. Proof. (* Goal: @eq (list T) (cat (rcons s1 x) s2) (cat s1 (@cons T x s2)) *) by rewrite -cats1 -catA. Qed. Lemma rcons_cat x s1 s2 : rcons (s1 ++ s2) x = s1 ++ rcons s2 x. Proof. (* Goal: @eq (list T) (rcons (cat s1 s2) x) (cat s1 (rcons s2 x)) *) by rewrite -!cats1 catA. Qed. Variant last_spec : seq T -> Type := | LastNil : last_spec [::] | LastRcons s x : last_spec (rcons s x). Lemma lastP s : last_spec s. Proof. (* Goal: last_spec s *) case: s => [|x s]; [left | rewrite lastI; right]. Qed. Lemma last_ind P : P [::] -> (forall s x, P s -> P (rcons s x)) -> forall s, P s. Proof. (* Goal: forall (_ : P (@nil T)) (_ : forall (s : list T) (x : T) (_ : P s), P (rcons s x)) (s : list T), P s *) move=> Hnil Hlast s; rewrite -(cat0s s). (* Goal: P (cat (@nil T) s) *) elim: s [::] Hnil => [|x s2 IHs] s1 Hs1; first by rewrite cats0. (* Goal: P (cat s1 (@cons T x s2)) *) by rewrite -cat_rcons; auto. Qed. Fixpoint nth s n {struct n} := if s is x :: s' then if n is n'.+1 then @nth s' n' else x else x0. Fixpoint set_nth s n y {struct n} := if s is x :: s' then if n is n'.+1 then x :: @set_nth s' n' y else y :: s' Lemma nth_default s n : size s <= n -> nth s n = x0. Proof. (* Goal: forall _ : is_true (leq (size s) n), @eq T (nth s n) x0 *) by elim: s n => [|x s IHs] []. Qed. Lemma nth_nil n : nth [::] n = x0. Proof. (* Goal: @eq T (nth (@nil T) n) x0 *) by case: n. Qed. Lemma last_nth x s : last x s = nth (x :: s) (size s). Proof. (* Goal: @eq T (last x s) (nth (@cons T x s) (size s)) *) by elim: s x => [|y s IHs] x /=. Qed. Lemma nth_last s : nth s (size s).-1 = last x0 s. Proof. (* Goal: @eq T (nth s (Nat.pred (size s))) (last x0 s) *) by case: s => //= x s; rewrite last_nth. Qed. Lemma nth_behead s n : nth (behead s) n = nth s n.+1. Proof. (* Goal: @eq T (nth (behead s) n) (nth s (S n)) *) by case: s n => [|x s] [|n]. Qed. Lemma nth_cat s1 s2 n : nth (s1 ++ s2) n = if n < size s1 then nth s1 n else nth s2 (n - size s1). Proof. (* Goal: @eq T (nth (cat s1 s2) n) (if leq (S n) (size s1) then nth s1 n else nth s2 (subn n (size s1))) *) by elim: s1 n => [|x s1 IHs] []. Qed. Lemma nth_rcons s x n : nth (rcons s x) n = if n < size s then nth s n else if n == size s then x else x0. Proof. (* Goal: @eq T (nth (rcons s x) n) (if leq (S n) (size s) then nth s n else if @eq_op nat_eqType n (size s) then x else x0) *) by elim: s n => [|y s IHs] [] //=; apply: nth_nil. Qed. Lemma nth_ncons m x s n : nth (ncons m x s) n = if n < m then x else nth s (n - m). Proof. (* Goal: @eq T (nth (ncons m x s) n) (if leq (S n) m then x else nth s (subn n m)) *) by elim: m n => [|m IHm] []. Qed. Lemma nth_nseq m x n : nth (nseq m x) n = (if n < m then x else x0). Proof. (* Goal: @eq T (nth (nseq m x) n) (if leq (S n) m then x else x0) *) by elim: m n => [|m IHm] []. Qed. Lemma eq_from_nth s1 s2 : size s1 = size s2 -> (forall i, i < size s1 -> nth s1 i = nth s2 i) -> s1 = s2. Proof. (* Goal: forall (_ : @eq nat (size s1) (size s2)) (_ : forall (i : nat) (_ : is_true (leq (S i) (size s1))), @eq T (nth s1 i) (nth s2 i)), @eq (list T) s1 s2 *) elim: s1 s2 => [|x1 s1 IHs1] [|x2 s2] //= [eq_sz] eq_s12. (* Goal: @eq (list T) (@cons T x1 s1) (@cons T x2 s2) *) by rewrite [x1](eq_s12 0) // (IHs1 s2) // => i; apply: (eq_s12 i.+1). Qed. Lemma size_set_nth s n y : size (set_nth s n y) = maxn n.+1 (size s). Proof. (* Goal: @eq nat (size (set_nth s n y)) (maxn (S n) (size s)) *) elim: s n => [|x s IHs] [|n] //=. (* Goal: @eq nat (S (size (set_nth s n y))) (maxn (S (S n)) (S (size s))) *) (* Goal: @eq nat (S (size s)) (maxn (S O) (S (size s))) *) (* Goal: @eq nat (S (size (ncons n x0 (@cons T y (@nil T))))) (maxn (S (S n)) O) *) - (* Goal: @eq nat (S (size (set_nth s n y))) (maxn (S (S n)) (S (size s))) *) (* Goal: @eq nat (S (size s)) (maxn (S O) (S (size s))) *) (* Goal: @eq nat (S (size (ncons n x0 (@cons T y (@nil T))))) (maxn (S (S n)) O) *) by rewrite size_ncons addn1 maxn0. (* Goal: @eq nat (S (size (set_nth s n y))) (maxn (S (S n)) (S (size s))) *) (* Goal: @eq nat (S (size s)) (maxn (S O) (S (size s))) *) - (* Goal: @eq nat (S (size (set_nth s n y))) (maxn (S (S n)) (S (size s))) *) (* Goal: @eq nat (S (size s)) (maxn (S O) (S (size s))) *) by rewrite maxnE subn1. (* Goal: @eq nat (S (size (set_nth s n y))) (maxn (S (S n)) (S (size s))) *) by rewrite IHs -add1n addn_maxr. Qed. Lemma set_nth_nil n y : set_nth [::] n y = ncons n x0 [:: y]. Proof. (* Goal: @eq (list T) (set_nth (@nil T) n y) (ncons n x0 (@cons T y (@nil T))) *) by case: n. Qed. Lemma nth_set_nth s n y : nth (set_nth s n y) =1 [eta nth s with n |-> y]. Proof. (* Goal: @eqfun T nat (nth (set_nth s n y)) (@fun_of_simpl (Equality.sort nat_eqType) T (@SimplFunDelta (Equality.sort nat_eqType) T (fun _ : Equality.sort nat_eqType => @app_fdelta nat_eqType T (@FunDelta nat_eqType T n y) (nth s)))) *) elim: s n => [|x s IHs] [|n] [|m] //=; rewrite ?nth_nil ?IHs // nth_ncons eqSS. (* Goal: @eq T (if leq (S m) n then x0 else nth (@cons T y (@nil T)) (subn m n)) (if @eq_op nat_eqType m n then y else x0) *) case: ltngtP => // [lt_nm | ->]; last by rewrite subnn. (* Goal: @eq T (nth (@cons T y (@nil T)) (subn m n)) x0 *) by rewrite nth_default // subn_gt0. Qed. Lemma set_set_nth s n1 y1 n2 y2 (s2 := set_nth s n2 y2) : set_nth (set_nth s n1 y1) n2 y2 = if n1 == n2 then s2 else set_nth s2 n1 y1. Proof. (* Goal: @eq (list T) (set_nth (set_nth s n1 y1) n2 y2) (if @eq_op nat_eqType n1 n2 then s2 else set_nth s2 n1 y1) *) have [-> | ne_n12] := altP eqP. (* Goal: @eq (list T) (set_nth (set_nth s n1 y1) n2 y2) (set_nth s2 n1 y1) *) (* Goal: @eq (list T) (set_nth (set_nth s n2 y1) n2 y2) s2 *) apply: eq_from_nth => [|i _]; first by rewrite !size_set_nth maxnA maxnn. (* Goal: @eq (list T) (set_nth (set_nth s n1 y1) n2 y2) (set_nth s2 n1 y1) *) (* Goal: @eq T (nth (set_nth (set_nth s n2 y1) n2 y2) i) (nth s2 i) *) by do 2!rewrite !nth_set_nth /=; case: eqP. (* Goal: @eq (list T) (set_nth (set_nth s n1 y1) n2 y2) (set_nth s2 n1 y1) *) apply: eq_from_nth => [|i _]; first by rewrite !size_set_nth maxnCA. (* Goal: @eq T (nth (set_nth (set_nth s n1 y1) n2 y2) i) (nth (set_nth s2 n1 y1) i) *) do 2!rewrite !nth_set_nth /=; case: eqP => // ->. (* Goal: @eq T y2 (if @eq_op nat_eqType n2 n1 then y1 else y2) *) by rewrite eq_sym -if_neg ne_n12. Qed. Section SeqFind. Variable a : pred T. Fixpoint find s := if s is x :: s' then if a x then 0 else (find s').+1 else 0. Fixpoint filter s := if s is x :: s' then if a x then x :: filter s' else filter s' else [::]. Fixpoint count s := if s is x :: s' then a x + count s' else 0. Fixpoint has s := if s is x :: s' then a x || has s' else false. Fixpoint all s := if s is x :: s' then a x && all s' else true. Lemma size_filter s : size (filter s) = count s. Proof. (* Goal: @eq nat (size (filter s)) (count s) *) by elim: s => //= x s <-; case (a x). Qed. Lemma has_count s : has s = (0 < count s). Proof. (* Goal: @eq bool (has s) (leq (S O) (count s)) *) by elim: s => //= x s ->; case (a x). Qed. Lemma count_size s : count s <= size s. Proof. (* Goal: is_true (leq (count s) (size s)) *) by elim: s => //= x s; case: (a x); last apply: leqW. Qed. Lemma all_count s : all s = (count s == size s). Proof. (* Goal: @eq bool (all s) (@eq_op nat_eqType (count s) (size s)) *) elim: s => //= x s; case: (a x) => _ //=. (* Goal: @eq bool false (@eq_op nat_eqType (addn O (count s)) (S (size s))) *) by rewrite add0n eqn_leq andbC ltnNge count_size. Qed. Lemma filter_all s : all (filter s). Proof. (* Goal: is_true (all (filter s)) *) by elim: s => //= x s IHs; case: ifP => //= ->. Qed. Lemma all_filterP s : reflect (filter s = s) (all s). Lemma filter_id s : filter (filter s) = filter s. Proof. (* Goal: @eq (list T) (filter (filter s)) (filter s) *) by apply/all_filterP; apply: filter_all. Qed. Lemma has_find s : has s = (find s < size s). Proof. (* Goal: @eq bool (has s) (leq (S (find s)) (size s)) *) by elim: s => //= x s IHs; case (a x); rewrite ?leqnn. Qed. Lemma find_size s : find s <= size s. Proof. (* Goal: is_true (leq (find s) (size s)) *) by elim: s => //= x s IHs; case (a x). Qed. Lemma find_cat s1 s2 : find (s1 ++ s2) = if has s1 then find s1 else size s1 + find s2. Proof. (* Goal: @eq nat (find (cat s1 s2)) (if has s1 then find s1 else addn (size s1) (find s2)) *) by elim: s1 => //= x s1 IHs; case: (a x) => //; rewrite IHs (fun_if succn). Qed. Lemma has_seq1 x : has [:: x] = a x. Proof. (* Goal: @eq bool (has (@cons T x (@nil T))) (a x) *) exact: orbF. Qed. Lemma has_nseq n x : has (nseq n x) = (0 < n) && a x. Proof. (* Goal: @eq bool (has (nseq n x)) (andb (leq (S O) n) (a x)) *) by elim: n => //= n ->; apply: andKb. Qed. Lemma has_seqb (b : bool) x : has (nseq b x) = b && a x. Proof. (* Goal: @eq bool (has (nseq (nat_of_bool b) x)) (andb b (a x)) *) by rewrite has_nseq lt0b. Qed. Lemma all_seq1 x : all [:: x] = a x. Proof. (* Goal: @eq bool (all (@cons T x (@nil T))) (a x) *) exact: andbT. Qed. Lemma all_nseq n x : all (nseq n x) = (n == 0) || a x. Proof. (* Goal: @eq bool (all (nseq n x)) (orb (@eq_op nat_eqType n O) (a x)) *) by elim: n => //= n ->; apply: orKb. Qed. Lemma all_nseqb (b : bool) x : all (nseq b x) = b ==> a x. Proof. (* Goal: @eq bool (all (nseq (nat_of_bool b) x)) (implb b (a x)) *) by rewrite all_nseq eqb0 implybE. Qed. Lemma find_nseq n x : find (nseq n x) = ~~ a x * n. Proof. (* Goal: @eq nat (find (nseq n x)) (muln (nat_of_bool (negb (a x))) n) *) by elim: n => //= n ->; case: (a x). Qed. Lemma nth_find s : has s -> a (nth s (find s)). Proof. (* Goal: forall _ : is_true (has s), is_true (a (nth s (find s))) *) by elim: s => //= x s IHs; case Hx: (a x). Qed. Lemma before_find s i : i < find s -> a (nth s i) = false. Proof. (* Goal: forall _ : is_true (leq (S i) (find s)), @eq bool (a (nth s i)) false *) by elim: s i => //= x s IHs; case Hx: (a x) => [|] // [|i] //; apply: (IHs i). Qed. Lemma filter_cat s1 s2 : filter (s1 ++ s2) = filter s1 ++ filter s2. Proof. (* Goal: @eq (list T) (filter (cat s1 s2)) (cat (filter s1) (filter s2)) *) by elim: s1 => //= x s1 ->; case (a x). Qed. Lemma filter_rcons s x : filter (rcons s x) = if a x then rcons (filter s) x else filter s. Proof. (* Goal: @eq (list T) (filter (rcons s x)) (if a x then rcons (filter s) x else filter s) *) by rewrite -!cats1 filter_cat /=; case (a x); rewrite /= ?cats0. Qed. Lemma count_cat s1 s2 : count (s1 ++ s2) = count s1 + count s2. Proof. (* Goal: @eq nat (count (cat s1 s2)) (addn (count s1) (count s2)) *) by rewrite -!size_filter filter_cat size_cat. Qed. Lemma has_cat s1 s2 : has (s1 ++ s2) = has s1 || has s2. Proof. (* Goal: @eq bool (has (cat s1 s2)) (orb (has s1) (has s2)) *) by elim: s1 => [|x s1 IHs] //=; rewrite IHs orbA. Qed. Lemma has_rcons s x : has (rcons s x) = a x || has s. Proof. (* Goal: @eq bool (has (rcons s x)) (orb (a x) (has s)) *) by rewrite -cats1 has_cat has_seq1 orbC. Qed. Lemma all_cat s1 s2 : all (s1 ++ s2) = all s1 && all s2. Proof. (* Goal: @eq bool (all (cat s1 s2)) (andb (all s1) (all s2)) *) by elim: s1 => [|x s1 IHs] //=; rewrite IHs andbA. Qed. Lemma all_rcons s x : all (rcons s x) = a x && all s. Proof. (* Goal: @eq bool (all (rcons s x)) (andb (a x) (all s)) *) by rewrite -cats1 all_cat all_seq1 andbC. Qed. End SeqFind. Lemma eq_find a1 a2 : a1 =1 a2 -> find a1 =1 find a2. Proof. (* Goal: forall _ : @eqfun bool T a1 a2, @eqfun nat (list T) (find a1) (find a2) *) by move=> Ea; elim=> //= x s IHs; rewrite Ea IHs. Qed. Lemma eq_filter a1 a2 : a1 =1 a2 -> filter a1 =1 filter a2. Proof. (* Goal: forall _ : @eqfun bool T a1 a2, @eqfun (list T) (list T) (filter a1) (filter a2) *) by move=> Ea; elim=> //= x s IHs; rewrite Ea IHs. Qed. Lemma eq_count a1 a2 : a1 =1 a2 -> count a1 =1 count a2. Proof. (* Goal: forall _ : @eqfun bool T a1 a2, @eqfun nat (list T) (count a1) (count a2) *) by move=> Ea s; rewrite -!size_filter (eq_filter Ea). Qed. Lemma eq_has a1 a2 : a1 =1 a2 -> has a1 =1 has a2. Proof. (* Goal: forall _ : @eqfun bool T a1 a2, @eqfun bool (list T) (has a1) (has a2) *) by move=> Ea s; rewrite !has_count (eq_count Ea). Qed. Lemma eq_all a1 a2 : a1 =1 a2 -> all a1 =1 all a2. Proof. (* Goal: forall _ : @eqfun bool T a1 a2, @eqfun bool (list T) (all a1) (all a2) *) by move=> Ea s; rewrite !all_count (eq_count Ea). Qed. Section SubPred. Variable (a1 a2 : pred T). Hypothesis s12 : subpred a1 a2. Lemma sub_find s : find a2 s <= find a1 s. Proof. (* Goal: is_true (leq (find a2 s) (find a1 s)) *) by elim: s => //= x s IHs; case: ifP => // /(contraFF (@s12 x))->. Qed. Lemma sub_has s : has a1 s -> has a2 s. Proof. (* Goal: forall _ : is_true (has a1 s), is_true (has a2 s) *) by rewrite !has_find; apply: leq_ltn_trans (sub_find s). Qed. Lemma sub_count s : count a1 s <= count a2 s. Proof. (* Goal: is_true (leq (count a1 s) (count a2 s)) *) by elim: s => //= x s; apply: leq_add; case a1x: (a1 x); rewrite // s12. Qed. Lemma sub_all s : all a1 s -> all a2 s. Proof. (* Goal: forall _ : is_true (all a1 s), is_true (all a2 s) *) by rewrite !all_count !eqn_leq !count_size => /leq_trans-> //; apply: sub_count. Qed. Lemma filter_predT s : filter predT s = s. Proof. (* Goal: @eq (list T) (filter (@pred_of_simpl T (@predT T)) s) s *) by elim: s => //= x s ->. Qed. Lemma filter_predI a1 a2 s : filter (predI a1 a2) s = filter a1 (filter a2 s). Proof. (* Goal: @eq (list T) (filter (@pred_of_simpl T (@predI T a1 a2)) s) (filter a1 (filter a2 s)) *) elim: s => //= x s IHs; rewrite andbC IHs. (* Goal: @eq (list T) (if andb (a2 x) (a1 x) then @cons T x (filter a1 (filter a2 s)) else filter a1 (filter a2 s)) (filter a1 (if a2 x then @cons T x (filter a2 s) else filter a2 s)) *) by case: (a2 x) => //=; case (a1 x). Qed. Lemma count_pred0 s : count pred0 s = 0. Proof. (* Goal: @eq nat (count (@pred_of_simpl T (@pred0 T)) s) O *) by rewrite -size_filter filter_pred0. Qed. Lemma count_predT s : count predT s = size s. Proof. (* Goal: @eq nat (count (@pred_of_simpl T (@predT T)) s) (size s) *) by rewrite -size_filter filter_predT. Qed. Lemma count_predUI a1 a2 s : count (predU a1 a2) s + count (predI a1 a2) s = count a1 s + count a2 s. Proof. (* Goal: @eq nat (addn (count (@pred_of_simpl T (@predU T a1 a2)) s) (count (@pred_of_simpl T (@predI T a1 a2)) s)) (addn (count a1 s) (count a2 s)) *) elim: s => //= x s IHs; rewrite /= addnCA -addnA IHs addnA addnC. (* Goal: @eq nat (addn (addn (count a1 s) (count a2 s)) (addn (nat_of_bool (andb (a1 x) (a2 x))) (nat_of_bool (orb (a1 x) (a2 x))))) (addn (addn (nat_of_bool (a1 x)) (count a1 s)) (addn (nat_of_bool (a2 x)) (count a2 s))) *) by rewrite -!addnA; do 2 nat_congr; case (a1 x); case (a2 x). Qed. Lemma count_predC a s : count a s + count (predC a) s = size s. Proof. (* Goal: @eq nat (addn (count a s) (count (@pred_of_simpl T (@predC T a)) s)) (size s) *) by elim: s => //= x s IHs; rewrite addnCA -addnA IHs addnA addn_negb. Qed. Lemma count_filter a1 a2 s : count a1 (filter a2 s) = count (predI a1 a2) s. Proof. (* Goal: @eq nat (count a1 (filter a2 s)) (count (@pred_of_simpl T (@predI T a1 a2)) s) *) by rewrite -!size_filter filter_predI. Qed. Lemma has_pred0 s : has pred0 s = false. Proof. (* Goal: @eq bool (has (@pred_of_simpl T (@pred0 T)) s) false *) by rewrite has_count count_pred0. Qed. Lemma has_predT s : has predT s = (0 < size s). Proof. (* Goal: @eq bool (has (@pred_of_simpl T (@predT T)) s) (leq (S O) (size s)) *) by rewrite has_count count_predT. Qed. Lemma has_predC a s : has (predC a) s = ~~ all a s. Proof. (* Goal: @eq bool (has (@pred_of_simpl T (@predC T a)) s) (negb (all a s)) *) by elim: s => //= x s ->; case (a x). Qed. Lemma has_predU a1 a2 s : has (predU a1 a2) s = has a1 s || has a2 s. Proof. (* Goal: @eq bool (has (@pred_of_simpl T (@predU T a1 a2)) s) (orb (has a1 s) (has a2 s)) *) by elim: s => //= x s ->; rewrite -!orbA; do !bool_congr. Qed. Lemma all_pred0 s : all pred0 s = (size s == 0). Proof. (* Goal: @eq bool (all (@pred_of_simpl T (@pred0 T)) s) (@eq_op nat_eqType (size s) O) *) by rewrite all_count count_pred0 eq_sym. Qed. Lemma all_predT s : all predT s. Proof. (* Goal: is_true (all (@pred_of_simpl T (@predT T)) s) *) by rewrite all_count count_predT. Qed. Lemma all_predC a s : all (predC a) s = ~~ has a s. Proof. (* Goal: @eq bool (all (@pred_of_simpl T (@predC T a)) s) (negb (has a s)) *) by elim: s => //= x s ->; case (a x). Qed. Lemma all_predI a1 a2 s : all (predI a1 a2) s = all a1 s && all a2 s. Proof. (* Goal: @eq bool (all (@pred_of_simpl T (@predI T a1 a2)) s) (andb (all a1 s) (all a2 s)) *) apply: (can_inj negbK); rewrite negb_and -!has_predC -has_predU. (* Goal: @eq bool (has (@pred_of_simpl T (@predC T (@pred_of_simpl T (@predI T a1 a2)))) s) (has (@pred_of_simpl T (@predU T (@pred_of_simpl T (@predC T a1)) (@pred_of_simpl T (@predC T a2)))) s) *) by apply: eq_has => x; rewrite /= negb_and. Qed. Fixpoint drop n s {struct s} := match s, n with | _ :: s', n'.+1 => drop n' s' | _, _ => s end. Lemma drop_behead : drop n0 =1 iter n0 behead. Proof. (* Goal: @eqfun (list T) (list T) (drop n0) (@iter (list T) n0 behead) *) by elim: n0 => [|n IHn] [|x s] //; rewrite iterSr -IHn. Qed. Lemma drop0 s : drop 0 s = s. Proof. by case: s. Qed. Proof. (* Goal: @eq (list T) (drop O s) s *) by case: s. Qed. Lemma drop_oversize n s : size s <= n -> drop n s = [::]. Proof. (* Goal: forall _ : is_true (leq (size s) n), @eq (list T) (drop n s) (@nil T) *) by elim: s n => [|x s IHs] []. Qed. Lemma drop_size s : drop (size s) s = [::]. Proof. (* Goal: @eq (list T) (drop (size s) s) (@nil T) *) by rewrite drop_oversize // leqnn. Qed. Lemma drop_cons x s : drop n0 (x :: s) = if n0 is n.+1 then drop n s else x :: s. Proof. (* Goal: @eq (list T) (drop n0 (@cons T x s)) match n0 with | O => @cons T x s | S n => drop n s end *) by []. Qed. Lemma size_drop s : size (drop n0 s) = size s - n0. Proof. (* Goal: @eq nat (size (drop n0 s)) (subn (size s) n0) *) by elim: s n0 => [|x s IHs] []. Qed. Lemma drop_cat s1 s2 : drop n0 (s1 ++ s2) = if n0 < size s1 then drop n0 s1 ++ s2 else drop (n0 - size s1) s2. Proof. (* Goal: @eq (list T) (drop n0 (cat s1 s2)) (if leq (S n0) (size s1) then cat (drop n0 s1) s2 else drop (subn n0 (size s1)) s2) *) by elim: s1 n0 => [|x s1 IHs] []. Qed. Lemma drop_size_cat n s1 s2 : size s1 = n -> drop n (s1 ++ s2) = s2. Proof. (* Goal: forall _ : @eq nat (size s1) n, @eq (list T) (drop n (cat s1 s2)) s2 *) by move <-; elim: s1 => //=; rewrite drop0. Qed. Lemma nconsK n x : cancel (ncons n x) (drop n). Proof. (* Goal: @cancel (list T) (list T) (ncons n x) (drop n) *) by elim: n => // -[]. Qed. Lemma drop_drop s n1 n2 : drop n1 (drop n2 s) = drop (n1 + n2) s. Proof. (* Goal: @eq (list T) (drop n1 (drop n2 s)) (drop (addn n1 n2) s) *) by elim: n2 s => [s|n2 IHn1 [|x s]]; rewrite ?drop0 ?addn0 ?addnS /=. Qed. Fixpoint take n s {struct s} := match s, n with | x :: s', n'.+1 => x :: take n' s' Lemma take_oversize n s : size s <= n -> take n s = s. Proof. (* Goal: forall _ : is_true (leq (size s) n), @eq (list T) (take n s) s *) by elim: s n => [|x s IHs] [|n] //= /IHs->. Qed. Lemma take_size s : take (size s) s = s. Proof. (* Goal: @eq (list T) (take (size s) s) s *) by rewrite take_oversize // leqnn. Qed. Lemma take_cons x s : take n0 (x :: s) = if n0 is n.+1 then x :: (take n s) else [::]. Lemma drop_rcons s : n0 <= size s -> forall x, drop n0 (rcons s x) = rcons (drop n0 s) x. Proof. (* Goal: forall (_ : is_true (leq n0 (size s))) (x : T), @eq (list T) (drop n0 (rcons s x)) (rcons (drop n0 s) x) *) by elim: s n0 => [|y s IHs] []. Qed. Lemma cat_take_drop s : take n0 s ++ drop n0 s = s. Proof. (* Goal: @eq (list T) (cat (take n0 s) (drop n0 s)) s *) by elim: s n0 => [|x s IHs] [|n] //=; rewrite IHs. Qed. Lemma size_takel s : n0 <= size s -> size (take n0 s) = n0. Proof. (* Goal: forall _ : is_true (leq n0 (size s)), @eq nat (size (take n0 s)) n0 *) by move/subKn; rewrite -size_drop -[in size s](cat_take_drop s) size_cat addnK. Qed. Lemma size_take s : size (take n0 s) = if n0 < size s then n0 else size s. Proof. (* Goal: @eq nat (size (take n0 s)) (if leq (S n0) (size s) then n0 else size s) *) have [le_sn | lt_ns] := leqP (size s) n0; first by rewrite take_oversize. (* Goal: @eq nat (size (take n0 s)) n0 *) by rewrite size_takel // ltnW. Qed. Lemma take_cat s1 s2 : take n0 (s1 ++ s2) = if n0 < size s1 then take n0 s1 else s1 ++ take (n0 - size s1) s2. Proof. (* Goal: @eq (list T) (take n0 (cat s1 s2)) (if leq (S n0) (size s1) then take n0 s1 else cat s1 (take (subn n0 (size s1)) s2)) *) elim: s1 n0 => [|x s1 IHs] [|n] //=. (* Goal: @eq (list T) (@cons T x (take n (cat s1 s2))) (if leq (S (S n)) (S (size s1)) then @cons T x (take n s1) else @cons T x (cat s1 (take (subn (S n) (S (size s1))) s2))) *) by rewrite ltnS subSS -(fun_if (cons x)) -IHs. Qed. Lemma take_size_cat n s1 s2 : size s1 = n -> take n (s1 ++ s2) = s1. Proof. (* Goal: forall _ : @eq nat (size s1) n, @eq (list T) (take n (cat s1 s2)) s1 *) by move <-; elim: s1 => [|x s1 IHs]; rewrite ?take0 //= IHs. Qed. Lemma takel_cat s1 : n0 <= size s1 -> forall s2, take n0 (s1 ++ s2) = take n0 s1. Proof. (* Goal: forall (_ : is_true (leq n0 (size s1))) (s2 : list T), @eq (list T) (take n0 (cat s1 s2)) (take n0 s1) *) move=> Hn0 s2; rewrite take_cat ltn_neqAle Hn0 andbT. (* Goal: @eq (list T) (if negb (@eq_op nat_eqType n0 (size s1)) then take n0 s1 else cat s1 (take (subn n0 (size s1)) s2)) (take n0 s1) *) by case: (n0 =P size s1) => //= ->; rewrite subnn take0 cats0 take_size. Qed. Lemma nth_drop s i : nth (drop n0 s) i = nth s (n0 + i). Proof. (* Goal: @eq T (nth (drop n0 s) i) (nth s (addn n0 i)) *) have [lt_n0_s | le_s_n0] := ltnP n0 (size s). (* Goal: @eq T (nth (drop n0 s) i) (nth s (addn n0 i)) *) (* Goal: @eq T (nth (drop n0 s) i) (nth s (addn n0 i)) *) rewrite -{2}[s]cat_take_drop nth_cat size_take lt_n0_s /= addKn. (* Goal: @eq T (nth (drop n0 s) i) (nth s (addn n0 i)) *) (* Goal: @eq T (nth (drop n0 s) i) (if leq (S (addn n0 i)) n0 then nth (take n0 s) (addn n0 i) else nth (drop n0 s) i) *) by rewrite ltnNge leq_addr. (* Goal: @eq T (nth (drop n0 s) i) (nth s (addn n0 i)) *) rewrite !nth_default //; first exact: leq_trans (leq_addr _ _). (* Goal: is_true (leq (size (drop n0 s)) i) *) by rewrite size_drop (eqnP le_s_n0). Qed. Lemma nth_take i : i < n0 -> forall s, nth (take n0 s) i = nth s i. Proof. (* Goal: forall (_ : is_true (leq (S i) n0)) (s : list T), @eq T (nth (take n0 s) i) (nth s i) *) move=> lt_i_n0 s; case lt_n0_s: (n0 < size s). (* Goal: @eq T (nth (take n0 s) i) (nth s i) *) (* Goal: @eq T (nth (take n0 s) i) (nth s i) *) by rewrite -{2}[s]cat_take_drop nth_cat size_take lt_n0_s /= lt_i_n0. (* Goal: @eq T (nth (take n0 s) i) (nth s i) *) by rewrite -{1}[s]cats0 take_cat lt_n0_s /= cats0. Qed. Lemma drop_nth n s : n < size s -> drop n s = nth s n :: drop n.+1 s. Proof. (* Goal: forall _ : is_true (leq (S n) (size s)), @eq (list T) (drop n s) (@cons T (nth s n) (drop (S n) s)) *) by elim: s n => [|x s IHs] [|n] Hn //=; rewrite ?drop0 1?IHs. Qed. Lemma take_nth n s : n < size s -> take n.+1 s = rcons (take n s) (nth s n). Proof. (* Goal: forall _ : is_true (leq (S n) (size s)), @eq (list T) (take (S n) s) (rcons (take n s) (nth s n)) *) by elim: s n => [|x s IHs] //= [|n] Hn /=; rewrite ?take0 -?IHs. Qed. Definition rot n s := drop n s ++ take n s. Lemma rot0 s : rot 0 s = s. Proof. (* Goal: @eq (list T) (rot O s) s *) by rewrite /rot drop0 take0 cats0. Qed. Lemma size_rot s : size (rot n0 s) = size s. Proof. (* Goal: @eq nat (size (rot n0 s)) (size s) *) by rewrite -{2}[s]cat_take_drop /rot !size_cat addnC. Qed. Lemma rot_oversize n s : size s <= n -> rot n s = s. Proof. (* Goal: forall _ : is_true (leq (size s) n), @eq (list T) (rot n s) s *) by move=> le_s_n; rewrite /rot take_oversize ?drop_oversize. Qed. Lemma rot_size s : rot (size s) s = s. Proof. (* Goal: @eq (list T) (rot (size s) s) s *) exact: rot_oversize. Qed. Lemma has_rot s a : has a (rot n0 s) = has a s. Proof. (* Goal: @eq bool (has a (rot n0 s)) (has a s) *) by rewrite has_cat orbC -has_cat cat_take_drop. Qed. Lemma rot_size_cat s1 s2 : rot (size s1) (s1 ++ s2) = s2 ++ s1. Proof. (* Goal: @eq (list T) (rot (size s1) (cat s1 s2)) (cat s2 s1) *) by rewrite /rot take_size_cat ?drop_size_cat. Qed. Definition rotr n s := rot (size s - n) s. Lemma rotK : cancel (rot n0) (rotr n0). Proof. (* Goal: @cancel (list T) (list T) (rot n0) (rotr n0) *) move=> s; rewrite /rotr size_rot -size_drop {2}/rot. (* Goal: @eq (list T) (rot (size (drop n0 s)) (cat (drop n0 s) (take n0 s))) s *) by rewrite rot_size_cat cat_take_drop. Qed. Lemma rot1_cons x s : rot 1 (x :: s) = rcons s x. Proof. (* Goal: @eq (list T) (rot (S O) (@cons T x s)) (rcons s x) *) by rewrite /rot /= take0 drop0 -cats1. Qed. Fixpoint catrev s1 s2 := if s1 is x :: s1' then catrev s1' (x :: s2) else s2. End Sequences. Definition rev T (s : seq T) := nosimpl (catrev s [::]). Arguments nilP {T s}. Arguments all_filterP {T a s}. Prenex Implicits size head ohead behead last rcons belast. Prenex Implicits cat take drop rev rot rotr. Prenex Implicits find count nth all has filter. Notation count_mem x := (count (pred_of_simpl (pred1 x))). Infix "++" := cat : seq_scope. Notation "[ 'seq' x <- s | C ]" := (filter (fun x => C%B) s) (at level 0, x at level 99, format "[ '[hv' 'seq' x <- s '/ ' | C ] ']'") : seq_scope. Notation "[ 'seq' x <- s | C1 & C2 ]" := [seq x <- s | C1 && C2] (at level 0, x at level 99, format "[ '[hv' 'seq' x <- s '/ ' | C1 '/ ' & C2 ] ']'") : seq_scope. Notation "[ 'seq' x : T <- s | C ]" := (filter (fun x : T => C%B) s) (at level 0, x at level 99, only parsing). Notation "[ 'seq' x : T <- s | C1 & C2 ]" := [seq x : T <- s | C1 && C2] (at level 0, x at level 99, only parsing). Lemma seq2_ind T1 T2 (P : seq T1 -> seq T2 -> Type) : P [::] [::] -> (forall x1 x2 s1 s2, P s1 s2 -> P (x1 :: s1) (x2 :: s2)) -> forall s1 s2, size s1 = size s2 -> P s1 s2. Proof. (* Goal: forall (_ : P (@nil T1) (@nil T2)) (_ : forall (x1 : T1) (x2 : T2) (s1 : list T1) (s2 : list T2) (_ : P s1 s2), P (@cons T1 x1 s1) (@cons T2 x2 s2)) (s1 : list T1) (s2 : list T2) (_ : @eq nat (@size T1 s1) (@size T2 s2)), P s1 s2 *) by move=> Pnil Pcons; elim=> [|x s IHs] [] //= x2 s2 [] /IHs/Pcons. Qed. Section Rev. Variable T : Type. Implicit Types s t : seq T. Lemma catrev_catl s t u : catrev (s ++ t) u = catrev t (catrev s u). Proof. (* Goal: @eq (list T) (@catrev T (@cat T s t) u) (@catrev T t (@catrev T s u)) *) by elim: s u => /=. Qed. Lemma catrev_catr s t u : catrev s (t ++ u) = catrev s t ++ u. Proof. (* Goal: @eq (list T) (@catrev T s (@cat T t u)) (@cat T (@catrev T s t) u) *) by elim: s t => //= x s IHs t; rewrite -IHs. Qed. Lemma catrevE s t : catrev s t = rev s ++ t. Proof. (* Goal: @eq (list T) (@catrev T s t) (@cat T (@rev T s) t) *) by rewrite -catrev_catr. Qed. Lemma rev_cons x s : rev (x :: s) = rcons (rev s) x. Proof. (* Goal: @eq (list T) (@rev T (@cons T x s)) (@rcons T (@rev T s) x) *) by rewrite -cats1 -catrevE. Qed. Lemma size_rev s : size (rev s) = size s. Proof. (* Goal: @eq nat (@size T (@rev T s)) (@size T s) *) by elim: s => // x s IHs; rewrite rev_cons size_rcons IHs. Qed. Lemma rev_cat s t : rev (s ++ t) = rev t ++ rev s. Proof. (* Goal: @eq (list T) (@rev T (@cat T s t)) (@cat T (@rev T t) (@rev T s)) *) by rewrite -catrev_catr -catrev_catl. Qed. Lemma rev_rcons s x : rev (rcons s x) = x :: rev s. Proof. (* Goal: @eq (list T) (@rev T (@rcons T s x)) (@cons T x (@rev T s)) *) by rewrite -cats1 rev_cat. Qed. Lemma revK : involutive (@rev T). Proof. (* Goal: @involutive (list T) (@rev T) *) by elim=> //= x s IHs; rewrite rev_cons rev_rcons IHs. Qed. Lemma nth_rev x0 n s : n < size s -> nth x0 (rev s) n = nth x0 s (size s - n.+1). Proof. (* Goal: forall _ : is_true (leq (S n) (@size T s)), @eq T (@nth T x0 (@rev T s) n) (@nth T x0 s (subn (@size T s) (S n))) *) elim/last_ind: s => // s x IHs in n *. rewrite rev_rcons size_rcons ltnS subSS -cats1 nth_cat /=. case: n => [|n] lt_n_s; first by rewrite subn0 ltnn subnn. by rewrite -{2}(subnK lt_n_s) -addSnnS leq_addr /= -IHs. Qed. Qed. Lemma filter_rev a s : filter a (rev s) = rev (filter a s). Proof. (* Goal: @eq (list T) (@filter T a (@rev T s)) (@rev T (@filter T a s)) *) by elim: s => //= x s IH; rewrite fun_if !rev_cons filter_rcons IH. Qed. Lemma count_rev a s : count a (rev s) = count a s. Proof. (* Goal: @eq nat (@count T a (@rev T s)) (@count T a s) *) by rewrite -!size_filter filter_rev size_rev. Qed. Lemma has_rev a s : has a (rev s) = has a s. Proof. (* Goal: @eq bool (@has T a (@rev T s)) (@has T a s) *) by rewrite !has_count count_rev. Qed. Lemma all_rev a s : all a (rev s) = all a s. Proof. (* Goal: @eq bool (@all T a (@rev T s)) (@all T a s) *) by rewrite !all_count count_rev size_rev. Qed. Lemma take_rev s n : take n (rev s) = rev (drop (size s - n) s). Proof. (* Goal: @eq (list T) (@take T n (@rev T s)) (@rev T (@drop T (subn (@size T s) n) s)) *) have /orP[le_s_n | le_n_s] := leq_total (size s) n. (* Goal: @eq (list T) (@take T n (@rev T s)) (@rev T (@drop T (subn (@size T s) n) s)) *) (* Goal: @eq (list T) (@take T n (@rev T s)) (@rev T (@drop T (subn (@size T s) n) s)) *) by rewrite (eqnP le_s_n) drop0 take_oversize ?size_rev. (* Goal: @eq (list T) (@take T n (@rev T s)) (@rev T (@drop T (subn (@size T s) n) s)) *) rewrite -[s in LHS](cat_take_drop (size s - n)). (* Goal: @eq (list T) (@take T n (@rev T (@cat T (@take T (subn (@size T s) n) s) (@drop T (subn (@size T s) n) s)))) (@rev T (@drop T (subn (@size T s) n) s)) *) by rewrite rev_cat take_size_cat // size_rev size_drop subKn. Qed. Lemma drop_rev s n : drop n (rev s) = rev (take (size s - n) s). Proof. (* Goal: @eq (list T) (@drop T n (@rev T s)) (@rev T (@take T (subn (@size T s) n) s)) *) rewrite -[s]revK take_rev !revK size_rev -minnE /minn. (* Goal: @eq (list T) (@drop T n (@rev T s)) (@drop T (if leq (S (@size T s)) n then @size T s else n) (@rev T s)) *) by case: ifP => // /ltnW-le_s_n; rewrite !drop_oversize ?size_rev. Qed. End Rev. Arguments revK {T}. Section EqSeq. Variables (n0 : nat) (T : eqType) (x0 : T). Local Notation nth := (nth x0). Implicit Type s : seq T. Implicit Types x y z : T. Fixpoint eqseq s1 s2 {struct s2} := match s1, s2 with | [::], [::] => true | x1 :: s1', x2 :: s2' => (x1 == x2) && eqseq s1' s2' | _, _ => false end. Lemma eqseqP : Equality.axiom eqseq. Proof. (* Goal: @Equality.axiom (list (Equality.sort T)) eqseq *) move; elim=> [|x1 s1 IHs] [|x2 s2]; do [by constructor | simpl]. (* Goal: Bool.reflect (@eq (list (Equality.sort T)) (@cons (Equality.sort T) x1 s1) (@cons (Equality.sort T) x2 s2)) (andb (@eq_op T x1 x2) (eqseq s1 s2)) *) case: (x1 =P x2) => [<-|neqx]; last by right; case. (* Goal: Bool.reflect (@eq (list (Equality.sort T)) (@cons (Equality.sort T) x1 s1) (@cons (Equality.sort T) x1 s2)) (andb true (eqseq s1 s2)) *) by apply: (iffP (IHs s2)) => [<-|[]]. Qed. Lemma eqseq_cons x1 x2 s1 s2 : (x1 :: s1 == x2 :: s2) = (x1 == x2) && (s1 == s2). Proof. (* Goal: @eq bool (@eq_op seq_eqType (@cons (Equality.sort T) x1 s1) (@cons (Equality.sort T) x2 s2)) (andb (@eq_op T x1 x2) (@eq_op seq_eqType s1 s2)) *) by []. Qed. Lemma eqseq_cat s1 s2 s3 s4 : size s1 = size s2 -> (s1 ++ s3 == s2 ++ s4) = (s1 == s2) && (s3 == s4). Proof. (* Goal: forall _ : @eq nat (@size (Equality.sort T) s1) (@size (Equality.sort T) s2), @eq bool (@eq_op seq_eqType (@cat (Equality.sort T) s1 s3) (@cat (Equality.sort T) s2 s4)) (andb (@eq_op seq_eqType s1 s2) (@eq_op seq_eqType s3 s4)) *) elim: s1 s2 => [|x1 s1 IHs] [|x2 s2] //= [sz12]. (* Goal: @eq bool (@eq_op seq_eqType (@cons (Equality.sort T) x1 (@cat (Equality.sort T) s1 s3)) (@cons (Equality.sort T) x2 (@cat (Equality.sort T) s2 s4))) (andb (@eq_op seq_eqType (@cons (Equality.sort T) x1 s1) (@cons (Equality.sort T) x2 s2)) (@eq_op seq_eqType s3 s4)) *) by rewrite !eqseq_cons -andbA IHs. Qed. Lemma eqseq_rcons s1 s2 x1 x2 : (rcons s1 x1 == rcons s2 x2) = (s1 == s2) && (x1 == x2). Proof. (* Goal: @eq bool (@eq_op seq_eqType (@rcons (Equality.sort T) s1 x1) (@rcons (Equality.sort T) s2 x2)) (andb (@eq_op seq_eqType s1 s2) (@eq_op T x1 x2)) *) by rewrite -(can_eq revK) !rev_rcons eqseq_cons andbC (can_eq revK). Qed. Lemma size_eq0 s : (size s == 0) = (s == [::]). Proof. (* Goal: @eq bool (@eq_op nat_eqType (@size (Equality.sort T) s) O) (@eq_op seq_eqType s (@nil (Equality.sort T))) *) exact: (sameP nilP eqP). Qed. Lemma has_filter a s : has a s = (filter a s != [::]). Proof. (* Goal: @eq bool (@has (Equality.sort T) a s) (negb (@eq_op seq_eqType (@filter (Equality.sort T) a s) (@nil (Equality.sort T)))) *) by rewrite -size_eq0 size_filter has_count lt0n. Qed. Fixpoint mem_seq (s : seq T) := if s is y :: s' then xpredU1 y (mem_seq s') else xpred0. Definition eqseq_class := seq T. Identity Coercion seq_of_eqseq : eqseq_class >-> seq. Coercion pred_of_eq_seq (s : eqseq_class) : pred_class := [eta mem_seq s]. Canonical seq_predType := @mkPredType T (seq T) pred_of_eq_seq. Canonical mem_seq_predType := mkPredType mem_seq. Lemma in_cons y s x : (x \in y :: s) = (x == y) || (x \in s). Proof. (* Goal: @eq bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) y s))) (orb (@eq_op T x y) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s))) *) by []. Qed. Lemma in_nil x : (x \in [::]) = false. Proof. (* Goal: @eq bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@nil (Equality.sort T)))) false *) by []. Qed. Lemma mem_seq1 x y : (x \in [:: y]) = (x == y). Proof. (* Goal: @eq bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) y (@nil (Equality.sort T))))) (@eq_op T x y) *) by rewrite in_cons orbF. Qed. Let inE := (mem_seq1, in_cons, inE). Lemma mem_seq2 x y1 y2 : (x \in [:: y1; y2]) = xpred2 y1 y2 x. Proof. (* Goal: @eq bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) y1 (@cons (Equality.sort T) y2 (@nil (Equality.sort T)))))) ((fun a1 a2 x : Equality.sort T => orb (@eq_op T x a1) (@eq_op T x a2)) y1 y2 x) *) by rewrite !inE. Qed. Lemma mem_seq3 x y1 y2 y3 : (x \in [:: y1; y2; y3]) = xpred3 y1 y2 y3 x. Proof. (* Goal: @eq bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) y1 (@cons (Equality.sort T) y2 (@cons (Equality.sort T) y3 (@nil (Equality.sort T))))))) ((fun a1 a2 a3 x : Equality.sort T => orb (@eq_op T x a1) (orb (@eq_op T x a2) (@eq_op T x a3))) y1 y2 y3 x) *) by rewrite !inE. Qed. Lemma mem_seq4 x y1 y2 y3 y4 : (x \in [:: y1; y2; y3; y4]) = xpred4 y1 y2 y3 y4 x. Proof. (* Goal: @eq bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) y1 (@cons (Equality.sort T) y2 (@cons (Equality.sort T) y3 (@cons (Equality.sort T) y4 (@nil (Equality.sort T)))))))) ((fun a1 a2 a3 a4 x : Equality.sort T => orb (@eq_op T x a1) (orb (@eq_op T x a2) (orb (@eq_op T x a3) (@eq_op T x a4)))) y1 y2 y3 y4 x) *) by rewrite !inE. Qed. Lemma mem_cat x s1 s2 : (x \in s1 ++ s2) = (x \in s1) || (x \in s2). Proof. (* Goal: @eq bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@cat (Equality.sort T) s1 s2))) (orb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s1)) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s2))) *) by elim: s1 => //= y s1 IHs; rewrite !inE /= -orbA -IHs. Qed. Lemma mem_rcons s y : rcons s y =i y :: s. Proof. (* Goal: @eq_mem (Equality.sort T) (@mem (Equality.sort T) seq_predType (@rcons (Equality.sort T) s y)) (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) y s)) *) by move=> x; rewrite -cats1 /= mem_cat mem_seq1 orbC in_cons. Qed. Lemma mem_head x s : x \in x :: s. Proof. (* Goal: is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) x s))) *) exact: predU1l. Qed. Lemma mem_last x s : last x s \in x :: s. Proof. (* Goal: is_true (@in_mem (Equality.sort T) (@last (Equality.sort T) x s) (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) x s))) *) by rewrite lastI mem_rcons mem_head. Qed. Lemma mem_behead s : {subset behead s <= s}. Proof. (* Goal: @sub_mem (Equality.sort T) (@mem (Equality.sort T) seq_predType (@behead (Equality.sort T) s)) (@mem (Equality.sort T) seq_predType s) *) by case: s => // y s x; apply: predU1r. Qed. Lemma mem_belast s y : {subset belast y s <= y :: s}. Proof. (* Goal: @sub_mem (Equality.sort T) (@mem (Equality.sort T) seq_predType (@belast (Equality.sort T) y s)) (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) y s)) *) by move=> x ys'x; rewrite lastI mem_rcons mem_behead. Qed. Lemma mem_nth s n : n < size s -> nth s n \in s. Proof. (* Goal: forall _ : is_true (leq (S n) (@size (Equality.sort T) s)), is_true (@in_mem (Equality.sort T) (@SerTop.nth (Equality.sort T) x0 s n) (@mem (Equality.sort T) seq_predType s)) *) by elim: s n => [|x s IHs] // [_|n sz_s]; rewrite ?mem_head // mem_behead ?IHs. Qed. Lemma mem_take s x : x \in take n0 s -> x \in s. Proof. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@take (Equality.sort T) n0 s))), is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s)) *) by move=> s0x; rewrite -(cat_take_drop n0 s) mem_cat /= s0x. Qed. Lemma mem_drop s x : x \in drop n0 s -> x \in s. Proof. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@drop (Equality.sort T) n0 s))), is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s)) *) by move=> s0'x; rewrite -(cat_take_drop n0 s) mem_cat /= s0'x orbT. Qed. Lemma last_eq s z x y : x != y -> z != y -> (last x s == y) = (last z s == y). Proof. (* Goal: forall (_ : is_true (negb (@eq_op T x y))) (_ : is_true (negb (@eq_op T z y))), @eq bool (@eq_op T (@last (Equality.sort T) x s) y) (@eq_op T (@last (Equality.sort T) z s) y) *) by move=> /negPf xz /negPf yz; case: s => [|t s]//; rewrite xz yz. Qed. Section Filters. Variable a : pred T. Lemma hasP s : reflect (exists2 x, x \in s & a x) (has a s). Proof. (* Goal: Bool.reflect (@ex2 (Equality.sort T) (fun x : Equality.sort T => is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s))) (fun x : Equality.sort T => is_true (a x))) (@has (Equality.sort T) a s) *) elim: s => [|y s IHs] /=; first by right; case. (* Goal: Bool.reflect (@ex2 (Equality.sort T) (fun x : Equality.sort T => is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) y s)))) (fun x : Equality.sort T => is_true (a x))) (orb (a y) (@has (Equality.sort T) a s)) *) case ay: (a y); first by left; exists y; rewrite ?mem_head. (* Goal: Bool.reflect (@ex2 (Equality.sort T) (fun x : Equality.sort T => is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) y s)))) (fun x : Equality.sort T => is_true (a x))) (orb false (@has (Equality.sort T) a s)) *) apply: (iffP IHs) => [] [x ysx ax]; exists x => //; first exact: mem_behead. (* Goal: is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s)) *) by case: (predU1P ysx) ax => [->|//]; rewrite ay. Qed. Lemma hasPP s aP : (forall x, reflect (aP x) (a x)) -> reflect (exists2 x, x \in s & aP x) (has a s). Proof. (* Goal: forall _ : forall x : Equality.sort T, Bool.reflect (aP x) (a x), Bool.reflect (@ex2 (Equality.sort T) (fun x : Equality.sort T => is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s))) (fun x : Equality.sort T => aP x)) (@has (Equality.sort T) a s) *) by move=> vP; apply: (iffP (hasP _)) => -[x?/vP]; exists x. Qed. Lemma hasPn s : reflect (forall x, x \in s -> ~~ a x) (~~ has a s). Proof. (* Goal: Bool.reflect (forall (x : Equality.sort T) (_ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s))), is_true (negb (a x))) (negb (@has (Equality.sort T) a s)) *) apply: (iffP idP) => not_a_s => [x s_x|]. (* Goal: is_true (negb (@has (Equality.sort T) a s)) *) (* Goal: is_true (negb (a x)) *) by apply: contra not_a_s => a_x; apply/hasP; exists x. (* Goal: is_true (negb (@has (Equality.sort T) a s)) *) by apply/hasP=> [[x s_x]]; apply/negP; apply: not_a_s. Qed. Lemma allP s : reflect (forall x, x \in s -> a x) (all a s). Proof. (* Goal: Bool.reflect (forall (x : Equality.sort T) (_ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s))), is_true (a x)) (@all (Equality.sort T) a s) *) elim: s => [|x s IHs]; first by left. (* Goal: Bool.reflect (forall (x0 : Equality.sort T) (_ : is_true (@in_mem (Equality.sort T) x0 (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) x s)))), is_true (a x0)) (@all (Equality.sort T) a (@cons (Equality.sort T) x s)) *) rewrite /= andbC; case: IHs => IHs /=. (* Goal: Bool.reflect (forall (x0 : Equality.sort T) (_ : is_true (@in_mem (Equality.sort T) x0 (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) x s)))), is_true (a x0)) false *) (* Goal: Bool.reflect (forall (x0 : Equality.sort T) (_ : is_true (@in_mem (Equality.sort T) x0 (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) x s)))), is_true (a x0)) (a x) *) apply: (iffP idP) => [Hx y|]; last by apply; apply: mem_head. (* Goal: Bool.reflect (forall (x0 : Equality.sort T) (_ : is_true (@in_mem (Equality.sort T) x0 (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) x s)))), is_true (a x0)) false *) (* Goal: forall _ : is_true (@in_mem (Equality.sort T) y (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) x s))), is_true (a y) *) by case/predU1P=> [->|Hy]; auto. (* Goal: Bool.reflect (forall (x0 : Equality.sort T) (_ : is_true (@in_mem (Equality.sort T) x0 (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) x s)))), is_true (a x0)) false *) by right=> H; case IHs => y Hy; apply H; apply: mem_behead. Qed. Lemma allPP s aP : (forall x, reflect (aP x) (a x)) -> reflect (forall x, x \in s -> aP x) (all a s). Proof. (* Goal: forall _ : forall x : Equality.sort T, Bool.reflect (aP x) (a x), Bool.reflect (forall (x : Equality.sort T) (_ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s))), aP x) (@all (Equality.sort T) a s) *) by move=> vP; apply: (iffP (allP _)) => /(_ _ _) /vP. Qed. Lemma allPn s : reflect (exists2 x, x \in s & ~~ a x) (~~ all a s). Proof. (* Goal: Bool.reflect (@ex2 (Equality.sort T) (fun x : Equality.sort T => is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s))) (fun x : Equality.sort T => is_true (negb (a x)))) (negb (@all (Equality.sort T) a s)) *) elim: s => [|x s IHs]; first by right=> [[x Hx _]]. (* Goal: Bool.reflect (@ex2 (Equality.sort T) (fun x0 : Equality.sort T => is_true (@in_mem (Equality.sort T) x0 (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) x s)))) (fun x : Equality.sort T => is_true (negb (a x)))) (negb (@all (Equality.sort T) a (@cons (Equality.sort T) x s))) *) rewrite /= andbC negb_and; case: IHs => IHs /=. (* Goal: Bool.reflect (@ex2 (Equality.sort T) (fun x0 : Equality.sort T => is_true (@in_mem (Equality.sort T) x0 (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) x s)))) (fun x : Equality.sort T => is_true (negb (a x)))) (negb (a x)) *) (* Goal: Bool.reflect (@ex2 (Equality.sort T) (fun x0 : Equality.sort T => is_true (@in_mem (Equality.sort T) x0 (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) x s)))) (fun x : Equality.sort T => is_true (negb (a x)))) true *) by left; case: IHs => y Hy Hay; exists y; first apply: mem_behead. (* Goal: Bool.reflect (@ex2 (Equality.sort T) (fun x0 : Equality.sort T => is_true (@in_mem (Equality.sort T) x0 (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) x s)))) (fun x : Equality.sort T => is_true (negb (a x)))) (negb (a x)) *) apply: (iffP idP) => [|[y]]; first by exists x; rewrite ?mem_head. (* Goal: forall (_ : is_true (@in_mem (Equality.sort T) y (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) x s)))) (_ : is_true (negb (a y))), is_true (negb (a x)) *) by case/predU1P=> [-> // | s_y not_a_y]; case: IHs; exists y. Qed. Lemma mem_filter x s : (x \in filter a s) = a x && (x \in s). Proof. (* Goal: @eq bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@filter (Equality.sort T) a s))) (andb (a x) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s))) *) rewrite andbC; elim: s => //= y s IHs. (* Goal: @eq bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (if a y then @cons (Equality.sort T) y (@filter (Equality.sort T) a s) else @filter (Equality.sort T) a s))) (andb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) y s))) (a x)) *) rewrite (fun_if (fun s' : seq T => x \in s')) !in_cons {}IHs. (* Goal: @eq bool (if a y then orb (@eq_op T x y) (andb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s)) (a x)) else andb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s)) (a x)) (andb (orb (@eq_op T x y) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s))) (a x)) *) by case: eqP => [->|_]; case (a y); rewrite /= ?andbF. Qed. End Filters. Notation "'has_ view" := (hasPP _ (fun _ => view)) (at level 4, right associativity, format "''has_' view"). Notation "'all_ view" := (allPP _ (fun _ => view)) (at level 4, right associativity, format "''all_' view"). Section EqIn. Variables a1 a2 : pred T. Lemma eq_in_filter s : {in s, a1 =1 a2} -> filter a1 s = filter a2 s. Proof. (* Goal: forall _ : @prop_in1 (Equality.sort T) (@mem (Equality.sort T) seq_predType s) (fun x : Equality.sort T => @eq bool (a1 x) (a2 x)) (inPhantom (@eqfun bool (Equality.sort T) a1 a2)), @eq (list (Equality.sort T)) (@filter (Equality.sort T) a1 s) (@filter (Equality.sort T) a2 s) *) elim: s => //= x s IHs eq_a. (* Goal: @eq (list (Equality.sort T)) (if a1 x then @cons (Equality.sort T) x (@filter (Equality.sort T) a1 s) else @filter (Equality.sort T) a1 s) (if a2 x then @cons (Equality.sort T) x (@filter (Equality.sort T) a2 s) else @filter (Equality.sort T) a2 s) *) by rewrite eq_a ?mem_head ?IHs // => y s_y; apply: eq_a; apply: mem_behead. Qed. Lemma eq_in_find s : {in s, a1 =1 a2} -> find a1 s = find a2 s. Proof. (* Goal: forall _ : @prop_in1 (Equality.sort T) (@mem (Equality.sort T) seq_predType s) (fun x : Equality.sort T => @eq bool (a1 x) (a2 x)) (inPhantom (@eqfun bool (Equality.sort T) a1 a2)), @eq nat (@find (Equality.sort T) a1 s) (@find (Equality.sort T) a2 s) *) elim: s => //= x s IHs eq_a12; rewrite eq_a12 ?mem_head // IHs // => y s'y. (* Goal: @eq bool (a1 y) (a2 y) *) by rewrite eq_a12 // mem_behead. Qed. Lemma eq_in_count s : {in s, a1 =1 a2} -> count a1 s = count a2 s. Proof. (* Goal: forall _ : @prop_in1 (Equality.sort T) (@mem (Equality.sort T) seq_predType s) (fun x : Equality.sort T => @eq bool (a1 x) (a2 x)) (inPhantom (@eqfun bool (Equality.sort T) a1 a2)), @eq nat (@count (Equality.sort T) a1 s) (@count (Equality.sort T) a2 s) *) by move/eq_in_filter=> eq_a12; rewrite -!size_filter eq_a12. Qed. Lemma eq_in_all s : {in s, a1 =1 a2} -> all a1 s = all a2 s. Proof. (* Goal: forall _ : @prop_in1 (Equality.sort T) (@mem (Equality.sort T) seq_predType s) (fun x : Equality.sort T => @eq bool (a1 x) (a2 x)) (inPhantom (@eqfun bool (Equality.sort T) a1 a2)), @eq bool (@all (Equality.sort T) a1 s) (@all (Equality.sort T) a2 s) *) by move=> eq_a12; rewrite !all_count eq_in_count. Qed. Lemma eq_in_has s : {in s, a1 =1 a2} -> has a1 s = has a2 s. Proof. (* Goal: forall _ : @prop_in1 (Equality.sort T) (@mem (Equality.sort T) seq_predType s) (fun x : Equality.sort T => @eq bool (a1 x) (a2 x)) (inPhantom (@eqfun bool (Equality.sort T) a1 a2)), @eq bool (@has (Equality.sort T) a1 s) (@has (Equality.sort T) a2 s) *) by move/eq_in_filter=> eq_a12; rewrite !has_filter eq_a12. Qed. End EqIn. Lemma eq_has_r s1 s2 : s1 =i s2 -> has^~ s1 =1 has^~ s2. Proof. (* Goal: forall _ : @eq_mem (Equality.sort T) (@mem (Equality.sort T) seq_predType s1) (@mem (Equality.sort T) seq_predType s2), @eqfun bool (pred (Equality.sort T)) (fun x : pred (Equality.sort T) => @has (Equality.sort T) x s1) (fun x : pred (Equality.sort T) => @has (Equality.sort T) x s2) *) move=> Es12 a; apply/(hasP a s1)/(hasP a s2) => [] [x Hx Hax]; by exists x; rewrite // ?Es12 // -Es12. Qed. Lemma eq_all_r s1 s2 : s1 =i s2 -> all^~ s1 =1 all^~ s2. Proof. (* Goal: forall _ : @eq_mem (Equality.sort T) (@mem (Equality.sort T) seq_predType s1) (@mem (Equality.sort T) seq_predType s2), @eqfun bool (pred (Equality.sort T)) (fun x : pred (Equality.sort T) => @all (Equality.sort T) x s1) (fun x : pred (Equality.sort T) => @all (Equality.sort T) x s2) *) by move=> Es12 a; apply/(allP a s1)/(allP a s2) => Hs x Hx; apply: Hs; rewrite Es12 in Hx *. Qed. Qed. Lemma has_sym s1 s2 : has (mem s1) s2 = has (mem s2) s1. Proof. (* Goal: @eq bool (@has (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred_of_mem_pred (Equality.sort T) (@mem (Equality.sort T) seq_predType s1))) s2) (@has (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred_of_mem_pred (Equality.sort T) (@mem (Equality.sort T) seq_predType s2))) s1) *) by apply/(hasP _ s2)/(hasP _ s1) => [] [x]; exists x. Qed. Lemma has_pred1 x s : has (pred1 x) s = (x \in s). Proof. (* Goal: @eq bool (@has (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s)) *) by rewrite -(eq_has (mem_seq1^~ x)) (has_sym [:: x]) /= orbF. Qed. Lemma mem_rev s : rev s =i s. Proof. (* Goal: @eq_mem (Equality.sort T) (@mem (Equality.sort T) seq_predType (@rev (Equality.sort T) s)) (@mem (Equality.sort T) seq_predType s) *) by move=> a; rewrite -!has_pred1 has_rev. Qed. Definition constant s := if s is x :: s' then all (pred1 x) s' else true. Lemma all_pred1P x s : reflect (s = nseq (size s) x) (all (pred1 x) s). Proof. (* Goal: Bool.reflect (@eq (list (Equality.sort T)) s (@nseq (Equality.sort T) (@size (Equality.sort T) s) x)) (@all (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s) *) elim: s => [|y s IHs] /=; first by left. (* Goal: Bool.reflect (@eq (list (Equality.sort T)) (@cons (Equality.sort T) y s) (@cons (Equality.sort T) x (@nseq (Equality.sort T) (@size (Equality.sort T) s) x))) (andb (@eq_op T y x) (@all (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s)) *) case: eqP => [->{y} | ne_xy]; last by right=> [] [? _]; case ne_xy. (* Goal: Bool.reflect (@eq (list (Equality.sort T)) (@cons (Equality.sort T) x s) (@cons (Equality.sort T) x (@nseq (Equality.sort T) (@size (Equality.sort T) s) x))) (andb true (@all (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s)) *) by apply: (iffP IHs) => [<- //| []]. Qed. Lemma all_pred1_constant x s : all (pred1 x) s -> constant s. Proof. (* Goal: forall _ : is_true (@all (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s), is_true (constant s) *) by case: s => //= y s /andP[/eqP->]. Qed. Lemma all_pred1_nseq x n : all (pred1 x) (nseq n x). Proof. (* Goal: is_true (@all (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) (@nseq (Equality.sort T) n x)) *) by rewrite all_nseq /= eqxx orbT. Qed. Lemma nseqP n x y : reflect (y = x /\ n > 0) (y \in nseq n x). Proof. (* Goal: Bool.reflect (and (@eq (Equality.sort T) y x) (is_true (leq (S O) n))) (@in_mem (Equality.sort T) y (@mem (Equality.sort T) seq_predType (@nseq (Equality.sort T) n x))) *) by rewrite -has_pred1 has_nseq /= eq_sym andbC; apply: (iffP andP) => -[/eqP]. Qed. Lemma constant_nseq n x : constant (nseq n x). Proof. (* Goal: is_true (constant (@nseq (Equality.sort T) n x)) *) exact: all_pred1_constant (all_pred1_nseq x n). Qed. Lemma constantP s : reflect (exists x, s = nseq (size s) x) (constant s). Fixpoint uniq s := if s is x :: s' then (x \notin s') && uniq s' else true. Lemma cons_uniq x s : uniq (x :: s) = (x \notin s) && uniq s. Proof. (* Goal: @eq bool (uniq (@cons (Equality.sort T) x s)) (andb (negb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s))) (uniq s)) *) by []. Qed. Lemma cat_uniq s1 s2 : uniq (s1 ++ s2) = [&& uniq s1, ~~ has (mem s1) s2 & uniq s2]. Proof. (* Goal: @eq bool (uniq (@cat (Equality.sort T) s1 s2)) (andb (uniq s1) (andb (negb (@has (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred_of_mem_pred (Equality.sort T) (@mem (Equality.sort T) seq_predType s1))) s2)) (uniq s2))) *) elim: s1 => [|x s1 IHs]; first by rewrite /= has_pred0. (* Goal: @eq bool (uniq (@cat (Equality.sort T) (@cons (Equality.sort T) x s1) s2)) (andb (uniq (@cons (Equality.sort T) x s1)) (andb (negb (@has (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred_of_mem_pred (Equality.sort T) (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) x s1)))) s2)) (uniq s2))) *) by rewrite has_sym /= mem_cat !negb_or has_sym IHs -!andbA; do !bool_congr. Qed. Lemma uniq_catC s1 s2 : uniq (s1 ++ s2) = uniq (s2 ++ s1). Proof. (* Goal: @eq bool (uniq (@cat (Equality.sort T) s1 s2)) (uniq (@cat (Equality.sort T) s2 s1)) *) by rewrite !cat_uniq has_sym andbCA andbA andbC. Qed. Lemma uniq_catCA s1 s2 s3 : uniq (s1 ++ s2 ++ s3) = uniq (s2 ++ s1 ++ s3). Proof. (* Goal: @eq bool (uniq (@cat (Equality.sort T) s1 (@cat (Equality.sort T) s2 s3))) (uniq (@cat (Equality.sort T) s2 (@cat (Equality.sort T) s1 s3))) *) by rewrite !catA -!(uniq_catC s3) !(cat_uniq s3) uniq_catC !has_cat orbC. Qed. Lemma rcons_uniq s x : uniq (rcons s x) = (x \notin s) && uniq s. Proof. (* Goal: @eq bool (uniq (@rcons (Equality.sort T) s x)) (andb (negb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s))) (uniq s)) *) by rewrite -cats1 uniq_catC. Qed. Lemma filter_uniq s a : uniq s -> uniq (filter a s). Proof. (* Goal: forall _ : is_true (uniq s), is_true (uniq (@filter (Equality.sort T) a s)) *) elim: s => [|x s IHs] //= /andP[Hx Hs]; case (a x); auto. (* Goal: is_true (uniq (@cons (Equality.sort T) x (@filter (Equality.sort T) a s))) *) by rewrite /= mem_filter /= (negbTE Hx) andbF; auto. Qed. Lemma rot_uniq s : uniq (rot n0 s) = uniq s. Proof. (* Goal: @eq bool (uniq (@rot (Equality.sort T) n0 s)) (uniq s) *) by rewrite /rot uniq_catC cat_take_drop. Qed. Lemma rev_uniq s : uniq (rev s) = uniq s. Proof. (* Goal: @eq bool (uniq (@rev (Equality.sort T) s)) (uniq s) *) elim: s => // x s IHs. (* Goal: @eq bool (uniq (@rev (Equality.sort T) (@cons (Equality.sort T) x s))) (uniq (@cons (Equality.sort T) x s)) *) by rewrite rev_cons -cats1 cat_uniq /= andbT andbC mem_rev orbF IHs. Qed. Lemma count_memPn x s : reflect (count_mem x s = 0) (x \notin s). Proof. (* Goal: Bool.reflect (@eq nat (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s) O) (negb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s))) *) by rewrite -has_pred1 has_count -eqn0Ngt; apply: eqP. Qed. Lemma count_uniq_mem s x : uniq s -> count_mem x s = (x \in s). Proof. (* Goal: forall _ : is_true (uniq s), @eq nat (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s) (nat_of_bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s))) *) elim: s => //= y s IHs /andP[/negbTE s'y /IHs-> {IHs}]. (* Goal: @eq nat (addn (nat_of_bool (@eq_op T y x)) (nat_of_bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s)))) (nat_of_bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) y s)))) *) by rewrite in_cons eq_sym; case: eqP => // ->; rewrite s'y. Qed. Lemma filter_pred1_uniq s x : uniq s -> x \in s -> filter (pred1 x) s = [:: x]. Proof. (* Goal: forall (_ : is_true (uniq s)) (_ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s))), @eq (list (Equality.sort T)) (@filter (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s) (@cons (Equality.sort T) x (@nil (Equality.sort T))) *) move=> uniq_s s_x; rewrite (all_pred1P _ _ (filter_all _ _)). (* Goal: @eq (list (Equality.sort T)) (@nseq (Equality.sort T) (@size (Equality.sort T) (@filter (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s)) x) (@cons (Equality.sort T) x (@nil (Equality.sort T))) *) by rewrite size_filter count_uniq_mem ?s_x. Qed. Fixpoint undup s := if s is x :: s' then if x \in s' then undup s' else x :: undup s' else [::]. Lemma size_undup s : size (undup s) <= size s. Proof. (* Goal: is_true (leq (@size (Equality.sort T) (undup s)) (@size (Equality.sort T) s)) *) by elim: s => //= x s IHs; case: (x \in s) => //=; apply: ltnW. Qed. Lemma mem_undup s : undup s =i s. Proof. (* Goal: @eq_mem (Equality.sort T) (@mem (Equality.sort T) seq_predType (undup s)) (@mem (Equality.sort T) seq_predType s) *) move=> x; elim: s => //= y s IHs. (* Goal: @eq bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (if @in_mem (Equality.sort T) y (@mem (Equality.sort T) seq_predType s) then undup s else @cons (Equality.sort T) y (undup s)))) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) y s))) *) by case Hy: (y \in s); rewrite in_cons IHs //; case: eqP => // ->. Qed. Lemma undup_uniq s : uniq (undup s). Proof. (* Goal: is_true (uniq (undup s)) *) by elim: s => //= x s IHs; case s_x: (x \in s); rewrite //= mem_undup s_x. Qed. Lemma undup_id s : uniq s -> undup s = s. Proof. (* Goal: forall _ : is_true (uniq s), @eq (list (Equality.sort T)) (undup s) s *) by elim: s => //= x s IHs /andP[/negbTE-> /IHs->]. Qed. Lemma ltn_size_undup s : (size (undup s) < size s) = ~~ uniq s. Proof. (* Goal: @eq bool (leq (S (@size (Equality.sort T) (undup s))) (@size (Equality.sort T) s)) (negb (uniq s)) *) by elim: s => //= x s IHs; case Hx: (x \in s); rewrite //= ltnS size_undup. Qed. Lemma filter_undup p s : filter p (undup s) = undup (filter p s). Proof. (* Goal: @eq (list (Equality.sort T)) (@filter (Equality.sort T) p (undup s)) (undup (@filter (Equality.sort T) p s)) *) elim: s => //= x s IHs; rewrite (fun_if undup) fun_if /= mem_filter /=. (* Goal: if p x then @eq (list (Equality.sort T)) (@filter (Equality.sort T) p (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s) then undup s else @cons (Equality.sort T) x (undup s))) (if andb (p x) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s)) then undup (@filter (Equality.sort T) p s) else @cons (Equality.sort T) x (undup (@filter (Equality.sort T) p s))) else @eq (list (Equality.sort T)) (@filter (Equality.sort T) p (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s) then undup s else @cons (Equality.sort T) x (undup s))) (undup (@filter (Equality.sort T) p s)) *) by rewrite (fun_if (filter p)) /= IHs; case: ifP => -> //=; apply: if_same. Qed. Lemma undup_nil s : undup s = [::] -> s = [::]. Proof. (* Goal: forall _ : @eq (list (Equality.sort T)) (undup s) (@nil (Equality.sort T)), @eq (list (Equality.sort T)) s (@nil (Equality.sort T)) *) by case: s => //= x s; rewrite -mem_undup; case: ifP; case: undup. Qed. Definition index x := find (pred1 x). Lemma index_size x s : index x s <= size s. Proof. (* Goal: is_true (leq (index x s) (@size (Equality.sort T) s)) *) by rewrite /index find_size. Qed. Lemma index_mem x s : (index x s < size s) = (x \in s). Proof. (* Goal: @eq bool (leq (S (index x s)) (@size (Equality.sort T) s)) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s)) *) by rewrite -has_pred1 has_find. Qed. Lemma nth_index x s : x \in s -> nth s (index x s) = x. Proof. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s)), @eq (Equality.sort T) (@SerTop.nth (Equality.sort T) x0 s (index x s)) x *) by rewrite -has_pred1 => /(nth_find x0)/eqP. Qed. Lemma index_cat x s1 s2 : index x (s1 ++ s2) = if x \in s1 then index x s1 else size s1 + index x s2. Proof. (* Goal: @eq nat (index x (@cat (Equality.sort T) s1 s2)) (if @in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s1) then index x s1 else addn (@size (Equality.sort T) s1) (index x s2)) *) by rewrite /index find_cat has_pred1. Qed. Lemma index_uniq i s : i < size s -> uniq s -> index (nth s i) s = i. Proof. (* Goal: forall (_ : is_true (leq (S i) (@size (Equality.sort T) s))) (_ : is_true (uniq s)), @eq nat (index (@SerTop.nth (Equality.sort T) x0 s i) s) i *) elim: s i => [|x s IHs] //= [|i]; rewrite /= ?eqxx // ltnS => lt_i_s. (* Goal: forall _ : is_true (andb (negb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s))) (uniq s)), @eq nat (if @eq_op T x (@SerTop.nth (Equality.sort T) x0 s i) then O else S (index (@SerTop.nth (Equality.sort T) x0 s i) s)) (S i) *) case/andP=> not_s_x /(IHs i)-> {IHs}//. (* Goal: @eq nat (if @eq_op T x (@SerTop.nth (Equality.sort T) x0 s i) then O else S i) (S i) *) by case: eqP not_s_x => // ->; rewrite mem_nth. Qed. Lemma index_head x s : index x (x :: s) = 0. Proof. (* Goal: @eq nat (index x (@cons (Equality.sort T) x s)) O *) by rewrite /= eqxx. Qed. Lemma index_last x s : uniq (x :: s) -> index (last x s) (x :: s) = size s. Proof. (* Goal: forall _ : is_true (uniq (@cons (Equality.sort T) x s)), @eq nat (index (@last (Equality.sort T) x s) (@cons (Equality.sort T) x s)) (@size (Equality.sort T) s) *) rewrite lastI rcons_uniq -cats1 index_cat size_belast. (* Goal: forall _ : is_true (andb (negb (@in_mem (Equality.sort T) (@last (Equality.sort T) x s) (@mem (Equality.sort T) seq_predType (@belast (Equality.sort T) x s)))) (uniq (@belast (Equality.sort T) x s))), @eq nat (if @in_mem (Equality.sort T) (@last (Equality.sort T) x s) (@mem (Equality.sort T) seq_predType (@belast (Equality.sort T) x s)) then index (@last (Equality.sort T) x s) (@belast (Equality.sort T) x s) else addn (@size (Equality.sort T) s) (index (@last (Equality.sort T) x s) (@cons (Equality.sort T) (@last (Equality.sort T) x s) (@nil (Equality.sort T))))) (@size (Equality.sort T) s) *) by case: ifP => //=; rewrite eqxx addn0. Qed. Lemma nth_uniq s i j : i < size s -> j < size s -> uniq s -> (nth s i == nth s j) = (i == j). Proof. (* Goal: forall (_ : is_true (leq (S i) (@size (Equality.sort T) s))) (_ : is_true (leq (S j) (@size (Equality.sort T) s))) (_ : is_true (uniq s)), @eq bool (@eq_op T (@SerTop.nth (Equality.sort T) x0 s i) (@SerTop.nth (Equality.sort T) x0 s j)) (@eq_op nat_eqType i j) *) move=> lt_i_s lt_j_s Us; apply/eqP/eqP=> [eq_sij|-> //]. (* Goal: @eq (Equality.sort nat_eqType) i j *) by rewrite -(index_uniq lt_i_s Us) eq_sij index_uniq. Qed. Lemma uniqPn s : reflect (exists i j, [/\ i < j, j < size s & nth s i = nth s j]) (~~ uniq s). Lemma uniqP s : reflect {in [pred i | i < size s] &, injective (nth s)} (uniq s). Lemma mem_rot s : rot n0 s =i s. Proof. (* Goal: @eq_mem (Equality.sort T) (@mem (Equality.sort T) seq_predType (@rot (Equality.sort T) n0 s)) (@mem (Equality.sort T) seq_predType s) *) by move=> x; rewrite -{2}(cat_take_drop n0 s) !mem_cat /= orbC. Qed. Lemma eqseq_rot s1 s2 : (rot n0 s1 == rot n0 s2) = (s1 == s2). Proof. (* Goal: @eq bool (@eq_op seq_eqType (@rot (Equality.sort T) n0 s1) (@rot (Equality.sort T) n0 s2)) (@eq_op seq_eqType s1 s2) *) by apply: inj_eq; apply: rot_inj. Qed. Variant rot_to_spec s x := RotToSpec i s' of rot i s = x :: s'. Lemma rot_to s x : x \in s -> rot_to_spec s x. Proof. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType s)), rot_to_spec s x *) move=> s_x; pose i := index x s; exists i (drop i.+1 s ++ take i s). (* Goal: @eq (list (Equality.sort T)) (@rot (Equality.sort T) i s) (@cons (Equality.sort T) x (@cat (Equality.sort T) (@drop (Equality.sort T) (S i) s) (@take (Equality.sort T) i s))) *) rewrite -cat_cons {}/i; congr cat; elim: s s_x => //= y s IHs. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) seq_predType (@cons (Equality.sort T) y s))), @eq (list (Equality.sort T)) match (if @eq_op T y x then O else S (index x s)) with | O => @cons (Equality.sort T) y s | S n' => @drop (Equality.sort T) n' s end (@cons (Equality.sort T) x (@drop (Equality.sort T) (if @eq_op T y x then O else S (index x s)) s)) *) by rewrite eq_sym in_cons; case: eqP => // -> _; rewrite drop0. Qed. End EqSeq. Definition inE := (mem_seq1, in_cons, inE). Prenex Implicits mem_seq1 uniq undup index. Arguments eqseq {T} !_ !_. Arguments eqseqP {T x y}. Arguments hasP {T a s}. Arguments hasPn {T a s}. Arguments allP {T a s}. Arguments allPn {T a s}. Arguments nseqP {T n x y}. Arguments count_memPn {T x s}. Section NthTheory. Lemma nthP (T : eqType) (s : seq T) x x0 : reflect (exists2 i, i < size s & nth x0 s i = x) (x \in s). Variable T : Type. Lemma has_nthP (a : pred T) s x0 : reflect (exists2 i, i < size s & a (nth x0 s i)) (has a s). Proof. (* Goal: Bool.reflect (@ex2 nat (fun i : nat => is_true (leq (S i) (@size T s))) (fun i : nat => is_true (a (@nth T x0 s i)))) (@has T a s) *) elim: s => [|x s IHs] /=; first by right; case. (* Goal: Bool.reflect (@ex2 nat (fun i : nat => is_true (leq (S i) (S (@size T s)))) (fun i : nat => is_true (a (@nth T x0 (@cons T x s) i)))) (orb (a x) (@has T a s)) *) case nax: (a x); first by left; exists 0. (* Goal: Bool.reflect (@ex2 nat (fun i : nat => is_true (leq (S i) (S (@size T s)))) (fun i : nat => is_true (a (@nth T x0 (@cons T x s) i)))) (orb false (@has T a s)) *) by apply: (iffP IHs) => [[i]|[[|i]]]; [exists i.+1 | rewrite nax | exists i]. Qed. Lemma all_nthP (a : pred T) s x0 : reflect (forall i, i < size s -> a (nth x0 s i)) (all a s). Proof. (* Goal: Bool.reflect (forall (i : nat) (_ : is_true (leq (S i) (@size T s))), is_true (a (@nth T x0 s i))) (@all T a s) *) rewrite -(eq_all (fun x => negbK (a x))) all_predC. (* Goal: Bool.reflect (forall (i : nat) (_ : is_true (leq (S i) (@size T s))), is_true (a (@nth T x0 s i))) (negb (@has T (fun x : T => negb (a x)) s)) *) case: (has_nthP _ _ x0) => [na_s | a_s]; [right=> a_s | left=> i lti]. (* Goal: is_true (a (@nth T x0 s i)) *) (* Goal: False *) by case: na_s => i lti; rewrite a_s. (* Goal: is_true (a (@nth T x0 s i)) *) by apply/idPn=> na_si; case: a_s; exists i. Qed. End NthTheory. Lemma set_nth_default T s (y0 x0 : T) n : n < size s -> nth x0 s n = nth y0 s n. Proof. (* Goal: forall _ : is_true (leq (S n) (@size T s)), @eq T (@nth T x0 s n) (@nth T y0 s n) *) by elim: s n => [|y s' IHs] [|n] /=; auto. Qed. Lemma headI T s (x : T) : rcons s x = head x s :: behead (rcons s x). Proof. (* Goal: @eq (list T) (@rcons T s x) (@cons T (@head T x s) (@behead T (@rcons T s x))) *) by case: s. Qed. Arguments nthP {T s x}. Arguments has_nthP {T a s}. Arguments all_nthP {T a s}. Definition bitseq := seq bool. Canonical bitseq_eqType := Eval hnf in [eqType of bitseq]. Canonical bitseq_predType := Eval hnf in [predType of bitseq]. Fixpoint incr_nth v i {struct i} := if v is n :: v' then if i is i'.+1 then n :: incr_nth v' i' else n.+1 :: v' else ncons i 0 [:: 1]. Lemma nth_incr_nth v i j : nth 0 (incr_nth v i) j = (i == j) + nth 0 v j. Proof. (* Goal: @eq nat (@nth nat O (incr_nth v i) j) (addn (nat_of_bool (@eq_op nat_eqType i j)) (@nth nat O v j)) *) elim: v i j => [|n v IHv] [|i] [|j] //=; rewrite ?eqSS ?addn0 //; try by case j. (* Goal: @eq nat (@nth nat O (@ncons nat i O (@cons nat (S O) (@nil nat))) j) (nat_of_bool (@eq_op nat_eqType i j)) *) elim: i j => [|i IHv] [|j] //=; rewrite ?eqSS //; by case j. Qed. Lemma size_incr_nth v i : size (incr_nth v i) = if i < size v then size v else i.+1. Proof. (* Goal: @eq nat (@size nat (incr_nth v i)) (if leq (S i) (@size nat v) then @size nat v else S i) *) elim: v i => [|n v IHv] [|i] //=; first by rewrite size_ncons /= addn1. (* Goal: @eq nat (S (@size nat (incr_nth v i))) (if leq (S (S i)) (S (@size nat v)) then S (@size nat v) else S (S i)) *) by rewrite IHv; apply: fun_if. Qed. Lemma incr_nth_inj v : injective (incr_nth v). Proof. (* Goal: @injective (list nat) nat (incr_nth v) *) move=> i j /(congr1 (nth 0 ^~ i)); apply: contra_eq => neq_ij. (* Goal: is_true (negb (@eq_op nat_eqType (@nth nat O (incr_nth v i) i) (@nth nat O (incr_nth v j) i))) *) by rewrite !nth_incr_nth eqn_add2r eqxx /nat_of_bool ifN_eqC. Qed. Lemma incr_nthC v i j : incr_nth (incr_nth v i) j = incr_nth (incr_nth v j) i. Section PermSeq. Variable T : eqType. Implicit Type s : seq T. Definition perm_eq s1 s2 := all [pred x | count_mem x s1 == count_mem x s2] (s1 ++ s2). Lemma perm_eqP s1 s2 : reflect (count^~ s1 =1 count^~ s2) (perm_eq s1 s2). Proof. (* Goal: Bool.reflect (@eqfun nat (pred (Equality.sort T)) (fun x : pred (Equality.sort T) => @count (Equality.sort T) x s1) (fun x : pred (Equality.sort T) => @count (Equality.sort T) x s2)) (perm_eq s1 s2) *) apply: (iffP allP) => /= [eq_cnt1 a | eq_cnt x _]; last exact/eqP. (* Goal: @eq nat (@count (Equality.sort T) a s1) (@count (Equality.sort T) a s2) *) elim: {a}_.+1 {-2}a (ltnSn (count a (s1 ++ s2))) => // n IHn a le_an. (* Goal: @eq nat (@count (Equality.sort T) a s1) (@count (Equality.sort T) a s2) *) have [/eqP|] := posnP (count a (s1 ++ s2)). (* Goal: forall _ : is_true (leq (S O) (@count (Equality.sort T) a (@cat (Equality.sort T) s1 s2))), @eq nat (@count (Equality.sort T) a s1) (@count (Equality.sort T) a s2) *) (* Goal: forall _ : is_true (@eq_op nat_eqType (@count (Equality.sort T) a (@cat (Equality.sort T) s1 s2)) O), @eq nat (@count (Equality.sort T) a s1) (@count (Equality.sort T) a s2) *) by rewrite count_cat addn_eq0; do 2!case: eqP => // ->. (* Goal: forall _ : is_true (leq (S O) (@count (Equality.sort T) a (@cat (Equality.sort T) s1 s2))), @eq nat (@count (Equality.sort T) a s1) (@count (Equality.sort T) a s2) *) rewrite -has_count => /hasP[x s12x a_x]; pose a' := predD1 a x. (* Goal: @eq nat (@count (Equality.sort T) a s1) (@count (Equality.sort T) a s2) *) have cnt_a' s: count a s = count_mem x s + count a' s. (* Goal: @eq nat (@count (Equality.sort T) a s1) (@count (Equality.sort T) a s2) *) (* Goal: @eq nat (@count (Equality.sort T) a s) (addn (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s) (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) a') s)) *) rewrite -count_predUI -[LHS]addn0 -(count_pred0 s). (* Goal: @eq nat (@count (Equality.sort T) a s1) (@count (Equality.sort T) a s2) *) (* Goal: @eq nat (addn (@count (Equality.sort T) a s) (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred0 (Equality.sort T))) s)) (addn (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@predU (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) (@pred_of_simpl (Equality.sort T) a'))) s) (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@predI (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) (@pred_of_simpl (Equality.sort T) a'))) s)) *) by congr (_ + _); apply: eq_count => y /=; case: eqP => // ->. (* Goal: @eq nat (@count (Equality.sort T) a s1) (@count (Equality.sort T) a s2) *) rewrite !cnt_a' (eqnP (eq_cnt1 _ s12x)) (IHn a') // -ltnS. (* Goal: is_true (leq (S (S (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) a') (@cat (Equality.sort T) s1 s2)))) (S n)) *) apply: leq_trans le_an. (* Goal: is_true (leq (S (S (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) a') (@cat (Equality.sort T) s1 s2)))) (S (@count (Equality.sort T) a (@cat (Equality.sort T) s1 s2)))) *) by rewrite ltnS cnt_a' -add1n leq_add2r -has_count has_pred1. Qed. Lemma perm_eq_refl s : perm_eq s s. Proof. (* Goal: is_true (perm_eq s s) *) exact/perm_eqP. Qed. Hint Resolve perm_eq_refl : core. Lemma perm_eq_sym : symmetric perm_eq. Proof. (* Goal: @symmetric (list (Equality.sort T)) perm_eq *) by move=> s1 s2; apply/perm_eqP/perm_eqP=> ? ?. Qed. Lemma perm_eq_trans : transitive perm_eq. Proof. (* Goal: @transitive (list (Equality.sort T)) perm_eq *) by move=> s2 s1 s3 /perm_eqP-eq12 /perm_eqP/(ftrans eq12)/perm_eqP. Qed. Lemma perm_eqlP s1 s2 : reflect (perm_eql s1 s2) (perm_eq s1 s2). Lemma perm_eqrP s1 s2 : reflect (perm_eqr s1 s2) (perm_eq s1 s2). Proof. (* Goal: Bool.reflect (@eqfun bool (list (Equality.sort T)) (fun x : list (Equality.sort T) => perm_eq x s1) (fun x : list (Equality.sort T) => perm_eq x s2)) (perm_eq s1 s2) *) apply: (iffP idP) => [/perm_eqlP eq12 s3| <- //]. (* Goal: @eq bool (perm_eq s3 s1) (perm_eq s3 s2) *) by rewrite !(perm_eq_sym s3) eq12. Qed. Lemma perm_catC s1 s2 : perm_eql (s1 ++ s2) (s2 ++ s1). Proof. (* Goal: @eqfun bool (list (Equality.sort T)) (perm_eq (@cat (Equality.sort T) s1 s2)) (perm_eq (@cat (Equality.sort T) s2 s1)) *) by apply/perm_eqlP; apply/perm_eqP=> a; rewrite !count_cat addnC. Qed. Lemma perm_cat2l s1 s2 s3 : perm_eq (s1 ++ s2) (s1 ++ s3) = perm_eq s2 s3. Proof. (* Goal: @eq bool (perm_eq (@cat (Equality.sort T) s1 s2) (@cat (Equality.sort T) s1 s3)) (perm_eq s2 s3) *) apply/perm_eqP/perm_eqP=> eq23 a; apply/eqP; by move/(_ a)/eqP: eq23; rewrite !count_cat eqn_add2l. Qed. Lemma perm_cons x s1 s2 : perm_eq (x :: s1) (x :: s2) = perm_eq s1 s2. Proof. (* Goal: @eq bool (perm_eq (@cons (Equality.sort T) x s1) (@cons (Equality.sort T) x s2)) (perm_eq s1 s2) *) exact: (perm_cat2l [::x]). Qed. Lemma perm_cat2r s1 s2 s3 : perm_eq (s2 ++ s1) (s3 ++ s1) = perm_eq s2 s3. Proof. (* Goal: @eq bool (perm_eq (@cat (Equality.sort T) s2 s1) (@cat (Equality.sort T) s3 s1)) (perm_eq s2 s3) *) by do 2!rewrite perm_eq_sym perm_catC; apply: perm_cat2l. Qed. Lemma perm_catAC s1 s2 s3 : perm_eql ((s1 ++ s2) ++ s3) ((s1 ++ s3) ++ s2). Proof. (* Goal: @eqfun bool (list (Equality.sort T)) (perm_eq (@cat (Equality.sort T) (@cat (Equality.sort T) s1 s2) s3)) (perm_eq (@cat (Equality.sort T) (@cat (Equality.sort T) s1 s3) s2)) *) by apply/perm_eqlP; rewrite -!catA perm_cat2l perm_catC. Qed. Lemma perm_catCA s1 s2 s3 : perm_eql (s1 ++ s2 ++ s3) (s2 ++ s1 ++ s3). Proof. (* Goal: @eqfun bool (list (Equality.sort T)) (perm_eq (@cat (Equality.sort T) s1 (@cat (Equality.sort T) s2 s3))) (perm_eq (@cat (Equality.sort T) s2 (@cat (Equality.sort T) s1 s3))) *) by apply/perm_eqlP; rewrite !catA perm_cat2r perm_catC. Qed. Lemma perm_rcons x s : perm_eql (rcons s x) (x :: s). Lemma perm_rot n s : perm_eql (rot n s) s. Proof. (* Goal: @eqfun bool (list (Equality.sort T)) (perm_eq (@rot (Equality.sort T) n s)) (perm_eq s) *) by move=> /= s2; rewrite perm_catC cat_take_drop. Qed. Lemma perm_rotr n s : perm_eql (rotr n s) s. Proof. (* Goal: @eqfun bool (list (Equality.sort T)) (perm_eq (@rotr (Equality.sort T) n s)) (perm_eq s) *) exact: perm_rot. Qed. Lemma perm_eq_rev s : perm_eq s (rev s). Proof. (* Goal: is_true (perm_eq s (@rev (Equality.sort T) s)) *) by apply/perm_eqP=> i; rewrite count_rev. Qed. Lemma perm_filter s1 s2 P : perm_eq s1 s2 -> perm_eq (filter P s1) (filter P s2). Proof. (* Goal: forall _ : is_true (perm_eq s1 s2), is_true (perm_eq (@filter (Equality.sort T) P s1) (@filter (Equality.sort T) P s2)) *) by move/perm_eqP=> s12_count; apply/perm_eqP=> Q; rewrite !count_filter. Qed. Lemma perm_filterC a s : perm_eql (filter a s ++ filter (predC a) s) s. Proof. (* Goal: @eqfun bool (list (Equality.sort T)) (perm_eq (@cat (Equality.sort T) (@filter (Equality.sort T) a s) (@filter (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@predC (Equality.sort T) a)) s))) (perm_eq s) *) apply/perm_eqlP; elim: s => //= x s IHs. (* Goal: is_true (perm_eq (@cat (Equality.sort T) (if a x then @cons (Equality.sort T) x (@filter (Equality.sort T) a s) else @filter (Equality.sort T) a s) (if negb (a x) then @cons (Equality.sort T) x (@filter (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@predC (Equality.sort T) a)) s) else @filter (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@predC (Equality.sort T) a)) s)) (@cons (Equality.sort T) x s)) *) by case: (a x); last rewrite /= -cat1s perm_catCA; rewrite perm_cons. Qed. Lemma perm_eq_mem s1 s2 : perm_eq s1 s2 -> s1 =i s2. Proof. (* Goal: forall _ : is_true (perm_eq s1 s2), @eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s1) (@mem (Equality.sort T) (seq_predType T) s2) *) by move/perm_eqP=> eq12 x; rewrite -!has_pred1 !has_count eq12. Qed. Lemma perm_eq_all s1 s2 P : perm_eq s1 s2 -> all P s1 = all P s2. Proof. (* Goal: forall _ : is_true (perm_eq s1 s2), @eq bool (@all (Equality.sort T) P s1) (@all (Equality.sort T) P s2) *) by move/perm_eq_mem/eq_all_r. Qed. Lemma perm_eq_size s1 s2 : perm_eq s1 s2 -> size s1 = size s2. Proof. (* Goal: forall _ : is_true (perm_eq s1 s2), @eq nat (@size (Equality.sort T) s1) (@size (Equality.sort T) s2) *) by move/perm_eqP=> eq12; rewrite -!count_predT eq12. Qed. Lemma perm_eq_small s1 s2 : size s2 <= 1 -> perm_eq s1 s2 -> s1 = s2. Proof. (* Goal: forall (_ : is_true (leq (@size (Equality.sort T) s2) (S O))) (_ : is_true (perm_eq s1 s2)), @eq (list (Equality.sort T)) s1 s2 *) move=> s2_le1 eqs12; move/perm_eq_size: eqs12 s2_le1 (perm_eq_mem eqs12). (* Goal: forall (_ : @eq nat (@size (Equality.sort T) s1) (@size (Equality.sort T) s2)) (_ : is_true (leq (@size (Equality.sort T) s2) (S O))) (_ : @eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s1) (@mem (Equality.sort T) (seq_predType T) s2)), @eq (list (Equality.sort T)) s1 s2 *) by case: s2 s1 => [|x []] // [|y []] // _ _ /(_ x); rewrite !inE eqxx => /eqP->. Qed. Lemma uniq_leq_size s1 s2 : uniq s1 -> {subset s1 <= s2} -> size s1 <= size s2. Proof. (* Goal: forall (_ : is_true (@uniq T s1)) (_ : @sub_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s1) (@mem (Equality.sort T) (seq_predType T) s2)), is_true (leq (@size (Equality.sort T) s1) (@size (Equality.sort T) s2)) *) elim: s1 s2 => //= x s1 IHs s2 /andP[not_s1x Us1] /allP/=/andP[s2x /allP ss12]. (* Goal: is_true (leq (S (@size (Equality.sort T) s1)) (@size (Equality.sort T) s2)) *) have [i s3 def_s2] := rot_to s2x; rewrite -(size_rot i s2) def_s2. (* Goal: is_true (leq (S (@size (Equality.sort T) s1)) (@size (Equality.sort T) (@cons (Equality.sort T) x s3))) *) apply: IHs => // y s1y; have:= ss12 y s1y. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) s2)), is_true (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) s3)) *) by rewrite -(mem_rot i) def_s2 inE (negPf (memPn _ y s1y)). Qed. Lemma leq_size_uniq s1 s2 : uniq s1 -> {subset s1 <= s2} -> size s2 <= size s1 -> uniq s2. Proof. (* Goal: forall (_ : is_true (@uniq T s1)) (_ : @sub_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s1) (@mem (Equality.sort T) (seq_predType T) s2)) (_ : is_true (leq (@size (Equality.sort T) s2) (@size (Equality.sort T) s1))), is_true (@uniq T s2) *) elim: s1 s2 => [[] | x s1 IHs s2] // Us1x; have /andP[not_s1x Us1] := Us1x. (* Goal: forall (_ : @sub_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) x s1)) (@mem (Equality.sort T) (seq_predType T) s2)) (_ : is_true (leq (@size (Equality.sort T) s2) (@size (Equality.sort T) (@cons (Equality.sort T) x s1)))), is_true (@uniq T s2) *) case/allP/andP=> /rot_to[i s3 def_s2] /allP ss12 le_s21. (* Goal: is_true (@uniq T s2) *) rewrite -(rot_uniq i) -(size_rot i) def_s2 /= in le_s21 *. have ss13 y (s1y : y \in s1): y \in s3. (* Goal: is_true (@uniq T s2) *) (* Goal: is_true (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) s3)) *) by have:= ss12 y s1y; rewrite -(mem_rot i) def_s2 inE (negPf (memPn _ y s1y)). (* Goal: is_true (@uniq T s2) *) rewrite IHs // andbT; apply: contraL _ le_s21 => s3x; rewrite -leqNgt. by apply/(uniq_leq_size Us1x)/allP; rewrite /= s3x; apply/allP. Qed. Qed. Lemma uniq_size_uniq s1 s2 : uniq s1 -> s1 =i s2 -> uniq s2 = (size s2 == size s1). Proof. (* Goal: forall (_ : is_true (@uniq T s1)) (_ : @eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s1) (@mem (Equality.sort T) (seq_predType T) s2)), @eq bool (@uniq T s2) (@eq_op nat_eqType (@size (Equality.sort T) s2) (@size (Equality.sort T) s1)) *) move=> Us1 eqs12; apply/idP/idP=> [Us2 | /eqP eq_sz12]. (* Goal: is_true (@uniq T s2) *) (* Goal: is_true (@eq_op nat_eqType (@size (Equality.sort T) s2) (@size (Equality.sort T) s1)) *) by rewrite eqn_leq !uniq_leq_size // => y; rewrite eqs12. (* Goal: is_true (@uniq T s2) *) by apply: (leq_size_uniq Us1) => [y|]; rewrite (eqs12, eq_sz12). Qed. Lemma leq_size_perm s1 s2 : uniq s1 -> {subset s1 <= s2} -> size s2 <= size s1 -> s1 =i s2 /\ size s1 = size s2. Proof. (* Goal: forall (_ : is_true (@uniq T s1)) (_ : @sub_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s1) (@mem (Equality.sort T) (seq_predType T) s2)) (_ : is_true (leq (@size (Equality.sort T) s2) (@size (Equality.sort T) s1))), and (@eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s1) (@mem (Equality.sort T) (seq_predType T) s2)) (@eq nat (@size (Equality.sort T) s1) (@size (Equality.sort T) s2)) *) move=> Us1 ss12 le_s21; have Us2: uniq s2 := leq_size_uniq Us1 ss12 le_s21. (* Goal: and (@eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s1) (@mem (Equality.sort T) (seq_predType T) s2)) (@eq nat (@size (Equality.sort T) s1) (@size (Equality.sort T) s2)) *) suffices: s1 =i s2 by split; last by apply/eqP; rewrite -uniq_size_uniq. (* Goal: @eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s1) (@mem (Equality.sort T) (seq_predType T) s2) *) move=> x; apply/idP/idP=> [/ss12// | s2x]; apply: contraLR le_s21 => not_s1x. (* Goal: is_true (negb (leq (@size (Equality.sort T) s2) (@size (Equality.sort T) s1))) *) rewrite -ltnNge (@uniq_leq_size (x :: s1)) /= ?not_s1x //. (* Goal: @sub_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) (@cons (Equality.sort T) x s1)) (@mem (Equality.sort T) (seq_predType T) s2) *) by apply/allP; rewrite /= s2x; apply/allP. Qed. Lemma perm_uniq s1 s2 : s1 =i s2 -> size s1 = size s2 -> uniq s1 = uniq s2. Proof. (* Goal: forall (_ : @eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s1) (@mem (Equality.sort T) (seq_predType T) s2)) (_ : @eq nat (@size (Equality.sort T) s1) (@size (Equality.sort T) s2)), @eq bool (@uniq T s1) (@uniq T s2) *) move=> Es12 Esz12. (* Goal: @eq bool (@uniq T s1) (@uniq T s2) *) by apply/idP/idP=> Us; rewrite (uniq_size_uniq Us) ?Esz12 ?eqxx. Qed. Lemma perm_eq_uniq s1 s2 : perm_eq s1 s2 -> uniq s1 = uniq s2. Proof. (* Goal: forall _ : is_true (perm_eq s1 s2), @eq bool (@uniq T s1) (@uniq T s2) *) by move=> eq_s12; apply: perm_uniq; [apply: perm_eq_mem | apply: perm_eq_size]. Qed. Lemma uniq_perm_eq s1 s2 : uniq s1 -> uniq s2 -> s1 =i s2 -> perm_eq s1 s2. Lemma count_mem_uniq s : (forall x, count_mem x s = (x \in s)) -> uniq s. Proof. (* Goal: forall _ : forall x : Equality.sort T, @eq nat (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s) (nat_of_bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) s))), is_true (@uniq T s) *) move=> count1_s; have Uus := undup_uniq s. (* Goal: is_true (@uniq T s) *) suffices: perm_eq s (undup s) by move/perm_eq_uniq->. (* Goal: is_true (perm_eq s (@undup T s)) *) by apply/allP=> x _; apply/eqP; rewrite (count_uniq_mem x Uus) mem_undup. Qed. Lemma catCA_perm_ind P : (forall s1 s2 s3, P (s1 ++ s2 ++ s3) -> P (s2 ++ s1 ++ s3)) -> (forall s1 s2, perm_eq s1 s2 -> P s1 -> P s2). Proof. (* Goal: forall (_ : forall (s1 s2 s3 : list (Equality.sort T)) (_ : P (@cat (Equality.sort T) s1 (@cat (Equality.sort T) s2 s3))), P (@cat (Equality.sort T) s2 (@cat (Equality.sort T) s1 s3))) (s1 s2 : list (Equality.sort T)) (_ : is_true (perm_eq s1 s2)) (_ : P s1), P s2 *) move=> PcatCA s1 s2 eq_s12; rewrite -[s1]cats0 -[s2]cats0. (* Goal: forall _ : P (@cat (Equality.sort T) s1 (@nil (Equality.sort T))), P (@cat (Equality.sort T) s2 (@nil (Equality.sort T))) *) elim: s2 nil => [| x s2 IHs] s3 in s1 eq_s12 *. by case: s1 {eq_s12}(perm_eq_size eq_s12). have /rot_to[i s' def_s1]: x \in s1 by rewrite (perm_eq_mem eq_s12) mem_head. rewrite -(cat_take_drop i s1) -catA => /PcatCA. rewrite catA -/(rot i s1) def_s1 /= -cat1s => /PcatCA/IHs/PcatCA; apply. by rewrite -(perm_cons x) -def_s1 perm_rot. Qed. Qed. Lemma catCA_perm_subst R F : (forall s1 s2 s3, F (s1 ++ s2 ++ s3) = F (s2 ++ s1 ++ s3) :> R) -> (forall s1 s2, perm_eq s1 s2 -> F s1 = F s2). Proof. (* Goal: forall (_ : forall s1 s2 s3 : list (Equality.sort T), @eq R (F (@cat (Equality.sort T) s1 (@cat (Equality.sort T) s2 s3))) (F (@cat (Equality.sort T) s2 (@cat (Equality.sort T) s1 s3)))) (s1 s2 : list (Equality.sort T)) (_ : is_true (perm_eq s1 s2)), @eq R (F s1) (F s2) *) move=> FcatCA s1 s2 /catCA_perm_ind => ind_s12. (* Goal: @eq R (F s1) (F s2) *) by apply: (ind_s12 (eq _ \o F)) => //= *; rewrite FcatCA. Qed. End PermSeq. Notation perm_eql s1 s2 := (perm_eq s1 =1 perm_eq s2). Notation perm_eqr s1 s2 := (perm_eq^~ s1 =1 perm_eq^~ s2). Arguments perm_eqP {T s1 s2}. Arguments perm_eqlP {T s1 s2}. Arguments perm_eqrP {T s1 s2}. Prenex Implicits perm_eq. Hint Resolve perm_eq_refl : core. Section RotrLemmas. Variables (n0 : nat) (T : Type) (T' : eqType). Implicit Type s : seq T. Lemma size_rotr s : size (rotr n0 s) = size s. Proof. (* Goal: @eq nat (@size T (@rotr T n0 s)) (@size T s) *) by rewrite size_rot. Qed. Lemma mem_rotr (s : seq T') : rotr n0 s =i s. Proof. (* Goal: @eq_mem (Equality.sort T') (@mem (Equality.sort T') (seq_predType T') (@rotr (Equality.sort T') n0 s)) (@mem (Equality.sort T') (seq_predType T') s) *) by move=> x; rewrite mem_rot. Qed. Lemma rotr_size_cat s1 s2 : rotr (size s2) (s1 ++ s2) = s2 ++ s1. Proof. (* Goal: @eq (list T) (@rotr T (@size T s2) (@cat T s1 s2)) (@cat T s2 s1) *) by rewrite /rotr size_cat addnK rot_size_cat. Qed. Lemma rotr1_rcons x s : rotr 1 (rcons s x) = x :: s. Proof. (* Goal: @eq (list T) (@rotr T (S O) (@rcons T s x)) (@cons T x s) *) by rewrite -rot1_cons rotK. Qed. Lemma has_rotr a s : has a (rotr n0 s) = has a s. Proof. (* Goal: @eq bool (@has T a (@rotr T n0 s)) (@has T a s) *) by rewrite has_rot. Qed. Lemma rotr_uniq (s : seq T') : uniq (rotr n0 s) = uniq s. Proof. (* Goal: @eq bool (@uniq T' (@rotr (Equality.sort T') n0 s)) (@uniq T' s) *) by rewrite rot_uniq. Qed. Lemma rotrK : cancel (@rotr T n0) (rot n0). Proof. (* Goal: @cancel (list T) (list T) (@rotr T n0) (@rot T n0) *) move=> s; have [lt_n0s | ge_n0s] := ltnP n0 (size s). (* Goal: @eq (list T) (@rot T n0 (@rotr T n0 s)) s *) (* Goal: @eq (list T) (@rot T n0 (@rotr T n0 s)) s *) by rewrite -{1}(subKn (ltnW lt_n0s)) -{1}[size s]size_rotr; apply: rotK. (* Goal: @eq (list T) (@rot T n0 (@rotr T n0 s)) s *) by rewrite -{2}(rot_oversize ge_n0s) /rotr (eqnP ge_n0s) rot0. Qed. Lemma rotr_inj : injective (@rotr T n0). Proof. (* Goal: @injective (list T) (list T) (@rotr T n0) *) exact (can_inj rotrK). Qed. Lemma rev_rotr s : rev (rotr n0 s) = rot n0 (rev s). Proof. (* Goal: @eq (list T) (@rev T (@rotr T n0 s)) (@rot T n0 (@rev T s)) *) by rewrite rev_cat -take_rev -drop_rev. Qed. Lemma rev_rot s : rev (rot n0 s) = rotr n0 (rev s). Proof. (* Goal: @eq (list T) (@rev T (@rot T n0 s)) (@rotr T n0 (@rev T s)) *) by rewrite (canRL revK (rev_rotr _)) revK. Qed. End RotrLemmas. Section RotCompLemmas. Variable T : Type. Implicit Type s : seq T. Lemma rot_addn m n s : m + n <= size s -> rot (m + n) s = rot m (rot n s). Proof. (* Goal: forall _ : is_true (leq (addn m n) (@size T s)), @eq (list T) (@rot T (addn m n) s) (@rot T m (@rot T n s)) *) move=> sz_s; rewrite {1}/rot -[take _ s](cat_take_drop n). (* Goal: @eq (list T) (@cat T (@drop T (addn m n) s) (@cat T (@take T n (@take T (addn m n) s)) (@drop T n (@take T (addn m n) s)))) (@rot T m (@rot T n s)) *) rewrite 5!(catA, =^~ rot_size_cat) !cat_take_drop. (* Goal: @eq (list T) (@rot T (@size T (@drop T n (@take T (addn m n) s))) (@rot T (@size T (@take T n (@take T (addn m n) s))) s)) (@rot T m (@rot T n s)) *) by rewrite size_drop !size_takel ?leq_addl ?addnK. Qed. Lemma rotS n s : n < size s -> rot n.+1 s = rot 1 (rot n s). Proof. (* Goal: forall _ : is_true (leq (S n) (@size T s)), @eq (list T) (@rot T (S n) s) (@rot T (S O) (@rot T n s)) *) exact: (@rot_addn 1). Qed. Lemma rot_add_mod m n s : n <= size s -> m <= size s -> rot m (rot n s) = rot (if m + n <= size s then m + n else m + n - size s) s. Proof. (* Goal: forall (_ : is_true (leq n (@size T s))) (_ : is_true (leq m (@size T s))), @eq (list T) (@rot T m (@rot T n s)) (@rot T (if leq (addn m n) (@size T s) then addn m n else subn (addn m n) (@size T s)) s) *) move=> Hn Hm; case: leqP => [/rot_addn // | /ltnW Hmn]; symmetry. (* Goal: @eq (list T) (@rot T (subn (addn m n) (@size T s)) s) (@rot T m (@rot T n s)) *) by rewrite -{2}(rotK n s) /rotr -rot_addn size_rot addnBA ?subnK ?addnK. Qed. Lemma rot_rot m n s : rot m (rot n s) = rot n (rot m s). Proof. (* Goal: @eq (list T) (@rot T m (@rot T n s)) (@rot T n (@rot T m s)) *) case: (ltnP (size s) m) => Hm. (* Goal: @eq (list T) (@rot T m (@rot T n s)) (@rot T n (@rot T m s)) *) (* Goal: @eq (list T) (@rot T m (@rot T n s)) (@rot T n (@rot T m s)) *) by rewrite !(@rot_oversize T m) ?size_rot 1?ltnW. (* Goal: @eq (list T) (@rot T m (@rot T n s)) (@rot T n (@rot T m s)) *) case: (ltnP (size s) n) => Hn. (* Goal: @eq (list T) (@rot T m (@rot T n s)) (@rot T n (@rot T m s)) *) (* Goal: @eq (list T) (@rot T m (@rot T n s)) (@rot T n (@rot T m s)) *) by rewrite !(@rot_oversize T n) ?size_rot 1?ltnW. (* Goal: @eq (list T) (@rot T m (@rot T n s)) (@rot T n (@rot T m s)) *) by rewrite !rot_add_mod 1?addnC. Qed. Lemma rot_rotr m n s : rot m (rotr n s) = rotr n (rot m s). Proof. (* Goal: @eq (list T) (@rot T m (@rotr T n s)) (@rotr T n (@rot T m s)) *) by rewrite {2}/rotr size_rot rot_rot. Qed. Lemma rotr_rotr m n s : rotr m (rotr n s) = rotr n (rotr m s). Proof. (* Goal: @eq (list T) (@rotr T m (@rotr T n s)) (@rotr T n (@rotr T m s)) *) by rewrite /rotr !size_rot rot_rot. Qed. End RotCompLemmas. Section Mask. Variables (n0 : nat) (T : Type). Implicit Types (m : bitseq) (s : seq T). Fixpoint mask m s {struct m} := match m, s with | b :: m', x :: s' => if b then x :: mask m' s' else mask m' s' | _, _ => [::] end. Lemma mask_false s n : mask (nseq n false) s = [::]. Proof. (* Goal: @eq (list T) (mask (@nseq bool n false) s) (@nil T) *) by elim: s n => [|x s IHs] [|n] /=. Qed. Lemma mask_true s n : size s <= n -> mask (nseq n true) s = s. Proof. (* Goal: forall _ : is_true (leq (@size T s) n), @eq (list T) (mask (@nseq bool n true) s) s *) by elim: s n => [|x s IHs] [|n] //= Hn; congr (_ :: _); apply: IHs. Qed. Lemma mask0 m : mask m [::] = [::]. Proof. (* Goal: @eq (list T) (mask m (@nil T)) (@nil T) *) by case: m. Qed. Lemma mask1 b x : mask [:: b] [:: x] = nseq b x. Proof. (* Goal: @eq (list T) (mask (@cons bool b (@nil bool)) (@cons T x (@nil T))) (@nseq T (nat_of_bool b) x) *) by case: b. Qed. Lemma mask_cons b m x s : mask (b :: m) (x :: s) = nseq b x ++ mask m s. Proof. (* Goal: @eq (list T) (mask (@cons bool b m) (@cons T x s)) (@cat T (@nseq T (nat_of_bool b) x) (mask m s)) *) by case: b. Qed. Lemma size_mask m s : size m = size s -> size (mask m s) = count id m. Proof. (* Goal: forall _ : @eq nat (@size bool m) (@size T s), @eq nat (@size T (mask m s)) (@count bool (fun x : bool => x) m) *) by move: m s; apply: seq2_ind => // -[] x m s /= ->. Qed. Lemma mask_cat m1 m2 s1 s2 : size m1 = size s1 -> mask (m1 ++ m2) (s1 ++ s2) = mask m1 s1 ++ mask m2 s2. Proof. (* Goal: forall _ : @eq nat (@size bool m1) (@size T s1), @eq (list T) (mask (@cat bool m1 m2) (@cat T s1 s2)) (@cat T (mask m1 s1) (mask m2 s2)) *) by move: m1 s1; apply: seq2_ind => // -[] m1 x1 s1 /= ->. Qed. Lemma has_mask_cons a b m x s : has a (mask (b :: m) (x :: s)) = b && a x || has a (mask m s). Proof. (* Goal: @eq bool (@has T a (mask (@cons bool b m) (@cons T x s))) (orb (andb b (a x)) (@has T a (mask m s))) *) by case: b. Qed. Lemma has_mask a m s : has a (mask m s) -> has a s. Proof. (* Goal: forall _ : is_true (@has T a (mask m s)), is_true (@has T a s) *) elim: m s => [|b m IHm] [|x s] //; rewrite has_mask_cons /= andbC. (* Goal: forall _ : is_true (orb (andb (a x) b) (@has T a (mask m s))), is_true (orb (a x) (@has T a s)) *) by case: (a x) => //= /IHm. Qed. Lemma mask_rot m s : size m = size s -> mask (rot n0 m) (rot n0 s) = rot (count id (take n0 m)) (mask m s). Proof. (* Goal: forall _ : @eq nat (@size bool m) (@size T s), @eq (list T) (mask (@rot bool n0 m) (@rot T n0 s)) (@rot T (@count bool (fun x : bool => x) (@take bool n0 m)) (mask m s)) *) move=> Ems; rewrite mask_cat ?size_drop ?Ems // -rot_size_cat. (* Goal: @eq (list T) (@rot T (@size T (mask (@take bool n0 m) (@take T n0 s))) (@cat T (mask (@take bool n0 m) (@take T n0 s)) (mask (@drop bool n0 m) (@drop T n0 s)))) (@rot T (@count bool (fun x : bool => x) (@take bool n0 m)) (mask m s)) *) by rewrite size_mask -?mask_cat ?size_take ?Ems // !cat_take_drop. Qed. Lemma resize_mask m s : {m1 | size m1 = size s & mask m s = mask m1 s}. Proof. (* Goal: @sig2 (list bool) (fun m1 : list bool => @eq nat (@size bool m1) (@size T s)) (fun m1 : list bool => @eq (list T) (mask m s) (mask m1 s)) *) by exists (take (size s) m ++ nseq (size s - size m) false); elim: s m => [|x s IHs] [|b m] //=; rewrite (size_nseq, mask_false, IHs). Qed. End Mask. Section EqMask. Variables (n0 : nat) (T : eqType). Implicit Types (s : seq T) (m : bitseq). Lemma mem_mask_cons x b m y s : (x \in mask (b :: m) (y :: s)) = b && (x == y) || (x \in mask m s). Proof. (* Goal: @eq bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@mask (Equality.sort T) (@cons bool b m) (@cons (Equality.sort T) y s)))) (orb (andb b (@eq_op T x y)) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@mask (Equality.sort T) m s)))) *) by case: b. Qed. Lemma mem_mask x m s : x \in mask m s -> x \in s. Proof. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@mask (Equality.sort T) m s))), is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) s)) *) by rewrite -!has_pred1 => /has_mask. Qed. Lemma mask_uniq s : uniq s -> forall m, uniq (mask m s). Proof. (* Goal: forall (_ : is_true (@uniq T s)) (m : bitseq), is_true (@uniq T (@mask (Equality.sort T) m s)) *) elim: s => [|x s IHs] Uxs [|b m] //=. (* Goal: is_true (@uniq T (if b then @cons (Equality.sort T) x (@mask (Equality.sort T) m s) else @mask (Equality.sort T) m s)) *) case: b Uxs => //= /andP[s'x Us]; rewrite {}IHs // andbT. (* Goal: is_true (negb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@mask (Equality.sort T) m s)))) *) by apply: contra s'x; apply: mem_mask. Qed. Lemma mem_mask_rot m s : size m = size s -> mask (rot n0 m) (rot n0 s) =i mask m s. Proof. (* Goal: forall _ : @eq nat (@size bool m) (@size (Equality.sort T) s), @eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) (@mask (Equality.sort T) (@rot bool n0 m) (@rot (Equality.sort T) n0 s))) (@mem (Equality.sort T) (seq_predType T) (@mask (Equality.sort T) m s)) *) by move=> Ems x; rewrite mask_rot // mem_rot. Qed. End EqMask. Section Subseq. Variable T : eqType. Implicit Type s : seq T. Fixpoint subseq s1 s2 := if s2 is y :: s2' then if s1 is x :: s1' then subseq (if x == y then s1' else s1) s2' else true else s1 == [::]. Lemma sub0seq s : subseq [::] s. Proof. by case: s. Qed. Proof. (* Goal: is_true (subseq (@nil (Equality.sort T)) s) *) by case: s. Qed. Lemma subseqP s1 s2 : reflect (exists2 m, size m = size s2 & s1 = mask m s2) (subseq s1 s2). Proof. (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) s2)) (fun m : list bool => @eq (list (Equality.sort T)) s1 (@mask (Equality.sort T) m s2))) (subseq s1 s2) *) elim: s2 s1 => [|y s2 IHs2] [|x s1]. (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@cons (Equality.sort T) y s2))) (fun m : list bool => @eq (list (Equality.sort T)) (@cons (Equality.sort T) x s1) (@mask (Equality.sort T) m (@cons (Equality.sort T) y s2)))) (subseq (@cons (Equality.sort T) x s1) (@cons (Equality.sort T) y s2)) *) (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@cons (Equality.sort T) y s2))) (fun m : list bool => @eq (list (Equality.sort T)) (@nil (Equality.sort T)) (@mask (Equality.sort T) m (@cons (Equality.sort T) y s2)))) (subseq (@nil (Equality.sort T)) (@cons (Equality.sort T) y s2)) *) (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@nil (Equality.sort T)))) (fun m : list bool => @eq (list (Equality.sort T)) (@cons (Equality.sort T) x s1) (@mask (Equality.sort T) m (@nil (Equality.sort T))))) (subseq (@cons (Equality.sort T) x s1) (@nil (Equality.sort T))) *) (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@nil (Equality.sort T)))) (fun m : list bool => @eq (list (Equality.sort T)) (@nil (Equality.sort T)) (@mask (Equality.sort T) m (@nil (Equality.sort T))))) (subseq (@nil (Equality.sort T)) (@nil (Equality.sort T))) *) - (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@cons (Equality.sort T) y s2))) (fun m : list bool => @eq (list (Equality.sort T)) (@cons (Equality.sort T) x s1) (@mask (Equality.sort T) m (@cons (Equality.sort T) y s2)))) (subseq (@cons (Equality.sort T) x s1) (@cons (Equality.sort T) y s2)) *) (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@cons (Equality.sort T) y s2))) (fun m : list bool => @eq (list (Equality.sort T)) (@nil (Equality.sort T)) (@mask (Equality.sort T) m (@cons (Equality.sort T) y s2)))) (subseq (@nil (Equality.sort T)) (@cons (Equality.sort T) y s2)) *) (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@nil (Equality.sort T)))) (fun m : list bool => @eq (list (Equality.sort T)) (@cons (Equality.sort T) x s1) (@mask (Equality.sort T) m (@nil (Equality.sort T))))) (subseq (@cons (Equality.sort T) x s1) (@nil (Equality.sort T))) *) (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@nil (Equality.sort T)))) (fun m : list bool => @eq (list (Equality.sort T)) (@nil (Equality.sort T)) (@mask (Equality.sort T) m (@nil (Equality.sort T))))) (subseq (@nil (Equality.sort T)) (@nil (Equality.sort T))) *) by left; exists [::]. (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@cons (Equality.sort T) y s2))) (fun m : list bool => @eq (list (Equality.sort T)) (@cons (Equality.sort T) x s1) (@mask (Equality.sort T) m (@cons (Equality.sort T) y s2)))) (subseq (@cons (Equality.sort T) x s1) (@cons (Equality.sort T) y s2)) *) (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@cons (Equality.sort T) y s2))) (fun m : list bool => @eq (list (Equality.sort T)) (@nil (Equality.sort T)) (@mask (Equality.sort T) m (@cons (Equality.sort T) y s2)))) (subseq (@nil (Equality.sort T)) (@cons (Equality.sort T) y s2)) *) (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@nil (Equality.sort T)))) (fun m : list bool => @eq (list (Equality.sort T)) (@cons (Equality.sort T) x s1) (@mask (Equality.sort T) m (@nil (Equality.sort T))))) (subseq (@cons (Equality.sort T) x s1) (@nil (Equality.sort T))) *) - (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@cons (Equality.sort T) y s2))) (fun m : list bool => @eq (list (Equality.sort T)) (@cons (Equality.sort T) x s1) (@mask (Equality.sort T) m (@cons (Equality.sort T) y s2)))) (subseq (@cons (Equality.sort T) x s1) (@cons (Equality.sort T) y s2)) *) (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@cons (Equality.sort T) y s2))) (fun m : list bool => @eq (list (Equality.sort T)) (@nil (Equality.sort T)) (@mask (Equality.sort T) m (@cons (Equality.sort T) y s2)))) (subseq (@nil (Equality.sort T)) (@cons (Equality.sort T) y s2)) *) (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@nil (Equality.sort T)))) (fun m : list bool => @eq (list (Equality.sort T)) (@cons (Equality.sort T) x s1) (@mask (Equality.sort T) m (@nil (Equality.sort T))))) (subseq (@cons (Equality.sort T) x s1) (@nil (Equality.sort T))) *) by right; do 2!case. (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@cons (Equality.sort T) y s2))) (fun m : list bool => @eq (list (Equality.sort T)) (@cons (Equality.sort T) x s1) (@mask (Equality.sort T) m (@cons (Equality.sort T) y s2)))) (subseq (@cons (Equality.sort T) x s1) (@cons (Equality.sort T) y s2)) *) (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@cons (Equality.sort T) y s2))) (fun m : list bool => @eq (list (Equality.sort T)) (@nil (Equality.sort T)) (@mask (Equality.sort T) m (@cons (Equality.sort T) y s2)))) (subseq (@nil (Equality.sort T)) (@cons (Equality.sort T) y s2)) *) - (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@cons (Equality.sort T) y s2))) (fun m : list bool => @eq (list (Equality.sort T)) (@cons (Equality.sort T) x s1) (@mask (Equality.sort T) m (@cons (Equality.sort T) y s2)))) (subseq (@cons (Equality.sort T) x s1) (@cons (Equality.sort T) y s2)) *) (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@cons (Equality.sort T) y s2))) (fun m : list bool => @eq (list (Equality.sort T)) (@nil (Equality.sort T)) (@mask (Equality.sort T) m (@cons (Equality.sort T) y s2)))) (subseq (@nil (Equality.sort T)) (@cons (Equality.sort T) y s2)) *) by left; exists (nseq (size s2).+1 false); rewrite ?size_nseq //= mask_false. (* Goal: Bool.reflect (@ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@cons (Equality.sort T) y s2))) (fun m : list bool => @eq (list (Equality.sort T)) (@cons (Equality.sort T) x s1) (@mask (Equality.sort T) m (@cons (Equality.sort T) y s2)))) (subseq (@cons (Equality.sort T) x s1) (@cons (Equality.sort T) y s2)) *) apply: {IHs2}(iffP (IHs2 _)) => [] [m sz_m def_s1]. (* Goal: @ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) s2)) (fun m : list bool => @eq (list (Equality.sort T)) (if @eq_op T x y then s1 else @cons (Equality.sort T) x s1) (@mask (Equality.sort T) m s2)) *) (* Goal: @ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) (@cons (Equality.sort T) y s2))) (fun m : list bool => @eq (list (Equality.sort T)) (@cons (Equality.sort T) x s1) (@mask (Equality.sort T) m (@cons (Equality.sort T) y s2))) *) by exists ((x == y) :: m); rewrite /= ?sz_m // -def_s1; case: eqP => // ->. (* Goal: @ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) s2)) (fun m : list bool => @eq (list (Equality.sort T)) (if @eq_op T x y then s1 else @cons (Equality.sort T) x s1) (@mask (Equality.sort T) m s2)) *) case: eqP => [_ | ne_xy]; last first. (* Goal: @ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) s2)) (fun m : list bool => @eq (list (Equality.sort T)) s1 (@mask (Equality.sort T) m s2)) *) (* Goal: @ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) s2)) (fun m : list bool => @eq (list (Equality.sort T)) (@cons (Equality.sort T) x s1) (@mask (Equality.sort T) m s2)) *) by case: m def_s1 sz_m => [//|[m []//|m]] -> [<-]; exists m. (* Goal: @ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) s2)) (fun m : list bool => @eq (list (Equality.sort T)) s1 (@mask (Equality.sort T) m s2)) *) pose i := index true m; have def_m_i: take i m = nseq (size (take i m)) false. (* Goal: @ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) s2)) (fun m : list bool => @eq (list (Equality.sort T)) s1 (@mask (Equality.sort T) m s2)) *) (* Goal: @eq (list bool) (@take bool i m) (@nseq bool (@size bool (@take bool i m)) false) *) apply/all_pred1P; apply/(all_nthP true) => j. (* Goal: @ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) s2)) (fun m : list bool => @eq (list (Equality.sort T)) s1 (@mask (Equality.sort T) m s2)) *) (* Goal: forall _ : is_true (leq (S j) (@size bool (@take bool i m))), is_true (@pred_of_simpl (Equality.sort bool_eqType) (@pred1 bool_eqType false) (@nth bool true (@take bool i m) j)) *) rewrite size_take ltnNge geq_min negb_or -ltnNge; case/andP=> lt_j_i _. (* Goal: @ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) s2)) (fun m : list bool => @eq (list (Equality.sort T)) s1 (@mask (Equality.sort T) m s2)) *) (* Goal: is_true (@pred_of_simpl (Equality.sort bool_eqType) (@pred1 bool_eqType false) (@nth bool true (@take bool i m) j)) *) rewrite nth_take //= -negb_add addbF -addbT -negb_eqb. (* Goal: @ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) s2)) (fun m : list bool => @eq (list (Equality.sort T)) s1 (@mask (Equality.sort T) m s2)) *) (* Goal: is_true (negb (@eq_op bool_eqType (@nth bool true m j) true)) *) by rewrite [_ == _](before_find _ lt_j_i). (* Goal: @ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) s2)) (fun m : list bool => @eq (list (Equality.sort T)) s1 (@mask (Equality.sort T) m s2)) *) have lt_i_m: i < size m. (* Goal: @ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) s2)) (fun m : list bool => @eq (list (Equality.sort T)) s1 (@mask (Equality.sort T) m s2)) *) (* Goal: is_true (leq (S i) (@size bool m)) *) rewrite ltnNge; apply/negP=> le_m_i; rewrite take_oversize // in def_m_i. (* Goal: @ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) s2)) (fun m : list bool => @eq (list (Equality.sort T)) s1 (@mask (Equality.sort T) m s2)) *) (* Goal: False *) by rewrite def_m_i mask_false in def_s1. (* Goal: @ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) s2)) (fun m : list bool => @eq (list (Equality.sort T)) s1 (@mask (Equality.sort T) m s2)) *) rewrite size_take lt_i_m in def_m_i. (* Goal: @ex2 (list bool) (fun m : list bool => @eq nat (@size bool m) (@size (Equality.sort T) s2)) (fun m : list bool => @eq (list (Equality.sort T)) s1 (@mask (Equality.sort T) m s2)) *) exists (take i m ++ drop i.+1 m). (* Goal: @eq (list (Equality.sort T)) s1 (@mask (Equality.sort T) (@cat bool (@take bool i m) (@drop bool (S i) m)) s2) *) (* Goal: @eq nat (@size bool (@cat bool (@take bool i m) (@drop bool (S i) m))) (@size (Equality.sort T) s2) *) rewrite size_cat size_take size_drop lt_i_m. (* Goal: @eq (list (Equality.sort T)) s1 (@mask (Equality.sort T) (@cat bool (@take bool i m) (@drop bool (S i) m)) s2) *) (* Goal: @eq nat (addn i (subn (@size bool m) (S i))) (@size (Equality.sort T) s2) *) by rewrite sz_m in lt_i_m *; rewrite subnKC. (* Goal: @eq (list (Equality.sort T)) s1 (@mask (Equality.sort T) (@cat bool (@take bool i m) (@drop bool (S i) m)) s2) *) rewrite {s1 def_s1}[s1](congr1 behead def_s1). (* Goal: @eq (list (Equality.sort T)) (@behead (Equality.sort T) (@mask (Equality.sort T) m (@cons (Equality.sort T) y s2))) (@mask (Equality.sort T) (@cat bool (@take bool i m) (@drop bool (S i) m)) s2) *) rewrite -[s2](cat_take_drop i) -{1}[m](cat_take_drop i) {}def_m_i -cat_cons. (* Goal: @eq (list (Equality.sort T)) (@behead (Equality.sort T) (@mask (Equality.sort T) (@cat bool (@nseq bool i false) (@drop bool i m)) (@cat (Equality.sort T) (@cons (Equality.sort T) y (@take (Equality.sort T) i s2)) (@drop (Equality.sort T) i s2)))) (@mask (Equality.sort T) (@cat bool (@nseq bool i false) (@drop bool (S i) m)) (@cat (Equality.sort T) (@take (Equality.sort T) i s2) (@drop (Equality.sort T) i s2))) *) have sz_i_s2: size (take i s2) = i by apply: size_takel; rewrite sz_m in lt_i_m. (* Goal: @eq (list (Equality.sort T)) (@behead (Equality.sort T) (@mask (Equality.sort T) (@cat bool (@nseq bool i false) (@drop bool i m)) (@cat (Equality.sort T) (@cons (Equality.sort T) y (@take (Equality.sort T) i s2)) (@drop (Equality.sort T) i s2)))) (@mask (Equality.sort T) (@cat bool (@nseq bool i false) (@drop bool (S i) m)) (@cat (Equality.sort T) (@take (Equality.sort T) i s2) (@drop (Equality.sort T) i s2))) *) rewrite lastI cat_rcons !mask_cat ?size_nseq ?size_belast ?mask_false //=. (* Goal: @eq (list (Equality.sort T)) (@behead (Equality.sort T) (@mask (Equality.sort T) (@drop bool i m) (@cons (Equality.sort T) (@last (Equality.sort T) y (@take (Equality.sort T) i s2)) (@drop (Equality.sort T) i s2)))) (@mask (Equality.sort T) (@drop bool (S i) m) (@drop (Equality.sort T) i s2)) *) by rewrite (drop_nth true) // nth_index -?index_mem. Qed. Lemma mask_subseq m s : subseq (mask m s) s. Proof. (* Goal: is_true (subseq (@mask (Equality.sort T) m s) s) *) by apply/subseqP; have [m1] := resize_mask m s; exists m1. Qed. Lemma subseq_trans : transitive subseq. Lemma subseq_refl s : subseq s s. Proof. (* Goal: is_true (subseq s s) *) by elim: s => //= x s IHs; rewrite eqxx. Qed. Hint Resolve subseq_refl : core. Lemma cat_subseq s1 s2 s3 s4 : subseq s1 s3 -> subseq s2 s4 -> subseq (s1 ++ s2) (s3 ++ s4). Lemma prefix_subseq s1 s2 : subseq s1 (s1 ++ s2). Proof. (* Goal: is_true (subseq s1 (@cat (Equality.sort T) s1 s2)) *) by rewrite -[s1 in subseq s1]cats0 cat_subseq ?sub0seq. Qed. Lemma suffix_subseq s1 s2 : subseq s2 (s1 ++ s2). Proof. (* Goal: is_true (subseq s2 (@cat (Equality.sort T) s1 s2)) *) exact: cat_subseq (sub0seq s1) _. Qed. Lemma take_subseq s i : subseq (take i s) s. Proof. (* Goal: is_true (subseq (@take (Equality.sort T) i s) s) *) by rewrite -[s in X in subseq _ X](cat_take_drop i) prefix_subseq. Qed. Lemma drop_subseq s i : subseq (drop i s) s. Proof. (* Goal: is_true (subseq (@drop (Equality.sort T) i s) s) *) by rewrite -[s in X in subseq _ X](cat_take_drop i) suffix_subseq. Qed. Lemma mem_subseq s1 s2 : subseq s1 s2 -> {subset s1 <= s2}. Proof. (* Goal: forall _ : is_true (subseq s1 s2), @sub_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s1) (@mem (Equality.sort T) (seq_predType T) s2) *) by case/subseqP=> m _ -> x; apply: mem_mask. Qed. Lemma sub1seq x s : subseq [:: x] s = (x \in s). Proof. (* Goal: @eq bool (subseq (@cons (Equality.sort T) x (@nil (Equality.sort T))) s) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) s)) *) by elim: s => //= y s; rewrite inE; case: (x == y); rewrite ?sub0seq. Qed. Lemma size_subseq s1 s2 : subseq s1 s2 -> size s1 <= size s2. Proof. (* Goal: forall _ : is_true (subseq s1 s2), is_true (leq (@size (Equality.sort T) s1) (@size (Equality.sort T) s2)) *) by case/subseqP=> m sz_m ->; rewrite size_mask -sz_m ?count_size. Qed. Lemma size_subseq_leqif s1 s2 : subseq s1 s2 -> size s1 <= size s2 ?= iff (s1 == s2). Proof. (* Goal: forall _ : is_true (subseq s1 s2), leqif (@size (Equality.sort T) s1) (@size (Equality.sort T) s2) (@eq_op (seq_eqType T) s1 s2) *) move=> sub12; split; first exact: size_subseq. (* Goal: @eq bool (@eq_op nat_eqType (@size (Equality.sort T) s1) (@size (Equality.sort T) s2)) (@eq_op (seq_eqType T) s1 s2) *) apply/idP/eqP=> [|-> //]; case/subseqP: sub12 => m sz_m ->{s1}. (* Goal: forall _ : is_true (@eq_op nat_eqType (@size (Equality.sort T) (@mask (Equality.sort T) m s2)) (@size (Equality.sort T) s2)), @eq (Equality.sort (seq_eqType T)) (@mask (Equality.sort T) m s2) s2 *) rewrite size_mask -sz_m // -all_count -(eq_all eqb_id). (* Goal: forall _ : is_true (@all (Equality.sort bool_eqType) (fun b : Equality.sort bool_eqType => @eq_op bool_eqType b true) m), @eq (Equality.sort (seq_eqType T)) (@mask (Equality.sort T) m s2) s2 *) by move/(@all_pred1P _ true)->; rewrite sz_m mask_true. Qed. Lemma subseq_cons s x : subseq s (x :: s). Proof. (* Goal: is_true (subseq s (@cons (Equality.sort T) x s)) *) exact: suffix_subseq [:: x] s. Qed. Lemma subseq_rcons s x : subseq s (rcons s x). Proof. (* Goal: is_true (subseq s (@rcons (Equality.sort T) s x)) *) by rewrite -cats1 prefix_subseq. Qed. Lemma subseq_uniq s1 s2 : subseq s1 s2 -> uniq s2 -> uniq s1. Proof. (* Goal: forall (_ : is_true (subseq s1 s2)) (_ : is_true (@uniq T s2)), is_true (@uniq T s1) *) by case/subseqP=> m _ -> Us2; apply: mask_uniq. Qed. End Subseq. Prenex Implicits subseq. Arguments subseqP {T s1 s2}. Hint Resolve subseq_refl : core. Section Rem. Variables (T : eqType) (x : T). Fixpoint rem s := if s is y :: t then (if y == x then t else y :: rem t) else s. Lemma rem_id s : x \notin s -> rem s = s. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) s))), @eq (list (Equality.sort T)) (rem s) s *) by elim: s => //= y s IHs /norP[neq_yx /IHs->]; rewrite eq_sym (negbTE neq_yx). Qed. Lemma perm_to_rem s : x \in s -> perm_eq s (x :: rem s). Proof. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) s)), is_true (@perm_eq T s (@cons (Equality.sort T) x (rem s))) *) elim: s => // y s IHs; rewrite inE /= eq_sym perm_eq_sym. (* Goal: forall _ : is_true (orb (@eq_op T y x) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) s))), is_true (@perm_eq T (@cons (Equality.sort T) x (if @eq_op T y x then s else @cons (Equality.sort T) y (rem s))) (@cons (Equality.sort T) y s)) *) case: eqP => [-> // | _ /IHs]. (* Goal: forall _ : is_true (@perm_eq T s (@cons (Equality.sort T) x (rem s))), is_true (@perm_eq T (@cons (Equality.sort T) x (@cons (Equality.sort T) y (rem s))) (@cons (Equality.sort T) y s)) *) by rewrite (perm_catCA [:: x] [:: y]) perm_cons perm_eq_sym. Qed. Lemma size_rem s : x \in s -> size (rem s) = (size s).-1. Proof. (* Goal: forall _ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) s)), @eq nat (@size (Equality.sort T) (rem s)) (Nat.pred (@size (Equality.sort T) s)) *) by move/perm_to_rem/perm_eq_size->. Qed. Lemma rem_subseq s : subseq (rem s) s. Proof. (* Goal: is_true (@subseq T (rem s) s) *) elim: s => //= y s IHs; rewrite eq_sym. (* Goal: is_true match (if @eq_op T x y then s else @cons (Equality.sort T) y (rem s)) with | nil => true | cons x0 s1' => @subseq T (if @eq_op T x0 y then s1' else if @eq_op T x y then s else @cons (Equality.sort T) y (rem s)) s end *) by case: ifP => _; [apply: subseq_cons | rewrite eqxx]. Qed. Lemma rem_uniq s : uniq s -> uniq (rem s). Proof. (* Goal: forall _ : is_true (@uniq T s), is_true (@uniq T (rem s)) *) by apply: subseq_uniq; apply: rem_subseq. Qed. Lemma mem_rem s : {subset rem s <= s}. Proof. (* Goal: @sub_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) (rem s)) (@mem (Equality.sort T) (seq_predType T) s) *) exact: mem_subseq (rem_subseq s). Qed. Lemma rem_filter s : uniq s -> rem s = filter (predC1 x) s. Proof. (* Goal: forall _ : is_true (@uniq T s), @eq (list (Equality.sort T)) (rem s) (@filter (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@predC1 T x)) s) *) elim: s => //= y s IHs /andP[not_s_y /IHs->]. (* Goal: @eq (list (Equality.sort T)) (if @eq_op T y x then s else @cons (Equality.sort T) y (@filter (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@predC1 T x)) s)) (if negb (@eq_op T y x) then @cons (Equality.sort T) y (@filter (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@predC1 T x)) s) else @filter (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@predC1 T x)) s) *) by case: eqP => //= <-; apply/esym/all_filterP; rewrite all_predC has_pred1. Qed. Lemma mem_rem_uniq s : uniq s -> rem s =i [predD1 s & x]. Proof. (* Goal: forall _ : is_true (@uniq T s), @eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) (rem s)) (@mem (Equality.sort T) (simplPredType (Equality.sort T)) (@predD1 T (@pred_of_simpl (Equality.sort T) (@pred_of_mem_pred (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s))) x)) *) by move/rem_filter=> -> y; rewrite mem_filter. Qed. End Rem. Section Map. Variables (n0 : nat) (T1 : Type) (x1 : T1). Variables (T2 : Type) (x2 : T2) (f : T1 -> T2). Fixpoint map s := if s is x :: s' then f x :: map s' else [::]. Lemma map_cons x s : map (x :: s) = f x :: map s. Proof. (* Goal: @eq (list T2) (map (@cons T1 x s)) (@cons T2 (f x) (map s)) *) by []. Qed. Lemma map_nseq x : map (nseq n0 x) = nseq n0 (f x). Proof. (* Goal: @eq (list T2) (map (@nseq T1 n0 x)) (@nseq T2 n0 (f x)) *) by elim: n0 => // *; congr (_ :: _). Qed. Lemma map_cat s1 s2 : map (s1 ++ s2) = map s1 ++ map s2. Proof. (* Goal: @eq (list T2) (map (@cat T1 s1 s2)) (@cat T2 (map s1) (map s2)) *) by elim: s1 => [|x s1 IHs] //=; rewrite IHs. Qed. Lemma size_map s : size (map s) = size s. Proof. (* Goal: @eq nat (@size T2 (map s)) (@size T1 s) *) by elim: s => //= x s ->. Qed. Lemma behead_map s : behead (map s) = map (behead s). Proof. (* Goal: @eq (list T2) (@behead T2 (map s)) (map (@behead T1 s)) *) by case: s. Qed. Lemma nth_map n s : n < size s -> nth x2 (map s) n = f (nth x1 s n). Proof. (* Goal: forall _ : is_true (leq (S n) (@size T1 s)), @eq T2 (@nth T2 x2 (map s) n) (f (@nth T1 x1 s n)) *) by elim: s n => [|x s IHs] []. Qed. Lemma map_rcons s x : map (rcons s x) = rcons (map s) (f x). Proof. (* Goal: @eq (list T2) (map (@rcons T1 s x)) (@rcons T2 (map s) (f x)) *) by rewrite -!cats1 map_cat. Qed. Lemma last_map s x : last (f x) (map s) = f (last x s). Proof. (* Goal: @eq T2 (@last T2 (f x) (map s)) (f (@last T1 x s)) *) by elim: s x => /=. Qed. Lemma belast_map s x : belast (f x) (map s) = map (belast x s). Proof. (* Goal: @eq (list T2) (@belast T2 (f x) (map s)) (map (@belast T1 x s)) *) by elim: s x => //= y s IHs x; rewrite IHs. Qed. Lemma filter_map a s : filter a (map s) = map (filter (preim f a) s). Proof. (* Goal: @eq (list T2) (@filter T2 a (map s)) (map (@filter T1 (@pred_of_simpl T1 (@preim T1 T2 f a)) s)) *) by elim: s => //= x s IHs; rewrite (fun_if map) /= IHs. Qed. Lemma find_map a s : find a (map s) = find (preim f a) s. Proof. (* Goal: @eq nat (@find T2 a (map s)) (@find T1 (@pred_of_simpl T1 (@preim T1 T2 f a)) s) *) by elim: s => //= x s ->. Qed. Lemma has_map a s : has a (map s) = has (preim f a) s. Proof. (* Goal: @eq bool (@has T2 a (map s)) (@has T1 (@pred_of_simpl T1 (@preim T1 T2 f a)) s) *) by elim: s => //= x s ->. Qed. Lemma all_map a s : all a (map s) = all (preim f a) s. Proof. (* Goal: @eq bool (@all T2 a (map s)) (@all T1 (@pred_of_simpl T1 (@preim T1 T2 f a)) s) *) by elim: s => //= x s ->. Qed. Lemma count_map a s : count a (map s) = count (preim f a) s. Proof. (* Goal: @eq nat (@count T2 a (map s)) (@count T1 (@pred_of_simpl T1 (@preim T1 T2 f a)) s) *) by elim: s => //= x s ->. Qed. Lemma map_take s : map (take n0 s) = take n0 (map s). Proof. (* Goal: @eq (list T2) (map (@take T1 n0 s)) (@take T2 n0 (map s)) *) by elim: n0 s => [|n IHn] [|x s] //=; rewrite IHn. Qed. Lemma map_drop s : map (drop n0 s) = drop n0 (map s). Proof. (* Goal: @eq (list T2) (map (@drop T1 n0 s)) (@drop T2 n0 (map s)) *) by elim: n0 s => [|n IHn] [|x s] //=; rewrite IHn. Qed. Lemma map_rot s : map (rot n0 s) = rot n0 (map s). Proof. (* Goal: @eq (list T2) (map (@rot T1 n0 s)) (@rot T2 n0 (map s)) *) by rewrite /rot map_cat map_take map_drop. Qed. Lemma map_rotr s : map (rotr n0 s) = rotr n0 (map s). Proof. (* Goal: @eq (list T2) (map (@rotr T1 n0 s)) (@rotr T2 n0 (map s)) *) by apply: canRL (@rotK n0 T2) _; rewrite -map_rot rotrK. Qed. Lemma map_rev s : map (rev s) = rev (map s). Proof. (* Goal: @eq (list T2) (map (@rev T1 s)) (@rev T2 (map s)) *) by elim: s => //= x s IHs; rewrite !rev_cons -!cats1 map_cat IHs. Qed. Lemma map_mask m s : map (mask m s) = mask m (map s). Proof. (* Goal: @eq (list T2) (map (@mask T1 m s)) (@mask T2 m (map s)) *) by elim: m s => [|[|] m IHm] [|x p] //=; rewrite IHm. Qed. Lemma inj_map : injective f -> injective map. Proof. (* Goal: forall _ : @injective T2 T1 f, @injective (list T2) (list T1) map *) by move=> injf; elim=> [|y1 s1 IHs] [|y2 s2] //= [/injf-> /IHs->]. Qed. End Map. Notation "[ 'seq' E | i <- s ]" := (map (fun i => E) s) (at level 0, E at level 99, i ident, format "[ '[hv' 'seq' E '/ ' | i <- s ] ']'") : seq_scope. Notation "[ 'seq' E | i <- s & C ]" := [seq E | i <- [seq i <- s | C]] (at level 0, E at level 99, i ident, format "[ '[hv' 'seq' E '/ ' | i <- s '/ ' & C ] ']'") : seq_scope. Notation "[ 'seq' E | i : T <- s ]" := (map (fun i : T => E) s) (at level 0, E at level 99, i ident, only parsing) : seq_scope. Notation "[ 'seq' E | i : T <- s & C ]" := [seq E | i : T <- [seq i : T <- s | C]] (at level 0, E at level 99, i ident, only parsing) : seq_scope. Lemma filter_mask T a (s : seq T) : filter a s = mask (map a s) s. Proof. (* Goal: @eq (list T) (@filter T a s) (@mask T (@map T bool a s) s) *) by elim: s => //= x s <-; case: (a x). Qed. Section FilterSubseq. Variable T : eqType. Implicit Types (s : seq T) (a : pred T). Lemma filter_subseq a s : subseq (filter a s) s. Proof. (* Goal: is_true (@subseq T (@filter (Equality.sort T) a s) s) *) by apply/subseqP; exists (map a s); rewrite ?size_map ?filter_mask. Qed. Lemma subseq_filter s1 s2 a : subseq s1 (filter a s2) = all a s1 && subseq s1 s2. Proof. (* Goal: @eq bool (@subseq T s1 (@filter (Equality.sort T) a s2)) (andb (@all (Equality.sort T) a s1) (@subseq T s1 s2)) *) elim: s2 s1 => [|x s2 IHs] [|y s1] //=; rewrite ?andbF ?sub0seq //. (* Goal: @eq bool (@subseq T (@cons (Equality.sort T) y s1) (if a x then @cons (Equality.sort T) x (@filter (Equality.sort T) a s2) else @filter (Equality.sort T) a s2)) (andb (andb (a y) (@all (Equality.sort T) a s1)) (@subseq T (if @eq_op T y x then s1 else @cons (Equality.sort T) y s1) s2)) *) by case a_x: (a x); rewrite /= !IHs /=; case: eqP => // ->; rewrite a_x. Qed. Lemma subseq_uniqP s1 s2 : uniq s2 -> reflect (s1 = filter (mem s1) s2) (subseq s1 s2). Lemma perm_to_subseq s1 s2 : subseq s1 s2 -> {s3 | perm_eq s2 (s1 ++ s3)}. Proof. (* Goal: forall _ : is_true (@subseq T s1 s2), @sig (list (Equality.sort T)) (fun s3 : list (Equality.sort T) => is_true (@perm_eq T s2 (@cat (Equality.sort T) s1 s3))) *) elim Ds2: s2 s1 => [|y s2' IHs] [|x s1] //=; try by exists s2; rewrite Ds2. (* Goal: forall _ : is_true (@subseq T (if @eq_op T x y then s1 else @cons (Equality.sort T) x s1) s2'), @sig (list (Equality.sort T)) (fun s3 : list (Equality.sort T) => is_true (@perm_eq T (@cons (Equality.sort T) y s2') (@cons (Equality.sort T) x (@cat (Equality.sort T) s1 s3)))) *) case: eqP => [-> | _] /IHs[s3 perm_s2] {IHs}. (* Goal: @sig (list (Equality.sort T)) (fun s3 : list (Equality.sort T) => is_true (@perm_eq T (@cons (Equality.sort T) y s2') (@cons (Equality.sort T) x (@cat (Equality.sort T) s1 s3)))) *) (* Goal: @sig (list (Equality.sort T)) (fun s3 : list (Equality.sort T) => is_true (@perm_eq T (@cons (Equality.sort T) y s2') (@cons (Equality.sort T) y (@cat (Equality.sort T) s1 s3)))) *) by exists s3; rewrite perm_cons. (* Goal: @sig (list (Equality.sort T)) (fun s3 : list (Equality.sort T) => is_true (@perm_eq T (@cons (Equality.sort T) y s2') (@cons (Equality.sort T) x (@cat (Equality.sort T) s1 s3)))) *) by exists (rcons s3 y); rewrite -cat_cons -perm_rcons -!cats1 catA perm_cat2r. Qed. End FilterSubseq. Arguments subseq_uniqP [T s1 s2]. Section EqMap. Variables (n0 : nat) (T1 : eqType) (x1 : T1). Variables (T2 : eqType) (x2 : T2) (f : T1 -> T2). Implicit Type s : seq T1. Lemma map_f s x : x \in s -> f x \in map f s. Proof. (* Goal: forall _ : is_true (@in_mem (Equality.sort T1) x (@mem (Equality.sort T1) (seq_predType T1) s)), is_true (@in_mem (Equality.sort T2) (f x) (@mem (Equality.sort T2) (seq_predType T2) (@map (Equality.sort T1) (Equality.sort T2) f s))) *) elim: s => [|y s IHs] //=. (* Goal: forall _ : is_true (@in_mem (Equality.sort T1) x (@mem (Equality.sort T1) (seq_predType T1) (@cons (Equality.sort T1) y s))), is_true (@in_mem (Equality.sort T2) (f x) (@mem (Equality.sort T2) (seq_predType T2) (@cons (Equality.sort T2) (f y) (@map (Equality.sort T1) (Equality.sort T2) f s)))) *) by case/predU1P=> [->|Hx]; [apply: predU1l | apply: predU1r; auto]. Qed. Lemma mapP s y : reflect (exists2 x, x \in s & y = f x) (y \in map f s). Proof. (* Goal: Bool.reflect (@ex2 (Equality.sort T1) (fun x : Equality.sort T1 => is_true (@in_mem (Equality.sort T1) x (@mem (Equality.sort T1) (seq_predType T1) s))) (fun x : Equality.sort T1 => @eq (Equality.sort T2) y (f x))) (@in_mem (Equality.sort T2) y (@mem (Equality.sort T2) (seq_predType T2) (@map (Equality.sort T1) (Equality.sort T2) f s))) *) elim: s => [|x s IHs]; first by right; case. (* Goal: Bool.reflect (@ex2 (Equality.sort T1) (fun x0 : Equality.sort T1 => is_true (@in_mem (Equality.sort T1) x0 (@mem (Equality.sort T1) (seq_predType T1) (@cons (Equality.sort T1) x s)))) (fun x : Equality.sort T1 => @eq (Equality.sort T2) y (f x))) (@in_mem (Equality.sort T2) y (@mem (Equality.sort T2) (seq_predType T2) (@map (Equality.sort T1) (Equality.sort T2) f (@cons (Equality.sort T1) x s)))) *) rewrite /= in_cons eq_sym; case Hxy: (f x == y). (* Goal: Bool.reflect (@ex2 (Equality.sort T1) (fun x0 : Equality.sort T1 => is_true (@in_mem (Equality.sort T1) x0 (@mem (Equality.sort T1) (seq_predType T1) (@cons (Equality.sort T1) x s)))) (fun x : Equality.sort T1 => @eq (Equality.sort T2) y (f x))) (orb false (@in_mem (Equality.sort T2) y (@mem (Equality.sort T2) (seq_predType T2) (@map (Equality.sort T1) (Equality.sort T2) f s)))) *) (* Goal: Bool.reflect (@ex2 (Equality.sort T1) (fun x0 : Equality.sort T1 => is_true (@in_mem (Equality.sort T1) x0 (@mem (Equality.sort T1) (seq_predType T1) (@cons (Equality.sort T1) x s)))) (fun x : Equality.sort T1 => @eq (Equality.sort T2) y (f x))) (orb true (@in_mem (Equality.sort T2) y (@mem (Equality.sort T2) (seq_predType T2) (@map (Equality.sort T1) (Equality.sort T2) f s)))) *) by left; exists x; [rewrite mem_head | rewrite (eqP Hxy)]. (* Goal: Bool.reflect (@ex2 (Equality.sort T1) (fun x0 : Equality.sort T1 => is_true (@in_mem (Equality.sort T1) x0 (@mem (Equality.sort T1) (seq_predType T1) (@cons (Equality.sort T1) x s)))) (fun x : Equality.sort T1 => @eq (Equality.sort T2) y (f x))) (orb false (@in_mem (Equality.sort T2) y (@mem (Equality.sort T2) (seq_predType T2) (@map (Equality.sort T1) (Equality.sort T2) f s)))) *) apply: (iffP IHs) => [[x' Hx' ->]|[x' Hx' Dy]]. (* Goal: @ex2 (Equality.sort T1) (fun x : Equality.sort T1 => is_true (@in_mem (Equality.sort T1) x (@mem (Equality.sort T1) (seq_predType T1) s))) (fun x : Equality.sort T1 => @eq (Equality.sort T2) y (f x)) *) (* Goal: @ex2 (Equality.sort T1) (fun x0 : Equality.sort T1 => is_true (@in_mem (Equality.sort T1) x0 (@mem (Equality.sort T1) (seq_predType T1) (@cons (Equality.sort T1) x s)))) (fun x : Equality.sort T1 => @eq (Equality.sort T2) (f x') (f x)) *) by exists x'; first apply: predU1r. (* Goal: @ex2 (Equality.sort T1) (fun x : Equality.sort T1 => is_true (@in_mem (Equality.sort T1) x (@mem (Equality.sort T1) (seq_predType T1) s))) (fun x : Equality.sort T1 => @eq (Equality.sort T2) y (f x)) *) by move: Dy Hxy => ->; case/predU1P: Hx' => [->|]; [rewrite eqxx | exists x']. Qed. Lemma map_uniq s : uniq (map f s) -> uniq s. Proof. (* Goal: forall _ : is_true (@uniq T2 (@map (Equality.sort T1) (Equality.sort T2) f s)), is_true (@uniq T1 s) *) elim: s => //= x s IHs /andP[not_sfx /IHs->]; rewrite andbT. (* Goal: is_true (negb (@in_mem (Equality.sort T1) x (@mem (Equality.sort T1) (seq_predType T1) s))) *) by apply: contra not_sfx => sx; apply/mapP; exists x. Qed. Lemma map_inj_in_uniq s : {in s &, injective f} -> uniq (map f s) = uniq s. Lemma map_subseq s1 s2 : subseq s1 s2 -> subseq (map f s1) (map f s2). Lemma nth_index_map s x0 x : {in s &, injective f} -> x \in s -> nth x0 s (index (f x) (map f s)) = x. Proof. (* Goal: forall (_ : @prop_in2 (Equality.sort T1) (@mem (Equality.sort T1) (seq_predType T1) s) (fun x1 x2 : Equality.sort T1 => forall _ : @eq (Equality.sort T2) (f x1) (f x2), @eq (Equality.sort T1) x1 x2) (inPhantom (@injective (Equality.sort T2) (Equality.sort T1) f))) (_ : is_true (@in_mem (Equality.sort T1) x (@mem (Equality.sort T1) (seq_predType T1) s))), @eq (Equality.sort T1) (@nth (Equality.sort T1) x0 s (@index T2 (f x) (@map (Equality.sort T1) (Equality.sort T2) f s))) x *) elim: s => //= y s IHs inj_f s_x; rewrite (inj_in_eq inj_f) ?mem_head //. (* Goal: @eq (Equality.sort T1) (@nth (Equality.sort T1) x0 (@cons (Equality.sort T1) y s) (if @eq_op T1 y x then O else S (@index T2 (f x) (@map (Equality.sort T1) (Equality.sort T2) f s)))) x *) move: s_x; rewrite inE eq_sym; case: eqP => [-> | _] //=; apply: IHs. (* Goal: @prop_in2 (Equality.sort T1) (@mem (Equality.sort T1) (seq_predType T1) s) (fun x1 x2 : Equality.sort T1 => forall _ : @eq (Equality.sort T2) (f x1) (f x2), @eq (Equality.sort T1) x1 x2) (inPhantom (@injective (Equality.sort T2) (Equality.sort T1) f)) *) by apply: sub_in2 inj_f => z; apply: predU1r. Qed. Lemma perm_map s t : perm_eq s t -> perm_eq (map f s) (map f t). Proof. (* Goal: forall _ : is_true (@perm_eq T1 s t), is_true (@perm_eq T2 (@map (Equality.sort T1) (Equality.sort T2) f s) (@map (Equality.sort T1) (Equality.sort T2) f t)) *) by move/perm_eqP=> Est; apply/perm_eqP=> a; rewrite !count_map Est. Qed. Hypothesis Hf : injective f. Lemma mem_map s x : (f x \in map f s) = (x \in s). Proof. (* Goal: @eq bool (@in_mem (Equality.sort T2) (f x) (@mem (Equality.sort T2) (seq_predType T2) (@map (Equality.sort T1) (Equality.sort T2) f s))) (@in_mem (Equality.sort T1) x (@mem (Equality.sort T1) (seq_predType T1) s)) *) by apply/mapP/idP=> [[y Hy /Hf->] //|]; exists x. Qed. Lemma index_map s x : index (f x) (map f s) = index x s. Proof. (* Goal: @eq nat (@index T2 (f x) (@map (Equality.sort T1) (Equality.sort T2) f s)) (@index T1 x s) *) by rewrite /index; elim: s => //= y s IHs; rewrite (inj_eq Hf) IHs. Qed. Lemma map_inj_uniq s : uniq (map f s) = uniq s. Proof. (* Goal: @eq bool (@uniq T2 (@map (Equality.sort T1) (Equality.sort T2) f s)) (@uniq T1 s) *) by apply: map_inj_in_uniq; apply: in2W. Qed. Lemma perm_map_inj s t : perm_eq (map f s) (map f t) -> perm_eq s t. Proof. (* Goal: forall _ : is_true (@perm_eq T2 (@map (Equality.sort T1) (Equality.sort T2) f s) (@map (Equality.sort T1) (Equality.sort T2) f t)), is_true (@perm_eq T1 s t) *) move/perm_eqP=> Est; apply/allP=> x _ /=. (* Goal: is_true (@eq_op nat_eqType (@count (Equality.sort T1) (@pred_of_simpl (Equality.sort T1) (@pred1 T1 x)) s) (@count (Equality.sort T1) (@pred_of_simpl (Equality.sort T1) (@pred1 T1 x)) t)) *) have Dx: pred1 x =1 preim f (pred1 (f x)) by move=> y /=; rewrite inj_eq. (* Goal: is_true (@eq_op nat_eqType (@count (Equality.sort T1) (@pred_of_simpl (Equality.sort T1) (@pred1 T1 x)) s) (@count (Equality.sort T1) (@pred_of_simpl (Equality.sort T1) (@pred1 T1 x)) t)) *) by rewrite !(eq_count Dx) -!count_map Est. Qed. End EqMap. Arguments mapP {T1 T2 f s y}. Lemma map_of_seq (T1 : eqType) T2 (s : seq T1) (fs : seq T2) (y0 : T2) : {f | uniq s -> size fs = size s -> map f s = fs}. Proof. (* Goal: @sig (forall _ : Equality.sort T1, T2) (fun f : forall _ : Equality.sort T1, T2 => forall (_ : is_true (@uniq T1 s)) (_ : @eq nat (@size T2 fs) (@size (Equality.sort T1) s)), @eq (list T2) (@map (Equality.sort T1) T2 f s) fs) *) exists (fun x => nth y0 fs (index x s)) => uAs eq_sz. (* Goal: @eq (list T2) (@map (Equality.sort T1) T2 (fun x : Equality.sort T1 => @nth T2 y0 fs (@index T1 x s)) s) fs *) apply/esym/(@eq_from_nth _ y0); rewrite ?size_map eq_sz // => i ltis. (* Goal: @eq T2 (@nth T2 y0 fs i) (@nth T2 y0 (@map (Equality.sort T1) T2 (fun x : Equality.sort T1 => @nth T2 y0 fs (@index T1 x s)) s) i) *) by have x0 : T1 by [case: (s) ltis]; rewrite (nth_map x0) // index_uniq. Qed. Section MapComp. Variable T1 T2 T3 : Type. Lemma map_id (s : seq T1) : map id s = s. Proof. (* Goal: @eq (list T1) (@map T1 T1 (fun x : T1 => x) s) s *) by elim: s => //= x s ->. Qed. Lemma eq_map (f1 f2 : T1 -> T2) : f1 =1 f2 -> map f1 =1 map f2. Proof. (* Goal: forall _ : @eqfun T2 T1 f1 f2, @eqfun (list T2) (list T1) (@map T1 T2 f1) (@map T1 T2 f2) *) by move=> Ef; elim=> //= x s ->; rewrite Ef. Qed. Lemma map_comp (f1 : T2 -> T3) (f2 : T1 -> T2) s : map (f1 \o f2) s = map f1 (map f2 s). Proof. (* Goal: @eq (list T3) (@map T1 T3 (@funcomp T3 T2 T1 tt f1 f2) s) (@map T2 T3 f1 (@map T1 T2 f2 s)) *) by elim: s => //= x s ->. Qed. Lemma mapK (f1 : T1 -> T2) (f2 : T2 -> T1) : cancel f1 f2 -> cancel (map f1) (map f2). Proof. (* Goal: forall _ : @cancel T2 T1 f1 f2, @cancel (list T2) (list T1) (@map T1 T2 f1) (@map T2 T1 f2) *) by move=> eq_f12; elim=> //= x s ->; rewrite eq_f12. Qed. End MapComp. Lemma eq_in_map (T1 : eqType) T2 (f1 f2 : T1 -> T2) (s : seq T1) : {in s, f1 =1 f2} <-> map f1 s = map f2 s. Lemma map_id_in (T : eqType) f (s : seq T) : {in s, f =1 id} -> map f s = s. Proof. (* Goal: forall _ : @prop_in1 (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) s) (fun x : Equality.sort T => @eq (Equality.sort T) (f x) ((fun x0 : Equality.sort T => x0) x)) (inPhantom (@eqfun (Equality.sort T) (Equality.sort T) f (fun x : Equality.sort T => x))), @eq (list (Equality.sort T)) (@map (Equality.sort T) (Equality.sort T) f s) s *) by move/eq_in_map->; apply: map_id. Qed. Section Pmap. Variables (aT rT : Type) (f : aT -> option rT) (g : rT -> aT). Fixpoint pmap s := if s is x :: s' then let r := pmap s' in oapp (cons^~ r) r (f x) else [::]. Lemma map_pK : pcancel g f -> cancel (map g) pmap. Proof. (* Goal: forall _ : @pcancel aT rT g f, @cancel (list aT) (list rT) (@map rT aT g) pmap *) by move=> gK; elim=> //= x s ->; rewrite gK. Qed. Lemma size_pmap s : size (pmap s) = count [eta f] s. Proof. (* Goal: @eq nat (@size rT (pmap s)) (@count aT (fun x : aT => @isSome rT (f x)) s) *) by elim: s => //= x s <-; case: (f _). Qed. Lemma pmapS_filter s : map some (pmap s) = map f (filter [eta f] s). Proof. (* Goal: @eq (list (option rT)) (@map rT (option rT) (@Some rT) (pmap s)) (@map aT (option rT) f (@filter aT (fun x : aT => @isSome rT (f x)) s)) *) by elim: s => //= x s; case fx: (f x) => //= [u] <-; congr (_ :: _). Qed. Hypothesis fK : ocancel f g. Lemma pmap_filter s : map g (pmap s) = filter [eta f] s. Proof. (* Goal: @eq (list aT) (@map rT aT g (pmap s)) (@filter aT (fun x : aT => @isSome rT (f x)) s) *) by elim: s => //= x s <-; rewrite -{3}(fK x); case: (f _). Qed. Lemma pmap_cat s t : pmap (s ++ t) = pmap s ++ pmap t. Proof. (* Goal: @eq (list rT) (pmap (@cat aT s t)) (@cat rT (pmap s) (pmap t)) *) by elim: s => //= x s ->; case/f: x. Qed. End Pmap. Section EqPmap. Variables (aT rT : eqType) (f : aT -> option rT) (g : rT -> aT). Lemma eq_pmap (f1 f2 : aT -> option rT) : f1 =1 f2 -> pmap f1 =1 pmap f2. Proof. (* Goal: forall _ : @eqfun (option (Equality.sort rT)) (Equality.sort aT) f1 f2, @eqfun (list (Equality.sort rT)) (list (Equality.sort aT)) (@pmap (Equality.sort aT) (Equality.sort rT) f1) (@pmap (Equality.sort aT) (Equality.sort rT) f2) *) by move=> Ef; elim=> //= x s ->; rewrite Ef. Qed. Lemma mem_pmap s u : (u \in pmap f s) = (Some u \in map f s). Proof. (* Goal: @eq bool (@in_mem (Equality.sort rT) u (@mem (Equality.sort rT) (seq_predType rT) (@pmap (Equality.sort aT) (Equality.sort rT) f s))) (@in_mem (option (Equality.sort rT)) (@Some (Equality.sort rT) u) (@mem (Equality.sort (option_eqType rT)) (seq_predType (option_eqType rT)) (@map (Equality.sort aT) (option (Equality.sort rT)) f s))) *) by elim: s => //= x s IHs; rewrite in_cons -IHs; case: (f x). Qed. Hypothesis fK : ocancel f g. Lemma can2_mem_pmap : pcancel g f -> forall s u, (u \in pmap f s) = (g u \in s). Proof. (* Goal: forall (_ : @pcancel (Equality.sort aT) (Equality.sort rT) g f) (s : list (Equality.sort aT)) (u : Equality.sort rT), @eq bool (@in_mem (Equality.sort rT) u (@mem (Equality.sort rT) (seq_predType rT) (@pmap (Equality.sort aT) (Equality.sort rT) f s))) (@in_mem (Equality.sort aT) (g u) (@mem (Equality.sort aT) (seq_predType aT) s)) *) by move=> gK s u; rewrite -(mem_map (pcan_inj gK)) pmap_filter // mem_filter gK. Qed. Lemma pmap_uniq s : uniq s -> uniq (pmap f s). Proof. (* Goal: forall _ : is_true (@uniq aT s), is_true (@uniq rT (@pmap (Equality.sort aT) (Equality.sort rT) f s)) *) by move/(filter_uniq [eta f]); rewrite -(pmap_filter fK); apply: map_uniq. Qed. Lemma perm_pmap s t : perm_eq s t -> perm_eq (pmap f s) (pmap f t). Proof. (* Goal: forall _ : is_true (@perm_eq aT s t), is_true (@perm_eq rT (@pmap (Equality.sort aT) (Equality.sort rT) f s) (@pmap (Equality.sort aT) (Equality.sort rT) f t)) *) move=> eq_st; apply/(perm_map_inj (@Some_inj _)); rewrite !pmapS_filter. (* Goal: is_true (@perm_eq (option_eqType rT) (@map (Equality.sort aT) (option (Equality.sort rT)) f (@filter (Equality.sort aT) (fun x : Equality.sort aT => @isSome (Equality.sort rT) (f x)) s)) (@map (Equality.sort aT) (option (Equality.sort rT)) f (@filter (Equality.sort aT) (fun x : Equality.sort aT => @isSome (Equality.sort rT) (f x)) t))) *) exact/perm_map/perm_filter. Qed. End EqPmap. Section PmapSub. Variables (T : Type) (p : pred T) (sT : subType p). Lemma size_pmap_sub s : size (pmap (insub : T -> option sT) s) = count p s. Proof. (* Goal: @eq nat (@size (@sub_sort T p sT) (@pmap T (@sub_sort T p sT) (@insub T p sT : forall _ : T, option (@sub_sort T p sT)) s)) (@count T p s) *) by rewrite size_pmap (eq_count (isSome_insub _)). Qed. End PmapSub. Section EqPmapSub. Variables (T : eqType) (p : pred T) (sT : subType p). Let insT : T -> option sT := insub. Lemma mem_pmap_sub s u : (u \in pmap insT s) = (val u \in s). Proof. (* Goal: @eq bool (@in_mem (Equality.sort (@sub_eqType T p sT)) u (@mem (Equality.sort (@sub_eqType T p sT)) (seq_predType (@sub_eqType T p sT)) (@pmap (Equality.sort T) (@sub_sort (Equality.sort T) p sT) insT s))) (@in_mem (Equality.sort T) (@val (Equality.sort T) p sT u) (@mem (Equality.sort T) (seq_predType T) s)) *) exact/(can2_mem_pmap (insubK _))/valK. Qed. Lemma pmap_sub_uniq s : uniq s -> uniq (pmap insT s). Proof. (* Goal: forall _ : is_true (@uniq T s), is_true (@uniq (@sub_eqType T p sT) (@pmap (Equality.sort T) (@sub_sort (Equality.sort T) p sT) insT s)) *) exact: (pmap_uniq (insubK _)). Qed. End EqPmapSub. Fixpoint iota m n := if n is n'.+1 then m :: iota m.+1 n' else [::]. Lemma size_iota m n : size (iota m n) = n. Proof. (* Goal: @eq nat (@size nat (iota m n)) n *) by elim: n m => //= n IHn m; rewrite IHn. Qed. Lemma iota_add m n1 n2 : iota m (n1 + n2) = iota m n1 ++ iota (m + n1) n2. Proof. (* Goal: @eq (list nat) (iota m (addn n1 n2)) (@cat nat (iota m n1) (iota (addn m n1) n2)) *) by elim: n1 m => //= [|n1 IHn1] m; rewrite ?addn0 // -addSnnS -IHn1. Qed. Lemma iota_addl m1 m2 n : iota (m1 + m2) n = map (addn m1) (iota m2 n). Proof. (* Goal: @eq (list nat) (iota (addn m1 m2) n) (@map nat nat (addn m1) (iota m2 n)) *) by elim: n m2 => //= n IHn m2; rewrite -addnS IHn. Qed. Lemma nth_iota p m n i : i < n -> nth p (iota m n) i = m + i. Proof. (* Goal: forall _ : is_true (leq (S i) n), @eq nat (@nth nat p (iota m n) i) (addn m i) *) by move/subnKC <-; rewrite addSnnS iota_add nth_cat size_iota ltnn subnn. Qed. Lemma mem_iota m n i : (i \in iota m n) = (m <= i) && (i < m + n). Proof. (* Goal: @eq bool (@in_mem (Equality.sort nat_eqType) i (@mem (Equality.sort nat_eqType) (seq_predType nat_eqType) (iota m n))) (andb (leq m i) (leq (S i) (addn m n))) *) elim: n m => [|n IHn] /= m; first by rewrite addn0 ltnNge andbN. (* Goal: @eq bool (@in_mem nat i (@mem nat (seq_predType nat_eqType) (@cons nat m (iota (S m) n)))) (andb (leq m i) (leq (S i) (addn m (S n)))) *) rewrite -addSnnS leq_eqVlt in_cons eq_sym. (* Goal: @eq bool (orb (@eq_op nat_eqType m i) (@in_mem (Equality.sort nat_eqType) i (@mem (Equality.sort nat_eqType) (seq_predType nat_eqType) (iota (S m) n)))) (andb (orb (@eq_op nat_eqType m i) (leq (S m) i)) (leq (S i) (addn (S m) n))) *) by case: eqP => [->|_]; [rewrite leq_addr | apply: IHn]. Qed. Lemma iota_uniq m n : uniq (iota m n). Proof. (* Goal: is_true (@uniq nat_eqType (iota m n)) *) by elim: n m => //= n IHn m; rewrite mem_iota ltnn /=. Qed. Section MakeSeq. Variables (T : Type) (x0 : T). Definition mkseq f n : seq T := map f (iota 0 n). Lemma size_mkseq f n : size (mkseq f n) = n. Proof. (* Goal: @eq nat (@size T (mkseq f n)) n *) by rewrite size_map size_iota. Qed. Lemma eq_mkseq f g : f =1 g -> mkseq f =1 mkseq g. Proof. (* Goal: forall _ : @eqfun T nat f g, @eqfun (list T) nat (mkseq f) (mkseq g) *) by move=> Efg n; apply: eq_map Efg _. Qed. Lemma nth_mkseq f n i : i < n -> nth x0 (mkseq f n) i = f i. Proof. (* Goal: forall _ : is_true (leq (S i) n), @eq T (@nth T x0 (mkseq f n) i) (f i) *) by move=> Hi; rewrite (nth_map 0) ?nth_iota ?size_iota. Qed. Lemma mkseq_nth s : mkseq (nth x0 s) (size s) = s. Proof. (* Goal: @eq (list T) (mkseq (@nth T x0 s) (@size T s)) s *) by apply: (@eq_from_nth _ x0); rewrite size_mkseq // => i Hi; rewrite nth_mkseq. Qed. End MakeSeq. Section MakeEqSeq. Variable T : eqType. Lemma mkseq_uniq (f : nat -> T) n : injective f -> uniq (mkseq f n). Proof. (* Goal: forall _ : @injective (Equality.sort T) nat f, is_true (@uniq T (@mkseq (Equality.sort T) f n)) *) by move/map_inj_uniq->; apply: iota_uniq. Qed. Lemma perm_eq_iotaP {s t : seq T} x0 (It := iota 0 (size t)) : reflect (exists2 Is, perm_eq Is It & s = map (nth x0 t) Is) (perm_eq s t). Proof. (* Goal: Bool.reflect (@ex2 (list (Equality.sort nat_eqType)) (fun Is : list (Equality.sort nat_eqType) => is_true (@perm_eq nat_eqType Is It)) (fun Is : list (Equality.sort nat_eqType) => @eq (list (Equality.sort T)) s (@map nat (Equality.sort T) (@nth (Equality.sort T) x0 t) Is))) (@perm_eq T s t) *) apply: (iffP idP) => [Est | [Is eqIst ->]]; last first. (* Goal: @ex2 (list (Equality.sort nat_eqType)) (fun Is : list (Equality.sort nat_eqType) => is_true (@perm_eq nat_eqType Is It)) (fun Is : list (Equality.sort nat_eqType) => @eq (list (Equality.sort T)) s (@map nat (Equality.sort T) (@nth (Equality.sort T) x0 t) Is)) *) (* Goal: is_true (@perm_eq T (@map nat (Equality.sort T) (@nth (Equality.sort T) x0 t) Is) t) *) by rewrite -{2}[t](mkseq_nth x0) perm_map. (* Goal: @ex2 (list (Equality.sort nat_eqType)) (fun Is : list (Equality.sort nat_eqType) => is_true (@perm_eq nat_eqType Is It)) (fun Is : list (Equality.sort nat_eqType) => @eq (list (Equality.sort T)) s (@map nat (Equality.sort T) (@nth (Equality.sort T) x0 t) Is)) *) elim: t => [|x t IHt] in s It Est *. by rewrite (perm_eq_small _ Est) //; exists [::]. have /rot_to[k s1 Ds]: x \in s by rewrite (perm_eq_mem Est) mem_head. have [|Is1 eqIst1 Ds1] := IHt s1; first by rewrite -(perm_cons x) -Ds perm_rot. exists (rotr k (0 :: map succn Is1)). by rewrite perm_rot /It /= perm_cons (iota_addl 1) perm_map. by rewrite map_rotr /= -map_comp -(@eq_map _ _ (nth x0 t)) // -Ds1 -Ds rotK. Qed. Qed. End MakeEqSeq. Arguments perm_eq_iotaP {T s t}. Section FoldRight. Variables (T : Type) (R : Type) (f : T -> R -> R) (z0 : R). Fixpoint foldr s := if s is x :: s' then f x (foldr s') else z0. End FoldRight. Section FoldRightComp. Variables (T1 T2 : Type) (h : T1 -> T2). Variables (R : Type) (f : T2 -> R -> R) (z0 : R). Lemma foldr_cat s1 s2 : foldr f z0 (s1 ++ s2) = foldr f (foldr f z0 s2) s1. Proof. (* Goal: @eq R (@foldr T2 R f z0 (@cat T2 s1 s2)) (@foldr T2 R f (@foldr T2 R f z0 s2) s1) *) by elim: s1 => //= x s1 ->. Qed. Lemma foldr_map s : foldr f z0 (map h s) = foldr (fun x z => f (h x) z) z0 s. Proof. (* Goal: @eq R (@foldr T2 R f z0 (@map T1 T2 h s)) (@foldr T1 R (fun (x : T1) (z : R) => f (h x) z) z0 s) *) by elim: s => //= x s ->. Qed. End FoldRightComp. Definition sumn := foldr addn 0. Lemma sumn_nseq x n : sumn (nseq n x) = x * n. Proof. (* Goal: @eq nat (sumn (@nseq nat n x)) (muln x n) *) by rewrite mulnC; elim: n => //= n ->. Qed. Lemma sumn_cat s1 s2 : sumn (s1 ++ s2) = sumn s1 + sumn s2. Proof. (* Goal: @eq nat (sumn (@cat nat s1 s2)) (addn (sumn s1) (sumn s2)) *) by elim: s1 => //= x s1 ->; rewrite addnA. Qed. Lemma sumn_count T (P : pred T) s : sumn [seq (P i : nat) | i <- s] = count P s. Proof. (* Goal: @eq nat (sumn (@map T nat (fun i : T => nat_of_bool (P i) : nat) s)) (@count T P s) *) by elim: s => //= s0 s /= ->. Qed. Lemma sumn_rcons s n : sumn (rcons s n) = sumn s + n. Proof. (* Goal: @eq nat (sumn (@rcons nat s n)) (addn (sumn s) n) *) by rewrite -cats1 sumn_cat /= addn0. Qed. Lemma sumn_rev s : sumn (rev s) = sumn s. Proof. (* Goal: @eq nat (sumn (@rev nat s)) (sumn s) *) by elim: s => //= x s <-; rewrite rev_cons sumn_rcons addnC. Qed. Lemma natnseq0P s : reflect (s = nseq (size s) 0) (sumn s == 0). Section FoldLeft. Variables (T R : Type) (f : R -> T -> R). Fixpoint foldl z s := if s is x :: s' then foldl (f z x) s' else z. Lemma foldl_rev z s : foldl z (rev s) = foldr (fun x z => f z x) z s. Proof. (* Goal: @eq R (foldl z (@rev T s)) (@foldr T R (fun (x : T) (z : R) => f z x) z s) *) elim/last_ind: s z => [|s x IHs] z //=. (* Goal: @eq R (foldl z (@rev T (@rcons T s x))) (@foldr T R (fun (x : T) (z : R) => f z x) z (@rcons T s x)) *) by rewrite rev_rcons -cats1 foldr_cat -IHs. Qed. Lemma foldl_cat z s1 s2 : foldl z (s1 ++ s2) = foldl (foldl z s1) s2. Proof. (* Goal: @eq R (foldl z (@cat T s1 s2)) (foldl (foldl z s1) s2) *) by rewrite -(revK (s1 ++ s2)) foldl_rev rev_cat foldr_cat -!foldl_rev !revK. Qed. End FoldLeft. Section Scan. Variables (T1 : Type) (x1 : T1) (T2 : Type) (x2 : T2). Variables (f : T1 -> T1 -> T2) (g : T1 -> T2 -> T1). Fixpoint pairmap x s := if s is y :: s' then f x y :: pairmap y s' else [::]. Lemma size_pairmap x s : size (pairmap x s) = size s. Proof. (* Goal: @eq nat (@size T2 (pairmap x s)) (@size T1 s) *) by elim: s x => //= y s IHs x; rewrite IHs. Qed. Lemma pairmap_cat x s1 s2 : pairmap x (s1 ++ s2) = pairmap x s1 ++ pairmap (last x s1) s2. Proof. (* Goal: @eq (list T2) (pairmap x (@cat T1 s1 s2)) (@cat T2 (pairmap x s1) (pairmap (@last T1 x s1) s2)) *) by elim: s1 x => //= y s1 IHs1 x; rewrite IHs1. Qed. Lemma nth_pairmap s n : n < size s -> forall x, nth x2 (pairmap x s) n = f (nth x1 (x :: s) n) (nth x1 s n). Proof. (* Goal: forall (_ : is_true (leq (S n) (@size T1 s))) (x : T1), @eq T2 (@nth T2 x2 (pairmap x s) n) (f (@nth T1 x1 (@cons T1 x s) n) (@nth T1 x1 s n)) *) by elim: s n => [|y s IHs] [|n] //= Hn x; apply: IHs. Qed. Fixpoint scanl x s := if s is y :: s' then let x' := g x y in x' :: scanl x' s' else [::]. Lemma size_scanl x s : size (scanl x s) = size s. Proof. (* Goal: @eq nat (@size T1 (scanl x s)) (@size T2 s) *) by elim: s x => //= y s IHs x; rewrite IHs. Qed. Lemma scanl_cat x s1 s2 : scanl x (s1 ++ s2) = scanl x s1 ++ scanl (foldl g x s1) s2. Proof. (* Goal: @eq (list T1) (scanl x (@cat T2 s1 s2)) (@cat T1 (scanl x s1) (scanl (@foldl T2 T1 g x s1) s2)) *) by elim: s1 x => //= y s1 IHs1 x; rewrite IHs1. Qed. Lemma nth_scanl s n : n < size s -> forall x, nth x1 (scanl x s) n = foldl g x (take n.+1 s). Proof. (* Goal: forall (_ : is_true (leq (S n) (@size T2 s))) (x : T1), @eq T1 (@nth T1 x1 (scanl x s) n) (@foldl T2 T1 g x (@take T2 (S n) s)) *) by elim: s n => [|y s IHs] [|n] Hn x //=; rewrite ?take0 ?IHs. Qed. Lemma scanlK : (forall x, cancel (g x) (f x)) -> forall x, cancel (scanl x) (pairmap x). Proof. (* Goal: forall (_ : forall x : T1, @cancel T1 T2 (g x) (f x)) (x : T1), @cancel (list T1) (list T2) (scanl x) (pairmap x) *) by move=> Hfg x s; elim: s x => //= y s IHs x; rewrite Hfg IHs. Qed. Lemma pairmapK : (forall x, cancel (f x) (g x)) -> forall x, cancel (pairmap x) (scanl x). Proof. (* Goal: forall (_ : forall x : T1, @cancel T2 T1 (f x) (g x)) (x : T1), @cancel (list T2) (list T1) (pairmap x) (scanl x) *) by move=> Hgf x s; elim: s x => //= y s IHs x; rewrite Hgf IHs. Qed. End Scan. Prenex Implicits mask map pmap foldr foldl scanl pairmap. Section Zip. Variables S T : Type. Fixpoint zip (s : seq S) (t : seq T) {struct t} := match s, t with | x :: s', y :: t' => (x, y) :: zip s' t' | _, _ => [::] end. Definition unzip1 := map (@fst S T). Definition unzip2 := map (@snd S T). Lemma zip_unzip s : zip (unzip1 s) (unzip2 s) = s. Proof. (* Goal: @eq (list (prod S T)) (zip (unzip1 s) (unzip2 s)) s *) by elim: s => [|[x y] s /= ->]. Qed. Lemma unzip1_zip s t : size s <= size t -> unzip1 (zip s t) = s. Proof. (* Goal: forall _ : is_true (leq (@size S s) (@size T t)), @eq (list S) (unzip1 (zip s t)) s *) by elim: s t => [|x s IHs] [|y t] //= le_s_t; rewrite IHs. Qed. Lemma unzip2_zip s t : size t <= size s -> unzip2 (zip s t) = t. Proof. (* Goal: forall _ : is_true (leq (@size T t) (@size S s)), @eq (list T) (unzip2 (zip s t)) t *) by elim: s t => [|x s IHs] [|y t] //= le_t_s; rewrite IHs. Qed. Lemma size1_zip s t : size s <= size t -> size (zip s t) = size s. Proof. (* Goal: forall _ : is_true (leq (@size S s) (@size T t)), @eq nat (@size (prod S T) (zip s t)) (@size S s) *) by elim: s t => [|x s IHs] [|y t] //= Hs; rewrite IHs. Qed. Lemma size2_zip s t : size t <= size s -> size (zip s t) = size t. Proof. (* Goal: forall _ : is_true (leq (@size T t) (@size S s)), @eq nat (@size (prod S T) (zip s t)) (@size T t) *) by elim: s t => [|x s IHs] [|y t] //= Hs; rewrite IHs. Qed. Lemma size_zip s t : size (zip s t) = minn (size s) (size t). Proof. (* Goal: @eq nat (@size (prod S T) (zip s t)) (minn (@size S s) (@size T t)) *) by elim: s t => [|x s IHs] [|t2 t] //=; rewrite IHs -add1n addn_minr. Qed. Lemma zip_cat s1 s2 t1 t2 : size s1 = size t1 -> zip (s1 ++ s2) (t1 ++ t2) = zip s1 t1 ++ zip s2 t2. Proof. (* Goal: forall _ : @eq nat (@size S s1) (@size T t1), @eq (list (prod S T)) (zip (@cat S s1 s2) (@cat T t1 t2)) (@cat (prod S T) (zip s1 t1) (zip s2 t2)) *) by elim: s1 t1 => [|x s IHs] [|y t] //= [/IHs->]. Qed. Lemma nth_zip x y s t i : size s = size t -> nth (x, y) (zip s t) i = (nth x s i, nth y t i). Proof. (* Goal: forall _ : @eq nat (@size S s) (@size T t), @eq (prod S T) (@nth (prod S T) (@pair S T x y) (zip s t) i) (@pair S T (@nth S x s i) (@nth T y t i)) *) by elim: i s t => [|i IHi] [|y1 s1] [|y2 t] //= [/IHi->]. Qed. Lemma nth_zip_cond p s t i : nth p (zip s t) i = (if i < size (zip s t) then (nth p.1 s i, nth p.2 t i) else p). Proof. (* Goal: @eq (prod S T) (@nth (prod S T) p (zip s t) i) (if leq (Datatypes.S i) (@size (prod S T) (zip s t)) then @pair S T (@nth S (@fst S T p) s i) (@nth T (@snd S T p) t i) else p) *) rewrite size_zip ltnNge geq_min. (* Goal: @eq (prod S T) (@nth (prod S T) p (zip s t) i) (if negb (orb (leq (@size S s) i) (leq (@size T t) i)) then @pair S T (@nth S (@fst S T p) s i) (@nth T (@snd S T p) t i) else p) *) by elim: s t i => [|x s IHs] [|y t] [|i] //=; rewrite ?orbT -?IHs. Qed. Lemma zip_rcons s1 s2 z1 z2 : size s1 = size s2 -> zip (rcons s1 z1) (rcons s2 z2) = rcons (zip s1 s2) (z1, z2). Proof. (* Goal: forall _ : @eq nat (@size S s1) (@size T s2), @eq (list (prod S T)) (zip (@rcons S s1 z1) (@rcons T s2 z2)) (@rcons (prod S T) (zip s1 s2) (@pair S T z1 z2)) *) by move=> eq_sz; rewrite -!cats1 zip_cat //= eq_sz. Qed. Lemma rev_zip s1 s2 : size s1 = size s2 -> rev (zip s1 s2) = zip (rev s1) (rev s2). Proof. (* Goal: forall _ : @eq nat (@size S s1) (@size T s2), @eq (list (prod S T)) (@rev (prod S T) (zip s1 s2)) (zip (@rev S s1) (@rev T s2)) *) elim: s1 s2 => [|x s1 IHs] [|y s2] //= [eq_sz]. (* Goal: @eq (list (prod S T)) (@rev (prod S T) (@cons (prod S T) (@pair S T x y) (zip s1 s2))) (zip (@rev S (@cons S x s1)) (@rev T (@cons T y s2))) *) by rewrite !rev_cons zip_rcons ?IHs ?size_rev. Qed. End Zip. Prenex Implicits zip unzip1 unzip2. Section Flatten. Variable T : Type. Implicit Types (s : seq T) (ss : seq (seq T)). Definition flatten := foldr cat (Nil T). Definition shape := map (@size T). Fixpoint reshape sh s := if sh is n :: sh' then take n s :: reshape sh' (drop n s) else [::]. Definition flatten_index sh r c := sumn (take r sh) + c. Definition reshape_index sh i := find (pred1 0) (scanl subn i.+1 sh). Definition reshape_offset sh i := i - sumn (take (reshape_index sh i) sh). Lemma size_flatten ss : size (flatten ss) = sumn (shape ss). Proof. (* Goal: @eq nat (@size T (flatten ss)) (sumn (shape ss)) *) by elim: ss => //= s ss <-; rewrite size_cat. Qed. Lemma flatten_cat ss1 ss2 : flatten (ss1 ++ ss2) = flatten ss1 ++ flatten ss2. Proof. (* Goal: @eq (list T) (flatten (@cat (list T) ss1 ss2)) (@cat T (flatten ss1) (flatten ss2)) *) by elim: ss1 => //= s ss1 ->; rewrite catA. Qed. Lemma size_reshape sh s : size (reshape sh s) = size sh. Proof. (* Goal: @eq nat (@size (list T) (reshape sh s)) (@size nat sh) *) by elim: sh s => //= s0 sh IHsh s; rewrite IHsh. Qed. Lemma nth_reshape (sh : seq nat) l n : nth [::] (reshape sh l) n = take (nth 0 sh n) (drop (sumn (take n sh)) l). Proof. (* Goal: @eq (list T) (@nth (list T) (@nil T) (reshape sh l) n) (@take T (@nth nat O sh n) (@drop T (sumn (@take nat n sh)) l)) *) elim: n sh l => [| n IHn] [| sh0 sh] l; rewrite ?take0 ?drop0 //=. (* Goal: @eq (list T) (@nth (list T) (@nil T) (reshape sh (@drop T sh0 l)) n) (@take T (@nth nat O sh n) (@drop T (addn sh0 (sumn (@take nat n sh))) l)) *) by rewrite addnC -drop_drop; apply: IHn. Qed. Lemma flattenK ss : reshape (shape ss) (flatten ss) = ss. Proof. (* Goal: @eq (list (list T)) (reshape (shape ss) (flatten ss)) ss *) by elim: ss => //= s ss IHss; rewrite take_size_cat ?drop_size_cat ?IHss. Qed. Lemma reshapeKr sh s : size s <= sumn sh -> flatten (reshape sh s) = s. Proof. (* Goal: forall _ : is_true (leq (@size T s) (sumn sh)), @eq (list T) (flatten (reshape sh s)) s *) elim: sh s => [[]|n sh IHsh] //= s sz_s; rewrite IHsh ?cat_take_drop //. (* Goal: is_true (leq (@size T (@drop T n s)) (sumn sh)) *) by rewrite size_drop leq_subLR. Qed. Lemma reshapeKl sh s : size s >= sumn sh -> shape (reshape sh s) = sh. Proof. (* Goal: forall _ : is_true (leq (sumn sh) (@size T s)), @eq (list nat) (shape (reshape sh s)) sh *) elim: sh s => [[]|n sh IHsh] //= s sz_s. (* Goal: @eq (list nat) (@cons nat (@size T (@take T n s)) (shape (reshape sh (@drop T n s)))) (@cons nat n sh) *) rewrite size_takel; last exact: leq_trans (leq_addr _ _) sz_s. (* Goal: @eq (list nat) (@cons nat n (shape (reshape sh (@drop T n s)))) (@cons nat n sh) *) by rewrite IHsh // -(leq_add2l n) size_drop -maxnE leq_max sz_s orbT. Qed. Lemma flatten_rcons ss s : flatten (rcons ss s) = flatten ss ++ s. Proof. (* Goal: @eq (list T) (flatten (@rcons (list T) ss s)) (@cat T (flatten ss) s) *) by rewrite -cats1 flatten_cat /= cats0. Qed. Lemma flatten_seq1 s : flatten [seq [:: x] | x <- s] = s. Proof. (* Goal: @eq (list T) (flatten (@map T (list T) (fun x : T => @cons T x (@nil T)) s)) s *) by elim: s => //= s0 s ->. Qed. Lemma count_flatten ss P : count P (flatten ss) = sumn [seq count P x | x <- ss]. Proof. (* Goal: @eq nat (@count T P (flatten ss)) (sumn (@map (list T) nat (fun x : list T => @count T P x) ss)) *) by elim: ss => //= s ss IHss; rewrite count_cat IHss. Qed. Lemma filter_flatten ss (P : pred T) : filter P (flatten ss) = flatten [seq filter P i | i <- ss]. Proof. (* Goal: @eq (list T) (@filter T P (flatten ss)) (flatten (@map (list T) (list T) (fun i : list T => @filter T P i) ss)) *) by elim: ss => // s ss /= <-; apply: filter_cat. Qed. Lemma rev_flatten ss : rev (flatten ss) = flatten (rev (map rev ss)). Proof. (* Goal: @eq (list T) (@rev T (flatten ss)) (flatten (@rev (list T) (@map (list T) (list T) (@rev T) ss))) *) elim: ss => //= s ss IHss. (* Goal: @eq (list T) (@rev T (@cat T s (flatten ss))) (flatten (@rev (list T) (@cons (list T) (@rev T s) (@map (list T) (list T) (@rev T) ss)))) *) by rewrite rev_cons flatten_rcons -IHss rev_cat. Qed. Lemma nth_shape ss i : nth 0 (shape ss) i = size (nth [::] ss i). Proof. (* Goal: @eq nat (@nth nat O (shape ss) i) (@size T (@nth (list T) (@nil T) ss i)) *) rewrite /shape; case: (ltnP i (size ss)) => Hi; first exact: nth_map. (* Goal: @eq nat (@nth nat O (@map (list T) nat (@size T) ss) i) (@size T (@nth (list T) (@nil T) ss i)) *) by rewrite !nth_default // size_map. Qed. Lemma shape_rev ss : shape (rev ss) = rev (shape ss). Proof. (* Goal: @eq (list nat) (shape (@rev (list T) ss)) (@rev nat (shape ss)) *) exact: map_rev. Qed. Lemma eq_from_flatten_shape ss1 ss2 : flatten ss1 = flatten ss2 -> shape ss1 = shape ss2 -> ss1 = ss2. Proof. (* Goal: forall (_ : @eq (list T) (flatten ss1) (flatten ss2)) (_ : @eq (list nat) (shape ss1) (shape ss2)), @eq (list (list T)) ss1 ss2 *) by move=> Eflat Esh; rewrite -[LHS]flattenK Eflat Esh flattenK. Qed. Lemma rev_reshape sh s : size s = sumn sh -> rev (reshape sh s) = map rev (reshape (rev sh) (rev s)). Lemma reshape_rcons s sh n (m := sumn sh) : m + n = size s -> reshape (rcons sh n) s = rcons (reshape sh (take m s)) (drop m s). Proof. (* Goal: forall _ : @eq nat (addn m n) (@size T s), @eq (list (list T)) (reshape (@rcons nat sh n) s) (@rcons (list T) (reshape sh (@take T m s)) (@drop T m s)) *) move=> Dmn; apply/(can_inj revK); rewrite rev_reshape ?rev_rcons ?sumn_rcons //. (* Goal: @eq (list (list T)) (@map (list T) (list T) (@rev T) (reshape (@cons nat n (@rev nat sh)) (@rev T s))) (@cons (list T) (@drop T m s) (@rev (list T) (reshape sh (@take T m s)))) *) rewrite /= take_rev drop_rev -Dmn addnK revK -rev_reshape //. (* Goal: @eq nat (@size T (@take T m s)) (sumn sh) *) by rewrite size_takel // -Dmn leq_addr. Qed. Lemma flatten_indexP sh r c : c < nth 0 sh r -> flatten_index sh r c < sumn sh. Proof. (* Goal: forall _ : is_true (leq (S c) (@nth nat O sh r)), is_true (leq (S (flatten_index sh r c)) (sumn sh)) *) move=> lt_c_sh; rewrite -[sh in sumn sh](cat_take_drop r) sumn_cat ltn_add2l. (* Goal: is_true (leq (S c) (sumn (@drop nat r sh))) *) suffices lt_r_sh: r < size sh by rewrite (drop_nth 0 lt_r_sh) ltn_addr. (* Goal: is_true (leq (S r) (@size nat sh)) *) by case: ltnP => // le_sh_r; rewrite nth_default in lt_c_sh. Qed. Lemma reshape_indexP sh i : i < sumn sh -> reshape_index sh i < size sh. Proof. (* Goal: forall _ : is_true (leq (S i) (sumn sh)), is_true (leq (S (reshape_index sh i)) (@size nat sh)) *) rewrite /reshape_index; elim: sh => //= n sh IHsh in i *; rewrite subn_eq0. (* Goal: forall _ : is_true (leq (S i) (addn n (sumn sh))), is_true (leq (S (if leq (S i) n then O else S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i) n) sh)))) (S (@size nat sh))) *) by have [// | le_n_i] := ltnP i n; rewrite -leq_subLR subSn // => /IHsh. Qed. Lemma reshape_offsetP sh i : i < sumn sh -> reshape_offset sh i < nth 0 sh (reshape_index sh i). Proof. (* Goal: forall _ : is_true (leq (S i) (sumn sh)), is_true (leq (S (reshape_offset sh i)) (@nth nat O sh (reshape_index sh i))) *) rewrite /reshape_offset /reshape_index; elim: sh => //= n sh IHsh in i *. rewrite subn_eq0; have [| le_n_i] := ltnP i n; first by rewrite subn0. by rewrite -leq_subLR /= subnDA subSn // => /IHsh. Qed. Qed. Lemma reshape_indexK sh i : flatten_index sh (reshape_index sh i) (reshape_offset sh i) = i. Proof. (* Goal: @eq nat (flatten_index sh (reshape_index sh i) (reshape_offset sh i)) i *) rewrite /reshape_offset /reshape_index /flatten_index -subSKn. (* Goal: @eq nat (addn (sumn (@take nat (@find (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType O)) (@scanl nat nat subn (S i) sh)) sh)) (Nat.pred (subn (S i) (sumn (@take nat (@find (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType O)) (@scanl nat nat subn (S i) sh)) sh))))) i *) elim: sh => //= n sh IHsh in i *; rewrite subn_eq0; have [//|le_n_i] := ltnP. (* Goal: @eq nat (addn (sumn (@cons nat n (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i) n) sh)) sh))) (Nat.pred (subn (S i) (sumn (@cons nat n (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i) n) sh)) sh)))))) i *) by rewrite /= subnDA subSn // -addnA IHsh subnKC. Qed. Lemma flatten_indexKl sh r c : c < nth 0 sh r -> reshape_index sh (flatten_index sh r c) = r. Proof. (* Goal: forall _ : is_true (leq (S c) (@nth nat O sh r)), @eq nat (reshape_index sh (flatten_index sh r c)) r *) rewrite /reshape_index /flatten_index. (* Goal: forall _ : is_true (leq (S c) (@nth nat O sh r)), @eq nat (@find (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType O)) (@scanl nat nat subn (S (addn (sumn (@take nat r sh)) c)) sh)) r *) elim: sh r => [|n sh IHsh] [|r] //= lt_c_sh; first by rewrite ifT. (* Goal: @eq nat (if @eq_op nat_eqType (subn (S (addn (addn n (sumn (@take nat r sh))) c)) n) O then O else S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S (addn (addn n (sumn (@take nat r sh))) c)) n) sh))) (S r) *) by rewrite -addnA -addnS addKn IHsh. Qed. Lemma flatten_indexKr sh r c : c < nth 0 sh r -> reshape_offset sh (flatten_index sh r c) = c. Proof. (* Goal: forall _ : is_true (leq (S c) (@nth nat O sh r)), @eq nat (reshape_offset sh (flatten_index sh r c)) c *) rewrite /reshape_offset /reshape_index /flatten_index. (* Goal: forall _ : is_true (leq (S c) (@nth nat O sh r)), @eq nat (subn (addn (sumn (@take nat r sh)) c) (sumn (@take nat (@find (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType O)) (@scanl nat nat subn (S (addn (sumn (@take nat r sh)) c)) sh)) sh))) c *) elim: sh r => [|n sh IHsh] [|r] //= lt_c_sh; first by rewrite ifT ?subn0. (* Goal: @eq nat (subn (addn (addn n (sumn (@take nat r sh))) c) (sumn match (if @eq_op nat_eqType (subn (S (addn (addn n (sumn (@take nat r sh))) c)) n) O then O else S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S (addn (addn n (sumn (@take nat r sh))) c)) n) sh))) with | O => @nil nat | S n' => @cons nat n (@take nat n' sh) end)) c *) by rewrite -addnA -addnS addKn /= subnDl IHsh. Qed. Lemma nth_flatten x0 ss i (r := reshape_index (shape ss) i) : nth x0 (flatten ss) i = nth x0 (nth [::] ss r) (reshape_offset (shape ss) i). Proof. (* Goal: @eq T (@nth T x0 (flatten ss) i) (@nth T x0 (@nth (list T) (@nil T) ss r) (reshape_offset (shape ss) i)) *) rewrite /reshape_offset -subSKn {}/r /reshape_index. (* Goal: @eq T (@nth T x0 (flatten ss) i) (@nth T x0 (@nth (list T) (@nil T) ss (@find (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType O)) (@scanl nat nat subn (S i) (shape ss)))) (Nat.pred (subn (S i) (sumn (@take nat (@find (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType O)) (@scanl nat nat subn (S i) (shape ss))) (shape ss)))))) *) elim: ss => //= s ss IHss in i *; rewrite subn_eq0 nth_cat. (* Goal: @eq T (if leq (S i) (@size T s) then @nth T x0 s i else @nth T x0 (flatten ss) (subn i (@size T s))) (@nth T x0 (@nth (list T) (@nil T) (@cons (list T) s ss) (if leq (S i) (@size T s) then O else S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i) (@size T s)) (shape ss))))) (Nat.pred (subn (S i) (sumn match (if leq (S i) (@size T s) then O else S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i) (@size T s)) (shape ss)))) with | O => @nil nat | S n' => @cons nat (@size T s) (@take nat n' (shape ss)) end)))) *) by have [//|le_s_i] := ltnP; rewrite subnDA subSn /=. Qed. Lemma reshape_leq sh i1 i2 (r1 := reshape_index sh i1) (c1 := reshape_offset sh i1) (r2 := reshape_index sh i2) (c2 := reshape_offset sh i2) : (i1 <= i2) = ((r1 < r2) || ((r1 == r2) && (c1 <= c2))). Proof. (* Goal: @eq bool (leq i1 i2) (orb (leq (S r1) r2) (andb (@eq_op nat_eqType r1 r2) (leq c1 c2))) *) rewrite {}/r1 {}/c1 {}/r2 {}/c2 /reshape_offset /reshape_index. (* Goal: @eq bool (leq i1 i2) (orb (leq (S (@find (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType O)) (@scanl nat nat subn (S i1) sh))) (@find (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType O)) (@scanl nat nat subn (S i2) sh))) (andb (@eq_op nat_eqType (@find (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType O)) (@scanl nat nat subn (S i1) sh)) (@find (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType O)) (@scanl nat nat subn (S i2) sh))) (leq (subn i1 (sumn (@take nat (@find (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType O)) (@scanl nat nat subn (S i1) sh)) sh))) (subn i2 (sumn (@take nat (@find (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType O)) (@scanl nat nat subn (S i2) sh)) sh)))))) *) elim: sh => [|s0 s IHs] /= in i1 i2 *; rewrite ?subn0 ?subn_eq0 //. (* Goal: @eq bool (leq i1 i2) (orb (leq (S (if leq (S i1) s0 then O else S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)))) (if leq (S i2) s0 then O else S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)))) (andb (@eq_op nat_eqType (if leq (S i1) s0 then O else S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s))) (if leq (S i2) s0 then O else S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)))) (leq (subn i1 (sumn match (if leq (S i1) s0 then O else S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s))) with | O => @nil nat | S n' => @cons nat s0 (@take nat n' s) end)) (subn i2 (sumn match (if leq (S i2) s0 then O else S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s))) with | O => @nil nat | S n' => @cons nat s0 (@take nat n' s) end))))) *) have [[] i1s0 [] i2s0] := (ltnP i1 s0, ltnP i2 s0); first by rewrite !subn0. (* Goal: @eq bool (leq i1 i2) (orb (leq (S (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)))) (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)))) (andb (@eq_op nat_eqType (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s))) (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)))) (leq (subn i1 (sumn (@cons nat s0 (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)) s)))) (subn i2 (sumn (@cons nat s0 (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)) s))))))) *) (* Goal: @eq bool (leq i1 i2) (orb (leq (S (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)))) O) (andb (@eq_op nat_eqType (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s))) O) (leq (subn i1 (sumn (@cons nat s0 (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)) s)))) (subn i2 (sumn (@nil nat)))))) *) (* Goal: @eq bool (leq i1 i2) (orb (leq (S O) (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)))) (andb (@eq_op nat_eqType O (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)))) (leq (subn i1 (sumn (@nil nat))) (subn i2 (sumn (@cons nat s0 (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)) s))))))) *) - (* Goal: @eq bool (leq i1 i2) (orb (leq (S (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)))) (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)))) (andb (@eq_op nat_eqType (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s))) (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)))) (leq (subn i1 (sumn (@cons nat s0 (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)) s)))) (subn i2 (sumn (@cons nat s0 (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)) s))))))) *) (* Goal: @eq bool (leq i1 i2) (orb (leq (S (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)))) O) (andb (@eq_op nat_eqType (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s))) O) (leq (subn i1 (sumn (@cons nat s0 (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)) s)))) (subn i2 (sumn (@nil nat)))))) *) (* Goal: @eq bool (leq i1 i2) (orb (leq (S O) (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)))) (andb (@eq_op nat_eqType O (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)))) (leq (subn i1 (sumn (@nil nat))) (subn i2 (sumn (@cons nat s0 (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)) s))))))) *) by apply: leq_trans i2s0; apply/ltnW. (* Goal: @eq bool (leq i1 i2) (orb (leq (S (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)))) (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)))) (andb (@eq_op nat_eqType (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s))) (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)))) (leq (subn i1 (sumn (@cons nat s0 (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)) s)))) (subn i2 (sumn (@cons nat s0 (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)) s))))))) *) (* Goal: @eq bool (leq i1 i2) (orb (leq (S (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)))) O) (andb (@eq_op nat_eqType (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s))) O) (leq (subn i1 (sumn (@cons nat s0 (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)) s)))) (subn i2 (sumn (@nil nat)))))) *) - (* Goal: @eq bool (leq i1 i2) (orb (leq (S (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)))) (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)))) (andb (@eq_op nat_eqType (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s))) (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)))) (leq (subn i1 (sumn (@cons nat s0 (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)) s)))) (subn i2 (sumn (@cons nat s0 (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)) s))))))) *) (* Goal: @eq bool (leq i1 i2) (orb (leq (S (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)))) O) (andb (@eq_op nat_eqType (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s))) O) (leq (subn i1 (sumn (@cons nat s0 (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)) s)))) (subn i2 (sumn (@nil nat)))))) *) by apply/negP => /(leq_trans i1s0); rewrite leqNgt i2s0. (* Goal: @eq bool (leq i1 i2) (orb (leq (S (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)))) (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)))) (andb (@eq_op nat_eqType (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s))) (S (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)))) (leq (subn i1 (sumn (@cons nat s0 (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i1) s0) s)) s)))) (subn i2 (sumn (@cons nat s0 (@take nat (@find nat (@pred_of_simpl nat (@pred1 nat_eqType O)) (@scanl nat nat subn (subn (S i2) s0) s)) s))))))) *) by rewrite !subSn // !eqSS !ltnS !subnDA -IHs leq_subLR subnKC. Qed. End Flatten. Prenex Implicits flatten shape reshape. Lemma map_flatten S T (f : T -> S) ss : map f (flatten ss) = flatten (map (map f) ss). Proof. (* Goal: @eq (list S) (@map T S f (@flatten T ss)) (@flatten S (@map (list T) (list S) (@map T S f) ss)) *) by elim: ss => // s ss /= <-; apply: map_cat. Qed. Lemma sumn_flatten (ss : seq (seq nat)) : sumn (flatten ss) = sumn (map sumn ss). Proof. (* Goal: @eq nat (sumn (@flatten nat ss)) (sumn (@map (list nat) nat sumn ss)) *) by elim: ss => // s ss /= <-; apply: sumn_cat. Qed. Lemma map_reshape T S (f : T -> S) sh s : map (map f) (reshape sh s) = reshape sh (map f s). Proof. (* Goal: @eq (list (list S)) (@map (list T) (list S) (@map T S f) (@reshape T sh s)) (@reshape S sh (@map T S f s)) *) by elim: sh s => //= sh0 sh IHsh s; rewrite map_take IHsh map_drop. Qed. Section EqFlatten. Variables S T : eqType. Lemma flattenP (A : seq (seq T)) x : reflect (exists2 s, s \in A & x \in s) (x \in flatten A). Proof. (* Goal: Bool.reflect (@ex2 (Equality.sort (seq_eqType T)) (fun s : Equality.sort (seq_eqType T) => is_true (@in_mem (Equality.sort (seq_eqType T)) s (@mem (Equality.sort (seq_eqType T)) (seq_predType (seq_eqType T)) A))) (fun s : Equality.sort (seq_eqType T) => is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) s)))) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@flatten (Equality.sort T) A))) *) elim: A => /= [|s A /iffP IH_A]; [by right; case | rewrite mem_cat]. (* Goal: Bool.reflect (@ex2 (list (Equality.sort T)) (fun s0 : list (Equality.sort T) => is_true (@in_mem (list (Equality.sort T)) s0 (@mem (list (Equality.sort T)) (seq_predType (seq_eqType T)) (@cons (list (Equality.sort T)) s A)))) (fun s : list (Equality.sort T) => is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) s)))) (orb (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) s)) (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@flatten (Equality.sort T) A)))) *) have [s_x|s'x] := @idP (x \in s); first by left; exists s; rewrite ?mem_head. (* Goal: Bool.reflect (@ex2 (list (Equality.sort T)) (fun s0 : list (Equality.sort T) => is_true (@in_mem (list (Equality.sort T)) s0 (@mem (list (Equality.sort T)) (seq_predType (seq_eqType T)) (@cons (list (Equality.sort T)) s A)))) (fun s : list (Equality.sort T) => is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) s)))) (orb false (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@flatten (Equality.sort T) A)))) *) by apply: IH_A => [[t] | [t /predU1P[->|]]]; exists t; rewrite // mem_behead. Qed. Arguments flattenP {A x}. Lemma flatten_mapP (A : S -> seq T) s y : reflect (exists2 x, x \in s & y \in A x) (y \in flatten (map A s)). Proof. (* Goal: Bool.reflect (@ex2 (Equality.sort S) (fun x : Equality.sort S => is_true (@in_mem (Equality.sort S) x (@mem (Equality.sort S) (seq_predType S) s))) (fun x : Equality.sort S => is_true (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) (A x))))) (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) (@flatten (Equality.sort T) (@map (Equality.sort S) (list (Equality.sort T)) A s)))) *) apply: (iffP flattenP) => [[_ /mapP[x sx ->]] | [x sx]] Axy; first by exists x. (* Goal: @ex2 (Equality.sort (seq_eqType T)) (fun s0 : Equality.sort (seq_eqType T) => is_true (@in_mem (Equality.sort (seq_eqType T)) s0 (@mem (Equality.sort (seq_eqType T)) (seq_predType (seq_eqType T)) (@map (Equality.sort S) (list (Equality.sort T)) A s)))) (fun s : Equality.sort (seq_eqType T) => is_true (@in_mem (Equality.sort T) y (@mem (Equality.sort T) (seq_predType T) s))) *) by exists (A x); rewrite ?map_f. Qed. End EqFlatten. Arguments flattenP {T A x}. Arguments flatten_mapP {S T A s y}. Lemma perm_undup_count (T : eqType) (s : seq T) : perm_eq (flatten [seq nseq (count_mem x s) x | x <- undup s]) s. Proof. (* Goal: is_true (@perm_eq T (@flatten (Equality.sort T) (@map (Equality.sort T) (list (Equality.sort T)) (fun x : Equality.sort T => @nseq (Equality.sort T) (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s) x) (@undup T s))) s) *) pose N x r := count_mem x (flatten [seq nseq (count_mem y s) y | y <- r]). (* Goal: is_true (@perm_eq T (@flatten (Equality.sort T) (@map (Equality.sort T) (list (Equality.sort T)) (fun x : Equality.sort T => @nseq (Equality.sort T) (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s) x) (@undup T s))) s) *) apply/allP=> x _; rewrite /= -/(N x _). (* Goal: is_true (@eq_op nat_eqType (N x (@undup T s)) (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s)) *) have Nx0 r (r'x : x \notin r): N x r = 0. (* Goal: is_true (@eq_op nat_eqType (N x (@undup T s)) (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s)) *) (* Goal: @eq nat (N x r) O *) by apply/count_memPn; apply: contra r'x => /flatten_mapP[y r_y /nseqP[->]]. (* Goal: is_true (@eq_op nat_eqType (N x (@undup T s)) (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s)) *) have [|s'x] := boolP (x \in s); last by rewrite Nx0 ?mem_undup ?(count_memPn _). (* Goal: forall _ : is_true (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) s)), is_true (@eq_op nat_eqType (N x (@undup T s)) (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s)) *) rewrite -mem_undup => /perm_to_rem/catCA_perm_subst->; last first. (* Goal: is_true (@eq_op nat_eqType (N x (@cons (Equality.sort T) x (@rem T x (@undup T s)))) (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s)) *) (* Goal: forall s1 s2 s3 : list (Equality.sort T), @eq nat (N x (@cat (Equality.sort T) s1 (@cat (Equality.sort T) s2 s3))) (N x (@cat (Equality.sort T) s2 (@cat (Equality.sort T) s1 s3))) *) by move=> s1 s2 s3; rewrite /N !map_cat !flatten_cat !count_cat addnCA. (* Goal: is_true (@eq_op nat_eqType (N x (@cons (Equality.sort T) x (@rem T x (@undup T s)))) (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s)) *) rewrite /N /= count_cat -/(N x _) Nx0 ?mem_rem_uniq ?undup_uniq ?inE ?eqxx //. (* Goal: is_true (@eq_op nat_eqType (addn (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) (@nseq (Equality.sort T) (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s) x)) O) (@count (Equality.sort T) (@pred_of_simpl (Equality.sort T) (@pred1 T x)) s)) *) by rewrite addn0 -{2}(size_nseq (_ s) x) -all_count all_pred1_nseq. Qed. Section AllPairs. Variables (S T R : Type) (f : S -> T -> R). Implicit Types (s : seq S) (t : seq T). Definition allpairs s t := foldr (fun x => cat (map (f x) t)) [::] s. Lemma size_allpairs s t : size (allpairs s t) = size s * size t. Proof. (* Goal: @eq nat (@size R (allpairs s t)) (muln (@size S s) (@size T t)) *) by elim: s => //= x s IHs; rewrite size_cat size_map IHs. Qed. Lemma allpairs_cat s1 s2 t : allpairs (s1 ++ s2) t = allpairs s1 t ++ allpairs s2 t. Proof. (* Goal: @eq (list R) (allpairs (@cat S s1 s2) t) (@cat R (allpairs s1 t) (allpairs s2 t)) *) by elim: s1 => //= x s1 ->; rewrite catA. Qed. End AllPairs. Prenex Implicits allpairs. Notation "[ 'seq' E | i <- s , j <- t ]" := (allpairs (fun i j => E) s 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 ]" := (allpairs (fun (i : T) (j : U) => E) s t) (at level 0, E at level 99, i ident, j ident, only parsing) : seq_scope. Section EqAllPairs. Variables S T : eqType. Implicit Types (R : eqType) (s : seq S) (t : seq T). Lemma allpairsP R (f : S -> T -> R) s t z : reflect (exists p, [/\ p.1 \in s, p.2 \in t & z = f p.1 p.2]) Proof. (* Goal: Bool.reflect (@ex (prod (Equality.sort S) (Equality.sort T)) (fun p : prod (Equality.sort S) (Equality.sort T) => and3 (is_true (@in_mem (Equality.sort S) (@fst (Equality.sort S) (Equality.sort T) p) (@mem (Equality.sort S) (seq_predType S) s))) (is_true (@in_mem (Equality.sort T) (@snd (Equality.sort S) (Equality.sort T) p) (@mem (Equality.sort T) (seq_predType T) t))) (@eq (Equality.sort R) z (f (@fst (Equality.sort S) (Equality.sort T) p) (@snd (Equality.sort S) (Equality.sort T) p))))) (@in_mem (Equality.sort R) z (@mem (Equality.sort R) (seq_predType R) (@allpairs (Equality.sort S) (Equality.sort T) (Equality.sort R) f s t))) *) elim: s => [|x s IHs /=]; first by right=> [[p []]]. (* Goal: Bool.reflect (@ex (prod (Equality.sort S) (Equality.sort T)) (fun p : prod (Equality.sort S) (Equality.sort T) => and3 (is_true (@in_mem (Equality.sort S) (@fst (Equality.sort S) (Equality.sort T) p) (@mem (Equality.sort S) (seq_predType S) (@cons (Equality.sort S) x s)))) (is_true (@in_mem (Equality.sort T) (@snd (Equality.sort S) (Equality.sort T) p) (@mem (Equality.sort T) (seq_predType T) t))) (@eq (Equality.sort R) z (f (@fst (Equality.sort S) (Equality.sort T) p) (@snd (Equality.sort S) (Equality.sort T) p))))) (@in_mem (Equality.sort R) z (@mem (Equality.sort R) (seq_predType R) (@cat (Equality.sort R) (@map (Equality.sort T) (Equality.sort R) (f x) t) (@allpairs (Equality.sort S) (Equality.sort T) (Equality.sort R) f s t)))) *) rewrite mem_cat; have [fxt_z | not_fxt_z] := altP mapP. (* Goal: Bool.reflect (@ex (prod (Equality.sort S) (Equality.sort T)) (fun p : prod (Equality.sort S) (Equality.sort T) => and3 (is_true (@in_mem (Equality.sort S) (@fst (Equality.sort S) (Equality.sort T) p) (@mem (Equality.sort S) (seq_predType S) (@cons (Equality.sort S) x s)))) (is_true (@in_mem (Equality.sort T) (@snd (Equality.sort S) (Equality.sort T) p) (@mem (Equality.sort T) (seq_predType T) t))) (@eq (Equality.sort R) z (f (@fst (Equality.sort S) (Equality.sort T) p) (@snd (Equality.sort S) (Equality.sort T) p))))) (orb false (@in_mem (Equality.sort R) z (@mem (Equality.sort R) (seq_predType R) (@allpairs (Equality.sort S) (Equality.sort T) (Equality.sort R) f s t)))) *) (* Goal: Bool.reflect (@ex (prod (Equality.sort S) (Equality.sort T)) (fun p : prod (Equality.sort S) (Equality.sort T) => and3 (is_true (@in_mem (Equality.sort S) (@fst (Equality.sort S) (Equality.sort T) p) (@mem (Equality.sort S) (seq_predType S) (@cons (Equality.sort S) x s)))) (is_true (@in_mem (Equality.sort T) (@snd (Equality.sort S) (Equality.sort T) p) (@mem (Equality.sort T) (seq_predType T) t))) (@eq (Equality.sort R) z (f (@fst (Equality.sort S) (Equality.sort T) p) (@snd (Equality.sort S) (Equality.sort T) p))))) (orb true (@in_mem (Equality.sort R) z (@mem (Equality.sort R) (seq_predType R) (@allpairs (Equality.sort S) (Equality.sort T) (Equality.sort R) f s t)))) *) by left; have [y t_y ->] := fxt_z; exists (x, y); rewrite mem_head. (* Goal: Bool.reflect (@ex (prod (Equality.sort S) (Equality.sort T)) (fun p : prod (Equality.sort S) (Equality.sort T) => and3 (is_true (@in_mem (Equality.sort S) (@fst (Equality.sort S) (Equality.sort T) p) (@mem (Equality.sort S) (seq_predType S) (@cons (Equality.sort S) x s)))) (is_true (@in_mem (Equality.sort T) (@snd (Equality.sort S) (Equality.sort T) p) (@mem (Equality.sort T) (seq_predType T) t))) (@eq (Equality.sort R) z (f (@fst (Equality.sort S) (Equality.sort T) p) (@snd (Equality.sort S) (Equality.sort T) p))))) (orb false (@in_mem (Equality.sort R) z (@mem (Equality.sort R) (seq_predType R) (@allpairs (Equality.sort S) (Equality.sort T) (Equality.sort R) f s t)))) *) apply: (iffP IHs) => [] [[x' y] /= [s_x' t_y def_z]]; exists (x', y). (* Goal: and3 (is_true (@in_mem (Equality.sort S) (@fst (Equality.sort S) (Equality.sort T) (@pair (Equality.sort S) (Equality.sort T) x' y)) (@mem (Equality.sort S) (seq_predType S) s))) (is_true (@in_mem (Equality.sort T) (@snd (Equality.sort S) (Equality.sort T) (@pair (Equality.sort S) (Equality.sort T) x' y)) (@mem (Equality.sort T) (seq_predType T) t))) (@eq (Equality.sort R) z (f (@fst (Equality.sort S) (Equality.sort T) (@pair (Equality.sort S) (Equality.sort T) x' y)) (@snd (Equality.sort S) (Equality.sort T) (@pair (Equality.sort S) (Equality.sort T) x' y)))) *) (* Goal: and3 (is_true (@in_mem (Equality.sort S) (@fst (Equality.sort S) (Equality.sort T) (@pair (Equality.sort S) (Equality.sort T) x' y)) (@mem (Equality.sort S) (seq_predType S) (@cons (Equality.sort S) x s)))) (is_true (@in_mem (Equality.sort T) (@snd (Equality.sort S) (Equality.sort T) (@pair (Equality.sort S) (Equality.sort T) x' y)) (@mem (Equality.sort T) (seq_predType T) t))) (@eq (Equality.sort R) z (f (@fst (Equality.sort S) (Equality.sort T) (@pair (Equality.sort S) (Equality.sort T) x' y)) (@snd (Equality.sort S) (Equality.sort T) (@pair (Equality.sort S) (Equality.sort T) x' y)))) *) by rewrite !inE predU1r. (* Goal: and3 (is_true (@in_mem (Equality.sort S) (@fst (Equality.sort S) (Equality.sort T) (@pair (Equality.sort S) (Equality.sort T) x' y)) (@mem (Equality.sort S) (seq_predType S) s))) (is_true (@in_mem (Equality.sort T) (@snd (Equality.sort S) (Equality.sort T) (@pair (Equality.sort S) (Equality.sort T) x' y)) (@mem (Equality.sort T) (seq_predType T) t))) (@eq (Equality.sort R) z (f (@fst (Equality.sort S) (Equality.sort T) (@pair (Equality.sort S) (Equality.sort T) x' y)) (@snd (Equality.sort S) (Equality.sort T) (@pair (Equality.sort S) (Equality.sort T) x' y)))) *) by have [def_x' | //] := predU1P s_x'; rewrite def_z def_x' map_f in not_fxt_z. Qed. Lemma mem_allpairs R (f : S -> T -> R) s1 t1 s2 t2 : s1 =i s2 -> t1 =i t2 -> allpairs f s1 t1 =i allpairs 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)) (_ : @eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) t1) (@mem (Equality.sort T) (seq_predType T) t2)), @eq_mem (Equality.sort R) (@mem (Equality.sort R) (seq_predType R) (@allpairs (Equality.sort S) (Equality.sort T) (Equality.sort R) f s1 t1)) (@mem (Equality.sort R) (seq_predType R) (@allpairs (Equality.sort S) (Equality.sort T) (Equality.sort R) f s2 t2)) *) move=> eq_s eq_t z. (* Goal: @eq bool (@in_mem (Equality.sort R) z (@mem (Equality.sort R) (seq_predType R) (@allpairs (Equality.sort S) (Equality.sort T) (Equality.sort R) f s1 t1))) (@in_mem (Equality.sort R) z (@mem (Equality.sort R) (seq_predType R) (@allpairs (Equality.sort S) (Equality.sort T) (Equality.sort R) f s2 t2))) *) by apply/allpairsP/allpairsP=> [] [p fpz]; exists p; rewrite eq_s eq_t in fpz *. Qed. Qed. Lemma allpairs_catr R (f : S -> T -> R) s t1 t2 : allpairs f s (t1 ++ t2) =i allpairs f s t1 ++ allpairs f s t2. Lemma allpairs_uniq R (f : S -> T -> R) s t : uniq s -> uniq t -> {in [seq (x, y) | x <- s, y <- t] &, injective (prod_curry f)} -> uniq (allpairs f s t). End EqAllPairs. Section AllIff. Inductive all_iff_and (P Q : Prop) : Prop := AllIffConj of P & Q. Definition all_iff (P0 : Prop) (Ps : seq Prop) : Prop := (fix aux (P : Prop) (Qs : seq Prop) : Prop := if Qs is Q :: Qs then all_iff_and (P -> Q) (aux Q Qs) else P -> P0 : Prop) P0 Ps. Lemma all_iffLR P0 Ps : all_iff P0 Ps -> forall m n, nth P0 (P0 :: Ps) m -> nth P0 (P0 :: Ps) n. Proof. (* Goal: forall (_ : all_iff P0 Ps) (m n : nat) (_ : @nth Prop P0 (@cons Prop P0 Ps) m), @nth Prop P0 (@cons Prop P0 Ps) n *) have homo_ltn T (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}. (* Goal: forall (_ : all_iff P0 Ps) (m n : nat) (_ : @nth Prop P0 (@cons Prop P0 Ps) m), @nth Prop P0 (@cons Prop P0 Ps) n *) (* 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) *) move=> rtrans rfS x y; elim: y x => // y ihy x; rewrite ltnS leq_eqVlt. (* Goal: forall (_ : all_iff P0 Ps) (m n : nat) (_ : @nth Prop P0 (@cons Prop P0 Ps) m), @nth Prop P0 (@cons Prop P0 Ps) n *) (* Goal: forall _ : is_true (orb (@eq_op nat_eqType x y) (leq (S x) y)), r (f x) (f (S y)) *) case/orP=> [/eqP-> // | ltxy]; apply: rtrans (rfS _); exact: ihy. (* Goal: forall (_ : all_iff P0 Ps) (m n : nat) (_ : @nth Prop P0 (@cons Prop P0 Ps) m), @nth Prop P0 (@cons Prop P0 Ps) n *) move=> Ps_iff; have ltn_imply : {homo nth P0 Ps : m n / m < n >-> (m -> n)}. (* Goal: forall (m n : nat) (_ : @nth Prop P0 (@cons Prop P0 Ps) m), @nth Prop P0 (@cons Prop P0 Ps) n *) (* Goal: @homomorphism_2 nat Prop (@nth Prop P0 Ps) (fun m n : nat => is_true (leq (S m) n)) (fun m n : Prop => forall _ : m, n) *) apply: homo_ltn => [??? xy yz /xy /yz //|i]. (* Goal: forall (m n : nat) (_ : @nth Prop P0 (@cons Prop P0 Ps) m), @nth Prop P0 (@cons Prop P0 Ps) n *) (* Goal: forall _ : @nth Prop P0 Ps i, @nth Prop P0 Ps (S i) *) elim: Ps i P0 Ps_iff => [|P [|/=Q Ps] IHPs] [|i]//= P0 [P0P Ps_iff]//=; do ?by [rewrite nth_nil|case: Ps_iff]. (* Goal: forall (m n : nat) (_ : @nth Prop P0 (@cons Prop P0 Ps) m), @nth Prop P0 (@cons Prop P0 Ps) n *) (* Goal: forall _ : @nth Prop P0 (@cons Prop Q Ps) i, @nth Prop P0 Ps i *) by case: Ps_iff => [PQ Ps_iff]; apply: IHPs; split => // /P0P. (* Goal: forall (m n : nat) (_ : @nth Prop P0 (@cons Prop P0 Ps) m), @nth Prop P0 (@cons Prop P0 Ps) n *) have {ltn_imply}leq_imply : {homo nth P0 Ps : m n / m <= n >-> (m -> n)}. (* Goal: forall (m n : nat) (_ : @nth Prop P0 (@cons Prop P0 Ps) m), @nth Prop P0 (@cons Prop P0 Ps) n *) (* Goal: @homomorphism_2 nat Prop (@nth Prop P0 Ps) (fun m n : nat => is_true (leq m n)) (fun m n : Prop => forall _ : m, n) *) by move=> m n; rewrite leq_eqVlt => /predU1P[->//|/ltn_imply]. (* Goal: forall (m n : nat) (_ : @nth Prop P0 (@cons Prop P0 Ps) m), @nth Prop P0 (@cons Prop P0 Ps) n *) move=> [:P0ton Pnto0] [|m] [|n]//=. (* Goal: forall _ : @nth Prop P0 Ps m, @nth Prop P0 Ps n *) (* Goal: forall _ : @nth Prop P0 Ps m, P0 *) (* Goal: forall _ : P0, @nth Prop P0 Ps n *) - (* Goal: forall _ : @nth Prop P0 Ps m, @nth Prop P0 Ps n *) (* Goal: forall _ : @nth Prop P0 Ps m, P0 *) (* Goal: forall _ : P0, @nth Prop P0 Ps n *) abstract: P0ton n. (* Goal: forall _ : @nth Prop P0 Ps m, @nth Prop P0 Ps n *) (* Goal: forall _ : @nth Prop P0 Ps m, P0 *) (* Goal: forall _ : P0, @nth Prop P0 Ps n *) suff P0to0 : P0 -> nth P0 Ps 0 by move=> /P0to0; apply: leq_imply. (* Goal: forall _ : @nth Prop P0 Ps m, @nth Prop P0 Ps n *) (* Goal: forall _ : @nth Prop P0 Ps m, P0 *) (* Goal: forall _ : P0, @nth Prop P0 Ps O *) by case: Ps Ps_iff {leq_imply} => // P Ps []. (* Goal: forall _ : @nth Prop P0 Ps m, @nth Prop P0 Ps n *) (* Goal: forall _ : @nth Prop P0 Ps m, P0 *) - (* Goal: forall _ : @nth Prop P0 Ps m, @nth Prop P0 Ps n *) (* Goal: forall _ : @nth Prop P0 Ps m, P0 *) abstract: Pnto0 m => /(leq_imply m (maxn (size Ps) m)). (* Goal: forall _ : @nth Prop P0 Ps m, @nth Prop P0 Ps n *) (* Goal: forall _ : forall _ : is_true (leq m (maxn (@size Prop Ps) m)), @nth Prop P0 Ps (maxn (@size Prop Ps) m), P0 *) by rewrite nth_default ?leq_max ?leqnn // orbT ; apply. (* Goal: forall _ : @nth Prop P0 Ps m, @nth Prop P0 Ps n *) by move=> /Pnto0; apply: P0ton. Qed. Lemma all_iffP P0 Ps : all_iff P0 Ps -> forall m n, nth P0 (P0 :: Ps) m <-> nth P0 (P0 :: Ps) n. Proof. (* Goal: forall (_ : all_iff P0 Ps) (m n : nat), iff (@nth Prop P0 (@cons Prop P0 Ps) m) (@nth Prop P0 (@cons Prop P0 Ps) n) *) by move=> /all_iffLR iffPs m n; split => /iffPs. Qed. End AllIff. Arguments all_iffLR {P0 Ps}. Arguments all_iffP {P0 Ps}. Coercion all_iffP : all_iff >-> Funclass. Notation "[ '<->' P0 ; P1 ; .. ; Pn ]" := (all_iff P0 (P1 :: .. [:: Pn] ..)) (at level 0, format "[ '<->' '[' P0 ; '/' P1 ; '/' .. ; '/' Pn ']' ]") : form_scope. Section All2. Context {T U : Type} (p : T -> U -> bool). Fixpoint all2 s1 s2 := match s1, s2 with | [::], [::] => true | x1 :: s1, x2 :: s2 => p x1 x2 && all2 s1 s2 | _, _ => false end. Lemma all2E s1 s2 : all2 s1 s2 = (size s1 == size s2) && all [pred xy | p xy.1 xy.2] (zip s1 s2). Proof. (* Goal: @eq bool (all2 s1 s2) (andb (@eq_op nat_eqType (@size T s1) (@size U s2)) (@all (prod T U) (@pred_of_simpl (prod T U) (@SimplPred (prod T U) (fun xy : prod T U => p (@fst T U xy) (@snd T U xy)))) (@zip T U s1 s2))) *) by elim: s1 s2 => [|x s1 ihs1] [|y s2] //=; rewrite ihs1 andbCA. Qed. End All2. Arguments all2 {T U} p !s1 !s2.
Require Export GeoCoq.Tarski_dev.Ch03_bet. Section T3. Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}. Lemma l4_2 : forall A B C D A' B' C' D', IFSC A B C D A' B' C' D' -> Cong B D B' D'. Proof. (* Goal: forall (A B C D A' B' C' D' : @Tpoint Tn) (_ : @IFSC Tn A B C D A' B' C' D'), @Cong Tn B D B' D' *) unfold IFSC. (* Goal: forall (A B C D A' B' C' D' : @Tpoint Tn) (_ : and (@Bet Tn A B C) (and (@Bet Tn A' B' C') (and (@Cong Tn A C A' C') (and (@Cong Tn B C B' C') (and (@Cong Tn A D A' D') (@Cong Tn C D C' D')))))), @Cong Tn B D B' D' *) intros. (* Goal: @Cong Tn B D B' D' *) spliter. (* Goal: @Cong Tn B D B' D' *) induction (eq_dec_points A C). (* Goal: @Cong Tn B D B' D' *) (* Goal: @Cong Tn B D B' D' *) treat_equalities;assumption. (* Goal: @Cong Tn B D B' D' *) assert (exists E, Bet A C E /\ C <> E) by apply point_construction_different. (* Goal: @Cong Tn B D B' D' *) ex_and H6 E. (* Goal: @Cong Tn B D B' D' *) prolong A' C' E' C E. (* Goal: @Cong Tn B D B' D' *) assert (Cong E D E' D') by ( apply (five_segment_with_def A C E D A' C' E' D');[ unfold OFSC; repeat split;Cong| assumption]). (* Goal: @Cong Tn B D B' D' *) apply (five_segment_with_def E C B D E' C' B' D'). (* Goal: not (@eq (@Tpoint Tn) E C) *) (* Goal: @OFSC Tn E C B D E' C' B' D' *) unfold OFSC. (* Goal: not (@eq (@Tpoint Tn) E C) *) (* Goal: and (@Bet Tn E C B) (and (@Bet Tn E' C' B') (and (@Cong Tn E C E' C') (and (@Cong Tn C B C' B') (and (@Cong Tn E D E' D') (@Cong Tn C D C' D'))))) *) repeat split; try solve [eBetween| Cong ]. (* Goal: not (@eq (@Tpoint Tn) E C) *) auto. Qed. Lemma l4_3 : forall A B C A' B' C', Bet A B C -> Bet A' B' C' -> Cong A C A' C' -> Cong B C B' C' -> Cong A B A' B'. Proof. (* Goal: forall (A B C A' B' C' : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : @Bet Tn A' B' C') (_ : @Cong Tn A C A' C') (_ : @Cong Tn B C B' C'), @Cong Tn A B A' B' *) intros. (* Goal: @Cong Tn A B A' B' *) apply cong_commutativity. (* Goal: @Cong Tn B A B' A' *) apply (l4_2 A B C A A' B' C' A'). (* Goal: @IFSC Tn A B C A A' B' C' A' *) unfold IFSC. (* Goal: and (@Bet Tn A B C) (and (@Bet Tn A' B' C') (and (@Cong Tn A C A' C') (and (@Cong Tn B C B' C') (and (@Cong Tn A A A' A') (@Cong Tn C A C' A'))))) *) repeat split;Cong. Qed. Lemma l4_3_1 : forall A B C A' B' C', Bet A B C -> Bet A' B' C' -> Cong A B A' B' -> Cong A C A' C' -> Cong B C B' C'. Proof. (* Goal: forall (A B C A' B' C' : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : @Bet Tn A' B' C') (_ : @Cong Tn A B A' B') (_ : @Cong Tn A C A' C'), @Cong Tn B C B' C' *) intros. (* Goal: @Cong Tn B C B' C' *) apply cong_commutativity. (* Goal: @Cong Tn C B C' B' *) eapply l4_3;eBetween;Cong. Qed. Lemma l4_5 : forall A B C A' C', Bet A B C -> Cong A C A' C' -> exists B', Bet A' B' C' /\ Cong_3 A B C A' B' C'. Lemma l4_6 : forall A B C A' B' C', Bet A B C -> Cong_3 A B C A' B' C' -> Bet A' B' C'. Proof. (* Goal: forall (A B C A' B' C' : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : @Cong_3 Tn A B C A' B' C'), @Bet Tn A' B' C' *) unfold Cong_3. (* Goal: forall (A B C A' B' C' : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : and (@Cong Tn A B A' B') (and (@Cong Tn A C A' C') (@Cong Tn B C B' C'))), @Bet Tn A' B' C' *) intros. (* Goal: @Bet Tn A' B' C' *) assert (exists B'', Bet A' B'' C' /\ Cong_3 A B C A' B'' C') by (eapply l4_5;intuition). (* Goal: @Bet Tn A' B' C' *) ex_and H1 x. (* Goal: @Bet Tn A' B' C' *) unfold Cong_3 in *;spliter. (* Goal: @Bet Tn A' B' C' *) assert (Cong_3 A' x C' A' B' C'). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Cong_3 Tn A' x C' A' B' C' *) unfold Cong_3;repeat split; Cong. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Cong Tn x C' B' C' *) (* Goal: @Cong Tn A' x A' B' *) apply cong_transitivity with A B; Cong. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Cong Tn x C' B' C' *) apply cong_transitivity with B C; Cong. (* Goal: @Bet Tn A' B' C' *) unfold Cong_3 in H7;spliter. (* Goal: @Bet Tn A' B' C' *) assert (IFSC A' x C' x A' x C' B') by (unfold IFSC;repeat split;Cong). (* Goal: @Bet Tn A' B' C' *) assert (Cong x x x B') by (eapply l4_2;apply H10). (* Goal: @Bet Tn A' B' C' *) Between. Qed. Lemma cong3_bet_eq : forall A B C X, Bet A B C -> Cong_3 A B C A X C -> X = B. Proof. (* Goal: forall (A B C X : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : @Cong_3 Tn A B C A X C), @eq (@Tpoint Tn) X B *) unfold Cong_3. (* Goal: forall (A B C X : @Tpoint Tn) (_ : @Bet Tn A B C) (_ : and (@Cong Tn A B A X) (and (@Cong Tn A C A C) (@Cong Tn B C X C))), @eq (@Tpoint Tn) X B *) intros. (* Goal: @eq (@Tpoint Tn) X B *) spliter. (* Goal: @eq (@Tpoint Tn) X B *) assert (IFSC A B C B A B C X) by (unfold IFSC;intuition). (* Goal: @eq (@Tpoint Tn) X B *) assert (Cong B B B X) by (apply (l4_2 _ _ _ _ _ _ _ _ H3)). (* Goal: @eq (@Tpoint Tn) X B *) Between. Qed. End T3.
Require Export Qhomographic. Require Export quadraticAcc_Qquadratic_sign. Require Import general_Q Zaux. Lemma Qquadratic_sg_denom_nonzero_always : forall (k e f g h : Z) (p1 p2 : Qpositive), k <> 0%Z -> (0 < e)%Z -> (0 < f)%Z -> (0 < g)%Z -> (0 < h)%Z -> Qquadratic_sg_denom_nonzero (k * e) (k * f) (k * g) (k * h) p1 p2. Proof. (* Goal: forall (k e f g h : Z) (p1 p2 : Qpositive) (_ : not (@eq Z k Z0)) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) p1 p2 *) intros k e f g h p1 p2 Hk He Hf Hg Hh. (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) p1 p2 *) generalize e f g h He Hf Hg Hh p2. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) p1 p2 *) induction p1. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) (nR p1) p2 *) intros. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (nR p1) p0 *) case p0. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (nR p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (nR p1) (dL q) *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (nR p1) (nR q) *) intros. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (nR p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (nR p1) (dL q) *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (nR p1) (nR q) *) apply Qquadratic_signok1. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (nR p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (nR p1) (dL q) *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.add (Z.mul k e0) (Z.mul k f0)) (Z.add (Z.mul k e0) (Z.mul k g0)) (Z.add (Z.add (Z.add (Z.mul k e0) (Z.mul k f0)) (Z.mul k g0)) (Z.mul k h0)) p1 q *) replace (k * e0 + k * f0 + k * g0 + k * h0)%Z with (k * (e0 + f0 + g0 + h0))%Z; try replace (k * e0 + k * f0)%Z with (k * (e0 + f0))%Z; try replace (k * e0 + k * g0)%Z with (k * (e0 + g0))%Z; try apply IHp1; try first [ assumption | repeat apply Zlt_resp_pos ]; try assumption; repeat match goal with | |- (?X1 = ?X2) => abstract ring end. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (nR p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (nR p1) (dL q) *) intros. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (nR p1) One *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (nR p1) (dL q) *) apply Qquadratic_signok2. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (nR p1) One *) (* Goal: Qquadratic_sg_denom_nonzero (Z.add (Z.mul k e0) (Z.mul k f0)) (Z.mul k f0) (Z.add (Z.add (Z.add (Z.mul k e0) (Z.mul k f0)) (Z.mul k g0)) (Z.mul k h0)) (Z.add (Z.mul k f0) (Z.mul k h0)) p1 q *) replace (k * e0 + k * f0 + k * g0 + k * h0)%Z with (k * (e0 + f0 + g0 + h0))%Z; try replace (k * e0 + k * f0)%Z with (k * (e0 + f0))%Z; try replace (k * f0 + k * h0)%Z with (k * (f0 + h0))%Z; try apply IHp1; try first [ assumption | repeat apply Zlt_resp_pos ]; try assumption; repeat match goal with | |- (?X1 = ?X2) => abstract ring end. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (nR p1) One *) apply Qquadratic_signok0. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qhomographic_sg_denom_nonzero (Z.add (Z.mul k e0) (Z.mul k f0)) (Z.add (Z.mul k g0) (Z.mul k h0)) (nR p1) *) (* Goal: @eq Qpositive One One *) reflexivity. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qhomographic_sg_denom_nonzero (Z.add (Z.mul k e0) (Z.mul k f0)) (Z.add (Z.mul k g0) (Z.mul k h0)) (nR p1) *) replace (k * e0 + k * f0)%Z with ((e0 + f0) * k)%Z; try replace (k * g0 + k * h0)%Z with ((g0 + h0) * k)%Z; try apply Qhomographic_sg_denom_nonzero_always_1; try first [ assumption | repeat apply Zlt_resp_pos ]; try assumption; repeat match goal with | |- (?X1 = ?X2) => abstract ring end. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) (dL p1) p2 *) intros. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (dL p1) p0 *) case p0. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (dL p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (dL p1) (dL q) *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (dL p1) (nR q) *) intros. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (dL p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (dL p1) (dL q) *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (dL p1) (nR q) *) apply Qquadratic_signok3. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (dL p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (dL p1) (dL q) *) (* Goal: Qquadratic_sg_denom_nonzero (Z.add (Z.mul k e0) (Z.mul k g0)) (Z.add (Z.add (Z.add (Z.mul k e0) (Z.mul k f0)) (Z.mul k g0)) (Z.mul k h0)) (Z.mul k g0) (Z.add (Z.mul k g0) (Z.mul k h0)) p1 q *) replace (k * e0 + k * f0 + k * g0 + k * h0)%Z with (k * (e0 + f0 + g0 + h0))%Z; try replace (k * g0 + k * h0)%Z with (k * (g0 + h0))%Z; try replace (k * e0 + k * g0)%Z with (k * (e0 + g0))%Z; try apply IHp1; try first [ assumption | repeat apply Zlt_resp_pos ]; try assumption; repeat match goal with | |- (?X1 = ?X2) => abstract ring end. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (dL p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (dL p1) (dL q) *) intros. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (dL p1) One *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (dL p1) (dL q) *) apply Qquadratic_signok4. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (dL p1) One *) (* Goal: Qquadratic_sg_denom_nonzero (Z.add (Z.add (Z.add (Z.mul k e0) (Z.mul k f0)) (Z.mul k g0)) (Z.mul k h0)) (Z.add (Z.mul k f0) (Z.mul k h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) (Z.mul k h0) p1 q *) replace (k * e0 + k * f0 + k * g0 + k * h0)%Z with (k * (e0 + f0 + g0 + h0))%Z; try replace (k * g0 + k * h0)%Z with (k * (g0 + h0))%Z; try replace (k * f0 + k * h0)%Z with (k * (f0 + h0))%Z; try apply IHp1; try first [ assumption | repeat apply Zlt_resp_pos ]; try assumption; repeat match goal with | |- (?X1 = ?X2) => abstract ring end. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) (dL p1) One *) apply Qquadratic_signok0. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qhomographic_sg_denom_nonzero (Z.add (Z.mul k e0) (Z.mul k f0)) (Z.add (Z.mul k g0) (Z.mul k h0)) (dL p1) *) (* Goal: @eq Qpositive One One *) reflexivity. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qhomographic_sg_denom_nonzero (Z.add (Z.mul k e0) (Z.mul k f0)) (Z.add (Z.mul k g0) (Z.mul k h0)) (dL p1) *) replace (k * e0 + k * f0)%Z with ((e0 + f0) * k)%Z; try replace (k * g0 + k * h0)%Z with ((g0 + h0) * k)%Z; try apply Qhomographic_sg_denom_nonzero_always_1; try first [ assumption | repeat apply Zlt_resp_pos ]; try assumption; repeat match goal with | |- (?X1 = ?X2) => abstract ring end. (* Goal: forall (e f g h : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 f) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) (Z.mul k f) (Z.mul k g) (Z.mul k h) One p2 *) intros. (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e0) (Z.mul k f0) (Z.mul k g0) (Z.mul k h0) One p0 *) apply Qquadratic_signok0'. (* Goal: Qhomographic_sg_denom_nonzero (Z.add (Z.mul k e0) (Z.mul k g0)) (Z.add (Z.mul k f0) (Z.mul k h0)) p0 *) (* Goal: @eq Qpositive One One *) reflexivity. (* Goal: Qhomographic_sg_denom_nonzero (Z.add (Z.mul k e0) (Z.mul k g0)) (Z.add (Z.mul k f0) (Z.mul k h0)) p0 *) replace (k * e0 + k * g0)%Z with ((e0 + g0) * k)%Z; try replace (k * f0 + k * h0)%Z with ((f0 + h0) * k)%Z; try apply Qhomographic_sg_denom_nonzero_always_1; try first [ assumption | repeat apply Zlt_resp_pos ]; try assumption; repeat match goal with | |- (?X1 = ?X2) => abstract ring end. Qed. Lemma Qquadratic_sg_denom_nonzero_Zero_Zero_always : forall (k g h : Z) (p1 p2 : Qpositive), k <> 0%Z -> (0 < g)%Z -> (0 < h)%Z -> Qquadratic_sg_denom_nonzero 0 0 (k * g) (k * h) p1 p2. Proof. (* Goal: forall (k g h : Z) (p1 p2 : Qpositive) (_ : not (@eq Z k Z0)) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) p1 p2 *) intros k g h p1 p2 Hk Hg Hh. (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) p1 p2 *) generalize g h Hg Hh p2. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) p1 p2 *) induction p1. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (nR p1) p2 *) intros. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) p0 *) case p0. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) (dL q) *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) (nR q) *) intro p3. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) (dL q) *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) (nR p3) *) apply Qquadratic_signok1. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) (dL q) *) (* Goal: Qquadratic_sg_denom_nonzero Z0 (Z.add Z0 Z0) (Z.add Z0 (Z.mul k g0)) (Z.add (Z.add (Z.add Z0 Z0) (Z.mul k g0)) (Z.mul k h0)) p1 p3 *) simpl in |- *. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) (dL q) *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.add (Z.mul k g0) (Z.mul k h0)) p1 p3 *) replace (k * g0 + k * h0)%Z with (k * (g0 + h0))%Z; [ apply IHp1; try first [ assumption | repeat apply Zlt_resp_pos ]; try assumption | abstract ring ]. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) (dL q) *) intro p3. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) One *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) (dL p3) *) apply Qquadratic_signok2. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) One *) (* Goal: Qquadratic_sg_denom_nonzero (Z.add Z0 Z0) Z0 (Z.add (Z.add (Z.add Z0 Z0) (Z.mul k g0)) (Z.mul k h0)) (Z.add Z0 (Z.mul k h0)) p1 p3 *) simpl in |- *. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) One *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.add (Z.mul k g0) (Z.mul k h0)) (Z.mul k h0) p1 p3 *) replace (k * g0 + k * h0)%Z with (k * (g0 + h0))%Z; [ apply IHp1; try first [ assumption | repeat apply Zlt_resp_pos ]; try assumption | abstract ring ]. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (nR p1) One *) apply Qquadratic_signok0. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qhomographic_sg_denom_nonzero (Z.add Z0 Z0) (Z.add (Z.mul k g0) (Z.mul k h0)) (nR p1) *) (* Goal: @eq Qpositive One One *) reflexivity. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qhomographic_sg_denom_nonzero (Z.add Z0 Z0) (Z.add (Z.mul k g0) (Z.mul k h0)) (nR p1) *) simpl in |- *. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: Qhomographic_sg_denom_nonzero Z0 (Z.add (Z.mul k g0) (Z.mul k h0)) (nR p1) *) apply Qhomographic_sg_denom_nonzero_Zero_always. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: not (@eq Z (Z.add (Z.mul k g0) (Z.mul k h0)) Z0) *) replace (k * g0 + k * h0)%Z with (k * (g0 + h0))%Z. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) *) (* Goal: not (@eq Z (Z.mul k (Z.add g0 h0)) Z0) *) intro. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) *) (* Goal: False *) apply Hk. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) *) (* Goal: @eq Z k Z0 *) apply Zmult_integral_l with (g0 + h0)%Z. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) Z0 *) (* Goal: not (@eq Z (Z.add g0 h0) Z0) *) apply sym_not_eq. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) Z0 *) (* Goal: not (@eq Z Z0 (Z.add g0 h0)) *) apply Zorder.Zlt_not_eq. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) Z0 *) (* Goal: Z.lt Z0 (Z.add g0 h0) *) apply Zlt_resp_pos; assumption. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) Z0 *) assumption. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) *) abstract ring. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) (dL p1) p2 *) intros. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) p0 *) case p0. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) (dL q) *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) (nR q) *) intro p3. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) (dL q) *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) (nR p3) *) apply Qquadratic_signok3. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) (dL q) *) (* Goal: Qquadratic_sg_denom_nonzero (Z.add Z0 (Z.mul k g0)) (Z.add (Z.add (Z.add Z0 Z0) (Z.mul k g0)) (Z.mul k h0)) (Z.mul k g0) (Z.add (Z.mul k g0) (Z.mul k h0)) p1 p3 *) simpl in |- *. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) (dL q) *) (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k g0) (Z.add (Z.mul k g0) (Z.mul k h0)) (Z.mul k g0) (Z.add (Z.mul k g0) (Z.mul k h0)) p1 p3 *) replace (k * g0 + k * h0)%Z with (k * (g0 + h0))%Z; [ apply Qquadratic_sg_denom_nonzero_always; try first [ assumption | repeat apply Zlt_resp_pos ]; try assumption | abstract ring ]. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) One *) (* Goal: forall q : Qpositive, Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) (dL q) *) intro p3. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) One *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) (dL p3) *) apply Qquadratic_signok4. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) One *) (* Goal: Qquadratic_sg_denom_nonzero (Z.add (Z.add (Z.add Z0 Z0) (Z.mul k g0)) (Z.mul k h0)) (Z.add Z0 (Z.mul k h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) (Z.mul k h0) p1 p3 *) simpl in |- *. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) One *) (* Goal: Qquadratic_sg_denom_nonzero (Z.add (Z.mul k g0) (Z.mul k h0)) (Z.mul k h0) (Z.add (Z.mul k g0) (Z.mul k h0)) (Z.mul k h0) p1 p3 *) replace (k * g0 + k * h0)%Z with (k * (g0 + h0))%Z; [ apply Qquadratic_sg_denom_nonzero_always; try first [ assumption | repeat apply Zlt_resp_pos ]; try assumption | abstract ring ]. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) (dL p1) One *) apply Qquadratic_signok0. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qhomographic_sg_denom_nonzero (Z.add Z0 Z0) (Z.add (Z.mul k g0) (Z.mul k h0)) (dL p1) *) (* Goal: @eq Qpositive One One *) reflexivity. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qhomographic_sg_denom_nonzero (Z.add Z0 Z0) (Z.add (Z.mul k g0) (Z.mul k h0)) (dL p1) *) simpl in |- *. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: Qhomographic_sg_denom_nonzero Z0 (Z.add (Z.mul k g0) (Z.mul k h0)) (dL p1) *) apply Qhomographic_sg_denom_nonzero_Zero_always. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: not (@eq Z (Z.add (Z.mul k g0) (Z.mul k h0)) Z0) *) replace (k * g0 + k * h0)%Z with (k * (g0 + h0))%Z. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) *) (* Goal: not (@eq Z (Z.mul k (Z.add g0 h0)) Z0) *) intro. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) *) (* Goal: False *) apply Hk. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) *) (* Goal: @eq Z k Z0 *) apply Zmult_integral_l with (g0 + h0)%Z. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) Z0 *) (* Goal: not (@eq Z (Z.add g0 h0) Z0) *) apply sym_not_eq. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) Z0 *) (* Goal: not (@eq Z Z0 (Z.add g0 h0)) *) apply Zorder.Zlt_not_eq. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) Z0 *) (* Goal: Z.lt Z0 (Z.add g0 h0) *) apply Zlt_resp_pos; assumption. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) Z0 *) assumption. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) (* Goal: @eq Z (Z.mul k (Z.add g0 h0)) (Z.add (Z.mul k g0) (Z.mul k h0)) *) abstract ring. (* Goal: forall (g h : Z) (_ : Z.lt Z0 g) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g) (Z.mul k h) One p2 *) intros. (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 (Z.mul k g0) (Z.mul k h0) One p0 *) apply Qquadratic_signok0'. (* Goal: Qhomographic_sg_denom_nonzero (Z.add Z0 (Z.mul k g0)) (Z.add Z0 (Z.mul k h0)) p0 *) (* Goal: @eq Qpositive One One *) reflexivity. (* Goal: Qhomographic_sg_denom_nonzero (Z.add Z0 (Z.mul k g0)) (Z.add Z0 (Z.mul k h0)) p0 *) simpl in |- *. (* Goal: Qhomographic_sg_denom_nonzero (Z.mul k g0) (Z.mul k h0) p0 *) rewrite Zmult_comm with k h0. (* Goal: Qhomographic_sg_denom_nonzero (Z.mul k g0) (Z.mul h0 k) p0 *) rewrite Zmult_comm with k g0. (* Goal: Qhomographic_sg_denom_nonzero (Z.mul g0 k) (Z.mul h0 k) p0 *) apply Qhomographic_sg_denom_nonzero_always_1; assumption. Qed. Lemma Qquadratic_sg_denom_nonzero_Zero_always_Zero_always : forall (k f h : Z) (p1 p2 : Qpositive), k <> 0%Z -> (0 < f)%Z -> (0 < h)%Z -> Qquadratic_sg_denom_nonzero 0 (k * f) 0 (k * h) p1 p2. Proof. (* Goal: forall (k f h : Z) (p1 p2 : Qpositive) (_ : not (@eq Z k Z0)) (_ : Z.lt Z0 f) (_ : Z.lt Z0 h), Qquadratic_sg_denom_nonzero Z0 (Z.mul k f) Z0 (Z.mul k h) p1 p2 *) intros k f h p1 p2 Hk Hf Hh. (* Goal: Qquadratic_sg_denom_nonzero Z0 (Z.mul k f) Z0 (Z.mul k h) p1 p2 *) generalize f h Hf Hh p2. (* Goal: forall (f h : Z) (_ : Z.lt Z0 f) (_ : Z.lt Z0 h) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 (Z.mul k f) Z0 (Z.mul k h) p1 p2 *) abstract (induction p1; intros; [ destruct p0 as [q| q| ]; [ apply Qquadratic_signok1; simpl in |- *; rewrite Zplus_0_r; rewrite <- Zmult_plus_distr_r with k f0 h0; apply IHp1 | apply Qquadratic_signok2; simpl in |- *; rewrite Zplus_0_r; rewrite <- Zmult_plus_distr_r with k f0 h0; apply Qquadratic_sg_denom_nonzero_always | apply Qquadratic_signok0; [ reflexivity | simpl in |- *; rewrite Zmult_comm; rewrite Zmult_comm with k h0; apply Qhomographic_sg_denom_nonzero_always_1 ] ] | destruct p0 as [q| q| ]; [ apply Qquadratic_signok3; simpl in |- *; rewrite Zplus_0_r; rewrite <- Zmult_plus_distr_r with k f0 h0; apply IHp1 | apply Qquadratic_signok4; simpl in |- *; rewrite Zplus_0_r; rewrite <- Zmult_plus_distr_r with k f0 h0; apply Qquadratic_sg_denom_nonzero_always | apply Qquadratic_signok0; [ reflexivity | simpl in |- *; rewrite Zmult_comm; rewrite Zmult_comm with k h0; apply Qhomographic_sg_denom_nonzero_always_1 ] ] | apply Qquadratic_signok0'; [ reflexivity | simpl in |- *; rewrite <- Zmult_plus_distr_r with k f0 h0; apply Qhomographic_sg_denom_nonzero_Zero_always; apply Zmult_resp_nonzero; [ idtac | apply sym_not_eq; apply Zorder.Zlt_not_eq; apply Zlt_resp_pos ] ] ]; try first [ assumption | repeat apply Zlt_resp_pos ]; assumption). Qed. Lemma Qquadratic_sg_denom_nonzero_always_Zero_always_Zero : forall (k e g : Z) (p1 p2 : Qpositive), k <> 0%Z -> (0 < e)%Z -> (0 < g)%Z -> Qquadratic_sg_denom_nonzero (k * e) 0 (k * g) 0 p1 p2. Proof. (* Goal: forall (k e g : Z) (p1 p2 : Qpositive) (_ : not (@eq Z k Z0)) (_ : Z.lt Z0 e) (_ : Z.lt Z0 g), Qquadratic_sg_denom_nonzero (Z.mul k e) Z0 (Z.mul k g) Z0 p1 p2 *) intros k e g p1 p2 Hk He Hg. (* Goal: Qquadratic_sg_denom_nonzero (Z.mul k e) Z0 (Z.mul k g) Z0 p1 p2 *) generalize e g He Hg p2. (* Goal: forall (e g : Z) (_ : Z.lt Z0 e) (_ : Z.lt Z0 g) (p2 : Qpositive), Qquadratic_sg_denom_nonzero (Z.mul k e) Z0 (Z.mul k g) Z0 p1 p2 *) abstract (induction p1; intros; [ destruct p0 as [q| q| ]; [ apply Qquadratic_signok1; simpl in |- *; repeat rewrite Zplus_0_r; rewrite <- Zmult_plus_distr_r with k e0 g0; apply Qquadratic_sg_denom_nonzero_always | apply Qquadratic_signok2; simpl in |- *; repeat rewrite Zplus_0_r; rewrite <- Zmult_plus_distr_r with k e0 g0; apply IHp1 | apply Qquadratic_signok0; [ reflexivity | repeat rewrite Zplus_0_r; rewrite Zmult_comm; rewrite Zmult_comm with k g0; apply Qhomographic_sg_denom_nonzero_always_1 ] ] | destruct p0 as [q| q| ]; [ apply Qquadratic_signok3; simpl in |- *; repeat rewrite Zplus_0_r; rewrite <- Zmult_plus_distr_r with k e0 g0; apply Qquadratic_sg_denom_nonzero_always | apply Qquadratic_signok4; simpl in |- *; repeat rewrite Zplus_0_r; rewrite <- Zmult_plus_distr_r with k e0 g0; apply IHp1 | apply Qquadratic_signok0; [ reflexivity | repeat rewrite Zplus_0_r; rewrite Zmult_comm; rewrite Zmult_comm with k g0; apply Qhomographic_sg_denom_nonzero_always_1 ] ] | apply Qquadratic_signok0'; [ reflexivity | simpl in |- *; rewrite <- Zmult_plus_distr_r with k e0 g0; apply Qhomographic_sg_denom_nonzero_always_Zero; apply Zmult_resp_nonzero; [ idtac | apply sym_not_eq; apply Zorder.Zlt_not_eq; apply Zlt_resp_pos ] ] ]; assumption || (try apply Zlt_resp_pos); assumption). Qed. Lemma Qquadratic_sg_denom_nonzero_Zero_Zero_Zero_always : forall (h : Z) (p1 p2 : Qpositive), h <> 0%Z -> Qquadratic_sg_denom_nonzero 0 0 0 h p1 p2. Proof. (* Goal: forall (h : Z) (p1 p2 : Qpositive) (_ : not (@eq Z h Z0)), Qquadratic_sg_denom_nonzero Z0 Z0 Z0 h p1 p2 *) intros h p1 p2 Hh. (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 Z0 h p1 p2 *) generalize h Hh p2. (* Goal: forall (h : Z) (_ : not (@eq Z h Z0)) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 Z0 h p1 p2 *) abstract (induction p1; intros; [ destruct p0 as [q| q| ]; [ apply Qquadratic_signok1; simpl in |- *; apply IHp1; assumption | apply Qquadratic_signok2; simpl in |- *; rewrite <- Zmult_1_r with h0; apply Qquadratic_sg_denom_nonzero_Zero_Zero_always | apply Qquadratic_signok0 ] | destruct p0 as [q| q| ]; [ apply Qquadratic_signok3; simpl in |- *; rewrite <- Zmult_1_r with h0; apply Qquadratic_sg_denom_nonzero_Zero_always_Zero_always | apply Qquadratic_signok4; simpl in |- *; rewrite <- Zmult_1_r with h0; apply Qquadratic_sg_denom_nonzero_always | apply Qquadratic_signok0 ] | apply Qquadratic_signok0'; [ constructor | simpl in |- *; apply Qhomographic_sg_denom_nonzero_Zero_always; assumption ] ]; simpl in |- *; try apply Qhomographic_sg_denom_nonzero_Zero_always; assumption || (try constructor)). Qed. Lemma Qquadratic_sg_denom_nonzero_Zero_Zero_always_Zero : forall (g : Z) (p1 p2 : Qpositive), g <> 0%Z -> Qquadratic_sg_denom_nonzero 0 0 g 0 p1 p2. Proof. (* Goal: forall (g : Z) (p1 p2 : Qpositive) (_ : not (@eq Z g Z0)), Qquadratic_sg_denom_nonzero Z0 Z0 g Z0 p1 p2 *) intros g p1 p2 Hg. (* Goal: Qquadratic_sg_denom_nonzero Z0 Z0 g Z0 p1 p2 *) generalize g Hg p2. (* Goal: forall (g : Z) (_ : not (@eq Z g Z0)) (p2 : Qpositive), Qquadratic_sg_denom_nonzero Z0 Z0 g Z0 p1 p2 *) abstract (induction p1; intros; [ destruct p0 as [q| q| ]; [ apply Qquadratic_signok1; simpl in |- *; rewrite Zplus_0_r; rewrite <- Zmult_1_r with g0; apply Qquadratic_sg_denom_nonzero_Zero_Zero_always | apply Qquadratic_signok2; simpl in |- *; rewrite Zplus_0_r; apply IHp1; assumption | apply Qquadratic_signok0 ] | destruct p0 as [q| q| ]; [ apply Qquadratic_signok3; simpl in |- *; rewrite Zplus_0_r; rewrite <- Zmult_1_r with g0; apply Qquadratic_sg_denom_nonzero_always | apply Qquadratic_signok4; simpl in |- *; rewrite Zplus_0_r; rewrite <- Zmult_1_r with g0; apply Qquadratic_sg_denom_nonzero_always_Zero_always_Zero | apply Qquadratic_signok0 ] | apply Qquadratic_signok0'; [ constructor | simpl in |- *; apply Qhomographic_sg_denom_nonzero_always_Zero; assumption ] ]; simpl in |- *; try rewrite Zplus_0_r; try apply Qhomographic_sg_denom_nonzero_Zero_always; assumption || (try constructor)). Qed. Lemma Qquadratic_sg_denom_nonzero_nonzero : forall (e f g h : Z) (p1 p2 : Qpositive), e = 0%Z -> f = 0%Z -> g = 0%Z -> h = 0%Z -> ~ Qquadratic_sg_denom_nonzero e f g h p1 p2. Proof. (* Goal: forall (e f g h : Z) (p1 p2 : Qpositive) (_ : @eq Z e Z0) (_ : @eq Z f Z0) (_ : @eq Z g Z0) (_ : @eq Z h Z0), not (Qquadratic_sg_denom_nonzero e f g h p1 p2) *) intros e f g h p1 p2 He Hf Hg Hh H_Qquadratic_sg_denom_nonzero. (* Goal: False *) generalize He Hf Hg Hh. (* Goal: forall (_ : @eq Z e Z0) (_ : @eq Z f Z0) (_ : @eq Z g Z0) (_ : @eq Z h Z0), False *) elim H_Qquadratic_sg_denom_nonzero; intros; first [ refine (Qhomographic_sg_denom_nonzero_nonzero (e0 + f0) (g0 + h0) p0 _ _ H0) | refine (Qhomographic_sg_denom_nonzero_nonzero (e0 + g0) (f0 + h0) p3 _ _ H0) | apply H0 ]; repeat match goal with | id1:(?X1 = ?X2) |- ?X3 => rewrite id1 end; constructor. Qed. Lemma Qquadratic_sg_denom_nonzero_nonzero_1 : forall (e f g h : Z) (p1 p2 : Qpositive), Qquadratic_sg_denom_nonzero e f g h p1 p2 -> ~ (e = 0%Z /\ f = 0%Z /\ g = 0%Z /\ h = 0%Z). Proof. (* Goal: forall (e f g h : Z) (p1 p2 : Qpositive) (_ : Qquadratic_sg_denom_nonzero e f g h p1 p2), not (and (@eq Z e Z0) (and (@eq Z f Z0) (and (@eq Z g Z0) (@eq Z h Z0)))) *) intros e f g h p1 p2 H_Qquadratic_sg_denom_nonzero (He, (Hf, (Hg, Hh))). (* Goal: False *) exact (Qquadratic_sg_denom_nonzero_nonzero e f g h p1 p2 He Hf Hg Hh H_Qquadratic_sg_denom_nonzero). Qed. Lemma Qquadratic_sg_denom_nonzero_nonzero_inf : forall (e f g h : Z) (p1 p2 : Qpositive), Qquadratic_sg_denom_nonzero e f g h p1 p2 -> {e <> 0%Z} + {f <> 0%Z} + {g <> 0%Z} + {h <> 0%Z}. Proof. (* Goal: forall (e f g h : Z) (p1 p2 : Qpositive) (_ : Qquadratic_sg_denom_nonzero e f g h p1 p2), sumor (sumor (sumbool (not (@eq Z e Z0)) (not (@eq Z f Z0))) (not (@eq Z g Z0))) (not (@eq Z h Z0)) *) intros e f g h p1 p2 H_Qquadratic_sg_denom_nonzero. (* Goal: sumor (sumor (sumbool (not (@eq Z e Z0)) (not (@eq Z f Z0))) (not (@eq Z g Z0))) (not (@eq Z h Z0)) *) case (Z_zerop e); [ case (Z_zerop f); [ case (Z_zerop g); [ case (Z_zerop h); [ intros; apply False_rec; apply (Qquadratic_sg_denom_nonzero_nonzero_1 e f g h p1 p2 H_Qquadratic_sg_denom_nonzero); repeat split; assumption | intros ] | intros ] | intros ] | intros ]; [ right | left; right | left; left; right | left; left; left ]; assumption. Qed. Lemma Qquadratic_sg_denom_nonzero_nonzero_3 : forall (g h : Z) (p1 p2 : Qpositive), Qquadratic_sg_denom_nonzero 0 0 g h p1 p2 -> g <> 0%Z \/ h <> 0%Z. Proof. (* Goal: forall (g h : Z) (p1 p2 : Qpositive) (_ : Qquadratic_sg_denom_nonzero Z0 Z0 g h p1 p2), or (not (@eq Z g Z0)) (not (@eq Z h Z0)) *) intros. (* Goal: or (not (@eq Z g Z0)) (not (@eq Z h Z0)) *) case (Z_zerop g); [ intro; case (Z_zerop h); [ intro; idtac | intro; right ] | intro; left ]; try assumption. (* Goal: or (not (@eq Z g Z0)) (not (@eq Z h Z0)) *) apply False_ind. (* Goal: False *) apply (Qquadratic_sg_denom_nonzero_nonzero 0 0 g h p1 p2); try solve [ constructor | assumption ]. Qed. Definition Qquadratic_Qpositive_to_Q (a b c d e f g h : Z) (p1 p2 : Qpositive) (H_qsign : Qquadratic_sg_denom_nonzero e f g h p1 p2) : Q. Proof. (* Goal: Q *) case (same_ratio_dec_inf a b c d e f g h); [ intros _; case (Qquadratic_sg_denom_nonzero_nonzero_inf e f g h p1 p2 H_qsign); [ intros [[He| Hf]| Hg]; [ exact (fraction_encoding a e He) | exact (fraction_encoding b f Hf) | exact (fraction_encoding c g Hg) ] | intro Hh; exact (fraction_encoding d h Hh) ] | idtac ]. (* Goal: forall _ : not (same_ratio a b c d e f g h), Q *) intro not_same_ratio_abcdefgh. (* Goal: Q *) case (Qquadratic_sign_sign_dec a b c d e f g h p1 p2 H_qsign). (* Goal: forall _ : @eq Z (q_sign a b c d e f g h p1 p2 H_qsign) (Zneg xH), Q *) (* Goal: forall _ : sumbool (@eq Z (q_sign a b c d e f g h p1 p2 H_qsign) Z0) (@eq Z (q_sign a b c d e f g h p1 p2 H_qsign) (Zpos xH)), Q *) intros [l1_eq_zero| l1_eq_one]; [ exact Zero | idtac ]. (* Goal: forall _ : @eq Z (q_sign a b c d e f g h p1 p2 H_qsign) (Zneg xH), Q *) (* Goal: Q *) assert (H : Qquadratic_sign a b c d e f g h p1 p2 H_qsign = (1%Z, (qnew_a a b c d e f g h p1 p2 H_qsign, (qnew_b a b c d e f g h p1 p2 H_qsign, (qnew_c a b c d e f g h p1 p2 H_qsign, qnew_d a b c d e f g h p1 p2 H_qsign)), (qnew_e a b c d e f g h p1 p2 H_qsign, (qnew_f a b c d e f g h p1 p2 H_qsign, (qnew_g a b c d e f g h p1 p2 H_qsign, qnew_h a b c d e f g h p1 p2 H_qsign))), (qnew_p1 a b c d e f g h p1 p2 H_qsign, qnew_p2 a b c d e f g h p1 p2 H_qsign)))); [ abstract (rewrite <- l1_eq_one; unfold qnew_a, qnew_b, qnew_c, qnew_d, qnew_e, qnew_f, qnew_g, qnew_h, qnew_p1, qnew_p2 in |- *; replace (q_sign a b c d e f g h p1 p2 H_qsign) with (fst (Qquadratic_sign a b c d e f g h p1 p2 H_qsign)); [ idtac | reflexivity ]; repeat rewrite <- pair_1; reflexivity) | idtac ]. (* Goal: forall _ : @eq Z (q_sign a b c d e f g h p1 p2 H_qsign) (Zneg xH), Q *) (* Goal: Q *) case (Zsgn_1 (qnew_a a b c d e f g h p1 p2 H_qsign + qnew_b a b c d e f g h p1 p2 H_qsign + qnew_c a b c d e f g h p1 p2 H_qsign + qnew_d a b c d e f g h p1 p2 H_qsign)). (* Goal: forall _ : @eq Z (q_sign a b c d e f g h p1 p2 H_qsign) (Zneg xH), Q *) (* Goal: forall _ : @eq Z (Z.sgn (Z.add (Z.add (Z.add (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign)) (qnew_c a b c d e f g h p1 p2 H_qsign)) (qnew_d a b c d e f g h p1 p2 H_qsign))) (Zneg xH), Q *) (* Goal: forall _ : sumbool (@eq Z (Z.sgn (Z.add (Z.add (Z.add (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign)) (qnew_c a b c d e f g h p1 p2 H_qsign)) (qnew_d a b c d e f g h p1 p2 H_qsign))) Z0) (@eq Z (Z.sgn (Z.add (Z.add (Z.add (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign)) (qnew_c a b c d e f g h p1 p2 H_qsign)) (qnew_d a b c d e f g h p1 p2 H_qsign))) (Zpos xH)), Q *) intros [na_nb_nc_nd_eq_zero| na_nb_nc_nd_eq_one]. (* Goal: forall _ : @eq Z (q_sign a b c d e f g h p1 p2 H_qsign) (Zneg xH), Q *) (* Goal: forall _ : @eq Z (Z.sgn (Z.add (Z.add (Z.add (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign)) (qnew_c a b c d e f g h p1 p2 H_qsign)) (qnew_d a b c d e f g h p1 p2 H_qsign))) (Zneg xH), Q *) (* Goal: Q *) (* Goal: Q *) abstract (apply False_rec; generalize (Qquadratic_sign_pos_1 a b c d e f g h p1 p2 H_qsign (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign) (qnew_c a b c d e f g h p1 p2 H_qsign) (qnew_d a b c d e f g h p1 p2 H_qsign) (qnew_e a b c d e f g h p1 p2 H_qsign) (qnew_f a b c d e f g h p1 p2 H_qsign) (qnew_g a b c d e f g h p1 p2 H_qsign) (qnew_h a b c d e f g h p1 p2 H_qsign) (qnew_p1 a b c d e f g h p1 p2 H_qsign) (qnew_p2 a b c d e f g h p1 p2 H_qsign) H); intros [(na_nb_nc_nd_pos, _)| (na_nb_nc_nd_neg, _)]; generalize (Zsgn_2 _ na_nb_nc_nd_eq_zero); [ apply sym_not_eq | idtac ]; apply Zorder.Zlt_not_eq; assumption). (* Goal: forall _ : @eq Z (q_sign a b c d e f g h p1 p2 H_qsign) (Zneg xH), Q *) (* Goal: forall _ : @eq Z (Z.sgn (Z.add (Z.add (Z.add (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign)) (qnew_c a b c d e f g h p1 p2 H_qsign)) (qnew_d a b c d e f g h p1 p2 H_qsign))) (Zneg xH), Q *) (* Goal: Q *) refine (Qpos (Qquadratic_Qpositive_to_Qpositive (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign) (qnew_c a b c d e f g h p1 p2 H_qsign) (qnew_d a b c d e f g h p1 p2 H_qsign) (qnew_e a b c d e f g h p1 p2 H_qsign) (qnew_f a b c d e f g h p1 p2 H_qsign) (qnew_g a b c d e f g h p1 p2 H_qsign) (qnew_h a b c d e f g h p1 p2 H_qsign) (qnew_p1 a b c d e f g h p1 p2 H_qsign) (qnew_p2 a b c d e f g h p1 p2 H_qsign) _)). (* Goal: forall _ : @eq Z (q_sign a b c d e f g h p1 p2 H_qsign) (Zneg xH), Q *) (* Goal: forall _ : @eq Z (Z.sgn (Z.add (Z.add (Z.add (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign)) (qnew_c a b c d e f g h p1 p2 H_qsign)) (qnew_d a b c d e f g h p1 p2 H_qsign))) (Zneg xH), Q *) (* Goal: quadraticAcc (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign) (qnew_c a b c d e f g h p1 p2 H_qsign) (qnew_d a b c d e f g h p1 p2 H_qsign) (qnew_e a b c d e f g h p1 p2 H_qsign) (qnew_f a b c d e f g h p1 p2 H_qsign) (qnew_g a b c d e f g h p1 p2 H_qsign) (qnew_h a b c d e f g h p1 p2 H_qsign) (qnew_p1 a b c d e f g h p1 p2 H_qsign) (qnew_p2 a b c d e f g h p1 p2 H_qsign) *) abstract apply (Qquadratic_Qpositive_to_Q_quadraticAcc_pos_1 a b c d e f g h p1 p2 H_qsign not_same_ratio_abcdefgh l1_eq_one na_nb_nc_nd_eq_one). (* Goal: forall _ : @eq Z (q_sign a b c d e f g h p1 p2 H_qsign) (Zneg xH), Q *) (* Goal: forall _ : @eq Z (Z.sgn (Z.add (Z.add (Z.add (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign)) (qnew_c a b c d e f g h p1 p2 H_qsign)) (qnew_d a b c d e f g h p1 p2 H_qsign))) (Zneg xH), Q *) intro na_nb_nc_nd_eq_minus_one. (* Goal: forall _ : @eq Z (q_sign a b c d e f g h p1 p2 H_qsign) (Zneg xH), Q *) (* Goal: Q *) refine (Qpos (Qquadratic_Qpositive_to_Qpositive (- qnew_a a b c d e f g h p1 p2 H_qsign) (- qnew_b a b c d e f g h p1 p2 H_qsign) (- qnew_c a b c d e f g h p1 p2 H_qsign) (- qnew_d a b c d e f g h p1 p2 H_qsign) (- qnew_e a b c d e f g h p1 p2 H_qsign) (- qnew_f a b c d e f g h p1 p2 H_qsign) (- qnew_g a b c d e f g h p1 p2 H_qsign) (- qnew_h a b c d e f g h p1 p2 H_qsign) (qnew_p1 a b c d e f g h p1 p2 H_qsign) (qnew_p2 a b c d e f g h p1 p2 H_qsign) _)). (* Goal: forall _ : @eq Z (q_sign a b c d e f g h p1 p2 H_qsign) (Zneg xH), Q *) (* Goal: quadraticAcc (Z.opp (qnew_a a b c d e f g h p1 p2 H_qsign)) (Z.opp (qnew_b a b c d e f g h p1 p2 H_qsign)) (Z.opp (qnew_c a b c d e f g h p1 p2 H_qsign)) (Z.opp (qnew_d a b c d e f g h p1 p2 H_qsign)) (Z.opp (qnew_e a b c d e f g h p1 p2 H_qsign)) (Z.opp (qnew_f a b c d e f g h p1 p2 H_qsign)) (Z.opp (qnew_g a b c d e f g h p1 p2 H_qsign)) (Z.opp (qnew_h a b c d e f g h p1 p2 H_qsign)) (qnew_p1 a b c d e f g h p1 p2 H_qsign) (qnew_p2 a b c d e f g h p1 p2 H_qsign) *) abstract apply (Qquadratic_Qpositive_to_Q_quadraticAcc_pos_2 a b c d e f g h p1 p2 H_qsign not_same_ratio_abcdefgh l1_eq_one na_nb_nc_nd_eq_minus_one). (* Goal: forall _ : @eq Z (q_sign a b c d e f g h p1 p2 H_qsign) (Zneg xH), Q *) intro l1_eq_min_one. (* Goal: Q *) assert (H : Qquadratic_sign a b c d e f g h p1 p2 H_qsign = ((-1)%Z, (qnew_a a b c d e f g h p1 p2 H_qsign, (qnew_b a b c d e f g h p1 p2 H_qsign, (qnew_c a b c d e f g h p1 p2 H_qsign, qnew_d a b c d e f g h p1 p2 H_qsign)), (qnew_e a b c d e f g h p1 p2 H_qsign, (qnew_f a b c d e f g h p1 p2 H_qsign, (qnew_g a b c d e f g h p1 p2 H_qsign, qnew_h a b c d e f g h p1 p2 H_qsign))), (qnew_p1 a b c d e f g h p1 p2 H_qsign, qnew_p2 a b c d e f g h p1 p2 H_qsign)))); [ abstract (rewrite <- l1_eq_min_one; unfold qnew_a, qnew_b, qnew_c, qnew_d, qnew_e, qnew_f, qnew_g, qnew_h, qnew_p1, qnew_p2 in |- *; replace (q_sign a b c d e f g h p1 p2 H_qsign) with (fst (Qquadratic_sign a b c d e f g h p1 p2 H_qsign)); [ idtac | reflexivity ]; repeat rewrite <- pair_1; reflexivity) | idtac ]. (* Goal: Q *) case (Zsgn_1 (qnew_a a b c d e f g h p1 p2 H_qsign + qnew_b a b c d e f g h p1 p2 H_qsign + qnew_c a b c d e f g h p1 p2 H_qsign + qnew_d a b c d e f g h p1 p2 H_qsign)). (* Goal: forall _ : @eq Z (Z.sgn (Z.add (Z.add (Z.add (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign)) (qnew_c a b c d e f g h p1 p2 H_qsign)) (qnew_d a b c d e f g h p1 p2 H_qsign))) (Zneg xH), Q *) (* Goal: forall _ : sumbool (@eq Z (Z.sgn (Z.add (Z.add (Z.add (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign)) (qnew_c a b c d e f g h p1 p2 H_qsign)) (qnew_d a b c d e f g h p1 p2 H_qsign))) Z0) (@eq Z (Z.sgn (Z.add (Z.add (Z.add (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign)) (qnew_c a b c d e f g h p1 p2 H_qsign)) (qnew_d a b c d e f g h p1 p2 H_qsign))) (Zpos xH)), Q *) intros [na_nb_nc_nd_eq_zero| na_nb_nc_nd_eq_one]. (* Goal: forall _ : @eq Z (Z.sgn (Z.add (Z.add (Z.add (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign)) (qnew_c a b c d e f g h p1 p2 H_qsign)) (qnew_d a b c d e f g h p1 p2 H_qsign))) (Zneg xH), Q *) (* Goal: Q *) (* Goal: Q *) abstract (apply False_rec; generalize (Qquadratic_sign_neg_1 a b c d e f g h p1 p2 H_qsign (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign) (qnew_c a b c d e f g h p1 p2 H_qsign) (qnew_d a b c d e f g h p1 p2 H_qsign) (qnew_e a b c d e f g h p1 p2 H_qsign) (qnew_f a b c d e f g h p1 p2 H_qsign) (qnew_g a b c d e f g h p1 p2 H_qsign) (qnew_h a b c d e f g h p1 p2 H_qsign) (qnew_p1 a b c d e f g h p1 p2 H_qsign) (qnew_p2 a b c d e f g h p1 p2 H_qsign) H); intros [(na_nb_nc_nd_pos, _)| (na_nb_nc_nd_neg, _)]; generalize (Zsgn_2 _ na_nb_nc_nd_eq_zero); [ apply sym_not_eq | idtac ]; apply Zorder.Zlt_not_eq; assumption). (* Goal: forall _ : @eq Z (Z.sgn (Z.add (Z.add (Z.add (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign)) (qnew_c a b c d e f g h p1 p2 H_qsign)) (qnew_d a b c d e f g h p1 p2 H_qsign))) (Zneg xH), Q *) (* Goal: Q *) refine (Qneg (Qquadratic_Qpositive_to_Qpositive (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign) (qnew_c a b c d e f g h p1 p2 H_qsign) (qnew_d a b c d e f g h p1 p2 H_qsign) (- qnew_e a b c d e f g h p1 p2 H_qsign) (- qnew_f a b c d e f g h p1 p2 H_qsign) (- qnew_g a b c d e f g h p1 p2 H_qsign) (- qnew_h a b c d e f g h p1 p2 H_qsign) (qnew_p1 a b c d e f g h p1 p2 H_qsign) (qnew_p2 a b c d e f g h p1 p2 H_qsign) _)). (* Goal: forall _ : @eq Z (Z.sgn (Z.add (Z.add (Z.add (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign)) (qnew_c a b c d e f g h p1 p2 H_qsign)) (qnew_d a b c d e f g h p1 p2 H_qsign))) (Zneg xH), Q *) (* Goal: quadraticAcc (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign) (qnew_c a b c d e f g h p1 p2 H_qsign) (qnew_d a b c d e f g h p1 p2 H_qsign) (Z.opp (qnew_e a b c d e f g h p1 p2 H_qsign)) (Z.opp (qnew_f a b c d e f g h p1 p2 H_qsign)) (Z.opp (qnew_g a b c d e f g h p1 p2 H_qsign)) (Z.opp (qnew_h a b c d e f g h p1 p2 H_qsign)) (qnew_p1 a b c d e f g h p1 p2 H_qsign) (qnew_p2 a b c d e f g h p1 p2 H_qsign) *) abstract apply (Qquadratic_Qpositive_to_Q_quadraticAcc_neg_1 a b c d e f g h p1 p2 H_qsign not_same_ratio_abcdefgh l1_eq_min_one na_nb_nc_nd_eq_one). (* Goal: forall _ : @eq Z (Z.sgn (Z.add (Z.add (Z.add (qnew_a a b c d e f g h p1 p2 H_qsign) (qnew_b a b c d e f g h p1 p2 H_qsign)) (qnew_c a b c d e f g h p1 p2 H_qsign)) (qnew_d a b c d e f g h p1 p2 H_qsign))) (Zneg xH), Q *) intro na_nb_nc_nd_eq_minus_one. (* Goal: Q *) refine (Qneg (Qquadratic_Qpositive_to_Qpositive (- qnew_a a b c d e f g h p1 p2 H_qsign) (- qnew_b a b c d e f g h p1 p2 H_qsign) (- qnew_c a b c d e f g h p1 p2 H_qsign) (- qnew_d a b c d e f g h p1 p2 H_qsign) (qnew_e a b c d e f g h p1 p2 H_qsign) (qnew_f a b c d e f g h p1 p2 H_qsign) (qnew_g a b c d e f g h p1 p2 H_qsign) (qnew_h a b c d e f g h p1 p2 H_qsign) (qnew_p1 a b c d e f g h p1 p2 H_qsign) (qnew_p2 a b c d e f g h p1 p2 H_qsign) _)). (* Goal: quadraticAcc (Z.opp (qnew_a a b c d e f g h p1 p2 H_qsign)) (Z.opp (qnew_b a b c d e f g h p1 p2 H_qsign)) (Z.opp (qnew_c a b c d e f g h p1 p2 H_qsign)) (Z.opp (qnew_d a b c d e f g h p1 p2 H_qsign)) (qnew_e a b c d e f g h p1 p2 H_qsign) (qnew_f a b c d e f g h p1 p2 H_qsign) (qnew_g a b c d e f g h p1 p2 H_qsign) (qnew_h a b c d e f g h p1 p2 H_qsign) (qnew_p1 a b c d e f g h p1 p2 H_qsign) (qnew_p2 a b c d e f g h p1 p2 H_qsign) *) abstract apply (Qquadratic_Qpositive_to_Q_quadraticAcc_neg_2 a b c d e f g h p1 p2 H_qsign not_same_ratio_abcdefgh l1_eq_min_one na_nb_nc_nd_eq_minus_one). Qed. Inductive Qquadratic_denom_nonzero : Z -> Z -> Z -> Z -> Q -> Q -> Prop := | Qquadraticok00 : forall (e f g h : Z) (s1 s2 : Q), s1 = Zero -> s2 = Zero -> h <> 0%Z -> Qquadratic_denom_nonzero e f g h s1 s2 | Qquadraticok01 : forall (e f g h : Z) (s1 s2 : Q) (p2 : Qpositive), s1 = Zero -> s2 = Qpos p2 -> Qhomographic_sg_denom_nonzero g h p2 -> Qquadratic_denom_nonzero e f g h s1 s2 | Qquadraticok02 : forall (e f g h : Z) (s1 s2 : Q) (p2 : Qpositive), s1 = Zero -> s2 = Qneg p2 -> Qhomographic_sg_denom_nonzero (- g) h p2 -> Qquadratic_denom_nonzero e f g h s1 s2 | Qquadraticok10 : forall (e f g h : Z) (s1 s2 : Q) (p1 : Qpositive), s1 = Qpos p1 -> s2 = Zero -> Qhomographic_sg_denom_nonzero f h p1 -> Qquadratic_denom_nonzero e f g h s1 s2 | Qquadraticok20 : forall (e f g h : Z) (s1 s2 : Q) (p1 : Qpositive), s1 = Qneg p1 -> s2 = Zero -> Qhomographic_sg_denom_nonzero (- f) h p1 -> Qquadratic_denom_nonzero e f g h s1 s2 | Qquadraticok11 : forall (e f g h : Z) (s1 s2 : Q) (p1 p2 : Qpositive), s1 = Qpos p1 -> s2 = Qpos p2 -> Qquadratic_sg_denom_nonzero e f g h p1 p2 -> Qquadratic_denom_nonzero e f g h s1 s2 | Qquadraticok12 : forall (e f g h : Z) (s1 s2 : Q) (p1 p2 : Qpositive), s1 = Qpos p1 -> s2 = Qneg p2 -> Qquadratic_sg_denom_nonzero (- e) f (- g) h p1 p2 -> Qquadratic_denom_nonzero e f g h s1 s2 | Qquadraticok21 : forall (e f g h : Z) (s1 s2 : Q) (p1 p2 : Qpositive), s1 = Qneg p1 -> s2 = Qpos p2 -> Qquadratic_sg_denom_nonzero (- e) (- f) g h p1 p2 -> Qquadratic_denom_nonzero e f g h s1 s2 | Qquadraticok22 : forall (e f g h : Z) (s1 s2 : Q) (p1 p2 : Qpositive), s1 = Qneg p1 -> s2 = Qneg p2 -> Qquadratic_sg_denom_nonzero e (- f) (- g) h p1 p2 -> Qquadratic_denom_nonzero e f g h s1 s2. Lemma Qquadratic_00 : forall e f g h : Z, Qquadratic_denom_nonzero e f g h Zero Zero -> h <> 0%Z. Proof. (* Goal: forall (e f g h : Z) (_ : Qquadratic_denom_nonzero e f g h Zero Zero), not (@eq Z h Z0) *) intros. (* Goal: not (@eq Z h Z0) *) abstract (inversion H; assumption || (repeat match goal with | id1:(?X1 = ?X2) |- ?X3 => try discriminate id1; clear id1 end)). Qed. Lemma Qquadratic_01 : forall (e f g h : Z) (p2 : Qpositive), Qquadratic_denom_nonzero e f g h Zero (Qpos p2) -> Qhomographic_sg_denom_nonzero g h p2. Proof. (* Goal: forall (e f g h : Z) (p2 : Qpositive) (_ : Qquadratic_denom_nonzero e f g h Zero (Qpos p2)), Qhomographic_sg_denom_nonzero g h p2 *) intros. (* Goal: Qhomographic_sg_denom_nonzero g h p2 *) abstract (inversion H; try solve [ assumption | repeat match goal with | id1:(?X1 = ?X2) |- ?X3 => try discriminate id1; clear id1 end ]; generalize (f_equal Q_tail H1); simpl in |- *; intro H_p; rewrite H_p; assumption). Qed. Lemma Qquadratic_02 : forall (e f g h : Z) (p2 : Qpositive), Qquadratic_denom_nonzero e f g h Zero (Qneg p2) -> Qhomographic_sg_denom_nonzero (- g) h p2. Proof. (* Goal: forall (e f g h : Z) (p2 : Qpositive) (_ : Qquadratic_denom_nonzero e f g h Zero (Qneg p2)), Qhomographic_sg_denom_nonzero (Z.opp g) h p2 *) intros. (* Goal: Qhomographic_sg_denom_nonzero (Z.opp g) h p2 *) abstract (inversion H; try solve [ assumption | repeat match goal with | id1:(?X1 = ?X2) |- ?X3 => try discriminate id1; clear id1 end ]; generalize (f_equal Q_tail H1); simpl in |- *; intro H_p; rewrite H_p; assumption). Qed. Lemma Qquadratic_10 : forall (e f g h : Z) (p1 : Qpositive), Qquadratic_denom_nonzero e f g h (Qpos p1) Zero -> Qhomographic_sg_denom_nonzero f h p1. Proof. (* Goal: forall (e f g h : Z) (p1 : Qpositive) (_ : Qquadratic_denom_nonzero e f g h (Qpos p1) Zero), Qhomographic_sg_denom_nonzero f h p1 *) intros. (* Goal: Qhomographic_sg_denom_nonzero f h p1 *) abstract (inversion H; try solve [ assumption | repeat match goal with | id1:(?X1 = ?X2) |- ?X3 => try discriminate id1; clear id1 end ]; generalize (f_equal Q_tail H0); simpl in |- *; intro H_p; rewrite H_p; assumption). Qed. Lemma Qquadratic_20 : forall (e f g h : Z) (p1 : Qpositive), Qquadratic_denom_nonzero e f g h (Qneg p1) Zero -> Qhomographic_sg_denom_nonzero (- f) h p1. Proof. (* Goal: forall (e f g h : Z) (p1 : Qpositive) (_ : Qquadratic_denom_nonzero e f g h (Qneg p1) Zero), Qhomographic_sg_denom_nonzero (Z.opp f) h p1 *) intros. (* Goal: Qhomographic_sg_denom_nonzero (Z.opp f) h p1 *) abstract (inversion H; try solve [ assumption | repeat match goal with | id1:(?X1 = ?X2) |- ?X3 => try discriminate id1; clear id1 end ]; generalize (f_equal Q_tail H0); simpl in |- *; intro H_p; rewrite H_p; assumption). Qed. Lemma Qquadratic_11 : forall (e f g h : Z) (p1 p2 : Qpositive), Qquadratic_denom_nonzero e f g h (Qpos p1) (Qpos p2) -> Qquadratic_sg_denom_nonzero e f g h p1 p2. Proof. (* Goal: forall (e f g h : Z) (p1 p2 : Qpositive) (_ : Qquadratic_denom_nonzero e f g h (Qpos p1) (Qpos p2)), Qquadratic_sg_denom_nonzero e f g h p1 p2 *) intros. (* Goal: Qquadratic_sg_denom_nonzero e f g h p1 p2 *) abstract (inversion H; try solve [ assumption | repeat match goal with | id1:(?X1 = ?X2) |- ?X3 => try discriminate id1; clear id1 end ]; repeat match goal with | id1:(?X1 ?X2 = ?X1 ?X3) |- ?X4 => let tt := eval compute in (f_equal Q_tail id1) in rewrite tt end; assumption). Qed. Lemma Qquadratic_12 : forall (e f g h : Z) (p1 p2 : Qpositive), Qquadratic_denom_nonzero e f g h (Qpos p1) (Qneg p2) -> Qquadratic_sg_denom_nonzero (- e) f (- g) h p1 p2. Proof. (* Goal: forall (e f g h : Z) (p1 p2 : Qpositive) (_ : Qquadratic_denom_nonzero e f g h (Qpos p1) (Qneg p2)), Qquadratic_sg_denom_nonzero (Z.opp e) f (Z.opp g) h p1 p2 *) intros. (* Goal: Qquadratic_sg_denom_nonzero (Z.opp e) f (Z.opp g) h p1 p2 *) abstract (inversion H; try solve [ assumption | repeat match goal with | id1:(?X1 = ?X2) |- ?X3 => try discriminate id1; clear id1 end ]; repeat match goal with | id1:(?X1 ?X2 = ?X1 ?X3) |- ?X4 => let tt := eval compute in (f_equal Q_tail id1) in rewrite tt end; assumption). Qed. Lemma Qquadratic_21 : forall (e f g h : Z) (p1 p2 : Qpositive), Qquadratic_denom_nonzero e f g h (Qneg p1) (Qpos p2) -> Qquadratic_sg_denom_nonzero (- e) (- f) g h p1 p2. Proof. (* Goal: forall (e f g h : Z) (p1 p2 : Qpositive) (_ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qpos p2)), Qquadratic_sg_denom_nonzero (Z.opp e) (Z.opp f) g h p1 p2 *) intros. (* Goal: Qquadratic_sg_denom_nonzero (Z.opp e) (Z.opp f) g h p1 p2 *) abstract (inversion H; try solve [ assumption | repeat match goal with | id1:(?X1 = ?X2) |- ?X3 => try discriminate id1; clear id1 end ]; repeat match goal with | id1:(?X1 ?X2 = ?X1 ?X3) |- ?X4 => let tt := eval compute in (f_equal Q_tail id1) in rewrite tt end; assumption). Qed. Lemma Qquadratic_22 : forall (e f g h : Z) (p1 p2 : Qpositive), Qquadratic_denom_nonzero e f g h (Qneg p1) (Qneg p2) -> Qquadratic_sg_denom_nonzero e (- f) (- g) h p1 p2. Proof. (* Goal: forall (e f g h : Z) (p1 p2 : Qpositive) (_ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qneg p2)), Qquadratic_sg_denom_nonzero e (Z.opp f) (Z.opp g) h p1 p2 *) intros. (* Goal: Qquadratic_sg_denom_nonzero e (Z.opp f) (Z.opp g) h p1 p2 *) abstract (inversion H; try solve [ assumption | repeat match goal with | id1:(?X1 = ?X2) |- ?X3 => try discriminate id1; clear id1 end ]; repeat match goal with | id1:(?X1 ?X2 = ?X1 ?X3) |- ?X4 => let tt := eval compute in (f_equal Q_tail id1) in rewrite tt end; assumption). Qed. Definition Qquadratic : Z -> Z -> Z -> Z -> forall (e f g h : Z) (s1 s2 : Q) (H_Qquadratic_denom_nonzero : Qquadratic_denom_nonzero e f g h s1 s2), Q. Proof. (* Goal: forall (_ : Z) (_ : Z) (_ : Z) (_ : Z) (e f g h : Z) (s1 s2 : Q) (_ : Qquadratic_denom_nonzero e f g h s1 s2), Q *) intros a b c d e f g h [| p1 | p1 ]; [ |intros [| p2| p2] | intros [| p2| p2]]. (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qpos p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) Zero, Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) (Qpos p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) Zero, Q *) (* Goal: forall (s2 : Q) (_ : Qquadratic_denom_nonzero e f g h Zero s2), Q *) intros s2 H_Qquadratic_denom_nonzero. (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qpos p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) Zero, Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) (Qpos p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) Zero, Q *) (* Goal: Q *) refine (Qhomographic c d g h s2 _). (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qpos p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) Zero, Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) (Qpos p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) Zero, Q *) (* Goal: Qhomographic_denom_nonzero g h s2 *) abstract (inversion_clear H_Qquadratic_denom_nonzero; solve [ apply Qhomographicok0; assumption | apply Qhomographicok1 with p2; assumption | apply Qhomographicok2 with p2; assumption | match goal with | id1:(?X2 = ?X3) |- ?X4 => discriminate id1 end ]). (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qpos p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) Zero, Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) (Qpos p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) Zero, Q *) intro H_Qquadratic_denom_nonzero. (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qpos p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) Zero, Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) (Qpos p2), Q *) (* Goal: Q *) refine (Qhomographic b d f h (Qpos p1) _); abstract (inversion_clear H_Qquadratic_denom_nonzero; try solve [ apply Qhomographicok1 with p2; assumption | match goal with | id1:(?X2 = ?X3) |- ?X4 => discriminate id1 end ]; injection H; intro H_injection; rewrite H_injection; apply Qhomographicok1 with p0; [ reflexivity | assumption ]). (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qpos p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) Zero, Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) (Qpos p2), Q *) intro H_Qquadratic_denom_nonzero. (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qpos p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) Zero, Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) (Qneg p2), Q *) (* Goal: Q *) exact (Qquadratic_Qpositive_to_Q a b c d e f g h p1 p2 (Qquadratic_11 e f g h p1 p2 H_Qquadratic_denom_nonzero)). (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qpos p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) Zero, Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qpos p1) (Qneg p2), Q *) intro H_Qquadratic_denom_nonzero. (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qpos p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) Zero, Q *) (* Goal: Q *) exact (Qquadratic_Qpositive_to_Q (- a) b (- c) d (- e) f (- g) h p1 p2 (Qquadratic_12 e f g h p1 p2 H_Qquadratic_denom_nonzero)). (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qpos p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) Zero, Q *) intro H_Qquadratic_denom_nonzero. (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qpos p2), Q *) (* Goal: Q *) refine (Qhomographic b d f h (Qneg p1) _); abstract (inversion_clear H_Qquadratic_denom_nonzero; try solve [ apply Qhomographicok2 with p2; assumption | match goal with | id1:(?X2 = ?X3) |- ?X4 => discriminate id1 end ]; injection H; intro H_injection; rewrite H_injection; apply Qhomographicok2 with p0; [ reflexivity | assumption ]). (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qneg p2), Q *) (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qpos p2), Q *) intro H_Qquadratic_denom_nonzero. (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qneg p2), Q *) (* Goal: Q *) exact (Qquadratic_Qpositive_to_Q (- a) (- b) c d (- e) (- f) g h p1 p2 (Qquadratic_21 e f g h p1 p2 H_Qquadratic_denom_nonzero)). (* Goal: forall _ : Qquadratic_denom_nonzero e f g h (Qneg p1) (Qneg p2), Q *) intro H_Qquadratic_denom_nonzero. (* Goal: Q *) exact (Qquadratic_Qpositive_to_Q a (- b) (- c) d e (- f) (- g) h p1 p2 (Qquadratic_22 e f g h p1 p2 H_Qquadratic_denom_nonzero)). Qed. Lemma Qquadratic_denom_nonzero_Zero_Zero_Zero_always : forall (h : Z) (s1 s2 : Q), h <> 0%Z -> Qquadratic_denom_nonzero 0 0 0 h s1 s2. Proof. (* Goal: forall (h : Z) (s1 s2 : Q) (_ : not (@eq Z h Z0)), Qquadratic_denom_nonzero Z0 Z0 Z0 h s1 s2 *) intros h s1 s2 Hh. (* Goal: Qquadratic_denom_nonzero Z0 Z0 Z0 h s1 s2 *) generalize h Hh s2. (* Goal: forall (h : Z) (_ : not (@eq Z h Z0)) (s2 : Q), Qquadratic_denom_nonzero Z0 Z0 Z0 h s1 s2 *) abstract (induction s1 as [| p| p]; intros; case s0; [ apply Qquadraticok00 | intro p; apply Qquadraticok01 with p | intro p; apply Qquadraticok02 with p | apply Qquadraticok10 with p | intro p0; apply Qquadraticok11 with p p0 | intro p0; apply Qquadraticok12 with p p0 | apply Qquadraticok20 with p | intro p0; apply Qquadraticok21 with p p0 | intro p0; apply Qquadraticok22 with p p0 ]; simpl in |- *; reflexivity || apply Qhomographic_sg_denom_nonzero_Zero_always || (try apply Qquadratic_sg_denom_nonzero_Zero_Zero_Zero_always); assumption). Qed. Lemma Qquadratic_denom_nonzero_Zero_Zero_Zero_ONE : forall s1 s2 : Q, Qquadratic_denom_nonzero 0 0 0 1 s1 s2. Proof. (* Goal: forall s1 s2 : Q, Qquadratic_denom_nonzero Z0 Z0 Z0 (Zpos xH) s1 s2 *) intros. (* Goal: Qquadratic_denom_nonzero Z0 Z0 Z0 (Zpos xH) s1 s2 *) apply Qquadratic_denom_nonzero_Zero_Zero_Zero_always. (* Goal: not (@eq Z (Zpos xH) Z0) *) abstract discriminate. Qed. Lemma Qquadratic_denom_nonzero_Zero_Zero_always_Zero : forall (g : Z) (s1 s2 : Q) (H_nonzero_s2 : s2 <> Zero :>Q), g <> 0%Z -> Qquadratic_denom_nonzero 0 0 g 0 s1 s2. Proof. (* Goal: forall (g : Z) (s1 s2 : Q) (_ : not (@eq Q s2 Zero)) (_ : not (@eq Z g Z0)), Qquadratic_denom_nonzero Z0 Z0 g Z0 s1 s2 *) intros g s1 s2 H_nonzero_s2 Hg. (* Goal: Qquadratic_denom_nonzero Z0 Z0 g Z0 s1 s2 *) generalize g Hg s2 H_nonzero_s2. (* Goal: forall (g : Z) (_ : not (@eq Z g Z0)) (s2 : Q) (_ : not (@eq Q s2 Zero)), Qquadratic_denom_nonzero Z0 Z0 g Z0 s1 s2 *) abstract (induction s1 as [| p| p]; intros; destruct s0 as [| p0| p0]; [ Falsum | apply Qquadraticok01 with p0 | apply Qquadraticok02 with p0 | Falsum | apply Qquadraticok11 with p p0 | apply Qquadraticok12 with p p0 | Falsum | apply Qquadraticok21 with p p0 | apply Qquadraticok22 with p p0 ]; simpl in |- *; reflexivity || apply Qhomographic_sg_denom_nonzero_always_Zero || (try apply Qquadratic_sg_denom_nonzero_Zero_Zero_always_Zero); try match goal with | id1:?X2 |- ((- ?X1)%Z <> 0%Z) => apply Zopp_app end; assumption). Qed. Lemma Qquadratic_denom_nonzero_Zero_Zero_ONE_Zero : forall (s1 s2 : Q) (H_nonzero_s2 : s2 <> Zero :>Q), Qquadratic_denom_nonzero 0 0 1 0 s1 s2. Proof. (* Goal: forall (s1 s2 : Q) (_ : not (@eq Q s2 Zero)), Qquadratic_denom_nonzero Z0 Z0 (Zpos xH) Z0 s1 s2 *) intros. (* Goal: Qquadratic_denom_nonzero Z0 Z0 (Zpos xH) Z0 s1 s2 *) apply (Qquadratic_denom_nonzero_Zero_Zero_always_Zero 1 s1 s2 H_nonzero_s2). (* Goal: not (@eq Z (Zpos xH) Z0) *) abstract discriminate. Qed. Definition Qplus_lazy (x y : Q) : Q := Qquadratic 0 1 1 0 0 0 0 1 x y (Qquadratic_denom_nonzero_Zero_Zero_Zero_ONE x y). Definition Qmult_lazy (x y : Q) : Q := Qquadratic 1 0 0 0 0 0 0 1 x y (Qquadratic_denom_nonzero_Zero_Zero_Zero_ONE x y). Definition Qminus_lazy (x y : Q) : Q := Qquadratic 0 1 (-1) 0 0 0 0 1 x y (Qquadratic_denom_nonzero_Zero_Zero_Zero_ONE x y). Definition Qdiv_lazy (x y : Q) (Hy : y <> Zero) : Q := Qquadratic 0 1 0 0 0 0 1 0 x y (Qquadratic_denom_nonzero_Zero_Zero_ONE_Zero x y Hy).
Require Import syntax. Require Import List. Require Import utils. Require Import environments. Require Import typecheck. Inductive valid_env : OS_env -> Prop := | valid_nil : valid_env nil | valid_cons : forall (v : vari) (t : ty) (e : tm) (A : OS_env), TC (OS_Dom_ty A) e t -> valid_env A -> valid_env ((v, t, e) :: A). Inductive valid_config (c : config) : Prop := valid_cfg : valid_env (cfgenv c) -> forall t : ty, TC (OS_Dom_ty (cfgenv c)) (cfgexp c) t -> valid_config c. Definition valid_c (A : OS_env) := match A return Prop with | nil => True | vtt :: A' => valid_env A' /\ TC (OS_Dom_ty A') (snd vtt) (snd (fst vtt)) end. Goal forall (v : vari) (t : ty) (e : tm) (A : OS_env), valid_env ((v, t, e) :: A) -> valid_env A /\ TC (OS_Dom_ty A) e t. intros v t e A H. change (valid_c ((v, t, e) :: A)) in |- *. elim H; simpl in |- *; exact I || intros; split; assumption. Save inv_valid_cons.
Require Export GeoCoq.Elements.OriginalProofs.lemma_Euclid4. Require Export GeoCoq.Elements.OriginalProofs.proposition_28C. Require Export GeoCoq.Elements.OriginalProofs.lemma_parallelflip. Section Euclid. Context `{Ax1:euclidean_neutral_ruler_compass}. Lemma lemma_twoperpsparallel : forall A B C D, Per A B C -> Per B C D -> OS A D B C -> Par A B C D. Proof. (* Goal: forall (A B C D : @Point Ax) (_ : @Per Ax A B C) (_ : @Per Ax B C D) (_ : @OS Ax A D B C), @Par Ax A B C D *) intros. (* Goal: @Par Ax A B C D *) assert (nCol A B C) by (conclude lemma_rightangleNC). (* Goal: @Par Ax A B C D *) assert (neq B C) by (forward_using lemma_NCdistinct). (* Goal: @Par Ax A B C D *) let Tf:=fresh in assert (Tf:exists E, (BetS B C E /\ Cong C E B C)) by (conclude lemma_extension);destruct Tf as [E];spliter. (* Goal: @Par Ax A B C D *) assert (Col B C E) by (conclude_def Col ). (* Goal: @Par Ax A B C D *) assert (neq C E) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax A B C D *) assert (neq E C) by (conclude lemma_inequalitysymmetric). (* Goal: @Par Ax A B C D *) assert (Per E C D) by (conclude lemma_collinearright). (* Goal: @Par Ax A B C D *) assert (Per D C E) by (conclude lemma_8_2). (* Goal: @Par Ax A B C D *) assert (eq D D) by (conclude cn_equalityreflexive). (* Goal: @Par Ax A B C D *) assert (nCol B C D) by (conclude lemma_rightangleNC). (* Goal: @Par Ax A B C D *) assert (neq C D) by (forward_using lemma_NCdistinct). (* Goal: @Par Ax A B C D *) assert (Out C D D) by (conclude lemma_ray4). (* Goal: @Par Ax A B C D *) assert (Supp B C D D E) by (conclude_def Supp ). (* Goal: @Par Ax A B C D *) assert (CongA A B C B C D) by (conclude lemma_Euclid4). (* Goal: @Par Ax A B C D *) assert (CongA B C D D C E) by (conclude lemma_Euclid4). (* Goal: @Par Ax A B C D *) assert (RT A B C B C D) by (conclude_def RT ). (* Goal: @Par Ax A B C D *) assert (Par B A C D) by (conclude proposition_28C). (* Goal: @Par Ax A B C D *) assert (Par C D B A) by (conclude lemma_parallelsymmetric). (* Goal: @Par Ax A B C D *) assert (Par C D A B) by (forward_using lemma_parallelflip). (* Goal: @Par Ax A B C D *) assert (Par A B C D) by (conclude lemma_parallelsymmetric). (* Goal: @Par Ax A B C D *) close. Qed. End Euclid.
From mathcomp Require Import ssreflect ssrnat seq. From LemmaOverloading Require Import prefix. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Section XFind. Variable A : Type. Definition invariant s r i (e : A) := onth r i = Some e /\ prefix s r. Structure xtagged := XTag {xuntag :> A}. Definition extend_tag := XTag. Definition recurse_tag := extend_tag. Canonical Structure found_tag x := recurse_tag x. Structure xfind (s r : seq A) (i : nat) := XFind { elem_of :> xtagged; _ : invariant s r i elem_of}. Arguments XFind : clear implicits. Lemma found_pf x t : invariant (x :: t) (x :: t) 0 x. Proof. (* Goal: invariant (@cons A x t) (@cons A x t) O x *) by split; [|apply: prefix_refl]. Qed. Canonical Structure found_struct x t := XFind (x :: t) (x :: t) 0 (found_tag x) (found_pf x t). Lemma recurse_pf (i : nat) (y : A) (s r : seq A) (f : xfind s r i) : invariant (y :: s) (y :: r) i.+1 f. Proof. (* Goal: invariant (@cons A y s) (@cons A y r) (S i) (xuntag (@elem_of s r i f)) *) by case:f=>[q [H1 H2]]; split; [|apply/prefix_cons]. Qed. Canonical Structure recurse_struct i y t r (f : xfind t r i) := XFind (y :: t) (y :: r) i.+1 (recurse_tag f) (recurse_pf y f). Lemma extend_pf x : invariant [::] [:: x] 0 x. Proof. (* Goal: invariant (@nil A) (@cons A x (@nil A)) O x *) by []. Qed. Canonical Structure extend_struct x := XFind [::] [:: x] 0 (extend_tag x) (extend_pf x). End XFind. Lemma findme A (r s : seq A) i (f : xfind r s i) : onth s i = Some (xuntag (elem_of f)). Proof. (* Goal: @eq (option A) (@onth A s i) (@Some A (@xuntag A (@elem_of A r s i f))) *) by case: f=>e [/= ->]. Qed. Set Printing Implicit. Print test. Example unit_test : forall A (x1 x2 x3 x y : A), (forall s r i (f : xfind s r i), nth x1 r i = xuntag f -> xuntag f = x) -> x = x. Proof. move=>A x1 x2 x3 x y test_form. apply: (test_form [::]). simpl. apply: (test_form [:: x1; x]). simpl. apply: (test_form [:: x1; x2; x; x3]). simpl. apply: (test_form [:: x1; x2; x3]). simpl. Abort.
Require Export GeoCoq.Elements.OriginalProofs.lemma_lessthancongruence2. Require Export GeoCoq.Elements.OriginalProofs.lemma_ray4. Require Export GeoCoq.Elements.OriginalProofs.lemma_layoffunique. Require Export GeoCoq.Elements.OriginalProofs.lemma_trichotomy2. Require Export GeoCoq.Elements.OriginalProofs.lemma_outerconnectivity. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_lessthanadditive : forall A B C D E F, Lt A B C D -> BetS A B E -> BetS C D F -> Cong B E D F -> Lt A E C F. Proof. (* Goal: forall (A B C D E F : @Point Ax0) (_ : @Lt Ax0 A B C D) (_ : @BetS Ax0 A B E) (_ : @BetS Ax0 C D F) (_ : @Cong Ax0 B E D F), @Lt Ax0 A E C F *) intros. (* Goal: @Lt Ax0 A E C F *) let Tf:=fresh in assert (Tf:exists b, (BetS C b D /\ Cong C b A B)) by (conclude_def Lt );destruct Tf as [b];spliter. (* Goal: @Lt Ax0 A E C F *) assert (Cong A B C b) by (conclude lemma_congruencesymmetric). (* Goal: @Lt Ax0 A E C F *) assert (neq C b) by (forward_using lemma_betweennotequal). (* Goal: @Lt Ax0 A E C F *) assert (neq b C) by (conclude lemma_inequalitysymmetric). (* Goal: @Lt Ax0 A E C F *) assert (neq B E) by (forward_using lemma_betweennotequal). (* Goal: @Lt Ax0 A E C F *) let Tf:=fresh in assert (Tf:exists e, (BetS C b e /\ Cong b e B E)) by (conclude lemma_extension);destruct Tf as [e];spliter. (* Goal: @Lt Ax0 A E C F *) assert (Cong B E b e) by (conclude lemma_congruencesymmetric). (* Goal: @Lt Ax0 A E C F *) assert (Cong A E C e) by (conclude cn_sumofparts). (* Goal: @Lt Ax0 A E C F *) assert (Cong e D e D) by (conclude cn_congruencereflexive). (* Goal: @Lt Ax0 A E C F *) assert (BetS e b C) by (conclude axiom_betweennesssymmetry). (* Goal: @Lt Ax0 A E C F *) assert (BetS C b F) by (conclude lemma_3_6b). (* Goal: @Lt Ax0 A E C F *) assert (~ BetS b F e). (* Goal: @Lt Ax0 A E C F *) (* Goal: not (@BetS Ax0 b F e) *) { (* Goal: not (@BetS Ax0 b F e) *) intro. (* Goal: False *) assert (Cong b F b F) by (conclude cn_congruencereflexive). (* Goal: False *) assert (Lt b F b e) by (conclude_def Lt ). (* Goal: False *) assert (Cong F D F D) by (conclude cn_congruencereflexive). (* Goal: False *) assert (BetS b D F) by (conclude lemma_3_6a). (* Goal: False *) assert (BetS F D b) by (conclude axiom_betweennesssymmetry). (* Goal: False *) assert (Lt F D F b) by (conclude_def Lt ). (* Goal: False *) assert (Cong F b b F) by (conclude cn_equalityreverse). (* Goal: False *) assert (Lt F D b F) by (conclude lemma_lessthancongruence). (* Goal: False *) assert (Cong F D D F) by (conclude cn_equalityreverse). (* Goal: False *) assert (Lt D F b F) by (conclude lemma_lessthancongruence2). (* Goal: False *) assert (Cong b e D F) by (conclude lemma_congruencetransitive). (* Goal: False *) assert (Cong D F b e) by (conclude lemma_congruencesymmetric). (* Goal: False *) assert (Lt b e b F) by (conclude lemma_lessthancongruence2). (* Goal: False *) let Tf:=fresh in assert (Tf:exists q, (BetS b q F /\ Cong b q b e)) by (conclude_def Lt );destruct Tf as [q];spliter. (* Goal: False *) assert (neq b q) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (neq b F) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (Out b F q) by (conclude lemma_ray4). (* Goal: False *) assert (Out b F e) by (conclude lemma_ray4). (* Goal: False *) assert (eq q e) by (conclude lemma_layoffunique). (* Goal: False *) assert (BetS b e F) by (conclude cn_equalitysub). (* Goal: False *) assert (BetS F e F) by (conclude lemma_3_6a). (* Goal: False *) assert (~ BetS F e F) by (conclude axiom_betweennessidentity). (* Goal: False *) contradict. (* BG Goal: @Lt Ax0 A E C F *) } (* Goal: @Lt Ax0 A E C F *) assert (~ eq F e). (* Goal: @Lt Ax0 A E C F *) (* Goal: not (@eq Ax0 F e) *) { (* Goal: not (@eq Ax0 F e) *) intro. (* Goal: False *) assert (Cong b F B E) by (conclude cn_equalitysub). (* Goal: False *) assert (BetS b D F) by (conclude lemma_3_6a). (* Goal: False *) assert (BetS F D b) by (conclude axiom_betweennesssymmetry). (* Goal: False *) assert (Cong F D F D) by (conclude cn_congruencereflexive). (* Goal: False *) assert (Lt F D F b) by (conclude_def Lt ). (* Goal: False *) assert (Cong F b b F) by (conclude cn_equalityreverse). (* Goal: False *) assert (Lt F D b F) by (conclude lemma_lessthancongruence). (* Goal: False *) assert (Cong D F B E) by (conclude lemma_congruencesymmetric). (* Goal: False *) assert (Cong F D B E) by (forward_using lemma_congruenceflip). (* Goal: False *) assert (Lt B E b F) by (conclude lemma_lessthancongruence2). (* Goal: False *) assert (Cong b F b e) by (conclude lemma_congruencetransitive). (* Goal: False *) assert (Lt B E b e) by (conclude lemma_lessthancongruence). (* Goal: False *) assert (Lt B E B E) by (conclude lemma_lessthancongruence). (* Goal: False *) assert (~ Lt B E B E) by (conclude lemma_trichotomy2). (* Goal: False *) contradict. (* BG Goal: @Lt Ax0 A E C F *) } (* Goal: @Lt Ax0 A E C F *) assert (~ ~ BetS b e F). (* Goal: @Lt Ax0 A E C F *) (* Goal: not (not (@BetS Ax0 b e F)) *) { (* Goal: not (not (@BetS Ax0 b e F)) *) intro. (* Goal: False *) assert (eq F e) by (conclude lemma_outerconnectivity). (* Goal: False *) contradict. (* BG Goal: @Lt Ax0 A E C F *) } (* Goal: @Lt Ax0 A E C F *) assert (BetS C e F) by (conclude lemma_3_7a). (* Goal: @Lt Ax0 A E C F *) assert (Cong A E C e) by (conclude cn_sumofparts). (* Goal: @Lt Ax0 A E C F *) assert (Cong C e A E) by (conclude lemma_congruencesymmetric). (* Goal: @Lt Ax0 A E C F *) assert (Lt A E C F) by (conclude_def Lt ). (* Goal: @Lt Ax0 A E C F *) close. Qed. End Euclid.
Require Import securite. Lemma POinvprel4 : forall (l l0 : list C) (k k0 k1 k2 : K) (c c0 c1 c2 : C) (d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 : D), inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> invP (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> rel4 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) -> invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0). Proof. (* Goal: forall (l l0 : list C) (k k0 k1 k2 : K) (c c0 c1 c2 : C) (d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 : D) (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : invP (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : rel4 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0)), invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) do 32 intro. (* Goal: forall (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : invP (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : rel4 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0)), invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) unfold rel4 in |- *; intros Inv0 Inv1 InvP and4. (* Goal: invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) elim and4; intros t1 and2; elim and2; intros t2 and3; elim and3; intros t3 eq_l0. (* Goal: invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) elim eq_l0; assumption. Qed.
Require Export GeoCoq.Elements.OriginalProofs.proposition_06a. Require Export GeoCoq.Elements.OriginalProofs.lemma_trichotomy1. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma proposition_06 : forall A B C, Triangle A B C -> CongA A B C A C B -> Cong A B A C. Proof. (* Goal: forall (A B C : @Point Ax0) (_ : @Triangle Ax0 A B C) (_ : @CongA Ax0 A B C A C B), @Cong Ax0 A B A C *) intros. (* Goal: @Cong Ax0 A B A C *) assert (~ Lt A C A B) by (conclude proposition_06a). (* Goal: @Cong Ax0 A B A C *) assert (nCol A B C) by (conclude_def Triangle ). (* Goal: @Cong Ax0 A B A C *) assert (~ Col A C B). (* Goal: @Cong Ax0 A B A C *) (* Goal: not (@Col Ax0 A C B) *) { (* Goal: not (@Col Ax0 A C B) *) intro. (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @Cong Ax0 A B A C *) } (* Goal: @Cong Ax0 A B A C *) assert (Triangle A C B) by (conclude_def Triangle ). (* Goal: @Cong Ax0 A B A C *) assert (CongA A C B A B C) by (conclude lemma_equalanglessymmetric). (* Goal: @Cong Ax0 A B A C *) assert (~ Lt A B A C) by (conclude proposition_06a). (* Goal: @Cong Ax0 A B A C *) assert (neq A B) by (forward_using lemma_angledistinct). (* Goal: @Cong Ax0 A B A C *) assert (neq A C) by (forward_using lemma_angledistinct). (* Goal: @Cong Ax0 A B A C *) assert (Cong A B A C) by (conclude lemma_trichotomy1). (* Goal: @Cong Ax0 A B A C *) close. Qed. End Euclid.
Require Import securite. Lemma POinvprel5 : forall (l l0 : list C) (k k0 k1 k2 : K) (c c0 c1 c2 : C) (d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 : D), inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> invP (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) -> rel5 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) -> invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0). Proof. (* Goal: forall (l l0 : list C) (k k0 k1 k2 : K) (c c0 c1 c2 : C) (d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 : D) (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : invP (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : rel5 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0)), invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) do 32 intro. (* Goal: forall (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : inv1 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : invP (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : rel5 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0)), invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *) unfold inv1, invP, rel5 in |- *. (* Goal: forall (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : and (not (known_in (B2C (K2B (KeyX Aid))) (@app C l rngDDKKeyAB))) (not (known_in (B2C (K2B (KeyX Bid))) (@app C l rngDDKKeyAB)))) (_ : not (known_in (B2C (K2B (KeyAB Aid Bid))) (@app C l rngDDKKeyABminusKab))) (_ : and (@eq (list C) l0 (@cons C (triple (B2C (D2B d)) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))) l)) (and (@eq AState (MBNaKab d7 d8 d9 k0) (MBNaKab d18 d19 d20 k2)) (and (@eq BState (MANbKabCaCb d4 d5 d6 k c c0) (MANbKabCaCb d15 d16 d17 k1 c1 c2)) (@eq SState (MABNaNbKeyK d d0 d1 d2 d3) (MABNaNbKeyK d10 d11 d12 d13 d14))))), not (known_in (B2C (K2B (KeyAB Aid Bid))) (@app C l0 rngDDKKeyABminusKab)) *) intros Inv0 know_Kas_Kbs know_Kab and1. (* Goal: not (known_in (B2C (K2B (KeyAB Aid Bid))) (@app C l0 rngDDKKeyABminusKab)) *) elim know_Kas_Kbs; intros know_Kas know_Kbs. (* Goal: not (known_in (B2C (K2B (KeyAB Aid Bid))) (@app C l0 rngDDKKeyABminusKab)) *) elim and1; intros eq_l0 t1. (* Goal: not (known_in (B2C (K2B (KeyAB Aid Bid))) (@app C l0 rngDDKKeyABminusKab)) *) clear Inv0 know_Kas_Kbs and1 t1. (* Goal: not (known_in (B2C (K2B (KeyAB Aid Bid))) (@app C l0 rngDDKKeyABminusKab)) *) rewrite eq_l0. (* Goal: not (known_in (B2C (K2B (KeyAB Aid Bid))) (@app C (@cons C (triple (B2C (D2B d)) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))) l) rngDDKKeyABminusKab)) *) unfold triple in |- *. (* Goal: not (known_in (B2C (K2B (KeyAB Aid Bid))) (@app C (@cons C (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) l) rngDDKKeyABminusKab)) *) apply D2. (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@app C (@cons C (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) l) rngDDKKeyABminusKab) *) simpl in |- *. (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) (@app C l rngDDKKeyABminusKab)) *) repeat apply C3 || apply C4. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) elim (D_dec d0 d1). (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: forall _ : and (@eq D d0 Aid) (@eq D d1 Bid), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) intros eq_d0_d1; elim eq_d0_d1; intros eq_d0 eq_d1. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) rewrite eq_d0. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB Aid d1)))) (KeyX Aid)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB Aid d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) rewrite eq_d1. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Aid)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Bid)) (@app C l rngDDKKeyABminusKab))) *) apply C1. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Aid))) *) (* Goal: not_comp_of (B2C (K2B (KeyX Aid))) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Bid)) (@app C l rngDDKKeyABminusKab)) *) apply C1. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Bid))) *) (* Goal: not_comp_of (B2C (K2B (KeyX Bid))) (@app C l rngDDKKeyABminusKab) *) apply D1. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Bid))) *) (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l rngDDKKeyABminusKab)) *) apply EP1 with rngDDKKeyAB. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Bid))) *) (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C (@app C l rngDDKKeyABminusKab) rngDDKKeyAB)) *) apply equivnknown1 with (B2C (K2B (KeyX Bid))) (l ++ rngDDKKeyAB). (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Bid))) *) (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l rngDDKKeyAB)) *) (* Goal: @eq C (B2C (K2B (KeyX Bid))) (B2C (K2B (KeyX Bid))) *) (* Goal: equivS (@app C l rngDDKKeyAB) (@app C (@app C l rngDDKKeyABminusKab) rngDDKKeyAB) *) apply equivS4 with (l ++ rngDDKKeyABminusKab ++ rngDDKKeyAB). (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Bid))) *) (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l rngDDKKeyAB)) *) (* Goal: @eq C (B2C (K2B (KeyX Bid))) (B2C (K2B (KeyX Bid))) *) (* Goal: equivS (@app C l (@app C rngDDKKeyABminusKab rngDDKKeyAB)) (@app C (@app C l rngDDKKeyABminusKab) rngDDKKeyAB) *) (* Goal: equivS (@app C l rngDDKKeyAB) (@app C l (@app C rngDDKKeyABminusKab rngDDKKeyAB)) *) elim l; simpl in |- *; auto with otway_rees. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Bid))) *) (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l rngDDKKeyAB)) *) (* Goal: @eq C (B2C (K2B (KeyX Bid))) (B2C (K2B (KeyX Bid))) *) (* Goal: equivS (@app C l (@app C rngDDKKeyABminusKab rngDDKKeyAB)) (@app C (@app C l rngDDKKeyABminusKab) rngDDKKeyAB) *) (* Goal: equivS rngDDKKeyAB (@app C rngDDKKeyABminusKab rngDDKKeyAB) *) exact rngs. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Bid))) *) (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l rngDDKKeyAB)) *) (* Goal: @eq C (B2C (K2B (KeyX Bid))) (B2C (K2B (KeyX Bid))) *) (* Goal: equivS (@app C l (@app C rngDDKKeyABminusKab rngDDKKeyAB)) (@app C (@app C l rngDDKKeyABminusKab) rngDDKKeyAB) *) rewrite (app_ass l rngDDKKeyABminusKab rngDDKKeyAB). (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Bid))) *) (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l rngDDKKeyAB)) *) (* Goal: @eq C (B2C (K2B (KeyX Bid))) (B2C (K2B (KeyX Bid))) *) (* Goal: equivS (@app C l (@app C rngDDKKeyABminusKab rngDDKKeyAB)) (@app C l (@app C rngDDKKeyABminusKab rngDDKKeyAB)) *) elim l; elim rngDDKKeyABminusKab; elim rngDDKKeyAB; simpl in |- *; auto with otway_rees. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Bid))) *) (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l rngDDKKeyAB)) *) (* Goal: @eq C (B2C (K2B (KeyX Bid))) (B2C (K2B (KeyX Bid))) *) auto with otway_rees. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Bid))) *) (* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l rngDDKKeyAB)) *) assumption. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Aid))) *) (* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Bid))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB Aid Bid)))) (KeyX Aid))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: forall _ : not (and (@eq D d0 Aid) (@eq D d1 Bid)), not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) intros not_eq_d0_d1. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) repeat apply C2 || apply C3 || apply C4. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d2))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (B2C (K2B (KeyAB d0 d1))) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) apply equivncomp with (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1) :: B2C (K2B (KeyAB d0 d1)) :: l ++ rngDDKKeyABminusKab). (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d2))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@cons C (B2C (K2B (KeyAB d0 d1))) (@app C l rngDDKKeyABminusKab))) *) (* Goal: equivS (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@cons C (B2C (K2B (KeyAB d0 d1))) (@app C l rngDDKKeyABminusKab))) (@cons C (B2C (K2B (KeyAB d0 d1))) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@app C l rngDDKKeyABminusKab))) *) apply equivS2. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d2))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)) (@cons C (B2C (K2B (KeyAB d0 d1))) (@app C l rngDDKKeyABminusKab))) *) repeat apply C2 || apply C3 || apply C4. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d2))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d3))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (B2C (K2B (KeyAB d0 d1))) (@cons C (B2C (K2B (KeyAB d0 d1))) (@app C l rngDDKKeyABminusKab))) *) apply equivncomp with (B2C (K2B (KeyAB d0 d1)) :: l ++ rngDDKKeyABminusKab). (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d2))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d3))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (B2C (K2B (KeyAB d0 d1))) (@app C l rngDDKKeyABminusKab)) *) (* Goal: equivS (@cons C (B2C (K2B (KeyAB d0 d1))) (@app C l rngDDKKeyABminusKab)) (@cons C (B2C (K2B (KeyAB d0 d1))) (@cons C (B2C (K2B (KeyAB d0 d1))) (@app C l rngDDKKeyABminusKab))) *) apply AlreadyIn1; unfold In in |- *; left; auto with otway_rees. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d2))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d3))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@cons C (B2C (K2B (KeyAB d0 d1))) (@app C l rngDDKKeyABminusKab)) *) apply equivncomp with (l ++ rngDDKKeyABminusKab). (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d2))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d3))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@app C l rngDDKKeyABminusKab) *) (* Goal: equivS (@app C l rngDDKKeyABminusKab) (@cons C (B2C (K2B (KeyAB d0 d1))) (@app C l rngDDKKeyABminusKab)) *) apply AlreadyIn1; apply in_or_app; right. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d2))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d3))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@app C l rngDDKKeyABminusKab) *) (* Goal: @In C (B2C (K2B (KeyAB d0 d1))) rngDDKKeyABminusKab *) apply rngDDKKeyABminusKab1; apply KeyAB1. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d2))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d3))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@app C l rngDDKKeyABminusKab) *) (* Goal: not (and (@eq D d0 Aid) (@eq D d1 Bid)) *) tauto. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d2))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d3))) *) (* Goal: not_comp_of (B2C (K2B (KeyAB Aid Bid))) (@app C l rngDDKKeyABminusKab) *) apply D1; assumption. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d2))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d3))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d2))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1))))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d2))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d2))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1))))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1)))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (B2C (D2B d))) *) discriminate. (* Goal: not (@eq C (B2C (K2B (KeyAB Aid Bid))) (Pair (B2C (D2B d)) (Pair (Encrypt (Pair (B2C (D2B d2)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d0)) (Encrypt (Pair (B2C (D2B d3)) (B2C (K2B (KeyAB d0 d1)))) (KeyX d1))))) *) discriminate. Qed.
Require Import Bool Arith Div2 List. Require Import BellantoniCook.Lib. Notation bs := (list bool). Definition unary (v : bs) := forallb id v. Definition bs2bool (v:bs) : bool := hd false v. Definition bool2bs (b:bool) : bs := if b then true::nil else nil. Lemma bs_nat2bool_true : forall v, bs2bool v = true -> length v <> 0. Proof. (* Goal: forall (v : list bool) (_ : @eq bool (bs2bool v) true), not (@eq nat (@length bool v) O) *) intro v; case v; simpl; auto; intros; discriminate. Qed. Lemma bs_nat2bool_true_conv : forall v, unary v = true -> length v <> 0 -> bs2bool v = true. Proof. (* Goal: forall (v : list bool) (_ : @eq bool (unary v) true) (_ : not (@eq nat (@length bool v) O)), @eq bool (bs2bool v) true *) intro v; case v; simpl; intros. (* Goal: @eq bool b true *) (* Goal: @eq bool false true *) elim H0; trivial. (* Goal: @eq bool b true *) rewrite andb_true_iff in H. (* Goal: @eq bool b true *) decompose [and] H; destruct b; trivial. Qed. Lemma bs_nat2bool_false v : unary v = true -> bs2bool v = false -> length v = 0. Proof. (* Goal: forall (_ : @eq bool (unary v) true) (_ : @eq bool (bs2bool v) false), @eq nat (@length bool v) O *) destruct v; simpl; trivial; intros. (* Goal: @eq nat (S (@length bool v)) O *) rewrite andb_true_iff in H. (* Goal: @eq nat (S (@length bool v)) O *) decompose [and] H; destruct b; discriminate. Qed. Lemma bs_nat2bool_false_conv v : length v = 0 -> bs2bool v = false. Proof. (* Goal: forall _ : @eq nat (@length bool v) O, @eq bool (bs2bool v) false *) destruct v; simpl; trivial; intros. (* Goal: @eq bool b false *) discriminate. Qed. Fixpoint bs2nat (v:bs) : nat := match v with | nil => 0 | false :: v' => 2 * bs2nat v' | true :: v' => S (2 * bs2nat v') end. Fixpoint succ_bs (v : bs) : bs := match v with | nil => [true] | false :: v' => true :: v' | true :: v' => false :: succ_bs v' end. Lemma succ_bs_correct v : bs2nat (succ_bs v) = bs2nat v + 1. Proof. (* Goal: @eq nat (bs2nat (succ_bs v)) (Init.Nat.add (bs2nat v) (S O)) *) induction v; simpl; trivial; case a; simpl; ring [IHv]. Qed. Fixpoint nat2bs (n:nat) : bs := match n with | 0 => nil | S n' => succ_bs (nat2bs n') end. Lemma bs2nat_nil : bs2nat nil = 0. Proof. (* Goal: @eq nat (bs2nat (@nil bool)) O *) trivial. Qed. Lemma bs2nat_false v : bs2nat (false :: v) = 2 * bs2nat v. Proof. (* Goal: @eq nat (bs2nat (@cons bool false v)) (Init.Nat.mul (S (S O)) (bs2nat v)) *) trivial. Qed. Lemma bs2nat_true v : bs2nat (true :: v) = 1 + 2 * bs2nat v. Proof. (* Goal: @eq nat (bs2nat (@cons bool true v)) (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat v))) *) trivial. Qed. Lemma bs2nat_tl : forall v, bs2nat (tl v) = div2 (bs2nat v). Proof. (* Goal: forall v : list bool, @eq nat (bs2nat (@tl bool v)) (Nat.div2 (bs2nat v)) *) destruct v; simpl; [ trivial | ]. (* Goal: @eq nat (bs2nat v) (Nat.div2 (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))) *) replace (bs2nat v + (bs2nat v + 0)) with (2 * bs2nat v) by omega. (* Goal: @eq nat (bs2nat v) (Nat.div2 (if b then S (Init.Nat.mul (S (S O)) (bs2nat v)) else Init.Nat.mul (S (S O)) (bs2nat v))) *) case b;[ rewrite div2_double_plus_one | rewrite div2_double]; trivial. Qed. Lemma bs2nat_nat2bs : forall n, bs2nat (nat2bs n) = n. Proof. (* Goal: forall n : nat, @eq nat (bs2nat (nat2bs n)) n *) induction n as [ | n' IHn]; simpl; auto. (* Goal: @eq nat (bs2nat (succ_bs (nat2bs n'))) (S n') *) rewrite succ_bs_correct; ring [IHn]. Qed.
From mathcomp Require Import ssreflect ssrbool seq ssrfun. From LemmaOverloading Require Import heaps rels hprop stmod stsep. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Lemma bnd_is_try (A B : Type) (s1 : spec A) (s2 : A -> spec B) i r : verify (try_s s1 s2 (fun y => fr (throw_s B y))) i r -> verify (bind_s s1 s2) i r. Proof. (* Goal: forall _ : @verify' B (@fr B (@try_s A B s1 s2 (fun y : exn => @fr B (throw_s B y)))) i r, @verify' B (@fr B (@bind_s A B s1 s2)) i r *) move=>H; apply: frame0=>D. (* Goal: and (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@bind_s A B s1 s2) i) (forall (y : ans B) (m : heap) (_ : @snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@bind_s A B s1 s2) y i m) (_ : is_true (def m)), r y m) *) case: {H D} (H D) (D)=>[[i1]][i2][->][[H1 [H2 H3]]] _ T D. (* Goal: and (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@bind_s A B s1 s2) (union2 i1 i2)) (forall (y : ans B) (m : heap) (_ : @snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@bind_s A B s1 s2) y (union2 i1 i2) m) (_ : is_true (def m)), r y m) *) split=>[|y m]. (* Goal: forall (_ : @snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@bind_s A B s1 s2) y (union2 i1 i2) m) (_ : is_true (def m)), r y m *) (* Goal: @fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@bind_s A B s1 s2) (union2 i1 i2) *) - (* Goal: forall (_ : @snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@bind_s A B s1 s2) y (union2 i1 i2) m) (_ : is_true (def m)), r y m *) (* Goal: @fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@bind_s A B s1 s2) (union2 i1 i2) *) split=>[|x m]; first by apply: fr_pre H1. (* Goal: forall (_ : @snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@bind_s A B s1 s2) y (union2 i1 i2) m) (_ : is_true (def m)), r y m *) (* Goal: forall _ : @snd (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) (@fr A s1) (@Val A x) (union2 i1 i2) m, @fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@funcomp (spec B) (spec B) A tt (@fr B) s2 x) m *) by case/(locality D H1)=>m1 [->][_]; move/H2; apply: fr_pre. (* Goal: forall (_ : @snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@bind_s A B s1 s2) y (union2 i1 i2) m) (_ : is_true (def m)), r y m *) move=>{D} H; apply: T=>h1 h2 E. (* Goal: forall (_ : is_true (def (union2 i1 i2))) (_ : @fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@try_s A B s1 s2 (fun y : exn => @fr B (throw_s B y))) h1), @ex heap (fun m1 : heap => and (@eq heap m (union2 m1 h2)) (and (is_true (def m)) (@snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@try_s A B s1 s2 (fun y : exn => @fr B (throw_s B y))) y h1 m1))) *) rewrite {i1 i2 H1 H2 H3}E in H * => D1 [H1][H2] H3. (* Goal: @ex heap (fun m1 : heap => and (@eq heap m (union2 m1 h2)) (and (is_true (def m)) (@snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@try_s A B s1 s2 (fun y : exn => @fr B (throw_s B y))) y h1 m1))) *) case: H=>[[x][h][]|[e][->]]; move/(locality D1 H1); case=>[m1][->][D2] T1; move: (T1); [move/H2 | move/H3]=>H4. (* Goal: @ex heap (fun m2 : heap => and (@eq heap (union2 m1 h2) (union2 m2 h2)) (and (is_true (def (union2 m1 h2))) (@snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@try_s A B s1 s2 (fun y : exn => @fr B (throw_s B y))) (@Exn B e) h1 m2))) *) (* Goal: forall _ : @snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@funcomp (spec B) (spec B) A tt (@fr B) s2 x) y (union2 m1 h2) m, @ex heap (fun m1 : heap => and (@eq heap m (union2 m1 h2)) (and (is_true (def m)) (@snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@try_s A B s1 s2 (fun y : exn => @fr B (throw_s B y))) y h1 m1))) *) - (* Goal: @ex heap (fun m2 : heap => and (@eq heap (union2 m1 h2) (union2 m2 h2)) (and (is_true (def (union2 m1 h2))) (@snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@try_s A B s1 s2 (fun y : exn => @fr B (throw_s B y))) (@Exn B e) h1 m2))) *) (* Goal: forall _ : @snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@funcomp (spec B) (spec B) A tt (@fr B) s2 x) y (union2 m1 h2) m, @ex heap (fun m1 : heap => and (@eq heap m (union2 m1 h2)) (and (is_true (def m)) (@snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@try_s A B s1 s2 (fun y : exn => @fr B (throw_s B y))) y h1 m1))) *) move=>T2; case/(locality D2 H4): (T2)=>m3 [->][D3]. (* Goal: @ex heap (fun m2 : heap => and (@eq heap (union2 m1 h2) (union2 m2 h2)) (and (is_true (def (union2 m1 h2))) (@snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@try_s A B s1 s2 (fun y : exn => @fr B (throw_s B y))) (@Exn B e) h1 m2))) *) (* Goal: forall _ : lolli (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (s2 x)) (@snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (s2 x) y) m1 m3, @ex heap (fun m1 : heap => and (@eq heap (union2 m3 h2) (union2 m1 h2)) (and (is_true (def (union2 m3 h2))) (@snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@try_s A B s1 s2 (fun y : exn => @fr B (throw_s B y))) y h1 m1))) *) by exists m3; do !split=>//; left; exists x; exists m1. (* Goal: @ex heap (fun m2 : heap => and (@eq heap (union2 m1 h2) (union2 m2 h2)) (and (is_true (def (union2 m1 h2))) (@snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@try_s A B s1 s2 (fun y : exn => @fr B (throw_s B y))) (@Exn B e) h1 m2))) *) exists m1; do !split=>//; right; exists e; exists m1; split=>//. (* Goal: @snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@funcomp (spec B) (spec B) exn tt (@fr B) (fun y : exn => @fr B (throw_s B y)) e) (@Exn B e) m1 m1 *) move=>j1 j2 E D _; rewrite {m1 D2}E in T1 D H4 *. exists j1; do !split=>//; move=>k1 k2 -> D2 ->. by exists empty; rewrite un0h; do !split=>//; apply: defUnr D2. Qed. Qed. Local Notation cont A := (ans A -> heap -> Prop). Section EvalDo. Variables (A B : Type). Lemma val_do (s : spec A) i j (r : cont A) : s.1 i -> Proof. (* Goal: forall (_ : @fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s i) (_ : forall (x : A) (m : heap) (_ : @snd (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s (@Val A x) i m) (_ : is_true (def (union2 m j))), r (@Val A x) (union2 m j)) (_ : forall (e : exn) (m : heap) (_ : @snd (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s (@Exn A e) i m) (_ : is_true (def (union2 m j))), r (@Exn A e) (union2 m j)), @verify' A (@fr A s) (union2 i j) r *) move=>H1 H2 H3; apply: frame; apply: frame0; split=>//. (* Goal: forall (y : ans A) (m : heap) (_ : @snd (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s y i m) (_ : is_true (def m)) (_ : is_true (def (union2 m j))), r y (union2 m j) *) by case=>x m H4 D1 D2; [apply: H2 | apply: H3]. Qed. Lemma try_do (s : spec A) s1 s2 i j (r : cont B) : s.1 i -> Proof. (* Goal: forall (_ : @fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s i) (_ : forall (x : A) (m : heap) (_ : @snd (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s (@Val A x) i m), @verify' B (@fr B (s1 x)) (union2 m j) r) (_ : forall (e : exn) (m : heap) (_ : @snd (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s (@Exn A e) i m), @verify' B (@fr B (s2 e)) (union2 m j) r), @verify' B (@fr B (@try_s A B s s1 s2)) (union2 i j) r *) move=>H1 H2 H3; apply: frame0=>D; split=>[|y m]. (* Goal: forall (_ : @snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@try_s A B s s1 s2) y (union2 i j) m) (_ : is_true (def m)), r y m *) (* Goal: @fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@try_s A B s s1 s2) (union2 i j) *) - (* Goal: forall (_ : @snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@try_s A B s s1 s2) y (union2 i j) m) (_ : is_true (def m)), r y m *) (* Goal: @fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@try_s A B s s1 s2) (union2 i j) *) split; first by apply: fr_pre; exists i; exists empty; rewrite unh0. (* Goal: forall (_ : @snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@try_s A B s s1 s2) y (union2 i j) m) (_ : is_true (def m)), r y m *) (* Goal: and (forall (y : A) (m : heap) (_ : @snd (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) (@fr A s) (@Val A y) (union2 i j) m), @fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@funcomp (spec B) (spec B) A tt (@fr B) s1 y) m) (forall (e : exn) (m : heap) (_ : @snd (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) (@fr A s) (@Exn A e) (union2 i j) m), @fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@funcomp (spec B) (spec B) exn tt (@fr B) s2 e) m) *) by split=>y m; case/(_ i j (erefl _) D H1)=>m1 [->][D2]; [case/H2 | case/H3]. (* Goal: forall (_ : @snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (@try_s A B s s1 s2) y (union2 i j) m) (_ : is_true (def m)), r y m *) by case=>[[x]|[e]][h][]; case/(_ i j (erefl _) D H1)=>m1 [->][D2]; [case/H2 | case/H3]=>// _; apply. Qed. Lemma bnd_do (s : spec A) s2 i j (r : cont B) : s.1 i -> End EvalDo. Section EvalReturn. Variables (A B : Type). Lemma val_ret v i (r : cont A) : (def i -> r (Val v) i) -> verify (ret_s v) i r. Proof. (* Goal: forall _ : forall _ : is_true (def i), r (@Val A v) i, @verify' A (@fr A (@ret_s A v)) i r *) by rewrite -[i]un0h=>H; apply: val_do=>// x m [->] // [->]. Qed. Lemma try_ret s1 s2 (v : A) i (r : cont B) : verify (s1 v) i r -> verify (try_s (ret_s v) s1 s2) i r. Proof. (* Goal: forall _ : @verify' B (@fr B (s1 v)) i r, @verify' B (@fr B (@try_s A B (@ret_s A v) s1 s2)) i r *) by rewrite -[i]un0h=>H; apply: try_do=>// x m [->] // [->]. Qed. Lemma bnd_ret s (v : A) i (r : cont B) : verify (s v) i r -> verify (bind_s (ret_s v) s) i r. Proof. (* Goal: forall _ : @verify' B (@fr B (s v)) i r, @verify' B (@fr B (@bind_s A B (@ret_s A v) s)) i r *) by move=>H; apply: bnd_is_try; apply: try_ret. Qed. End EvalReturn. Section EvalRead. Variables (A B : Type). Lemma val_read v x i (r : cont A) : (def (x :-> v :+ i) -> r (Val v) (x :-> v :+ i)) -> verify (read_s A x) (x :-> v :+ i) r. Proof. (* Goal: forall _ : forall _ : is_true (def (union2 (@pts A x v) i)), r (@Val A v) (union2 (@pts A x v) i), @verify' A (@fr A (read_s A x)) (union2 (@pts A x v) i) r *) move=>*; apply: val_do; first by [exists v]; by move=>y m [<-]; move/(_ v (erefl _))=>// [->]. Qed. Lemma try_read s1 s2 v x i (r : cont B) : verify (s1 v) (x :-> v :+ i) r -> verify (try_s (read_s A x) s1 s2) (x :-> v :+ i) r. Proof. (* Goal: forall _ : @verify' B (@fr B (s1 v)) (union2 (@pts A x v) i) r, @verify' B (@fr B (@try_s A B (read_s A x) s1 s2)) (union2 (@pts A x v) i) r *) move=>*; apply: try_do; first by [exists v]; by move=>y m [<-]; move/(_ v (erefl _))=>// [->]. Qed. Lemma bnd_read s v x i (r : cont B) : verify (s v) (x :-> v :+ i) r -> verify (bind_s (read_s A x) s) (x :-> v :+ i) r. Proof. (* Goal: forall _ : @verify' B (@fr B (s v)) (union2 (@pts A x v) i) r, @verify' B (@fr B (@bind_s A B (read_s A x) s)) (union2 (@pts A x v) i) r *) by move=>*; apply: bnd_is_try; apply: try_read. Qed. End EvalRead. Section EvalWrite. Variables (A B C : Type). Lemma val_write (v : A) (w : B) x i (r : cont unit) : (def (x :-> v :+ i) -> r (Val tt) (x :-> v :+ i)) -> verify (write_s x v) (x :-> w :+ i) r. Proof. (* Goal: forall _ : forall _ : is_true (def (union2 (@pts A x v) i)), r (@Val unit tt) (union2 (@pts A x v) i), @verify' unit (@fr unit (@write_s A x v)) (union2 (@pts B x w) i) r *) move=>*; apply: val_do; first by [exists B; exists w]; by move=>y m [// [->] ->]. Qed. Lemma try_write s1 s2 (v: A) (w : C) x i (r : cont B) : verify (s1 tt) (x :-> v :+ i) r -> verify (try_s (write_s x v) s1 s2) (x :-> w :+ i) r. Proof. (* Goal: forall _ : @verify' B (@fr B (s1 tt)) (union2 (@pts A x v) i) r, @verify' B (@fr B (@try_s unit B (@write_s A x v) s1 s2)) (union2 (@pts C x w) i) r *) move=>*; apply: try_do; first by [exists C; exists w]; by move=>y m [// [->] ->]. Qed. Lemma bnd_write s (v : A) (w : C) x i (r : cont B) : verify (s tt) (x :-> v :+ i) r -> verify (bind_s (write_s x v) s) (x :-> w :+ i) r. Proof. (* Goal: forall _ : @verify' B (@fr B (s tt)) (union2 (@pts A x v) i) r, @verify' B (@fr B (@bind_s unit B (@write_s A x v) s)) (union2 (@pts C x w) i) r *) by move=>*; apply: bnd_is_try; apply: try_write. Qed. End EvalWrite. Section EvalAlloc. Variables (A B : Type). Lemma val_alloc (v : A) i (r : cont ptr) : (forall x, def (x :-> v :+ i) -> r (Val x) (x :-> v :+ i)) -> verify (alloc_s v) i r. Proof. (* Goal: forall _ : forall (x : ptr) (_ : is_true (def (union2 (@pts A x v) i))), r (@Val ptr x) (union2 (@pts A x v) i), @verify' ptr (@fr ptr (@alloc_s A v)) i r *) move=>H; rewrite -[i]un0h; apply: val_do=>//; by move=>y m [x][//][-> ->]; apply: H. Qed. Lemma try_alloc s1 s2 (v : A) i (r : cont B) : (forall x, verify (s1 x) (x :-> v :+ i) r) -> verify (try_s (alloc_s v) s1 s2) i r. Proof. (* Goal: forall _ : forall x : ptr, @verify' B (@fr B (s1 x)) (union2 (@pts A x v) i) r, @verify' B (@fr B (@try_s ptr B (@alloc_s A v) s1 s2)) i r *) move=>H; rewrite -[i]un0h; apply: try_do=>//; by move=>y m [x][//][-> ->]; apply: H. Qed. Lemma bnd_alloc s (v : A) i (r : cont B) : (forall x, verify (s x) (x :-> v :+ i) r) -> verify (bind_s (alloc_s v) s) i r. Proof. (* Goal: forall _ : forall x : ptr, @verify' B (@fr B (s x)) (union2 (@pts A x v) i) r, @verify' B (@fr B (@bind_s ptr B (@alloc_s A v) s)) i r *) by move=>*; apply: bnd_is_try; apply: try_alloc. Qed. End EvalAlloc. Section EvalBlockAlloc. Variables (A B : Type). Lemma val_allocb (v : A) n i (r : cont ptr) : (forall x, def (updi x (nseq n v) :+ i) -> r (Val x) (updi x (nseq n v) :+ i)) -> verify (allocb_s v n) i r. Proof. (* Goal: forall _ : forall (x : ptr) (_ : is_true (def (union2 (@updi A x (@nseq A n v)) i))), r (@Val ptr x) (union2 (@updi A x (@nseq A n v)) i), @verify' ptr (@fr ptr (@allocb_s A v n)) i r *) move=>H; rewrite -[i]un0h; apply: val_do=>//; by move=>y m [x][//][->]->; apply: H. Qed. Lemma try_allocb s1 s2 (v : A) n i (r : cont B) : (forall x, verify (s1 x) (updi x (nseq n v) :+ i) r) -> verify (try_s (allocb_s v n) s1 s2) i r. Proof. (* Goal: forall _ : forall x : ptr, @verify' B (@fr B (s1 x)) (union2 (@updi A x (@nseq A n v)) i) r, @verify' B (@fr B (@try_s ptr B (@allocb_s A v n) s1 s2)) i r *) move=>H; rewrite -[i]un0h; apply: try_do=>//; by move=>y m [x][//][->]->; apply: H. Qed. Lemma bnd_allocb s (v : A) n i (r : cont B) : (forall x, verify (s x) (updi x (nseq n v) :+ i) r) -> verify (bind_s (allocb_s v n) s) i r. Proof. (* Goal: forall _ : forall x : ptr, @verify' B (@fr B (s x)) (union2 (@updi A x (@nseq A n v)) i) r, @verify' B (@fr B (@bind_s ptr B (@allocb_s A v n) s)) i r *) by move=>*; apply: bnd_is_try; apply: try_allocb. Qed. End EvalBlockAlloc. Section EvalDealloc. Variables (A B : Type). Lemma val_dealloc (v : A) x i (r : cont unit) : (def i -> r (Val tt) i) -> verify (dealloc_s x) (x :-> v :+ i) r. Proof. (* Goal: forall _ : forall _ : is_true (def i), r (@Val unit tt) i, @verify' unit (@fr unit (dealloc_s x)) (union2 (@pts A x v) i) r *) move=>H; apply: val_do; first by [exists A; exists v]; by move=>y m [//][->] ->; rewrite un0h. Qed. Lemma try_dealloc s1 s2 (v : B) x i (r : cont A) : verify (s1 tt) i r -> verify (try_s (dealloc_s x) s1 s2) (x :-> v :+ i) r. Proof. (* Goal: forall _ : @verify' A (@fr A (s1 tt)) i r, @verify' A (@fr A (@try_s unit A (dealloc_s x) s1 s2)) (union2 (@pts B x v) i) r *) move=>H; apply: try_do; first by [exists B; exists v]; by move=>y m [//][->] ->; rewrite un0h. Qed. Lemma bnd_dealloc s (v : B) x i (r : cont A) : verify (s tt) i r -> verify (bind_s (dealloc_s x) s) (x :-> v :+ i) r. Proof. (* Goal: forall _ : @verify' A (@fr A (s tt)) i r, @verify' A (@fr A (@bind_s unit A (dealloc_s x) s)) (union2 (@pts B x v) i) r *) by move=>*; apply: bnd_is_try; apply: try_dealloc. Qed. End EvalDealloc. Section EvalThrow. Variables (A B : Type). Lemma val_throw e i (r : cont A) : (def i -> r (Exn e) i) -> verify (throw_s A e) i r. Proof. (* Goal: forall _ : forall _ : is_true (def i), r (@Exn A e) i, @verify' A (@fr A (throw_s A e)) i r *) move=>H; rewrite -[i]un0h; apply: val_do=>//; by move=>y m [->] // [->]; rewrite un0h. Qed. Lemma try_throw s1 s2 e i (r : cont B) : verify (s2 e) i r -> verify (try_s (throw_s A e) s1 s2) i r. Proof. (* Goal: forall _ : @verify' B (@fr B (s2 e)) i r, @verify' B (@fr B (@try_s A B (throw_s A e) s1 s2)) i r *) move=>H; rewrite -[i]un0h; apply: try_do=>//; by move=>y m [->] // [->]; rewrite un0h. Qed. Lemma bnd_throw s e i (r : cont B) : (def i -> r (Exn e) i) -> verify (bind_s (throw_s A e) s) i r. End EvalThrow. Section EvalGhost. Variables (A B C : Type) (t : C) (p : C -> Pred heap) (q : C -> post A). Variables (s1 : A -> spec B) (s2 : exn -> spec B) (i j : heap) (P : Pred heap). Lemma val_gh (r : cont A) : let: s := (fun i => exists x, i \In p x, fun y i m => forall x, i \In p x -> q x y i m) in (forall x m, q t (Val x) i m -> def (m :+ j) -> r (Val x) (m :+ j)) -> (forall e m, q t (Exn e) i m -> def (m :+ j) -> r (Exn e) (m :+ j)) -> i \In p t -> verify s (i :+ j) r. Proof. (* Goal: forall (_ : forall (x : A) (m : heap) (_ : q t (@Val A x) i m) (_ : is_true (def (union2 m j))), r (@Val A x) (union2 m j)) (_ : forall (e : exn) (m : heap) (_ : q t (@Exn A e) i m) (_ : is_true (def (union2 m j))), r (@Exn A e) (union2 m j)) (_ : @InMem heap i (@Mem heap (PredPredType heap) (p t))), @verify' A (@fr A (@pair (forall _ : heap, Prop) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) (fun i : heap => @ex C (fun x : C => @InMem heap i (@Mem heap (PredPredType heap) (p x)))) (fun (y : ans A) (i m : heap) => forall (x : C) (_ : @InMem heap i (@Mem heap (PredPredType heap) (p x))), q x y i m))) (union2 i j) r *) by move=>*; apply: val_do=>/=; eauto. Qed. Lemma val_gh1 (r : cont A) : let: Q := fun y i m => forall x, i \In p x -> q x y i m in (i \In p t -> P i) -> (forall x m, q t (Val x) i m -> def (m :+ j) -> r (Val x) (m :+ j)) -> (forall e m, q t (Exn e) i m -> def (m :+ j) -> r (Exn e) (m :+ j)) -> i \In p t -> verify (P, Q) (i :+ j) r. Proof. (* Goal: forall (_ : forall _ : @InMem heap i (@Mem heap (PredPredType heap) (p t)), P i) (_ : forall (x : A) (m : heap) (_ : q t (@Val A x) i m) (_ : is_true (def (union2 m j))), r (@Val A x) (union2 m j)) (_ : forall (e : exn) (m : heap) (_ : q t (@Exn A e) i m) (_ : is_true (def (union2 m j))), r (@Exn A e) (union2 m j)) (_ : @InMem heap i (@Mem heap (PredPredType heap) (p t))), @verify' A (@fr A (@pair (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) P (fun (y : ans A) (i m : heap) => forall (x : C) (_ : @InMem heap i (@Mem heap (PredPredType heap) (p x))), q x y i m))) (union2 i j) r *) by move=>*; apply: val_do=>/=; eauto. Qed. Lemma try_gh (r : cont B) : let: s := (fun i => exists x, i \In p x, fun y i m => forall x, i \In p x -> q x y i m) in (forall x m, q t (Val x) i m -> verify (s1 x) (m :+ j) r) -> (forall e m, q t (Exn e) i m -> verify (s2 e) (m :+ j) r) -> i \In p t -> verify (try_s s s1 s2) (i :+ j) r. Proof. (* Goal: forall (_ : forall (x : A) (m : heap) (_ : q t (@Val A x) i m), @verify' B (@fr B (s1 x)) (union2 m j) r) (_ : forall (e : exn) (m : heap) (_ : q t (@Exn A e) i m), @verify' B (@fr B (s2 e)) (union2 m j) r) (_ : @InMem heap i (@Mem heap (PredPredType heap) (p t))), @verify' B (@fr B (@try_s A B (@pair (forall _ : heap, Prop) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) (fun i : heap => @ex C (fun x : C => @InMem heap i (@Mem heap (PredPredType heap) (p x)))) (fun (y : ans A) (i m : heap) => forall (x : C) (_ : @InMem heap i (@Mem heap (PredPredType heap) (p x))), q x y i m)) s1 s2)) (union2 i j) r *) by move=>*; apply: try_do=>/=; eauto. Qed. Lemma try_gh1 (r : cont B) : let: Q := fun y i m => forall x, i \In p x -> q x y i m in (i \In p t -> P i) -> (forall x m, q t (Val x) i m -> verify (s1 x) (m :+ j) r) -> (forall e m, q t (Exn e) i m -> verify (s2 e) (m :+ j) r) -> i \In p t -> verify (try_s (P, Q) s1 s2) (i :+ j) r. Proof. (* Goal: forall (_ : forall _ : @InMem heap i (@Mem heap (PredPredType heap) (p t)), P i) (_ : forall (x : A) (m : heap) (_ : q t (@Val A x) i m), @verify' B (@fr B (s1 x)) (union2 m j) r) (_ : forall (e : exn) (m : heap) (_ : q t (@Exn A e) i m), @verify' B (@fr B (s2 e)) (union2 m j) r) (_ : @InMem heap i (@Mem heap (PredPredType heap) (p t))), @verify' B (@fr B (@try_s A B (@pair (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) P (fun (y : ans A) (i m : heap) => forall (x : C) (_ : @InMem heap i (@Mem heap (PredPredType heap) (p x))), q x y i m)) s1 s2)) (union2 i j) r *) by move=>*; apply: try_do=>/=; eauto. Qed. Lemma bnd_gh (r : cont B) : let: s := (fun i => exists x, i \In p x, fun y i m => forall x, i \In p x -> q x y i m) in (forall x m, q t (Val x) i m -> verify (s1 x) (m :+ j) r) -> (forall e m, q t (Exn e) i m -> def (m :+ j) -> r (Exn e) (m :+ j)) -> i \In p t -> verify (bind_s s s1) (i :+ j) r. Proof. (* Goal: forall (_ : forall (x : A) (m : heap) (_ : q t (@Val A x) i m), @verify' B (@fr B (s1 x)) (union2 m j) r) (_ : forall (e : exn) (m : heap) (_ : q t (@Exn A e) i m) (_ : is_true (def (union2 m j))), r (@Exn B e) (union2 m j)) (_ : @InMem heap i (@Mem heap (PredPredType heap) (p t))), @verify' B (@fr B (@bind_s A B (@pair (forall _ : heap, Prop) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) (fun i : heap => @ex C (fun x : C => @InMem heap i (@Mem heap (PredPredType heap) (p x)))) (fun (y : ans A) (i m : heap) => forall (x : C) (_ : @InMem heap i (@Mem heap (PredPredType heap) (p x))), q x y i m)) s1)) (union2 i j) r *) by move=>*; apply: bnd_do=>/=; eauto. Qed. Lemma bnd_gh1 (r : cont B) : let: Q := fun y i m => forall x, i \In p x -> q x y i m in (i \In p t -> P i) -> (forall x m, q t (Val x) i m -> verify (s1 x) (m :+ j) r) -> (forall e m, q t (Exn e) i m -> def (m :+ j) -> r (Exn e) (m :+ j)) -> i \In p t -> verify (bind_s (P, Q) s1) (i :+ j) r. Proof. (* Goal: forall (_ : forall _ : @InMem heap i (@Mem heap (PredPredType heap) (p t)), P i) (_ : forall (x : A) (m : heap) (_ : q t (@Val A x) i m), @verify' B (@fr B (s1 x)) (union2 m j) r) (_ : forall (e : exn) (m : heap) (_ : q t (@Exn A e) i m) (_ : is_true (def (union2 m j))), r (@Exn B e) (union2 m j)) (_ : @InMem heap i (@Mem heap (PredPredType heap) (p t))), @verify' B (@fr B (@bind_s A B (@pair (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) P (fun (y : ans A) (i m : heap) => forall (x : C) (_ : @InMem heap i (@Mem heap (PredPredType heap) (p x))), q x y i m)) s1)) (union2 i j) r *) by move=>*; apply: bnd_do=>/=; eauto. Qed. End EvalGhost. Definition pull (A : Type) x (v:A) := (unC (x :-> v), unCA (x :-> v)). Definition push (A : Type) x (v:A) := (unCA (x :-> v), unC (x :-> v)). Ltac hstep := match goal with | |- verify ?h (ret_s _) _ => apply: val_ret | |- verify ?h (try_s (ret_s _) _ _) _ => apply: try_ret | |- verify ?h (bind_s (ret_s _) _) _ => apply: bnd_ret | |- verify ?h (read_s _ ?l) _ => rewrite -?(pull l); apply: val_read | |- verify ?h (try_s (read_s _ ?l) _ _) _ => rewrite -?(pull l); apply: try_read | |- verify (?h) (bind_s (read_s _ ?l) _) _ => rewrite -?(pull l); apply: bnd_read | |- verify (?h) (write_s ?l _) _ => rewrite -?(pull l); apply: val_write | |- verify (?h) (try_s (write_s ?l _) _ _) _ => rewrite -?(pull l); apply: try_write | |- verify (?h) (bind_s (write_s ?l _) _) _ => rewrite -?(pull l); apply: bnd_write | |- verify ?h (alloc_s _) _ => apply: val_alloc | |- verify ?h (try_s (alloc_s _) _ _) _ => apply: try_alloc | |- verify ?h (bind_s (alloc_s _) _) _ => apply: bnd_alloc | |- verify ?h (allocb_s _ _) _ => apply: val_allocb | |- verify ?h (try_s (allocb_s _ _) _ _) _ => apply: try_allocb | |- verify ?h (bind_s (allocb_s _ _) _) _ => apply: bnd_allocb | |- verify ?h (dealloc_s ?l) _ => rewrite -?(pull l); apply: val_dealloc | |- verify ?h (try_s (dealloc_s ?l) _ _) _ => rewrite -?(pull l); apply: try_dealloc | |- verify ?h (bind_s (dealloc_s ?l) _) _ => rewrite -?(pull l); apply: bnd_dealloc | |- verify ?h (throw_s _ _) _ => apply: val_throw | |- verify ?h (try_s (throw_s _ _) _ _) _ => apply: try_throw | |- verify ?h (bind_s (throw_s _ _) _) _ => apply: bnd_throw end. Lemma swp : forall (A : Type) (v : A) x h, h \In x :--> v <-> h = x :-> v. Proof. (* Goal: forall (A : Type) (v : A) (x : ptr) (h : heap), iff (@InMem heap h (@Mem heap (PredPredType heap) (@ppts A x v))) (@eq heap h (@pts A x v)) *) by move=>A v x h; split; rewrite InE /pts /=; unlock. Qed. Lemma opn : forall (A : Type) (v : A) x h, h \In x :--> v <-> x :-> v = h. Proof. (* Goal: forall (A : Type) (v : A) (x : ptr) (h : heap), iff (@InMem heap h (@Mem heap (PredPredType heap) (@ppts A x v))) (@eq heap (@pts A x v) h) *) by move=>A v x h; split=>[|H]; rewrite InE /= /pts; unlock. Qed. Prenex Implicits swp opn. Lemma blah (A : Type) (p : ptr) (l : A) : def (p :-> l) -> (p :-> l) \In p :--> l. Proof. (* Goal: forall _ : is_true (def (@pts A p l)), @InMem heap (@pts A p l) (@Mem heap (PredPredType heap) (@ppts A p l)) *) by move=>H; apply/swp. Qed. Hint Immediate blah : core. Lemma blah2 (A : Type) (v1 v2 : A) q : def (q :-> v1) -> v1 = v2 -> q :-> v1 \In q :--> v2. Proof. (* Goal: forall (_ : is_true (def (@pts A q v1))) (_ : @eq A v1 v2), @InMem heap (@pts A q v1) (@Mem heap (PredPredType heap) (@ppts A q v2)) *) by move=>D E; apply/swp; rewrite E. Qed. Hint Immediate blah2 : core. Ltac hauto := (do ?econstructor=>//; try by [defcheck; auto | eapply blah2; defcheck; auto])=>//. Ltac hhauto := (do ?econstructor=>//; try by [heap_congr])=>//. Ltac hdone := repeat progress hhauto=>//=. Ltac heval := do ![hstep | by hhauto].
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrfun ssrbool eqtype ssrnat seq choice fintype. From mathcomp Require Import bigop ssralg poly. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Import GRing.Theory. Local Open Scope ring_scope. Reserved Notation "p %= q" (at level 70, no associativity). Local Notation simp := Monoid.simpm. Module Pdiv. Module CommonRing. Section RingPseudoDivision. Variable R : ringType. Implicit Types d p q r : {poly R}. Definition redivp_rec (q : {poly R}) := let sq := size q in let cq := lead_coef q in fix loop (k : nat) (qq r : {poly R})(n : nat) {struct n} := if size r < sq then (k, qq, r) else let m := (lead_coef r) *: 'X^(size r - sq) in let qq1 := qq * cq%:P + m in let r1 := r * cq%:P - m * q in if n is n1.+1 then loop k.+1 qq1 r1 n1 else (k.+1, qq1, r1). Definition redivp_expanded_def p q := if q == 0 then (0%N, 0, p) else redivp_rec q 0 0 p (size p). Definition redivp : {poly R} -> {poly R} -> nat * {poly R} * {poly R} := locked_with redivp_key redivp_expanded_def. Canonical redivp_unlockable := [unlockable fun redivp]. Definition rdivp p q := ((redivp p q).1).2. Definition rmodp p q := (redivp p q).2. Definition rscalp p q := ((redivp p q).1).1. Definition rdvdp p q := rmodp q p == 0. Lemma redivp_def p q : redivp p q = (rscalp p q, rdivp p q, rmodp p q). Proof. (* Goal: @eq (prod (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R)))) (redivp p q) (@pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) (rscalp p q) (rdivp p q)) (rmodp p q)) *) by rewrite /rscalp /rdivp /rmodp; case: (redivp p q) => [[]] /=. Qed. Lemma rdiv0p p : rdivp 0 p = 0. Proof. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rdivp (GRing.zero (poly_zmodType R)) p) (GRing.zero (poly_zmodType R)) *) rewrite /rdivp unlock; case: ifP => // Hp; rewrite /redivp_rec !size_poly0. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@snd nat (@poly_of R (Phant (GRing.Ring.sort R))) (@fst (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (if leq (S O) (@size (GRing.Ring.sort R) (@polyseq R p)) then @pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) O (GRing.zero (poly_zmodType R))) (GRing.zero (poly_zmodType R)) else @pair (prod nat (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType R)))) (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType R))) (@pair nat (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType R))) (S O) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.zero (poly_zmodType R)) (@polyC R (@lead_coef R p))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (GRing.zero (poly_zmodType R))) (@GRing.exp (poly_ringType R) (polyX R) (subn O (@size (GRing.Ring.sort R) (@polyseq R p))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.zero (poly_zmodType R)) (@polyC R (@lead_coef R p))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (GRing.zero (poly_zmodType R))) (@GRing.exp (poly_ringType R) (polyX R) (subn O (@size (GRing.Ring.sort R) (@polyseq R p))))) p)))))) (GRing.zero (poly_zmodType R)) *) by rewrite polySpred ?Hp. Qed. Lemma rdivp0 p : rdivp p 0 = 0. Proof. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rdivp p (GRing.zero (poly_zmodType R))) (GRing.zero (poly_zmodType R)) *) by rewrite /rdivp unlock eqxx. Qed. Lemma rdivp_small p q : size p < size q -> rdivp p q = 0. Proof. (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rdivp p q) (GRing.zero (poly_zmodType R)) *) rewrite /rdivp unlock; have [-> | _ ltpq] := eqP; first by rewrite size_poly0. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@snd nat (@poly_of R (Phant (GRing.Ring.sort R))) (@fst (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (redivp_rec q O (GRing.zero (poly_zmodType R)) p (@size (GRing.Ring.sort R) (@polyseq R p))))) (GRing.zero (poly_zmodType R)) *) by case: (size p) => [|s]; rewrite /= ltpq. Qed. Lemma leq_rdivp p q : size (rdivp p q) <= size p. Lemma rmod0p p : rmodp 0 p = 0. Proof. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp (GRing.zero (poly_zmodType R)) p) (GRing.zero (poly_zmodType R)) *) rewrite /rmodp unlock; case: ifP => // Hp; rewrite /redivp_rec !size_poly0. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@snd (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (if leq (S O) (@size (GRing.Ring.sort R) (@polyseq R p)) then @pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) O (GRing.zero (poly_zmodType R))) (GRing.zero (poly_zmodType R)) else @pair (prod nat (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType R)))) (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType R))) (@pair nat (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType R))) (S O) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.zero (poly_zmodType R)) (@polyC R (@lead_coef R p))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (GRing.zero (poly_zmodType R))) (@GRing.exp (poly_ringType R) (polyX R) (subn O (@size (GRing.Ring.sort R) (@polyseq R p))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.zero (poly_zmodType R)) (@polyC R (@lead_coef R p))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (GRing.zero (poly_zmodType R))) (@GRing.exp (poly_ringType R) (polyX R) (subn O (@size (GRing.Ring.sort R) (@polyseq R p))))) p))))) (GRing.zero (poly_zmodType R)) *) by rewrite polySpred ?Hp. Qed. Lemma rmodp0 p : rmodp p 0 = p. Proof. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p (GRing.zero (poly_zmodType R))) p *) by rewrite /rmodp unlock eqxx. Qed. Lemma rscalp_small p q : size p < size q -> rscalp p q = 0%N. Proof. (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q))), @eq nat (rscalp p q) O *) rewrite /rscalp unlock; case: eqP => Eq // spq. (* Goal: @eq nat (@fst nat (@poly_of R (Phant (GRing.Ring.sort R))) (@fst (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (redivp_rec q O (GRing.zero (poly_zmodType R)) p (@size (GRing.Ring.sort R) (@polyseq R p))))) O *) by case sp: (size p) => [| s] /=; rewrite spq. Qed. Lemma ltn_rmodp p q : (size (rmodp p q) < size q) = (q != 0). Lemma ltn_rmodpN0 p q : q != 0 -> size (rmodp p q) < size q. Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType R) q (GRing.zero (poly_zmodType R)))), is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R (rmodp p q)))) (@size (GRing.Ring.sort R) (@polyseq R q))) *) by rewrite ltn_rmodp. Qed. Lemma rmodp1 p : rmodp p 1 = 0. Proof. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p (GRing.one (poly_ringType R))) (GRing.zero (poly_zmodType R)) *) case p0: (p == 0); first by rewrite (eqP p0) rmod0p. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p (GRing.one (poly_ringType R))) (GRing.zero (poly_zmodType R)) *) apply/eqP; rewrite -size_poly_eq0. (* Goal: is_true (@eq_op nat_eqType (@size (GRing.Ring.sort R) (@polyseq R (rmodp p (GRing.one (poly_ringType R))))) O) *) by have := (ltn_rmodp p 1); rewrite size_polyC !oner_neq0 ltnS leqn0. Qed. Lemma rmodp_small p q : size p < size q -> rmodp p q = p. Proof. (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p q) p *) rewrite /rmodp unlock; case: eqP => Eq; first by rewrite Eq size_poly0. (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@snd (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (redivp_rec q O (GRing.zero (poly_zmodType R)) p (@size (GRing.Ring.sort R) (@polyseq R p)))) p *) by case sp: (size p) => [| s] Hs /=; rewrite sp Hs /=. Qed. Lemma leq_rmodp m d : size (rmodp m d) <= size m. Proof. (* Goal: is_true (leq (@size (GRing.Ring.sort R) (@polyseq R (rmodp m d))) (@size (GRing.Ring.sort R) (@polyseq R m))) *) case: (ltnP (size m) (size d)) => [|h]; first by move/rmodp_small->. (* Goal: is_true (leq (@size (GRing.Ring.sort R) (@polyseq R (rmodp m d))) (@size (GRing.Ring.sort R) (@polyseq R m))) *) case d0: (d == 0); first by rewrite (eqP d0) rmodp0. (* Goal: is_true (leq (@size (GRing.Ring.sort R) (@polyseq R (rmodp m d))) (@size (GRing.Ring.sort R) (@polyseq R m))) *) by apply: leq_trans h; apply: ltnW; rewrite ltn_rmodp d0. Qed. Lemma rmodpC p c : c != 0 -> rmodp p c%:P = 0. Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType R)) c (GRing.zero (GRing.Ring.zmodType R)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p (@polyC R c)) (GRing.zero (poly_zmodType R)) *) move=> Hc; apply/eqP; rewrite -size_poly_eq0 -leqn0 -ltnS. (* Goal: is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R (rmodp p (@polyC R c))))) (S O)) *) have -> : 1%N = nat_of_bool (c != 0) by rewrite Hc. (* Goal: is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R (rmodp p (@polyC R c))))) (nat_of_bool (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType R)) c (GRing.zero (GRing.Ring.zmodType R)))))) *) by rewrite -size_polyC ltn_rmodp polyC_eq0. Qed. Lemma rdvdp0 d : rdvdp d 0. Proof. (* Goal: is_true (rdvdp d (GRing.zero (poly_zmodType R))) *) by rewrite /rdvdp rmod0p. Qed. Lemma rdvd0p n : (rdvdp 0 n) = (n == 0). Proof. (* Goal: @eq bool (rdvdp (GRing.zero (poly_zmodType R)) n) (@eq_op (poly_eqType R) n (GRing.zero (poly_zmodType R))) *) by rewrite /rdvdp rmodp0. Qed. Lemma rdvd0pP n : reflect (n = 0) (rdvdp 0 n). Proof. (* Goal: Bool.reflect (@eq (GRing.Zmodule.sort (poly_zmodType R)) n (GRing.zero (poly_zmodType R))) (rdvdp (GRing.zero (poly_zmodType R)) n) *) by apply: (iffP idP); rewrite rdvd0p; move/eqP. Qed. Lemma rdvdpN0 p q : rdvdp p q -> q != 0 -> p != 0. Proof. (* Goal: forall (_ : is_true (rdvdp p q)) (_ : is_true (negb (@eq_op (poly_eqType R) q (GRing.zero (poly_zmodType R))))), is_true (negb (@eq_op (poly_eqType R) p (GRing.zero (poly_zmodType R)))) *) by move=> pq hq; apply: contraL pq => /eqP ->; rewrite rdvd0p. Qed. Lemma rdvdp1 d : (rdvdp d 1) = ((size d) == 1%N). Proof. (* Goal: @eq bool (rdvdp d (GRing.one (poly_ringType R))) (@eq_op nat_eqType (@size (GRing.Ring.sort R) (@polyseq R d)) (S O)) *) rewrite /rdvdp; case d0: (d == 0). (* Goal: @eq bool (@eq_op (poly_eqType R) (rmodp (GRing.one (poly_ringType R)) d) (GRing.zero (poly_zmodType R))) (@eq_op nat_eqType (@size (GRing.Ring.sort R) (@polyseq R d)) (S O)) *) (* Goal: @eq bool (@eq_op (poly_eqType R) (rmodp (GRing.one (poly_ringType R)) d) (GRing.zero (poly_zmodType R))) (@eq_op nat_eqType (@size (GRing.Ring.sort R) (@polyseq R d)) (S O)) *) by rewrite (eqP d0) rmodp0 size_poly0 (negPf (@oner_neq0 _)). (* Goal: @eq bool (@eq_op (poly_eqType R) (rmodp (GRing.one (poly_ringType R)) d) (GRing.zero (poly_zmodType R))) (@eq_op nat_eqType (@size (GRing.Ring.sort R) (@polyseq R d)) (S O)) *) have:= (size_poly_eq0 d); rewrite d0; move/negbT; rewrite -lt0n. (* Goal: forall _ : is_true (leq (S O) (@size (GRing.Ring.sort R) (@polyseq R d))), @eq bool (@eq_op (poly_eqType R) (rmodp (GRing.one (poly_ringType R)) d) (GRing.zero (poly_zmodType R))) (@eq_op nat_eqType (@size (GRing.Ring.sort R) (@polyseq R d)) (S O)) *) rewrite leq_eqVlt; case/orP => hd; last first. (* Goal: @eq bool (@eq_op (poly_eqType R) (rmodp (GRing.one (poly_ringType R)) d) (GRing.zero (poly_zmodType R))) (@eq_op nat_eqType (@size (GRing.Ring.sort R) (@polyseq R d)) (S O)) *) (* Goal: @eq bool (@eq_op (poly_eqType R) (rmodp (GRing.one (poly_ringType R)) d) (GRing.zero (poly_zmodType R))) (@eq_op nat_eqType (@size (GRing.Ring.sort R) (@polyseq R d)) (S O)) *) by rewrite rmodp_small ?size_poly1 // oner_eq0 -(subnKC hd). (* Goal: @eq bool (@eq_op (poly_eqType R) (rmodp (GRing.one (poly_ringType R)) d) (GRing.zero (poly_zmodType R))) (@eq_op nat_eqType (@size (GRing.Ring.sort R) (@polyseq R d)) (S O)) *) rewrite eq_sym in hd; rewrite hd; have [c cn0 ->] := size_poly1P _ hd. (* Goal: @eq bool (@eq_op (poly_eqType R) (rmodp (GRing.one (poly_ringType R)) (@polyC R c)) (GRing.zero (poly_zmodType R))) true *) rewrite /rmodp unlock -size_poly_eq0 size_poly1 /= size_poly1 size_polyC cn0 /=. (* Goal: @eq bool (@eq_op nat_eqType (@size (GRing.Ring.sort R) (@polyseq R (@snd (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (@polyC R c) (GRing.zero (poly_zmodType R)) then @pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) O (GRing.zero (poly_zmodType R))) (GRing.one (poly_ringType R)) else if leq (S (@size (GRing.Ring.sort R) (@polyseq R (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.one (poly_ringType R)) (@polyC R (@lead_coef R (@polyC R c)))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (GRing.one (poly_ringType R))) (@GRing.exp (poly_ringType R) (polyX R) (subn (S O) (S O)))) (@polyC R c))))))) (S O) then @pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) (S O) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.zero (poly_zmodType R)) (@polyC R (@lead_coef R (@polyC R c)))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (GRing.one (poly_ringType R))) (@GRing.exp (poly_ringType R) (polyX R) (subn (S O) (S O)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.one (poly_ringType R)) (@polyC R (@lead_coef R (@polyC R c)))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (GRing.one (poly_ringType R))) (@GRing.exp (poly_ringType R) (polyX R) (subn (S O) (S O)))) (@polyC R c)))) else @pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) (S (S O)) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.zero (poly_zmodType R)) (@polyC R (@lead_coef R (@polyC R c)))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (GRing.one (poly_ringType R))) (@GRing.exp (poly_ringType R) (polyX R) (subn (S O) (S O))))) (@polyC R (@lead_coef R (@polyC R c)))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.one (poly_ringType R)) (@polyC R (@lead_coef R (@polyC R c)))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (GRing.one (poly_ringType R))) (@GRing.exp (poly_ringType R) (polyX R) (subn (S O) (S O)))) (@polyC R c))))) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.one (poly_ringType R)) (@polyC R (@lead_coef R (@polyC R c)))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (GRing.one (poly_ringType R))) (@GRing.exp (poly_ringType R) (polyX R) (subn (S O) (S O)))) (@polyC R c)))))) (S O)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.one (poly_ringType R)) (@polyC R (@lead_coef R (@polyC R c)))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (GRing.one (poly_ringType R))) (@GRing.exp (poly_ringType R) (polyX R) (subn (S O) (S O)))) (@polyC R c)))) (@polyC R (@lead_coef R (@polyC R c)))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.one (poly_ringType R)) (@polyC R (@lead_coef R (@polyC R c)))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (GRing.one (poly_ringType R))) (@GRing.exp (poly_ringType R) (polyX R) (subn (S O) (S O)))) (@polyC R c))))) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.one (poly_ringType R)) (@polyC R (@lead_coef R (@polyC R c)))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (GRing.one (poly_ringType R))) (@GRing.exp (poly_ringType R) (polyX R) (subn (S O) (S O)))) (@polyC R c)))))) (S O)))) (@polyC R c)))))))) O) true *) by rewrite polyC_eq0 (negPf cn0) !lead_coefC !scale1r subrr !size_poly0. Qed. Lemma rdvd1p m : rdvdp 1 m. Proof. (* Goal: is_true (rdvdp (GRing.one (poly_ringType R)) m) *) by rewrite /rdvdp rmodp1. Qed. Lemma Nrdvdp_small (n d : {poly R}) : n != 0 -> size n < size d -> (rdvdp d n) = false. Proof. (* Goal: forall (_ : is_true (negb (@eq_op (poly_eqType R) n (GRing.zero (poly_zmodType R))))) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R n))) (@size (GRing.Ring.sort R) (@polyseq R d)))), @eq bool (rdvdp d n) false *) by move=> nn0 hs; rewrite /rdvdp; rewrite (rmodp_small hs); apply: negPf. Qed. Lemma rmodp_eq0P p q : reflect (rmodp p q = 0) (rdvdp q p). Proof. (* Goal: Bool.reflect (@eq (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p q) (GRing.zero (poly_zmodType R))) (rdvdp q p) *) exact: (iffP eqP). Qed. Lemma rmodp_eq0 p q : rdvdp q p -> rmodp p q = 0. Proof. (* Goal: forall _ : is_true (rdvdp q p), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p q) (GRing.zero (poly_zmodType R)) *) by move/rmodp_eq0P. Qed. Lemma rdvdp_leq p q : rdvdp p q -> q != 0 -> size p <= size q. Proof. (* Goal: forall (_ : is_true (rdvdp p q)) (_ : is_true (negb (@eq_op (poly_eqType R) q (GRing.zero (poly_zmodType R))))), is_true (leq (@size (GRing.Ring.sort R) (@polyseq R p)) (@size (GRing.Ring.sort R) (@polyseq R q))) *) by move=> dvd_pq; rewrite leqNgt; apply: contra => /rmodp_small <-. Qed. Definition rgcdp p q := let: (p1, q1) := if size p < size q then (q, p) else (p, q) in if p1 == 0 then q1 else let fix loop (n : nat) (pp qq : {poly R}) {struct n} := let rr := rmodp pp qq in if rr == 0 then qq else if n is n1.+1 then loop n1 qq rr else rr in loop (size p1) p1 q1. Lemma rgcd0p : left_id 0 rgcdp. Proof. (* Goal: @left_id (GRing.Zmodule.sort (poly_zmodType R)) (@poly_of R (Phant (GRing.Ring.sort R))) (GRing.zero (poly_zmodType R)) rgcdp *) move=> p; rewrite /rgcdp size_poly0 size_poly_gt0 if_neg. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (let 'pair p1 q1 := if @eq_op (poly_eqType R) p (GRing.zero (poly_zmodType R)) then @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) (GRing.zero (poly_zmodType R)) p else @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) p (GRing.zero (poly_zmodType R)) in if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then q1 else (fix loop (n : nat) (pp qq : @poly_of R (Phant (GRing.Ring.sort R))) {struct n} : @poly_of R (Phant (GRing.Ring.sort R)) := if @eq_op (poly_eqType R) (rmodp pp qq) (GRing.zero (poly_zmodType R)) then qq else match n with | O => rmodp pp qq | S n1 => loop n1 qq (rmodp pp qq) end) (@size (GRing.Ring.sort R) (@polyseq R p1)) p1 q1) p *) case: ifP => /= [_ | nzp]; first by rewrite eqxx. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) p (GRing.zero (poly_zmodType R)) then GRing.zero (poly_zmodType R) else (fix loop (n : nat) (pp qq : @poly_of R (Phant (GRing.Ring.sort R))) {struct n} : @poly_of R (Phant (GRing.Ring.sort R)) := if @eq_op (poly_eqType R) (rmodp pp qq) (GRing.zero (poly_zmodType R)) then qq else match n with | O => rmodp pp qq | S n1 => loop n1 qq (rmodp pp qq) end) (@size (GRing.Ring.sort R) (@polyseq R p)) p (GRing.zero (poly_zmodType R))) p *) by rewrite polySpred !(rmodp0, nzp) //; case: _.-1 => [|m]; rewrite rmod0p eqxx. Qed. Lemma rgcdp0 : right_id 0 rgcdp. Proof. (* Goal: @right_id (@poly_of R (Phant (GRing.Ring.sort R))) (GRing.Zmodule.sort (poly_zmodType R)) (GRing.zero (poly_zmodType R)) rgcdp *) move=> p; have:= rgcd0p p; rewrite /rgcdp size_poly0 size_poly_gt0 if_neg. (* Goal: forall _ : @eq (@poly_of R (Phant (GRing.Ring.sort R))) (let 'pair p1 q1 := if @eq_op (poly_eqType R) p (GRing.zero (poly_zmodType R)) then @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) (GRing.zero (poly_zmodType R)) p else @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) p (GRing.zero (poly_zmodType R)) in if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then q1 else (fix loop (n : nat) (pp qq : @poly_of R (Phant (GRing.Ring.sort R))) {struct n} : @poly_of R (Phant (GRing.Ring.sort R)) := if @eq_op (poly_eqType R) (rmodp pp qq) (GRing.zero (poly_zmodType R)) then qq else match n with | O => rmodp pp qq | S n1 => loop n1 qq (rmodp pp qq) end) (@size (GRing.Ring.sort R) (@polyseq R p1)) p1 q1) p, @eq (@poly_of R (Phant (GRing.Ring.sort R))) (let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) O then @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) (GRing.zero (poly_zmodType R)) p else @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) p (GRing.zero (poly_zmodType R)) in if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then q1 else (fix loop (n : nat) (pp qq : @poly_of R (Phant (GRing.Ring.sort R))) {struct n} : @poly_of R (Phant (GRing.Ring.sort R)) := if @eq_op (poly_eqType R) (rmodp pp qq) (GRing.zero (poly_zmodType R)) then qq else match n with | O => rmodp pp qq | S n1 => loop n1 qq (rmodp pp qq) end) (@size (GRing.Ring.sort R) (@polyseq R p1)) p1 q1) p *) by case: ifP => /= p0; rewrite ?(eqxx, p0) // (eqP p0). Qed. Lemma rgcdpE p q : rgcdp p q = if size p < size q then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q. Proof. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) pose rgcdp_rec := fix rgcdp_rec (n : nat) (pp qq : {poly R}) {struct n} := let rr := rmodp pp qq in if rr == 0 then qq else if n is n1.+1 then rgcdp_rec n1 qq rr else rr. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) have Irec: forall m n p q, size q <= m -> size q <= n -> size q < size p -> rgcdp_rec m p q = rgcdp_rec n p q. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: forall (m n : nat) (p q : @poly_of R (Phant (GRing.Ring.sort R))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q)) m)) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q)) n)) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q))) (@size (GRing.Ring.sort R) (@polyseq R p)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec m p q) (rgcdp_rec n p q) *) + (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: forall (m n : nat) (p q : @poly_of R (Phant (GRing.Ring.sort R))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q)) m)) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q)) n)) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q))) (@size (GRing.Ring.sort R) (@polyseq R p)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec m p q) (rgcdp_rec n p q) *) elim=> [|m Hrec] [|n] //= p1 q1. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S m))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S n))) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec m q1 (rmodp p1 q1)) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec n q1 (rmodp p1 q1)) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S m))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) O)) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec m q1 (rmodp p1 q1)) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rmodp p1 q1) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) O)) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S n))) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rmodp p1 q1) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec n q1 (rmodp p1 q1)) *) - (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S m))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S n))) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec m q1 (rmodp p1 q1)) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec n q1 (rmodp p1 q1)) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S m))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) O)) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec m q1 (rmodp p1 q1)) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rmodp p1 q1) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) O)) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S n))) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rmodp p1 q1) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec n q1 (rmodp p1 q1)) *) rewrite leqn0 size_poly_eq0; move/eqP=> -> _. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S m))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S n))) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec m q1 (rmodp p1 q1)) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec n q1 (rmodp p1 q1)) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S m))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) O)) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec m q1 (rmodp p1 q1)) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rmodp p1 q1) *) (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R (GRing.zero (poly_zmodType R))))) (@size (GRing.Ring.sort R) (@polyseq R p1))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 (GRing.zero (poly_zmodType R))) (GRing.zero (poly_zmodType R)) then GRing.zero (poly_zmodType R) else rmodp p1 (GRing.zero (poly_zmodType R))) (if @eq_op (poly_eqType R) (rmodp p1 (GRing.zero (poly_zmodType R))) (GRing.zero (poly_zmodType R)) then GRing.zero (poly_zmodType R) else rgcdp_rec n (GRing.zero (poly_zmodType R)) (rmodp p1 (GRing.zero (poly_zmodType R)))) *) rewrite size_poly0 size_poly_gt0 rmodp0 => nzp. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S m))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S n))) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec m q1 (rmodp p1 q1)) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec n q1 (rmodp p1 q1)) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S m))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) O)) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec m q1 (rmodp p1 q1)) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rmodp p1 q1) *) (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then GRing.zero (poly_zmodType R) else p1) (if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then GRing.zero (poly_zmodType R) else rgcdp_rec n (GRing.zero (poly_zmodType R)) p1) *) by rewrite (negPf nzp); case: n => [|n] /=; rewrite rmod0p eqxx. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S m))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S n))) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec m q1 (rmodp p1 q1)) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec n q1 (rmodp p1 q1)) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S m))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) O)) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec m q1 (rmodp p1 q1)) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rmodp p1 q1) *) - (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S m))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S n))) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec m q1 (rmodp p1 q1)) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec n q1 (rmodp p1 q1)) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S m))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) O)) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec m q1 (rmodp p1 q1)) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rmodp p1 q1) *) rewrite leqn0 size_poly_eq0 => _; move/eqP=> ->. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S m))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S n))) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec m q1 (rmodp p1 q1)) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec n q1 (rmodp p1 q1)) *) (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R (GRing.zero (poly_zmodType R))))) (@size (GRing.Ring.sort R) (@polyseq R p1))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 (GRing.zero (poly_zmodType R))) (GRing.zero (poly_zmodType R)) then GRing.zero (poly_zmodType R) else rgcdp_rec m (GRing.zero (poly_zmodType R)) (rmodp p1 (GRing.zero (poly_zmodType R)))) (if @eq_op (poly_eqType R) (rmodp p1 (GRing.zero (poly_zmodType R))) (GRing.zero (poly_zmodType R)) then GRing.zero (poly_zmodType R) else rmodp p1 (GRing.zero (poly_zmodType R))) *) rewrite size_poly0 size_poly_gt0 rmodp0 => nzp. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S m))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S n))) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec m q1 (rmodp p1 q1)) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec n q1 (rmodp p1 q1)) *) (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then GRing.zero (poly_zmodType R) else rgcdp_rec m (GRing.zero (poly_zmodType R)) p1) (if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then GRing.zero (poly_zmodType R) else p1) *) by rewrite (negPf nzp); case: m {Hrec} => [|m] /=; rewrite rmod0p eqxx. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S m))) (_ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q1)) (S n))) (_ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R q1))) (@size (GRing.Ring.sort R) (@polyseq R p1)))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec m q1 (rmodp p1 q1)) (if @eq_op (poly_eqType R) (rmodp p1 q1) (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec n q1 (rmodp p1 q1)) *) case: ifP => Epq Sm Sn Sq //; rewrite ?Epq //. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec m q1 (rmodp p1 q1)) (rgcdp_rec n q1 (rmodp p1 q1)) *) case: (eqVneq q1 0) => [->|nzq]. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec m q1 (rmodp p1 q1)) (rgcdp_rec n q1 (rmodp p1 q1)) *) (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec m (GRing.zero (poly_zmodType R)) (rmodp p1 (GRing.zero (poly_zmodType R)))) (rgcdp_rec n (GRing.zero (poly_zmodType R)) (rmodp p1 (GRing.zero (poly_zmodType R)))) *) by case: n m {Sm Sn Hrec} => [|m] [|n] //=; rewrite rmod0p eqxx. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec m q1 (rmodp p1 q1)) (rgcdp_rec n q1 (rmodp p1 q1)) *) apply: Hrec; last by rewrite ltn_rmodp. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: is_true (leq (@size (GRing.Ring.sort R) (@polyseq R (rmodp p1 q1))) n) *) (* Goal: is_true (leq (@size (GRing.Ring.sort R) (@polyseq R (rmodp p1 q1))) m) *) by rewrite -ltnS (leq_trans _ Sm) // ltn_rmodp. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: is_true (leq (@size (GRing.Ring.sort R) (@polyseq R (rmodp p1 q1))) n) *) by rewrite -ltnS (leq_trans _ Sn) // ltn_rmodp. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) case: (eqVneq p 0) => [-> | nzp]. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp (GRing.zero (poly_zmodType R)) q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R (GRing.zero (poly_zmodType R))))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q (GRing.zero (poly_zmodType R))) (GRing.zero (poly_zmodType R)) else rgcdp (rmodp (GRing.zero (poly_zmodType R)) q) q) *) by rewrite rmod0p rmodp0 rgcd0p rgcdp0 if_same. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) case: (eqVneq q 0) => [-> | nzq]. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p (GRing.zero (poly_zmodType R))) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R (GRing.zero (poly_zmodType R)))) then rgcdp (rmodp (GRing.zero (poly_zmodType R)) p) p else rgcdp (rmodp p (GRing.zero (poly_zmodType R))) (GRing.zero (poly_zmodType R))) *) by rewrite rmod0p rmodp0 rgcd0p rgcdp0 if_same. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp p q) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then rgcdp (rmodp q p) p else rgcdp (rmodp p q) q) *) rewrite /rgcdp -/rgcdp_rec. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) q p else @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) p q in if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p1)) p1 q1) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q)) then let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort R) (@polyseq R (rmodp q p)))) (@size (GRing.Ring.sort R) (@polyseq R p)) then @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) p (rmodp q p) else @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp q p) p in if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p1)) p1 q1 else let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort R) (@polyseq R (rmodp p q)))) (@size (GRing.Ring.sort R) (@polyseq R q)) then @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) q (rmodp p q) else @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p q) q in if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p1)) p1 q1) *) case: ltnP; rewrite (negPf nzp, negPf nzq) //=. (* Goal: forall _ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q)) (@size (GRing.Ring.sort R) (@polyseq R p))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p)) p q) (let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort R) (@polyseq R (rmodp p q)))) (@size (GRing.Ring.sort R) (@polyseq R q)) then @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) q (rmodp p q) else @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p q) q in if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p1)) p1 q1) *) (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (@size (GRing.Ring.sort R) (@polyseq R q))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R q)) q p) (let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort R) (@polyseq R (rmodp q p)))) (@size (GRing.Ring.sort R) (@polyseq R p)) then @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) p (rmodp q p) else @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp q p) p in if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p1)) p1 q1) *) move=> ltpq; rewrite ltn_rmodp (negPf nzp) //=. (* Goal: forall _ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q)) (@size (GRing.Ring.sort R) (@polyseq R p))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p)) p q) (let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort R) (@polyseq R (rmodp p q)))) (@size (GRing.Ring.sort R) (@polyseq R q)) then @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) q (rmodp p q) else @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p q) q in if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p1)) p1 q1) *) (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R q)) q p) (if @eq_op (poly_eqType R) p (GRing.zero (poly_zmodType R)) then rmodp q p else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p)) p (rmodp q p)) *) rewrite -(ltn_predK ltpq) /=; case: eqP => [->|]. (* Goal: forall _ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q)) (@size (GRing.Ring.sort R) (@polyseq R p))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p)) p q) (let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort R) (@polyseq R (rmodp p q)))) (@size (GRing.Ring.sort R) (@polyseq R q)) then @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) q (rmodp p q) else @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p q) q in if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p1)) p1 q1) *) (* Goal: forall _ : not (@eq (Equality.sort (poly_eqType R)) (rmodp q p) (GRing.zero (poly_zmodType R))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (Nat.pred (@size (GRing.Ring.sort R) (@polyseq R q))) p (rmodp q p)) (if @eq_op (poly_eqType R) p (GRing.zero (poly_zmodType R)) then rmodp q p else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p)) p (rmodp q p)) *) (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) p (if @eq_op (poly_eqType R) p (GRing.zero (poly_zmodType R)) then GRing.zero (poly_zmodType R) else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p)) p (GRing.zero (poly_zmodType R))) *) by case: (size p) => [|[|s]]; rewrite /= rmodp0 (negPf nzp) // rmod0p eqxx. (* Goal: forall _ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q)) (@size (GRing.Ring.sort R) (@polyseq R p))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p)) p q) (let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort R) (@polyseq R (rmodp p q)))) (@size (GRing.Ring.sort R) (@polyseq R q)) then @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) q (rmodp p q) else @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p q) q in if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p1)) p1 q1) *) (* Goal: forall _ : not (@eq (Equality.sort (poly_eqType R)) (rmodp q p) (GRing.zero (poly_zmodType R))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (Nat.pred (@size (GRing.Ring.sort R) (@polyseq R q))) p (rmodp q p)) (if @eq_op (poly_eqType R) p (GRing.zero (poly_zmodType R)) then rmodp q p else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p)) p (rmodp q p)) *) move/eqP=> nzqp; rewrite (negPf nzp). (* Goal: forall _ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q)) (@size (GRing.Ring.sort R) (@polyseq R p))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p)) p q) (let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort R) (@polyseq R (rmodp p q)))) (@size (GRing.Ring.sort R) (@polyseq R q)) then @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) q (rmodp p q) else @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p q) q in if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p1)) p1 q1) *) (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (Nat.pred (@size (GRing.Ring.sort R) (@polyseq R q))) p (rmodp q p)) (rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p)) p (rmodp q p)) *) apply: Irec => //; last by rewrite ltn_rmodp. (* Goal: forall _ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q)) (@size (GRing.Ring.sort R) (@polyseq R p))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p)) p q) (let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort R) (@polyseq R (rmodp p q)))) (@size (GRing.Ring.sort R) (@polyseq R q)) then @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) q (rmodp p q) else @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p q) q in if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p1)) p1 q1) *) (* Goal: is_true (leq (@size (GRing.Ring.sort R) (@polyseq R (rmodp q p))) (@size (GRing.Ring.sort R) (@polyseq R p))) *) (* Goal: is_true (leq (@size (GRing.Ring.sort R) (@polyseq R (rmodp q p))) (Nat.pred (@size (GRing.Ring.sort R) (@polyseq R q)))) *) by rewrite -ltnS (ltn_predK ltpq) (leq_trans _ ltpq) ?leqW // ltn_rmodp. (* Goal: forall _ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q)) (@size (GRing.Ring.sort R) (@polyseq R p))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p)) p q) (let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort R) (@polyseq R (rmodp p q)))) (@size (GRing.Ring.sort R) (@polyseq R q)) then @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) q (rmodp p q) else @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p q) q in if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p1)) p1 q1) *) (* Goal: is_true (leq (@size (GRing.Ring.sort R) (@polyseq R (rmodp q p))) (@size (GRing.Ring.sort R) (@polyseq R p))) *) by rewrite ltnW // ltn_rmodp. (* Goal: forall _ : is_true (leq (@size (GRing.Ring.sort R) (@polyseq R q)) (@size (GRing.Ring.sort R) (@polyseq R p))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p)) p q) (let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort R) (@polyseq R (rmodp p q)))) (@size (GRing.Ring.sort R) (@polyseq R q)) then @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) q (rmodp p q) else @pair (@poly_of R (Phant (GRing.Ring.sort R))) (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p q) q in if @eq_op (poly_eqType R) p1 (GRing.zero (poly_zmodType R)) then q1 else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p1)) p1 q1) *) move=> leqp; rewrite ltn_rmodp (negPf nzq) //=. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p)) p q) (if @eq_op (poly_eqType R) q (GRing.zero (poly_zmodType R)) then rmodp p q else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R q)) q (rmodp p q)) *) have p_gt0: size p > 0 by rewrite size_poly_gt0. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R p)) p q) (if @eq_op (poly_eqType R) q (GRing.zero (poly_zmodType R)) then rmodp p q else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R q)) q (rmodp p q)) *) rewrite -(prednK p_gt0) /=; case: eqP => [->|]. (* Goal: forall _ : not (@eq (Equality.sort (poly_eqType R)) (rmodp p q) (GRing.zero (poly_zmodType R))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (Nat.pred (@size (GRing.Ring.sort R) (@polyseq R p))) q (rmodp p q)) (if @eq_op (poly_eqType R) q (GRing.zero (poly_zmodType R)) then rmodp p q else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R q)) q (rmodp p q)) *) (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) q (if @eq_op (poly_eqType R) q (GRing.zero (poly_zmodType R)) then GRing.zero (poly_zmodType R) else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R q)) q (GRing.zero (poly_zmodType R))) *) by case: (size q) => [|[|s]]; rewrite /= rmodp0 (negPf nzq) // rmod0p eqxx. (* Goal: forall _ : not (@eq (Equality.sort (poly_eqType R)) (rmodp p q) (GRing.zero (poly_zmodType R))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (Nat.pred (@size (GRing.Ring.sort R) (@polyseq R p))) q (rmodp p q)) (if @eq_op (poly_eqType R) q (GRing.zero (poly_zmodType R)) then rmodp p q else rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R q)) q (rmodp p q)) *) move/eqP=> nzpq; rewrite (negPf nzq). (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rgcdp_rec (Nat.pred (@size (GRing.Ring.sort R) (@polyseq R p))) q (rmodp p q)) (rgcdp_rec (@size (GRing.Ring.sort R) (@polyseq R q)) q (rmodp p q)) *) apply: Irec => //; last by rewrite ltn_rmodp. (* Goal: is_true (leq (@size (GRing.Ring.sort R) (@polyseq R (rmodp p q))) (@size (GRing.Ring.sort R) (@polyseq R q))) *) (* Goal: is_true (leq (@size (GRing.Ring.sort R) (@polyseq R (rmodp p q))) (Nat.pred (@size (GRing.Ring.sort R) (@polyseq R p)))) *) by rewrite -ltnS (prednK p_gt0) (leq_trans _ leqp) // ltn_rmodp. (* Goal: is_true (leq (@size (GRing.Ring.sort R) (@polyseq R (rmodp p q))) (@size (GRing.Ring.sort R) (@polyseq R q))) *) by rewrite ltnW // ltn_rmodp. Qed. Variant comm_redivp_spec m d : nat * {poly R} * {poly R} -> Type := ComEdivnSpec k (q r : {poly R}) of (GRing.comm d (lead_coef d)%:P -> m * (lead_coef d ^+ k)%:P = q * d + r) & (d != 0 -> size r < size d) : comm_redivp_spec m d (k, q, r). Lemma comm_redivpP m d : comm_redivp_spec m d (redivp m d). Proof. (* Goal: comm_redivp_spec m d (redivp m d) *) rewrite unlock; case: (altP (d =P 0))=> [->| Hd]. (* Goal: comm_redivp_spec m d (redivp_rec d O (GRing.zero (poly_zmodType R)) m (@size (GRing.Ring.sort R) (@polyseq R m))) *) (* Goal: comm_redivp_spec m (GRing.zero (poly_zmodType R)) (@pair (prod nat (GRing.Zmodule.sort (poly_zmodType R))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (GRing.Zmodule.sort (poly_zmodType R)) O (GRing.zero (poly_zmodType R))) m) *) by constructor; rewrite !(simp, eqxx). (* Goal: comm_redivp_spec m d (redivp_rec d O (GRing.zero (poly_zmodType R)) m (@size (GRing.Ring.sort R) (@polyseq R m))) *) have: GRing.comm d (lead_coef d)%:P -> m * (lead_coef d ^+ 0)%:P = 0 * d + m. (* Goal: forall _ : forall _ : @GRing.comm (poly_ringType R) d (@polyC R (@lead_coef R d)), @eq (GRing.Ring.sort (poly_ringType R)) (@GRing.mul (poly_ringType R) m (@polyC R (@GRing.exp R (@lead_coef R d) O))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.zero (GRing.Ring.zmodType (poly_ringType R))) d) m), comm_redivp_spec m d (redivp_rec d O (GRing.zero (poly_zmodType R)) m (@size (GRing.Ring.sort R) (@polyseq R m))) *) (* Goal: forall _ : @GRing.comm (poly_ringType R) d (@polyC R (@lead_coef R d)), @eq (GRing.Ring.sort (poly_ringType R)) (@GRing.mul (poly_ringType R) m (@polyC R (@GRing.exp R (@lead_coef R d) O))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.zero (GRing.Ring.zmodType (poly_ringType R))) d) m) *) by rewrite !simp. (* Goal: forall _ : forall _ : @GRing.comm (poly_ringType R) d (@polyC R (@lead_coef R d)), @eq (GRing.Ring.sort (poly_ringType R)) (@GRing.mul (poly_ringType R) m (@polyC R (@GRing.exp R (@lead_coef R d) O))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.zero (GRing.Ring.zmodType (poly_ringType R))) d) m), comm_redivp_spec m d (redivp_rec d O (GRing.zero (poly_zmodType R)) m (@size (GRing.Ring.sort R) (@polyseq R m))) *) elim: (size m) 0%N 0 {1 4 6}m (leqnn (size m))=> [|n IHn] k q r Hr /=. (* Goal: forall _ : forall _ : @GRing.comm (poly_ringType R) d (@polyC R (@lead_coef R d)), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@GRing.mul (poly_ringType R) m (@polyC R (@GRing.exp R (@lead_coef R d) k))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q d) r), comm_redivp_spec m d (if leq (S (@size (GRing.Ring.sort R) (@polyseq R r))) (@size (GRing.Ring.sort R) (@polyseq R d)) then @pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) k q) r else redivp_rec d (S k) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q (@polyC R (@lead_coef R d))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) r (@polyC R (@lead_coef R d))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))))) d))) n) *) (* Goal: forall _ : forall _ : @GRing.comm (poly_ringType R) d (@polyC R (@lead_coef R d)), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@GRing.mul (poly_ringType R) m (@polyC R (@GRing.exp R (@lead_coef R d) k))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q d) r), comm_redivp_spec m d (if leq (S (@size (GRing.Ring.sort R) (@polyseq R r))) (@size (GRing.Ring.sort R) (@polyseq R d)) then @pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) k q) r else @pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) (S k) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q (@polyC R (@lead_coef R d))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) r (@polyC R (@lead_coef R d))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))))) d)))) *) have{Hr} ->: r = 0 by apply/eqP; rewrite -size_poly_eq0; move: Hr; case: size. (* Goal: forall _ : forall _ : @GRing.comm (poly_ringType R) d (@polyC R (@lead_coef R d)), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@GRing.mul (poly_ringType R) m (@polyC R (@GRing.exp R (@lead_coef R d) k))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q d) r), comm_redivp_spec m d (if leq (S (@size (GRing.Ring.sort R) (@polyseq R r))) (@size (GRing.Ring.sort R) (@polyseq R d)) then @pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) k q) r else redivp_rec d (S k) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q (@polyC R (@lead_coef R d))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) r (@polyC R (@lead_coef R d))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))))) d))) n) *) (* Goal: forall _ : forall _ : @GRing.comm (poly_ringType R) d (@polyC R (@lead_coef R d)), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@GRing.mul (poly_ringType R) m (@polyC R (@GRing.exp R (@lead_coef R d) k))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q d) (GRing.zero (GRing.Ring.zmodType (poly_ringType R)))), comm_redivp_spec m d (if leq (S (@size (GRing.Ring.sort R) (@polyseq R (GRing.zero (GRing.Ring.zmodType (poly_ringType R)))))) (@size (GRing.Ring.sort R) (@polyseq R d)) then @pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) k q) (GRing.zero (GRing.Ring.zmodType (poly_ringType R))) else @pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) (S k) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q (@polyC R (@lead_coef R d))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (GRing.zero (GRing.Ring.zmodType (poly_ringType R)))) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R (GRing.zero (GRing.Ring.zmodType (poly_ringType R))))) (@size (GRing.Ring.sort R) (@polyseq R d))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.zero (GRing.Ring.zmodType (poly_ringType R))) (@polyC R (@lead_coef R d))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R (GRing.zero (GRing.Ring.zmodType (poly_ringType R)))) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R (GRing.zero (GRing.Ring.zmodType (poly_ringType R))))) (@size (GRing.Ring.sort R) (@polyseq R d))))) d)))) *) suff hsd: size (0: {poly R}) < size d by rewrite hsd => /= ?; constructor. (* Goal: forall _ : forall _ : @GRing.comm (poly_ringType R) d (@polyC R (@lead_coef R d)), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@GRing.mul (poly_ringType R) m (@polyC R (@GRing.exp R (@lead_coef R d) k))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q d) r), comm_redivp_spec m d (if leq (S (@size (GRing.Ring.sort R) (@polyseq R r))) (@size (GRing.Ring.sort R) (@polyseq R d)) then @pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) k q) r else redivp_rec d (S k) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q (@polyC R (@lead_coef R d))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) r (@polyC R (@lead_coef R d))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))))) d))) n) *) (* Goal: is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R (GRing.zero (poly_zmodType R))))) (@size (GRing.Ring.sort R) (@polyseq R d))) *) by rewrite size_polyC eqxx (polySpred Hd). (* Goal: forall _ : forall _ : @GRing.comm (poly_ringType R) d (@polyC R (@lead_coef R d)), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@GRing.mul (poly_ringType R) m (@polyC R (@GRing.exp R (@lead_coef R d) k))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q d) r), comm_redivp_spec m d (if leq (S (@size (GRing.Ring.sort R) (@polyseq R r))) (@size (GRing.Ring.sort R) (@polyseq R d)) then @pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) k q) r else redivp_rec d (S k) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q (@polyC R (@lead_coef R d))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) r (@polyC R (@lead_coef R d))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))))) d))) n) *) case: ltP=> Hlt Heq; first by constructor=> // _; apply/ltP. (* Goal: comm_redivp_spec m d (redivp_rec d (S k) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q (@polyC R (@lead_coef R d))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) r (@polyC R (@lead_coef R d))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))))) d))) n) *) apply: IHn=> [|Cda]; last first. (* Goal: is_true (leq (@size (GRing.Ring.sort R) (@polyseq R (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) r (@polyC R (@lead_coef R d))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))))) d))))) n) *) (* Goal: @eq (GRing.Ring.sort (poly_ringType R)) (@GRing.mul (poly_ringType R) m (@polyC R (@GRing.exp R (@lead_coef R d) (S k)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q (@polyC R (@lead_coef R d))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))) d) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) r (@polyC R (@lead_coef R d))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))))) d)))) *) rewrite mulrDl addrAC -addrA subrK exprSr polyC_mul mulrA Heq //. (* Goal: is_true (leq (@size (GRing.Ring.sort R) (@polyseq R (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) r (@polyC R (@lead_coef R d))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))))) d))))) n) *) (* Goal: @eq (GRing.Ring.sort (poly_ringType R)) (@GRing.mul (poly_ringType R) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q d) r) (@polyC R (@lead_coef R d))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@GRing.mul (poly_ringType R) q (@polyC R (@lead_coef R d))) d) (@GRing.mul (poly_ringType R) r (@polyC R (@lead_coef R d)))) *) by rewrite mulrDl -mulrA Cda mulrA. (* Goal: is_true (leq (@size (GRing.Ring.sort R) (@polyseq R (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) r (@polyC R (@lead_coef R d))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))))) d))))) n) *) apply/leq_sizeP => j Hj. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) r (@polyC R (@lead_coef R d))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))))) d)))) j) (GRing.zero (GRing.Ring.zmodType R)) *) rewrite coefD coefN coefMC -scalerAl coefZ coefXnM. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@GRing.add (GRing.Ring.zmodType R) (@GRing.mul R (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R r) j) (@lead_coef R d)) (@GRing.opp (GRing.Ring.zmodType R) (@GRing.mul R (@lead_coef R r) (if leq (S j) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))) then GRing.zero (GRing.Ring.zmodType R) else @nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R d) (subn j (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))))) (GRing.zero (GRing.Ring.zmodType R)) *) move/ltP: Hlt; rewrite -leqNgt=> Hlt. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@GRing.add (GRing.Ring.zmodType R) (@GRing.mul R (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R r) j) (@lead_coef R d)) (@GRing.opp (GRing.Ring.zmodType R) (@GRing.mul R (@lead_coef R r) (if leq (S j) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))) then GRing.zero (GRing.Ring.zmodType R) else @nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R d) (subn j (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))))) (GRing.zero (GRing.Ring.zmodType R)) *) move: Hj; rewrite leq_eqVlt; case/predU1P => [<-{j} | Hj]; last first. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@GRing.add (GRing.Ring.zmodType R) (@GRing.mul R (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R r) n) (@lead_coef R d)) (@GRing.opp (GRing.Ring.zmodType R) (@GRing.mul R (@lead_coef R r) (if leq (S n) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))) then GRing.zero (GRing.Ring.zmodType R) else @nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R d) (subn n (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))))) (GRing.zero (GRing.Ring.zmodType R)) *) (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@GRing.add (GRing.Ring.zmodType R) (@GRing.mul R (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R r) j) (@lead_coef R d)) (@GRing.opp (GRing.Ring.zmodType R) (@GRing.mul R (@lead_coef R r) (if leq (S j) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))) then GRing.zero (GRing.Ring.zmodType R) else @nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R d) (subn j (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))))) (GRing.zero (GRing.Ring.zmodType R)) *) rewrite nth_default ?(leq_trans Hqq) // ?simp; last by apply: (leq_trans Hr). (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@GRing.add (GRing.Ring.zmodType R) (@GRing.mul R (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R r) n) (@lead_coef R d)) (@GRing.opp (GRing.Ring.zmodType R) (@GRing.mul R (@lead_coef R r) (if leq (S n) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))) then GRing.zero (GRing.Ring.zmodType R) else @nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R d) (subn n (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))))) (GRing.zero (GRing.Ring.zmodType R)) *) (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@GRing.opp (GRing.Ring.zmodType R) (@GRing.mul R (@lead_coef R r) (if leq (S j) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))) then GRing.zero (GRing.Ring.zmodType R) else @nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R d) (subn j (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))))))) (GRing.zero (GRing.Ring.zmodType R)) *) rewrite nth_default; first by rewrite if_same !simp oppr0. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@GRing.add (GRing.Ring.zmodType R) (@GRing.mul R (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R r) n) (@lead_coef R d)) (@GRing.opp (GRing.Ring.zmodType R) (@GRing.mul R (@lead_coef R r) (if leq (S n) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))) then GRing.zero (GRing.Ring.zmodType R) else @nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R d) (subn n (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))))) (GRing.zero (GRing.Ring.zmodType R)) *) (* Goal: is_true (leq (@size (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@polyseq R d)) (subn j (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))))) *) by rewrite -{1}(subKn Hlt) leq_sub2r // (leq_trans Hr). (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@GRing.add (GRing.Ring.zmodType R) (@GRing.mul R (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R r) n) (@lead_coef R d)) (@GRing.opp (GRing.Ring.zmodType R) (@GRing.mul R (@lead_coef R r) (if leq (S n) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))) then GRing.zero (GRing.Ring.zmodType R) else @nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R d) (subn n (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))))) (GRing.zero (GRing.Ring.zmodType R)) *) move: Hr; rewrite leq_eqVlt ltnS; case/predU1P=> Hqq; last first. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@GRing.add (GRing.Ring.zmodType R) (@GRing.mul R (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R r) n) (@lead_coef R d)) (@GRing.opp (GRing.Ring.zmodType R) (@GRing.mul R (@lead_coef R r) (if leq (S n) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))) then GRing.zero (GRing.Ring.zmodType R) else @nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R d) (subn n (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))))) (GRing.zero (GRing.Ring.zmodType R)) *) (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@GRing.add (GRing.Ring.zmodType R) (@GRing.mul R (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R r) n) (@lead_coef R d)) (@GRing.opp (GRing.Ring.zmodType R) (@GRing.mul R (@lead_coef R r) (if leq (S n) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))) then GRing.zero (GRing.Ring.zmodType R) else @nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R d) (subn n (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))))) (GRing.zero (GRing.Ring.zmodType R)) *) rewrite !nth_default ?if_same ?simp ?oppr0 //. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@GRing.add (GRing.Ring.zmodType R) (@GRing.mul R (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R r) n) (@lead_coef R d)) (@GRing.opp (GRing.Ring.zmodType R) (@GRing.mul R (@lead_coef R r) (if leq (S n) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))) then GRing.zero (GRing.Ring.zmodType R) else @nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R d) (subn n (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))))) (GRing.zero (GRing.Ring.zmodType R)) *) (* Goal: is_true (leq (@size (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@polyseq R d)) (subn n (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))))) *) by rewrite -{1}(subKn Hlt) leq_sub2r // (leq_trans Hqq). (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@GRing.add (GRing.Ring.zmodType R) (@GRing.mul R (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R r) n) (@lead_coef R d)) (@GRing.opp (GRing.Ring.zmodType R) (@GRing.mul R (@lead_coef R r) (if leq (S n) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d))) then GRing.zero (GRing.Ring.zmodType R) else @nth (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R d) (subn n (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (@size (GRing.Ring.sort R) (@polyseq R d)))))))) (GRing.zero (GRing.Ring.zmodType R)) *) rewrite {2}/lead_coef Hqq polySpred // subSS ltnNge leq_subr /=. (* Goal: @eq (GRing.Ring.sort R) (@GRing.add (GRing.Ring.zmodType R) (@GRing.mul R (@nth (GRing.Ring.sort R) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R r) n) (@lead_coef R d)) (@GRing.opp (GRing.Ring.zmodType R) (@GRing.mul R (@nth (GRing.Ring.sort R) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R r) n) (@nth (GRing.Ring.sort R) (GRing.zero (GRing.Ring.zmodType R)) (@polyseq R d) (subn n (subn n (Nat.pred (@size (GRing.Ring.sort R) (@polyseq R d))))))))) (GRing.zero (GRing.Ring.zmodType R)) *) by rewrite subKn ?addrN // -subn1 leq_subLR add1n -Hqq. Qed. Lemma rmodpp p : GRing.comm p (lead_coef p)%:P -> rmodp p p = 0. Proof. (* Goal: forall _ : @GRing.comm (poly_ringType R) p (@polyC R (@lead_coef R p)), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rmodp p p) (GRing.zero (poly_zmodType R)) *) move=> hC; rewrite /rmodp unlock; case: ifP => hp /=; first by rewrite (eqP hp). (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@snd (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (redivp_rec p O (GRing.zero (poly_zmodType R)) p (@size (GRing.Ring.sort R) (@polyseq R p)))) (GRing.zero (poly_zmodType R)) *) move: (hp); rewrite -size_poly_eq0 /redivp_rec; case sp: (size p)=> [|n] // _. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@snd (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (if leq (S (@size (GRing.Ring.sort R) (@polyseq R p))) (S n) then @pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) O (GRing.zero (poly_zmodType R))) p else (fix loop (k : nat) (qq r : @poly_of R (Phant (GRing.Ring.sort R))) (n : nat) {struct n} : prod (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) := if leq (S (@size (GRing.Ring.sort R) (@polyseq R r))) (S n) then @pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) k qq) r else match n with | O => @pair (prod nat (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType R)))) (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType R))) (@pair nat (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType R))) (S k) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) qq (@polyC R (@lead_coef R p))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (S n)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) r (@polyC R (@lead_coef R p))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (S n)))) p))) | S n1 => loop (S k) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) qq (@polyC R (@lead_coef R p))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (S n))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) r (@polyC R (@lead_coef R p))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (S n)))) p))) n1 end) (S O) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (GRing.zero (poly_zmodType R)) (@polyC R (@lead_coef R p))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R p) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R p)) (S n))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) p (@polyC R (@lead_coef R p))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R p) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R p)) (S n)))) p))) n)) (GRing.zero (poly_zmodType R)) *) rewrite mul0r sp ltnn add0r subnn expr0 hC alg_polyC subrr. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@snd (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) ((fix loop (k : nat) (qq r : @poly_of R (Phant (GRing.Ring.sort R))) (n : nat) {struct n} : prod (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) := if leq (S (@size (GRing.Ring.sort R) (@polyseq R r))) (S n) then @pair (prod nat (@poly_of R (Phant (GRing.Ring.sort R)))) (@poly_of R (Phant (GRing.Ring.sort R))) (@pair nat (@poly_of R (Phant (GRing.Ring.sort R))) k qq) r else match n with | O => @pair (prod nat (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType R)))) (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType R))) (@pair nat (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType R))) (S k) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) qq (@polyC R (@lead_coef R p))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (S n)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) r (@polyC R (@lead_coef R p))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (S n)))) p))) | S n1 => loop (S k) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) qq (@polyC R (@lead_coef R p))) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (S n))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) r (@polyC R (@lead_coef R p))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R))) (@GRing.mul (@GRing.Lalgebra.ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@GRing.scale R (@GRing.Lalgebra.lmod_ringType R (Phant (GRing.Ring.sort R)) (poly_lalgType R)) (@lead_coef R r) (@GRing.exp (poly_ringType R) (polyX R) (subn (@size (GRing.Ring.sort R) (@polyseq R r)) (S n)))) p))) n1 end) (S O) (@polyC R (@lead_coef R p)) (GRing.zero (GRing.Ring.zmodType (poly_ringType R))) n)) (GRing.zero (poly_zmodType R)) *) by case: n sp => [|n] sp; rewrite size_polyC /= eqxx. Qed. Definition rcoprimep (p q : {poly R}) := size (rgcdp p q) == 1%N. Fixpoint rgdcop_rec q p n := if n is m.+1 then if rcoprimep p q then p else rgdcop_rec q (rdivp p (rgcdp p q)) m else (q == 0)%:R. Definition rgdcop q p := rgdcop_rec q p (size p). Lemma rgdcop0 q : rgdcop q 0 = (q == 0)%:R. Proof. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType R))) (rgdcop q (GRing.zero (poly_zmodType R))) (@GRing.natmul (GRing.Ring.zmodType (poly_ringType R)) (GRing.one (poly_ringType R)) (nat_of_bool (@eq_op (poly_eqType R) q (GRing.zero (poly_zmodType R))))) *) by rewrite /rgdcop size_poly0. Qed. End RingPseudoDivision. End CommonRing. Module RingComRreg. Import CommonRing. Section ComRegDivisor. Variable R : ringType. Variable d : {poly R}. Hypothesis Cdl : GRing.comm d (lead_coef d)%:P. Hypothesis Rreg : GRing.rreg (lead_coef d). Implicit Types p q r : {poly R}. Lemma redivp_eq q r : size r < size d -> let k := (redivp (q * d + r) d).1.1 in Lemma rdivp_eq p : p * (lead_coef d ^+ (rscalp p d))%:P = (rdivp p d) * d + (rmodp p d). Proof. (* Goal: @eq (GRing.Ring.sort (poly_ringType R)) (@GRing.mul (poly_ringType R) p (@polyC R (@GRing.exp R (@lead_coef R d) (@rscalp R p d)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@rdivp R p d) d) (@rmodp R p d)) *) by rewrite /rdivp /rmodp /rscalp; case: comm_redivpP=> k q1 r1 Hc _; apply: Hc. Qed. Lemma eq_rdvdp k q1 p: p * ((lead_coef d)^+ k)%:P = q1 * d -> rdvdp d p. Proof. (* Goal: forall _ : @eq (GRing.Ring.sort (poly_ringType R)) (@GRing.mul (poly_ringType R) p (@polyC R (@GRing.exp R (@lead_coef R d) k))) (@GRing.mul (poly_ringType R) q1 d), is_true (@rdvdp R d p) *) move=> he. (* Goal: is_true (@rdvdp R d p) *) have Hnq0 := rreg_lead0 Rreg; set lq := lead_coef d. (* Goal: is_true (@rdvdp R d p) *) pose v := rscalp p d; pose m := maxn v k. (* Goal: is_true (@rdvdp R d p) *) rewrite /rdvdp -(rreg_polyMC_eq0 _ (@rregX _ _ (m - v) Rreg)). (* Goal: is_true (@eq_op (GRing.Ring.eqType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@rmodp R p d) (@polyC R (@GRing.exp R (@lead_coef R d) (subn m v)))) (GRing.zero (GRing.Ring.zmodType (poly_ringType R)))) *) suff: ((rdivp p d) * (lq ^+ (m - v))%:P - q1 * (lq ^+ (m - k))%:P) * d + (rmodp p d) * (lq ^+ (m - v))%:P == 0. (* Goal: is_true (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (poly_ringType R))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@rdivp R p d) (@polyC R (@GRing.exp R lq (subn m v)))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q1 (@polyC R (@GRing.exp R lq (subn m k)))))) d) (@GRing.mul (poly_ringType R) (@rmodp R p d) (@polyC R (@GRing.exp R lq (subn m v))))) (GRing.zero (GRing.Ring.zmodType (poly_ringType R)))) *) (* Goal: forall _ : is_true (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (poly_ringType R))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@rdivp R p d) (@polyC R (@GRing.exp R lq (subn m v)))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q1 (@polyC R (@GRing.exp R lq (subn m k)))))) d) (@GRing.mul (poly_ringType R) (@rmodp R p d) (@polyC R (@GRing.exp R lq (subn m v))))) (GRing.zero (GRing.Ring.zmodType (poly_ringType R)))), is_true (@eq_op (GRing.Ring.eqType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@rmodp R p d) (@polyC R (@GRing.exp R (@lead_coef R d) (subn m v)))) (GRing.zero (GRing.Ring.zmodType (poly_ringType R)))) *) rewrite rreg_div0 //; first by case/andP. (* Goal: is_true (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (poly_ringType R))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@rdivp R p d) (@polyC R (@GRing.exp R lq (subn m v)))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q1 (@polyC R (@GRing.exp R lq (subn m k)))))) d) (@GRing.mul (poly_ringType R) (@rmodp R p d) (@polyC R (@GRing.exp R lq (subn m v))))) (GRing.zero (GRing.Ring.zmodType (poly_ringType R)))) *) (* Goal: is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R (@GRing.mul (poly_ringType R) (@rmodp R p d) (@polyC R (@GRing.exp R lq (subn m v))))))) (@size (GRing.Ring.sort R) (@polyseq R d))) *) by rewrite rreg_size ?ltn_rmodp //; apply rregX. (* Goal: is_true (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (poly_ringType R))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@rdivp R p d) (@polyC R (@GRing.exp R lq (subn m v)))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q1 (@polyC R (@GRing.exp R lq (subn m k)))))) d) (@GRing.mul (poly_ringType R) (@rmodp R p d) (@polyC R (@GRing.exp R lq (subn m v))))) (GRing.zero (GRing.Ring.zmodType (poly_ringType R)))) *) rewrite mulrDl addrAC mulNr -!mulrA polyC_exp -(GRing.commrX (m-v) Cdl). (* Goal: is_true (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (poly_ringType R))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@rdivp R p d) (@GRing.mul (poly_ringType R) d (@GRing.exp (poly_ringType R) (@polyC R (@lead_coef R d)) (subn m v)))) (@GRing.mul (poly_ringType R) (@rmodp R p d) (@GRing.exp (poly_ringType R) (@polyC R lq) (subn m v)))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q1 (@GRing.mul (poly_ringType R) (@polyC R (@GRing.exp R lq (subn m k))) d)))) (GRing.zero (GRing.Ring.zmodType (poly_ringType R)))) *) rewrite -polyC_exp mulrA -mulrDl -rdivp_eq // [(_ ^+ (m - k))%:P]polyC_exp. (* Goal: is_true (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (poly_ringType R))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@GRing.mul (poly_ringType R) p (@polyC R (@GRing.exp R (@lead_coef R d) (@rscalp R p d)))) (@polyC R (@GRing.exp R (@lead_coef R d) (subn m v)))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q1 (@GRing.mul (poly_ringType R) (@GRing.exp (poly_ringType R) (@polyC R lq) (subn m k)) d)))) (GRing.zero (GRing.Ring.zmodType (poly_ringType R)))) *) rewrite -(GRing.commrX (m-k) Cdl) -polyC_exp mulrA -he -!mulrA -!polyC_mul. (* Goal: is_true (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (poly_ringType R))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) p (@polyC R (@GRing.mul R (@GRing.exp R (@lead_coef R d) (@rscalp R p d)) (@GRing.exp R (@lead_coef R d) (subn m v))))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) p (@polyC R (@GRing.mul R (@GRing.exp R (@lead_coef R d) k) (@GRing.exp R (@lead_coef R d) (subn m k))))))) (GRing.zero (GRing.Ring.zmodType (poly_ringType R)))) *) rewrite -/v -!exprD addnC subnK ?leq_maxl //. (* Goal: is_true (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (poly_ringType R))) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) p (@polyC R (@GRing.exp R (@lead_coef R d) m))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) p (@polyC R (@GRing.exp R (@lead_coef R d) (addn k (subn m k))))))) (GRing.zero (GRing.Ring.zmodType (poly_ringType R)))) *) by rewrite addnC subnK ?subrr ?leq_maxr. Qed. Variant rdvdp_spec p q : {poly R} -> bool -> Type := | Rdvdp k q1 & p * ((lead_coef q)^+ k)%:P = q1 * q : rdvdp_spec p q 0 true | RdvdpN & rmodp p q != 0 : rdvdp_spec p q (rmodp p q) false. Lemma rdvdp_eqP p : rdvdp_spec p d (rmodp p d) (rdvdp d p). Lemma rdvdp_mull p : rdvdp d (p * d). Proof. (* Goal: is_true (@rdvdp R d (@GRing.mul (poly_ringType R) p d)) *) by apply: (@eq_rdvdp 0%N p); rewrite expr0 mulr1. Qed. Lemma rmodp_mull p : rmodp (p * d) d = 0. Proof. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rmodp R (@GRing.mul (poly_ringType R) p d) d) (GRing.zero (poly_zmodType R)) *) case: (d =P 0)=> Hd; first by rewrite Hd simp rmod0p. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rmodp R (@GRing.mul (poly_ringType R) p d) d) (GRing.zero (poly_zmodType R)) *) by apply/eqP; apply: rdvdp_mull. Qed. Lemma rmodpp : rmodp d d = 0. Lemma rdivpp : rdivp d d = (lead_coef d ^+ rscalp d d)%:P. Proof. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rdivp R d d) (@polyC R (@GRing.exp R (@lead_coef R d) (@rscalp R d d))) *) have dn0 : d != 0 by rewrite -lead_coef_eq0 rreg_neq0. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rdivp R d d) (@polyC R (@GRing.exp R (@lead_coef R d) (@rscalp R d d))) *) move: (rdivp_eq d); rewrite rmodpp addr0. (* Goal: forall _ : @eq (GRing.Ring.sort (poly_ringType R)) (@GRing.mul (poly_ringType R) d (@polyC R (@GRing.exp R (@lead_coef R d) (@rscalp R d d)))) (@GRing.mul (poly_ringType R) (@rdivp R d d) d), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rdivp R d d) (@polyC R (@GRing.exp R (@lead_coef R d) (@rscalp R d d))) *) suff ->: GRing.comm d (lead_coef d ^+ rscalp d d)%:P by move/(rreg_lead Rreg)->. (* Goal: @GRing.comm (poly_ringType R) d (@polyC R (@GRing.exp R (@lead_coef R d) (@rscalp R d d))) *) by rewrite polyC_exp; apply: commrX. Qed. Lemma rdvdpp : rdvdp d d. Proof. (* Goal: is_true (@rdvdp R d d) *) by apply/eqP; apply: rmodpp. Qed. Lemma rdivpK p : rdvdp d p -> (rdivp p d) * d = p * (lead_coef d ^+ rscalp p d)%:P. Proof. (* Goal: forall _ : is_true (@rdvdp R d p), @eq (GRing.Ring.sort (poly_ringType R)) (@GRing.mul (poly_ringType R) (@rdivp R p d) d) (@GRing.mul (poly_ringType R) p (@polyC R (@GRing.exp R (@lead_coef R d) (@rscalp R p d)))) *) by rewrite rdivp_eq /rdvdp; move/eqP->; rewrite addr0. Qed. End ComRegDivisor. End RingComRreg. Module RingMonic. Import CommonRing. Import RingComRreg. Section MonicDivisor. Variable R : ringType. Implicit Types p q r : {poly R}. Variable d : {poly R}. Hypothesis mond : d \is monic. Lemma redivp_eq q r : size r < size d -> let k := (redivp (q * d + r) d).1.1 in Lemma rdivp_eq p : p = (rdivp p d) * d + (rmodp p d). Lemma rdivpp : rdivp d d = 1. Lemma rdivp_addl_mul_small q r : size r < size d -> rdivp (q * d + r) d = q. Proof. (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R r))) (@size (GRing.Ring.sort R) (@polyseq R d))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rdivp R (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q d) r) d) q *) by move=> Hd; case: (monic_comreg mond)=> Hc Hr; rewrite /rdivp redivp_eq. Qed. Lemma rdivp_addl_mul q r : rdivp (q * d + r) d = q + rdivp r d. Proof. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rdivp R (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q d) r) d) (@GRing.add (poly_zmodType R) q (@rdivp R r d)) *) case: (monic_comreg mond)=> Hc Hr; rewrite {1}(rdivp_eq r) addrA. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rdivp R (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q d) (@GRing.mul (poly_ringType R) (@rdivp R r d) d)) (@rmodp R r d)) d) (@GRing.add (poly_zmodType R) q (@rdivp R r d)) *) by rewrite -mulrDl rdivp_addl_mul_small // ltn_rmodp monic_neq0. Qed. Lemma rdivp_addl q r : rdvdp d q -> rdivp (q + r) d = rdivp q d + rdivp r d. Proof. (* Goal: forall _ : is_true (@rdvdp R d q), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rdivp R (@GRing.add (poly_zmodType R) q r) d) (@GRing.add (poly_zmodType R) (@rdivp R q d) (@rdivp R r d)) *) case: (monic_comreg mond)=> Hc Hr; rewrite {1}(rdivp_eq r) addrA. (* Goal: forall _ : is_true (@rdvdp R d q), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rdivp R (@GRing.add (poly_zmodType R) (@GRing.add (poly_zmodType R) q (@GRing.mul (poly_ringType R) (@rdivp R r d) d)) (@rmodp R r d)) d) (@GRing.add (poly_zmodType R) (@rdivp R q d) (@rdivp R r d)) *) rewrite {2}(rdivp_eq q); move/rmodp_eq0P->; rewrite addr0. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rdivp R (@GRing.add (poly_zmodType R) (@GRing.add (poly_zmodType R) (@GRing.mul (poly_ringType R) (@rdivp R q d) d) (@GRing.mul (poly_ringType R) (@rdivp R r d) d)) (@rmodp R r d)) d) (@GRing.add (poly_zmodType R) (@rdivp R q d) (@rdivp R r d)) *) by rewrite -mulrDl rdivp_addl_mul_small // ltn_rmodp monic_neq0. Qed. Lemma rdivp_addr q r : rdvdp d r -> rdivp (q + r) d = rdivp q d + rdivp r d. Proof. (* Goal: forall _ : is_true (@rdvdp R d r), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rdivp R (@GRing.add (poly_zmodType R) q r) d) (@GRing.add (poly_zmodType R) (@rdivp R q d) (@rdivp R r d)) *) by rewrite addrC; move/rdivp_addl->; rewrite addrC. Qed. Lemma rdivp_mull p : rdivp (p * d) d = p. Proof. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rdivp R (@GRing.mul (poly_ringType R) p d) d) p *) by rewrite -[p * d]addr0 rdivp_addl_mul rdiv0p addr0. Qed. Lemma rmodp_mull p : rmodp (p * d) d = 0. Lemma rmodpp : rmodp d d = 0. Lemma rmodp_addl_mul_small q r : size r < size d -> rmodp (q * d + r) d = r. Proof. (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort R) (@polyseq R r))) (@size (GRing.Ring.sort R) (@polyseq R d))), @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rmodp R (@GRing.add (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) q d) r) d) r *) by move=> Hd; case: (monic_comreg mond)=> Hc Hr; rewrite /rmodp redivp_eq. Qed. Lemma rmodp_add p q : rmodp (p + q) d = rmodp p d + rmodp q d. Lemma rmodp_mulmr p q : rmodp (p * (rmodp q d)) d = rmodp (p * q) d. Proof. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rmodp R (@GRing.mul (poly_ringType R) p (@rmodp R q d)) d) (@rmodp R (@GRing.mul (poly_ringType R) p q) d) *) have -> : rmodp q d = q - (rdivp q d) * d. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rmodp R (@GRing.mul (poly_ringType R) p (@GRing.add (poly_zmodType R) q (@GRing.opp (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@rdivp R q d) d)))) d) (@rmodp R (@GRing.mul (poly_ringType R) p q) d) *) (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rmodp R q d) (@GRing.add (poly_zmodType R) q (@GRing.opp (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@rdivp R q d) d))) *) by rewrite {2}(rdivp_eq q) addrAC subrr add0r. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@rmodp R (@GRing.mul (poly_ringType R) p (@GRing.add (poly_zmodType R) q (@GRing.opp (GRing.Ring.zmodType (poly_ringType R)) (@GRing.mul (poly_ringType R) (@rdivp R q d) d)))) d) (@rmodp R (@GRing.mul (poly_ringType R) p q) d) *) rewrite mulrDr rmodp_add -mulNr mulrA. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (@GRing.add (poly_zmodType R) (@rmodp R (@GRing.mul (poly_ringType R) p q) d) (@rmodp R (@GRing.mul (poly_ringType R) (@GRing.mul (poly_ringType R) p (@GRing.opp (GRing.Ring.zmodType (poly_ringType R)) (@rdivp R q d))) d) d)) (@rmodp R (@GRing.mul (poly_ringType R) p q) d) *) by rewrite -{2}[rmodp _ _]addr0; congr (_ + _); apply: rmodp_mull. Qed. Lemma rdvdpp : rdvdp d d. Lemma eq_rdvdp q1 p : p = q1 * d -> rdvdp d p. Lemma rdvdp_mull p : rdvdp d (p * d). Lemma rdvdpP p : reflect (exists qq, p = qq * d) (rdvdp d p). Lemma rdivpK p : rdvdp d p -> (rdivp p d) * d = p. End MonicDivisor. End RingMonic. Module Ring. Include CommonRing. Import RingMonic. Section ExtraMonicDivisor. Variable R : ringType. Implicit Types d p q r : {poly R}. Lemma rdivp1 p : rdivp p 1 = p. Proof. (* Goal: @eq (@poly_of R (Phant (GRing.Ring.sort R))) (rdivp R p (GRing.one (poly_ringType R))) p *) by rewrite -{1}(mulr1 p) rdivp_mull // monic1. Qed. Lemma rdvdp_XsubCl p x : rdvdp ('X - x%:P) p = root p x. Lemma polyXsubCP p x : reflect (p.[x] = 0) (rdvdp ('X - x%:P) p). Proof. (* Goal: Bool.reflect (@eq (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@horner R p x) (GRing.zero (GRing.Ring.zmodType R))) (rdvdp R (@GRing.add (poly_zmodType R) (polyX R) (@GRing.opp (poly_zmodType R) (@polyC R x))) p) *) by apply: (iffP idP); rewrite rdvdp_XsubCl; move/rootP. Qed. Lemma root_factor_theorem p x : root p x = (rdvdp ('X - x%:P) p). Proof. (* Goal: @eq bool (@root R p x) (rdvdp R (@GRing.add (poly_zmodType R) (polyX R) (@GRing.opp (poly_zmodType R) (@polyC R x))) p) *) by rewrite rdvdp_XsubCl. Qed. End ExtraMonicDivisor. End Ring. Module ComRing. Import Ring. Import RingComRreg. Section CommutativeRingPseudoDivision. Variable R : comRingType. Implicit Types d p q m n r : {poly R}. Variant redivp_spec (m d : {poly R}) : nat * {poly R} * {poly R} -> Type := EdivnSpec k (q r: {poly R}) of (lead_coef d ^+ k) *: m = q * d + r & (d != 0 -> size r < size d) : redivp_spec m d (k, q, r). Lemma redivpP m d : redivp_spec m d (redivp m d). Proof. (* Goal: redivp_spec m d (redivp (GRing.ComRing.ringType R) m d) *) rewrite redivp_def; constructor; last by move=> dn0; rewrite ltn_rmodp. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComRing.ringType R) (Phant (GRing.Ring.sort (GRing.ComRing.ringType R))) (poly_lmodType (GRing.ComRing.ringType R))) (@GRing.Lmodule.base (GRing.ComRing.ringType R) (@GRing.Lmodule.sort (GRing.ComRing.ringType R) (Phant (GRing.Ring.sort (GRing.ComRing.ringType R))) (poly_lmodType (GRing.ComRing.ringType R))) (@GRing.Lmodule.class (GRing.ComRing.ringType R) (Phant (GRing.Ring.sort (GRing.ComRing.ringType R))) (poly_lmodType (GRing.ComRing.ringType R)))))) (@GRing.scale (GRing.ComRing.ringType R) (poly_lmodType (GRing.ComRing.ringType R)) (@GRing.exp (GRing.ComRing.ringType R) (@lead_coef (GRing.ComRing.ringType R) d) (rscalp (GRing.ComRing.ringType R) m d)) m) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.ComRing.ringType R))) (@GRing.mul (poly_ringType (GRing.ComRing.ringType R)) (rdivp (GRing.ComRing.ringType R) m d) d) (rmodp (GRing.ComRing.ringType R) m d)) *) by rewrite -mul_polyC mulrC rdivp_eq //= /GRing.comm mulrC. Qed. Lemma rdivp_eq d p : (lead_coef d ^+ (rscalp p d)) *: p = (rdivp p d) * d + (rmodp p d). Lemma rdvdp_eqP d p : rdvdp_spec p d (rmodp p d) (rdvdp d p). Lemma rdvdp_eq q p : (rdvdp q p) = ((lead_coef q) ^+ (rscalp p q) *: p == (rdivp p q) * q). Proof. (* Goal: @eq bool (rdvdp (GRing.ComRing.ringType R) q p) (@eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComRing.ringType R) (Phant (GRing.Ring.sort (GRing.ComRing.ringType R))) (poly_lmodType (GRing.ComRing.ringType R))) (@GRing.Lmodule.base (GRing.ComRing.ringType R) (@GRing.Lmodule.sort (GRing.ComRing.ringType R) (Phant (GRing.Ring.sort (GRing.ComRing.ringType R))) (poly_lmodType (GRing.ComRing.ringType R))) (@GRing.Lmodule.class (GRing.ComRing.ringType R) (Phant (GRing.Ring.sort (GRing.ComRing.ringType R))) (poly_lmodType (GRing.ComRing.ringType R)))))) (@GRing.scale (GRing.ComRing.ringType R) (poly_lmodType (GRing.ComRing.ringType R)) (@GRing.exp (GRing.ComRing.ringType R) (@lead_coef (GRing.ComRing.ringType R) q) (rscalp (GRing.ComRing.ringType R) p q)) p) (@GRing.mul (poly_ringType (GRing.ComRing.ringType R)) (rdivp (GRing.ComRing.ringType R) p q) q)) *) apply/rmodp_eq0P/eqP; rewrite rdivp_eq; first by move->; rewrite addr0. (* Goal: forall _ : @eq (Equality.sort (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComRing.ringType R) (Phant (GRing.Ring.sort (GRing.ComRing.ringType R))) (poly_lmodType (GRing.ComRing.ringType R))) (@GRing.Lmodule.base (GRing.ComRing.ringType R) (@GRing.Lmodule.sort (GRing.ComRing.ringType R) (Phant (GRing.Ring.sort (GRing.ComRing.ringType R))) (poly_lmodType (GRing.ComRing.ringType R))) (@GRing.Lmodule.class (GRing.ComRing.ringType R) (Phant (GRing.Ring.sort (GRing.ComRing.ringType R))) (poly_lmodType (GRing.ComRing.ringType R))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.ComRing.ringType R))) (@GRing.mul (poly_ringType (GRing.ComRing.ringType R)) (rdivp (GRing.ComRing.ringType R) p q) q) (rmodp (GRing.ComRing.ringType R) p q)) (@GRing.mul (poly_ringType (GRing.ComRing.ringType R)) (rdivp (GRing.ComRing.ringType R) p q) q), @eq (@poly_of (GRing.ComRing.ringType R) (Phant (GRing.Ring.sort (GRing.ComRing.ringType R)))) (rmodp (GRing.ComRing.ringType R) p q) (GRing.zero (poly_zmodType (GRing.ComRing.ringType R))) *) by move/eqP; rewrite eq_sym addrC -subr_eq subrr; move/eqP->. Qed. End CommutativeRingPseudoDivision. End ComRing. Module UnitRing. Import Ring. Section UnitRingPseudoDivision. Variable R : unitRingType. Implicit Type p q r d : {poly R}. Lemma uniq_roots_rdvdp p rs : all (root p) rs -> uniq_roots rs -> rdvdp (\prod_(z <- rs) ('X - z%:P)) p. Proof. (* Goal: forall (_ : is_true (@all (GRing.Ring.sort (GRing.UnitRing.ringType R)) (@root (GRing.UnitRing.ringType R) p) rs)) (_ : is_true (@uniq_roots R rs)), is_true (rdvdp (GRing.UnitRing.ringType R) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.UnitRing.ringType R))) (GRing.Ring.sort (GRing.UnitRing.ringType R)) (GRing.one (poly_ringType (GRing.UnitRing.ringType R))) rs (fun z : GRing.Ring.sort (GRing.UnitRing.ringType R) => @BigBody (GRing.Ring.sort (poly_ringType (GRing.UnitRing.ringType R))) (GRing.Ring.sort (GRing.UnitRing.ringType R)) z (@GRing.mul (poly_ringType (GRing.UnitRing.ringType R))) true (@GRing.add (poly_zmodType (GRing.UnitRing.ringType R)) (polyX (GRing.UnitRing.ringType R)) (@GRing.opp (poly_zmodType (GRing.UnitRing.ringType R)) (@polyC (GRing.UnitRing.ringType R) z))))) p) *) move=> rrs; case/(uniq_roots_prod_XsubC rrs)=> q ->. (* Goal: is_true (rdvdp (GRing.UnitRing.ringType R) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.UnitRing.ringType R))) (GRing.Ring.sort (GRing.UnitRing.ringType R)) (GRing.one (poly_ringType (GRing.UnitRing.ringType R))) rs (fun z : GRing.Ring.sort (GRing.UnitRing.ringType R) => @BigBody (GRing.Ring.sort (poly_ringType (GRing.UnitRing.ringType R))) (GRing.Ring.sort (GRing.UnitRing.ringType R)) z (@GRing.mul (poly_ringType (GRing.UnitRing.ringType R))) true (@GRing.add (poly_zmodType (GRing.UnitRing.ringType R)) (polyX (GRing.UnitRing.ringType R)) (@GRing.opp (poly_zmodType (GRing.UnitRing.ringType R)) (@polyC (GRing.UnitRing.ringType R) z))))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType R)) q (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.UnitRing.ringType R))) (GRing.UnitRing.sort R) (GRing.one (poly_ringType (GRing.UnitRing.ringType R))) rs (fun z : GRing.UnitRing.sort R => @BigBody (GRing.Ring.sort (poly_ringType (GRing.UnitRing.ringType R))) (GRing.UnitRing.sort R) z (@GRing.mul (poly_ringType (GRing.UnitRing.ringType R))) true (@GRing.add (poly_zmodType (GRing.UnitRing.ringType R)) (polyX (GRing.UnitRing.ringType R)) (@GRing.opp (poly_zmodType (GRing.UnitRing.ringType R)) (@polyC (GRing.UnitRing.ringType R) z))))))) *) exact/RingMonic.rdvdp_mull/monic_prod_XsubC. Qed. End UnitRingPseudoDivision. End UnitRing. Module IdomainDefs. Import Ring. Section IDomainPseudoDivisionDefs. Variable R : idomainType. Implicit Type p q r d : {poly R}. Definition edivp_expanded_def p q := let: (k, d, r) as edvpq := redivp p q in if lead_coef q \in GRing.unit then Definition edivp := locked_with edivp_key edivp_expanded_def. Canonical edivp_unlockable := [unlockable fun edivp]. Definition divp p q := ((edivp p q).1).2. Definition modp p q := (edivp p q).2. Definition scalp p q := ((edivp p q).1).1. Definition dvdp p q := modp q p == 0. Definition eqp p q := (dvdp p q) && (dvdp q p). End IDomainPseudoDivisionDefs. Notation "m %/ d" := (divp m d) : ring_scope. Notation "m %% d" := (modp m d) : ring_scope. Notation "p %| q" := (dvdp p q) : ring_scope. Notation "p %= q" := (eqp p q) : ring_scope. End IdomainDefs. Module WeakIdomain. Import Ring ComRing UnitRing IdomainDefs. Section WeakTheoryForIDomainPseudoDivision. Variable R : idomainType. Implicit Type p q r d : {poly R}. Lemma edivp_def p q : edivp p q = (scalp p q, divp p q, modp p q). Proof. (* Goal: @eq (prod (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (@edivp R p q) (@pair (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@pair nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@scalp R p q) (@divp R p q)) (@modp R p q)) *) by rewrite /scalp /divp /modp; case: (edivp p q) => [[]] /=. Qed. Lemma edivp_redivp p q : (lead_coef q \in GRing.unit) = false -> Proof. (* Goal: forall _ : @eq bool (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R))))) false, @eq (prod (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (@edivp R p q) (redivp (GRing.IntegralDomain.ringType R) p q) *) by move=> hu; rewrite unlock hu; case: (redivp p q) => [[? ?] ?]. Qed. Lemma divpE p q : p %/ q = if lead_coef q \in GRing.unit Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p q) (if @in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R)))) then @GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (rscalp (GRing.IntegralDomain.ringType R) p q))) (rdivp (GRing.IntegralDomain.ringType R) p q) else rdivp (GRing.IntegralDomain.ringType R) p q) *) by case ulcq: (lead_coef q \in GRing.unit); rewrite /divp unlock redivp_def ulcq. Qed. Lemma modpE p q : p %% q = if lead_coef q \in GRing.unit Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p q) (if @in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R)))) then @GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (rscalp (GRing.IntegralDomain.ringType R) p q))) (rmodp (GRing.IntegralDomain.ringType R) p q) else rmodp (GRing.IntegralDomain.ringType R) p q) *) by case ulcq: (lead_coef q \in GRing.unit); rewrite /modp unlock redivp_def ulcq. Qed. Lemma scalpE p q : scalp p q = if lead_coef q \in GRing.unit then 0%N else rscalp p q. Proof. (* Goal: @eq nat (@scalp R p q) (if @in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R)))) then O else rscalp (GRing.IntegralDomain.ringType R) p q) *) by case h: (lead_coef q \in GRing.unit); rewrite /scalp unlock redivp_def h. Qed. Lemma dvdpE p q : p %| q = rdvdp p q. Proof. (* Goal: @eq bool (@dvdp R p q) (rdvdp (GRing.IntegralDomain.ringType R) p q) *) rewrite /dvdp modpE /rdvdp; case ulcq: (lead_coef p \in GRing.unit)=> //. (* Goal: @eq bool (@eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) p) (rscalp (GRing.IntegralDomain.ringType R) q p))) (rmodp (GRing.IntegralDomain.ringType R) q p)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) (rmodp (GRing.IntegralDomain.ringType R) q p) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) *) rewrite -[_ *: _ == 0]size_poly_eq0 size_scale ?size_poly_eq0 //. (* Goal: is_true (negb (@eq_op (GRing.IntegralDomain.eqType R) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) p) (rscalp (GRing.IntegralDomain.ringType R) q p))) (GRing.zero (GRing.IntegralDomain.zmodType R)))) *) by rewrite invr_eq0 expf_neq0 //; apply: contraTneq ulcq => ->; rewrite unitr0. Qed. Lemma lc_expn_scalp_neq0 p q : lead_coef q ^+ scalp p q != 0. Proof. (* Goal: is_true (negb (@eq_op (GRing.Ring.eqType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@scalp R p q)) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) *) case: (eqVneq q 0) => [->|nzq]; last by rewrite expf_neq0 ?lead_coef_eq0. (* Goal: is_true (negb (@eq_op (GRing.Ring.eqType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (@scalp R p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) *) by rewrite /scalp 2!unlock /= eqxx lead_coef0 unitr0 /= oner_neq0. Qed. Hint Resolve lc_expn_scalp_neq0 : core. Variant edivp_spec (m d : {poly R}) : nat * {poly R} * {poly R} -> bool -> Type := |Redivp_spec k (q r: {poly R}) of (lead_coef d ^+ k) *: m = q * d + r & lead_coef d \notin GRing.unit & (d != 0 -> size r < size d) : edivp_spec m d (k, q, r) false |Fedivp_spec (q r: {poly R}) of m = q * d + r & (lead_coef d \in GRing.unit) & (d != 0 -> size r < size d) : edivp_spec m d (0%N, q, r) true. Lemma edivpP m d : edivp_spec m d (edivp m d) (lead_coef d \in GRing.unit). Proof. (* Goal: edivp_spec m d (@edivp R m d) (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) d) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R))))) *) have hC : GRing.comm d (lead_coef d)%:P by rewrite /GRing.comm mulrC. (* Goal: edivp_spec m d (@edivp R m d) (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) d) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R))))) *) case ud: (lead_coef d \in GRing.unit); last first. (* Goal: edivp_spec m d (@edivp R m d) true *) (* Goal: edivp_spec m d (@edivp R m d) false *) rewrite edivp_redivp // redivp_def; constructor; rewrite ?ltn_rmodp // ?ud //. (* Goal: edivp_spec m d (@edivp R m d) true *) (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R)))))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) m d)) m) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (rdivp (GRing.IntegralDomain.ringType R) m d) d) (rmodp (GRing.IntegralDomain.ringType R) m d)) *) by rewrite rdivp_eq. (* Goal: edivp_spec m d (@edivp R m d) true *) have cdn0: lead_coef d != 0 by apply: contraTneq ud => ->; rewrite unitr0. (* Goal: edivp_spec m d (@edivp R m d) true *) rewrite unlock ud redivp_def; constructor => //. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) d (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) m d))) (rmodp (GRing.IntegralDomain.ringType R) m d))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d))) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) m (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) m d))) (rdivp (GRing.IntegralDomain.ringType R) m d)) d) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) m d))) (rmodp (GRing.IntegralDomain.ringType R) m d))) *) rewrite -scalerAl -scalerDr -mul_polyC. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) d (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) m d))) (rmodp (GRing.IntegralDomain.ringType R) m d))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d))) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) m (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) m d)))) (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (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.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (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.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (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.mul (@GRing.Lalgebra.ringType (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lalgType (GRing.IntegralDomain.ringType R))) (rdivp (GRing.IntegralDomain.ringType R) m d) d) (rmodp (GRing.IntegralDomain.ringType R) m d))) *) have hn0 : (lead_coef d ^+ rscalp m d)%:P != 0. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) d (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) m d))) (rmodp (GRing.IntegralDomain.ringType R) m d))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d))) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) m (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) m d)))) (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (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.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (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.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (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.mul (@GRing.Lalgebra.ringType (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lalgType (GRing.IntegralDomain.ringType R))) (rdivp (GRing.IntegralDomain.ringType R) m d) d) (rmodp (GRing.IntegralDomain.ringType R) m d))) *) (* Goal: is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) m d))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) by rewrite polyC_eq0; apply: expf_neq0. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) d (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) m d))) (rmodp (GRing.IntegralDomain.ringType R) m d))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d))) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) m (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) m d)))) (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (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.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (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.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (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.mul (@GRing.Lalgebra.ringType (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lalgType (GRing.IntegralDomain.ringType R))) (rdivp (GRing.IntegralDomain.ringType R) m d) d) (rmodp (GRing.IntegralDomain.ringType R) m d))) *) apply: (mulfI hn0); rewrite !mulrA -exprVn !polyC_exp -exprMn -polyC_mul. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) d (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) m d))) (rmodp (GRing.IntegralDomain.ringType R) m d))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d))) *) (* Goal: @eq (GRing.Ring.sort (GRing.IntegralDomain.ringType (poly_idomainType R))) (@GRing.mul (GRing.IntegralDomain.ringType (poly_idomainType R)) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d)) (rscalp (GRing.IntegralDomain.ringType R) m d)) m) (@GRing.mul (GRing.IntegralDomain.ringType (poly_idomainType R)) (@GRing.exp (GRing.ComRing.ringType (GRing.IntegralDomain.comRingType (poly_idomainType R))) (@polyC (GRing.ComRing.ringType (GRing.IntegralDomain.comRingType R)) (@GRing.mul (GRing.ComRing.ringType (GRing.IntegralDomain.comRingType R)) (@lead_coef (GRing.IntegralDomain.ringType R) d) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@lead_coef (GRing.IntegralDomain.ringType R) d)))) (rscalp (GRing.IntegralDomain.ringType R) m d)) (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (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.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (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.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (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.mul (@GRing.Lalgebra.ringType (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lalgType (GRing.IntegralDomain.ringType R))) (rdivp (GRing.IntegralDomain.ringType R) m d) d) (rmodp (GRing.IntegralDomain.ringType R) m d))) *) by rewrite divrr // expr1n mul1r -polyC_exp mul_polyC rdivp_eq. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) d (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) m d))) (rmodp (GRing.IntegralDomain.ringType R) m d))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d))) *) move=> dn0; rewrite size_scale ?ltn_rmodp // -exprVn expf_eq0 negb_and. (* Goal: is_true (orb (negb (leq (S O) (rscalp (GRing.IntegralDomain.ringType R) m d))) (negb (@eq_op (GRing.IntegralDomain.eqType R) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@lead_coef (GRing.IntegralDomain.ringType R) d)) (GRing.zero (GRing.IntegralDomain.zmodType R))))) *) by rewrite invr_eq0 cdn0 orbT. Qed. Lemma edivp_eq d q r : size r < size d -> lead_coef d \in GRing.unit -> Proof. (* Goal: forall (_ : is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) r))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d)))) (_ : is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) d) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R)))))), @eq (prod (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (@edivp R (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d) r) d) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) O q) r) *) have hC : GRing.comm d (lead_coef d)%:P by apply: mulrC. (* Goal: forall (_ : is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) r))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d)))) (_ : is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) d) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R)))))), @eq (prod (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (@edivp R (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d) r) d) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) O q) r) *) move=> hsrd hu; rewrite unlock hu; case et: (redivp _ _) => [[s qq] rr]. (* Goal: @eq (prod (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (@pair (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@pair nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) O (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) s)) qq)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) s)) rr)) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) O q) r) *) have cdn0 : lead_coef d != 0. (* Goal: @eq (prod (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (@pair (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@pair nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) O (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) s)) qq)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) s)) rr)) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) O q) r) *) (* Goal: is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) d) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) *) by move: hu; case d0: (lead_coef d == 0) => //; rewrite (eqP d0) unitr0. (* Goal: @eq (prod (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (@pair (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@pair nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) O (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) s)) qq)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) s)) rr)) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) O q) r) *) move: (et); rewrite RingComRreg.redivp_eq //; last by apply/rregP. (* Goal: forall _ : @eq (prod (prod nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))))) (@pair (prod nat (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R)))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@pair nat (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@fst nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R)))) (@fst (prod nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R)))) (@CommonRing.redivp (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d) r) d))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q (@polyC (GRing.IntegralDomain.ringType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (@fst nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R)))) (@fst (prod nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R)))) (@CommonRing.redivp (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d) r) d))))))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) r (@polyC (GRing.IntegralDomain.ringType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (@fst nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R)))) (@fst (prod nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R)))) (@CommonRing.redivp (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d) r) d))))))) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R)))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R)))) s qq) rr), @eq (prod (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (@pair (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@pair nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) O (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) s)) qq)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) s)) rr)) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) O q) r) *) rewrite et /=; case=> e1 e2; rewrite -!mul_polyC -!exprVn !polyC_exp. (* Goal: @eq (prod (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)))) (@pair (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@pair nat (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) O (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyC (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@lead_coef (GRing.IntegralDomain.ringType R) d))) s) qq)) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyC (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@lead_coef (GRing.IntegralDomain.ringType R) d))) s) rr)) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) O q) r) *) suff h x y: x * (lead_coef d ^+ s)%:P = y -> ((lead_coef d)^-1)%:P ^+ s * y = x. (* Goal: forall _ : @eq (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) x (@polyC (GRing.IntegralDomain.ringType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) s))) y, @eq (GRing.Ring.sort (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyC (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@lead_coef (GRing.IntegralDomain.ringType R) d))) s) y) x *) (* Goal: @eq (prod (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)))) (@pair (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@pair nat (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) O (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyC (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@lead_coef (GRing.IntegralDomain.ringType R) d))) s) qq)) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyC (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@lead_coef (GRing.IntegralDomain.ringType R) d))) s) rr)) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) O q) r) *) by congr (_, _, _); apply: h. (* Goal: forall _ : @eq (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) x (@polyC (GRing.IntegralDomain.ringType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) s))) y, @eq (GRing.Ring.sort (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyC (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@lead_coef (GRing.IntegralDomain.ringType R) d))) s) y) x *) have hn0 : (lead_coef d)%:P ^+ s != 0 by apply: expf_neq0; rewrite polyC_eq0. (* Goal: forall _ : @eq (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) x (@polyC (GRing.IntegralDomain.ringType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) s))) y, @eq (GRing.Ring.sort (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyC (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@lead_coef (GRing.IntegralDomain.ringType R) d))) s) y) x *) move=> hh; apply: (mulfI hn0); rewrite mulrA -exprMn -polyC_mul divrr //. (* Goal: @eq (GRing.Ring.sort (GRing.IntegralDomain.ringType (poly_idomainType R))) (@GRing.mul (GRing.IntegralDomain.ringType (poly_idomainType R)) (@GRing.exp (GRing.ComRing.ringType (GRing.IntegralDomain.comRingType (poly_idomainType R))) (@polyC (GRing.ComRing.ringType (GRing.IntegralDomain.comRingType R)) (GRing.one (GRing.UnitRing.ringType (GRing.ComUnitRing.com_unitRingType (GRing.IntegralDomain.comUnitRingType R))))) s) y) (@GRing.mul (GRing.IntegralDomain.ringType (poly_idomainType R)) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d)) s) x) *) by rewrite expr1n mul1r -polyC_exp mulrC; apply: sym_eq. Qed. Lemma divp_eq p q : (lead_coef q ^+ (scalp p q)) *: p = (p %/ q) * q + (p %% q). Lemma dvdp_eq q p : (q %| p) = ((lead_coef q) ^+ (scalp p q) *: p == (p %/ q) * q). Lemma divpK d p : d %| p -> p %/ d * d = ((lead_coef d) ^+ (scalp p d)) *: p. Proof. (* Goal: forall _ : is_true (@dvdp R d p), @eq (GRing.Ring.sort (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p d) d) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (@scalp R p d)) p) *) by rewrite dvdp_eq; move/eqP->. Qed. Lemma divpKC d p : d %| p -> d * (p %/ d) = ((lead_coef d) ^+ (scalp p d)) *: p. Proof. (* Goal: forall _ : is_true (@dvdp R d p), @eq (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d (@divp R p d)) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (@scalp R p d)) p) *) by move=> ?; rewrite mulrC divpK. Qed. Lemma dvdpP q p : reflect (exists2 cqq, cqq.1 != 0 & cqq.1 *: p = cqq.2 * q) (q %| p). Proof. (* Goal: Bool.reflect (@ex2 (prod (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R)))) (fun cqq : prod (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) => is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@fst (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) cqq) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))))) (fun cqq : prod (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) => @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R)))))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@fst (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) cqq) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) cqq) q))) (@dvdp R q p) *) rewrite dvdp_eq; apply: (iffP eqP) => [e | [[c qq] cn0 e]]. (* Goal: @eq (Equality.sort (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))))))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@scalp R p q)) p) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p q) q) *) (* Goal: @ex2 (prod (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R)))) (fun cqq : prod (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) => is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@fst (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) cqq) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))))) (fun cqq : prod (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) => @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R)))))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@fst (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) cqq) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) cqq) q)) *) by exists (lead_coef q ^+ scalp p q, p %/ q) => //=. (* Goal: @eq (Equality.sort (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))))))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@scalp R p q)) p) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p q) q) *) apply/eqP; rewrite -dvdp_eq dvdpE. (* Goal: is_true (rdvdp (GRing.IntegralDomain.ringType R) q p) *) have Ecc: c%:P != 0 by rewrite polyC_eq0. (* Goal: is_true (rdvdp (GRing.IntegralDomain.ringType R) q p) *) case: (eqVneq p 0) => [->|nz_p]; first by rewrite rdvdp0. (* Goal: is_true (rdvdp (GRing.IntegralDomain.ringType R) q p) *) pose p1 : {poly R} := lead_coef q ^+ rscalp p q *: qq - c *: (rdivp p q). (* Goal: is_true (rdvdp (GRing.IntegralDomain.ringType R) q p) *) have E1: c *: (rmodp p q) = p1 * q. (* Goal: is_true (rdvdp (GRing.IntegralDomain.ringType R) q p) *) (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R)))))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c (rmodp (GRing.IntegralDomain.ringType R) p q)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p1 q) *) rewrite mulrDl {1}mulNr -scalerAl -e scalerA mulrC -scalerA -scalerAl. (* Goal: is_true (rdvdp (GRing.IntegralDomain.ringType R) q p) *) (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R)))))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c (rmodp (GRing.IntegralDomain.ringType R) p q)) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@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))) (@fst (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@pair (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) c qq)) (@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.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (rscalp (GRing.IntegralDomain.ringType R) p q)) p)) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@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))) c (@GRing.mul (@GRing.Lalgebra.ringType (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lalgType (GRing.IntegralDomain.ringType R))) (rdivp (GRing.IntegralDomain.ringType R) p q) q)))) *) by rewrite -scalerBr rdivp_eq addrC addKr. (* Goal: is_true (rdvdp (GRing.IntegralDomain.ringType R) q p) *) rewrite /dvdp; apply/idPn=> m_nz. (* Goal: False *) have: p1 * q != 0 by rewrite -E1 -mul_polyC mulf_neq0 // -/(dvdp q p) dvdpE. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Ring.eqType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p1 q) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R)))))), False *) rewrite mulf_eq0; case/norP=> p1_nz q_nz; have:= ltn_rmodp p q. (* Goal: forall _ : @eq bool (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (rmodp (GRing.IntegralDomain.ringType R) p q)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), False *) rewrite q_nz -(size_scale _ cn0) E1 size_mul //. (* Goal: forall _ : @eq bool (leq (S (Nat.pred (addn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p1)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) true, False *) by rewrite polySpred // ltnNge leq_addl. Qed. Lemma mulpK p q : q != 0 -> p * q %/ q = lead_coef q ^+ scalp (p * q) q *: p. Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) q) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@scalp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) q)) p) *) move=> qn0; move/rregP: (qn0); apply; rewrite -scalerAl divp_eq. (* Goal: @eq (GRing.Ring.sort (GRing.IntegralDomain.ringType (poly_idomainType R))) (@GRing.mul (GRing.IntegralDomain.ringType (poly_idomainType R)) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) q) q) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) q) q) (@modp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) q)) *) suff -> : (p * q) %% q = 0 by rewrite addr0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) q) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) rewrite modpE RingComRreg.rmodp_mull ?scaler0 ?if_same //. (* Goal: @GRing.rreg (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) *) (* Goal: @GRing.comm (poly_ringType (GRing.IntegralDomain.ringType R)) q (@polyC (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q)) *) by red; rewrite mulrC. (* Goal: @GRing.rreg (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) *) by apply/rregP; rewrite lead_coef_eq0. Qed. Lemma mulKp p q : q != 0 -> q * p %/ q = lead_coef q ^+ scalp (p * q) q *: p. Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q p) q) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@scalp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) q)) p) *) by move=> nzq; rewrite mulrC; apply: mulpK. Qed. Lemma divpp p : p != 0 -> p %/ p = (lead_coef p ^+ scalp p p)%:P. Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p p) (@polyC (GRing.IntegralDomain.ringType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) p) (@scalp R p p))) *) move=> np0; have := (divp_eq p p). (* Goal: forall _ : @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R)))))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) p) (@scalp R p p)) p) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p p) p) (@modp R p p)), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p p) (@polyC (GRing.IntegralDomain.ringType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) p) (@scalp R p p))) *) suff -> : p %% p = 0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p p) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) (* Goal: forall _ : @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R)))))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) p) (@scalp R p p)) p) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p p) p) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p p) (@polyC (GRing.IntegralDomain.ringType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) p) (@scalp R p p))) *) by rewrite addr0; move/eqP; rewrite -mul_polyC (inj_eq (mulIf np0)); move/eqP. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p p) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) rewrite modpE Ring.rmodpp; last by red; rewrite mulrC. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (if @in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) p) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R)))) then @GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) p) (rscalp (GRing.IntegralDomain.ringType R) p p))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) else GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) by rewrite scaler0 if_same. Qed. End WeakTheoryForIDomainPseudoDivision. Hint Resolve lc_expn_scalp_neq0 : core. End WeakIdomain. Module CommonIdomain. Import Ring ComRing UnitRing IdomainDefs WeakIdomain. Section IDomainPseudoDivision. Variable R : idomainType. Implicit Type p q r d m n : {poly R}. Lemma scalp0 p : scalp p 0 = 0%N. Proof. (* Goal: @eq nat (@scalp R p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) O *) by rewrite /scalp unlock lead_coef0 unitr0 unlock eqxx. Qed. Lemma divp_small p q : size p < size q -> p %/ q = 0. Proof. (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p q) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) move=> spq; rewrite /divp unlock redivp_def /=. (* Goal: @eq (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@snd nat (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@fst (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (if @in_mem (GRing.IntegralDomain.sort R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@mem (GRing.IntegralDomain.sort R) (predPredType (GRing.IntegralDomain.sort R)) (@has_quality (S O) (GRing.IntegralDomain.sort R) (@GRing.unit (GRing.IntegralDomain.unitRingType R)))) then @pair (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@pair nat (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) O (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (rscalp (GRing.IntegralDomain.ringType R) p q))) (rdivp (GRing.IntegralDomain.ringType R) p q))) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (rscalp (GRing.IntegralDomain.ringType R) p q))) (rmodp (GRing.IntegralDomain.ringType R) p q)) else @pair (prod nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (rscalp (GRing.IntegralDomain.ringType R) p q) (rdivp (GRing.IntegralDomain.ringType R) p q)) (rmodp (GRing.IntegralDomain.ringType R) p q)))) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) *) by case: ifP; rewrite rdivp_small // scaler0. Qed. Lemma leq_divp p q : (size (p %/ q) <= size p). Proof. (* Goal: is_true (leq (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) *) rewrite /divp unlock redivp_def /=; case: ifP=> /=; rewrite ?leq_rdivp //. (* Goal: forall _ : is_true (@in_mem (GRing.IntegralDomain.sort R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@mem (GRing.IntegralDomain.sort R) (predPredType (GRing.IntegralDomain.sort R)) (@has_quality (S O) (GRing.IntegralDomain.sort R) (@GRing.unit (GRing.IntegralDomain.unitRingType R))))), is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (rscalp (GRing.IntegralDomain.ringType R) p q))) (rdivp (GRing.IntegralDomain.ringType R) p q)))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))) *) move=> ulcq; rewrite size_scale ?leq_rdivp //. (* Goal: is_true (negb (@eq_op (GRing.IntegralDomain.eqType R) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (rscalp (GRing.IntegralDomain.ringType R) p q))) (GRing.zero (GRing.IntegralDomain.zmodType R)))) *) rewrite -exprVn expf_neq0 // invr_eq0. (* Goal: is_true (negb (@eq_op (GRing.UnitRing.eqType (GRing.IntegralDomain.unitRingType R)) (@lead_coef (GRing.IntegralDomain.ringType R) q) (GRing.zero (GRing.UnitRing.zmodType (GRing.IntegralDomain.unitRingType R))))) *) by move: ulcq; case lcq0: (lead_coef q == 0) => //; rewrite (eqP lcq0) unitr0. Qed. Lemma div0p p : 0 %/ p = 0. Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) p) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) by rewrite /divp unlock redivp_def /=; case: ifP; rewrite rdiv0p // scaler0. Qed. Lemma divp0 p : p %/ 0 = 0. Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) by rewrite /divp unlock redivp_def /=; case: ifP; rewrite rdivp0 // scaler0. Qed. Lemma divp1 m : m %/ 1 = m. Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R m (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) m *) by rewrite divpE lead_coefC unitr1 Ring.rdivp1 expr1n invr1 scale1r. Qed. Lemma modp0 p : p %% 0 = p. Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) p *) rewrite /modp unlock redivp_def; case: ifP; rewrite rmodp0 //= lead_coef0. (* Goal: forall _ : is_true (@in_mem (GRing.IntegralDomain.sort R) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@mem (GRing.IntegralDomain.sort R) (predPredType (GRing.IntegralDomain.sort R)) (@has_quality (S O) (GRing.IntegralDomain.sort R) (@GRing.unit (GRing.IntegralDomain.unitRingType R))))), @eq (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (rscalp (GRing.IntegralDomain.ringType R) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))) p) p *) by rewrite unitr0. Qed. Lemma mod0p p : 0 %% p = 0. Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) p) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) by rewrite /modp unlock redivp_def /=; case: ifP; rewrite rmod0p // scaler0. Qed. Lemma modp1 p : p %% 1 = 0. Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) by rewrite /modp unlock redivp_def /=; case: ifP; rewrite rmodp1 // scaler0. Qed. Hint Resolve divp0 divp1 mod0p modp0 modp1 : core. Lemma modp_small p q : size p < size q -> p %% q = p. Proof. (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p q) p *) move=> spq; rewrite /modp unlock redivp_def; case: ifP; rewrite rmodp_small //. (* Goal: forall _ : is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R))))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@snd (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@pair (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@pair nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) O (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (rscalp (GRing.IntegralDomain.ringType R) p q))) (rdivp (GRing.IntegralDomain.ringType R) p q))) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (rscalp (GRing.IntegralDomain.ringType R) p q))) p))) p *) by rewrite /= rscalp_small // expr0 /= invr1 scale1r. Qed. Lemma modpC p c : c != 0 -> p %% c%:P = 0. Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) c (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p (@polyC (GRing.IntegralDomain.ringType R) c)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) move=> cn0; rewrite /modp unlock redivp_def /=; case: ifP; rewrite ?rmodpC //. (* Goal: forall _ : is_true (@in_mem (GRing.IntegralDomain.sort R) (@lead_coef (GRing.IntegralDomain.ringType R) (@polyC (GRing.IntegralDomain.ringType R) c)) (@mem (GRing.IntegralDomain.sort R) (predPredType (GRing.IntegralDomain.sort R)) (@has_quality (S O) (GRing.IntegralDomain.sort R) (@GRing.unit (GRing.IntegralDomain.unitRingType R))))), @eq (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@snd (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@pair (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@pair nat (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) O (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) (@polyC (GRing.IntegralDomain.ringType R) c)) (rscalp (GRing.IntegralDomain.ringType R) p (@polyC (GRing.IntegralDomain.ringType R) c)))) (rdivp (GRing.IntegralDomain.ringType R) p (@polyC (GRing.IntegralDomain.ringType R) c)))) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) (@polyC (GRing.IntegralDomain.ringType R) c)) (rscalp (GRing.IntegralDomain.ringType R) p (@polyC (GRing.IntegralDomain.ringType R) c)))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) *) by rewrite scaler0. Qed. Lemma modp_mull p q : (p * q) %% q = 0. Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) q) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) case: (altP (q =P 0)) => [-> | nq0]; first by rewrite modp0 mulr0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) q) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) have rlcq : (GRing.rreg (lead_coef q)) by apply/rregP; rewrite lead_coef_eq0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) q) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) have hC : GRing.comm q (lead_coef q)%:P by red; rewrite mulrC. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) q) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) by rewrite modpE; case: ifP => ulcq; rewrite RingComRreg.rmodp_mull // scaler0. Qed. Lemma modp_mulr d p : (d * p) %% d = 0. Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d p) d) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) by rewrite mulrC modp_mull. Qed. Lemma modpp d : d %% d = 0. Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R d d) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) by rewrite -{1}(mul1r d) modp_mull. Qed. Lemma ltn_modp p q : (size (p %% q) < size q) = (q != 0). Proof. (* Goal: @eq bool (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R p q)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) rewrite /modp unlock redivp_def /=; case: ifP=> /=; rewrite ?ltn_rmodp //. (* Goal: forall _ : is_true (@in_mem (GRing.IntegralDomain.sort R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@mem (GRing.IntegralDomain.sort R) (predPredType (GRing.IntegralDomain.sort R)) (@has_quality (S O) (GRing.IntegralDomain.sort R) (@GRing.unit (GRing.IntegralDomain.unitRingType R))))), @eq bool (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (rscalp (GRing.IntegralDomain.ringType R) p q))) (rmodp (GRing.IntegralDomain.ringType R) p q))))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q))) (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) move=> ulcq; rewrite size_scale ?ltn_rmodp //. (* Goal: is_true (negb (@eq_op (GRing.IntegralDomain.eqType R) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (rscalp (GRing.IntegralDomain.ringType R) p q))) (GRing.zero (GRing.IntegralDomain.zmodType R)))) *) rewrite -exprVn expf_neq0 // invr_eq0. (* Goal: is_true (negb (@eq_op (GRing.UnitRing.eqType (GRing.IntegralDomain.unitRingType R)) (@lead_coef (GRing.IntegralDomain.ringType R) q) (GRing.zero (GRing.UnitRing.zmodType (GRing.IntegralDomain.unitRingType R))))) *) by move: ulcq; case lcq0: (lead_coef q == 0) => //; rewrite (eqP lcq0) unitr0. Qed. Lemma ltn_divpl d q p : d != 0 -> (size (q %/ d) < size p) = (size q < size (p * d)). Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) d (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), @eq bool (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) move=> dn0; have sd : size d > 0 by rewrite size_poly_gt0 dn0. (* Goal: @eq bool (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) have: (lead_coef d) ^+ (scalp q d) != 0 by apply: lc_expn_scalp_neq0. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Ring.eqType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (@scalp R q d)) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))), @eq bool (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) move/size_scale; move/(_ q)<-; rewrite divp_eq; case quo0 : (q %/ d == 0). (* Goal: @eq bool (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R q d) d) (@modp R q d))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) (* Goal: @eq bool (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R q d) d) (@modp R q d))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) rewrite (eqP quo0) mul0r add0r size_poly0. (* Goal: @eq bool (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R q d) d) (@modp R q d))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) (* Goal: @eq bool (leq (S O) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) case p0 : (p == 0); first by rewrite (eqP p0) mul0r size_poly0 ltnn ltn0. (* Goal: @eq bool (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R q d) d) (@modp R q d))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) (* Goal: @eq bool (leq (S O) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) have sp : size p > 0 by rewrite size_poly_gt0 p0. (* Goal: @eq bool (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R q d) d) (@modp R q d))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) (* Goal: @eq bool (leq (S O) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) rewrite /= size_mul ?p0 // sp; apply: sym_eq; move/prednK:(sp)<-. (* Goal: @eq bool (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R q d) d) (@modp R q d))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) (* Goal: @eq bool (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R q d)))) (Nat.pred (addn (S (Nat.pred (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d))))) true *) by rewrite addSn /= ltn_addl // ltn_modp. (* Goal: @eq bool (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R q d) d) (@modp R q d))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) rewrite size_addl; last first. (* Goal: @eq bool (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R q d) d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R q d) d)))) *) rewrite size_mul ?quo0 //; move/negbT: quo0; rewrite -size_poly_gt0. (* Goal: @eq bool (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R q d) d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) (* Goal: forall _ : is_true (leq (S O) (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))), is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R q d)))) (Nat.pred (addn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@divp R q d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d))))) *) by move/prednK<-; rewrite addSn /= ltn_addl // ltn_modp. (* Goal: @eq bool (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R q d) d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) case: (altP (p =P 0)) => [-> | pn0]; first by rewrite mul0r size_poly0 !ltn0. (* Goal: @eq bool (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R q d) d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) *) by rewrite !size_mul ?quo0 //; move/prednK: sd<-; rewrite !addnS ltn_add2r. Qed. Lemma leq_divpr d p q : d != 0 -> (size p <= size (q %/ d)) = (size (p * d) <= size q). Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) d (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), @eq bool (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))) (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) *) by move=> dn0; rewrite leqNgt ltn_divpl // -leqNgt. Qed. Lemma divpN0 d p : d != 0 -> (p %/ d != 0) = (size d <= size p). Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) d (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), @eq bool (negb (@eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p d) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))))) (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) *) move=> dn0; rewrite -{2}(mul1r d) -leq_divpr // size_polyC oner_eq0 /=. (* Goal: @eq bool (negb (@eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@divp R p d) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (leq (S O) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p d)))) *) by rewrite size_poly_gt0. Qed. Lemma size_divp p q : q != 0 -> size (p %/ q) = ((size p) - (size q).-1)%N. Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), @eq nat (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (subn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) move=> nq0; case: (leqP (size q) (size p)) => sqp; last first. (* Goal: @eq nat (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (subn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) (* Goal: @eq nat (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (subn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) move: (sqp); rewrite -{1}(ltn_predK sqp) ltnS -subn_eq0 divp_small //. (* Goal: @eq nat (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (subn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) (* Goal: forall _ : is_true (@eq_op nat_eqType (subn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) O), @eq nat (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))))) (subn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) by move/eqP->; rewrite size_poly0. (* Goal: @eq nat (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (subn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) move: (nq0); rewrite -size_poly_gt0 => lt0sq. (* Goal: @eq nat (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (subn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) move: (sqp); move/(leq_trans lt0sq) => lt0sp. (* Goal: @eq nat (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (subn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) move: (lt0sp); rewrite size_poly_gt0=> p0. (* Goal: @eq nat (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (subn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) move: (divp_eq p q); move/(congr1 (size \o (@polyseq R)))=> /=. (* Goal: forall _ : @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@scalp R p q)) p))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p q) q) (@modp R p q)))), @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (subn (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) rewrite size_scale; last by rewrite expf_eq0 lead_coef_eq0 (negPf nq0) andbF. (* Goal: forall _ : @eq nat (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p q) q) (@modp R p q)))), @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (subn (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) case: (eqVneq (p %/ q) 0) => [-> | qq0]. (* Goal: forall _ : @eq nat (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p q) q) (@modp R p q)))), @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (subn (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) (* Goal: forall _ : @eq nat (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) q) (@modp R p q)))), @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))))) (subn (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) by rewrite mul0r add0r=> es; move: nq0; rewrite -(ltn_modp p) -es ltnNge sqp. (* Goal: forall _ : @eq nat (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p q) q) (@modp R p q)))), @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (subn (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) move/negP:(qq0); move/negP; rewrite -size_poly_gt0 => lt0qq. (* Goal: forall _ : @eq nat (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p q) q) (@modp R p q)))), @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (subn (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) rewrite size_addl. (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p q) q)))) *) (* Goal: forall _ : @eq nat (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p q) q))), @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (subn (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) rewrite size_mul ?qq0 // => ->. (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p q) q)))) *) (* Goal: @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (subn (Nat.pred (addn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@divp R p q))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) apply/eqP; rewrite -(eqn_add2r ((size q).-1)). (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p q) q)))) *) (* Goal: is_true (@eq_op nat_eqType (addn (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))) (Nat.pred (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) (addn (subn (Nat.pred (addn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@divp R p q))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))) (Nat.pred (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))))) *) rewrite subnK; first by rewrite -subn1 addnBA // subn1. (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p q) q)))) *) (* Goal: is_true (leq (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q))) (Nat.pred (addn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@divp R p q))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))))) *) rewrite /leq -(subnDl 1%N) !add1n prednK // (@ltn_predK (size q)) //. (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p q) q)))) *) (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (addn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@divp R p q))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) (* Goal: is_true (@eq_op nat_eqType (subn (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) (addn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@divp R p q))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) O) *) by rewrite addnC subnDA subnn sub0n. (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p q) q)))) *) (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (addn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@divp R p q))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) by rewrite -[size q]add0n ltn_add2r. (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p q) q)))) *) rewrite size_mul ?qq0 //. (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (Nat.pred (addn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@divp R p q))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))))) *) move: nq0; rewrite -(ltn_modp p); move/leq_trans; apply; move/prednK: lt0qq<-. (* Goal: is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) (Nat.pred (addn (S (Nat.pred (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p q))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))))) *) by rewrite addSn /= leq_addl. Qed. Lemma ltn_modpN0 p q : q != 0 -> size (p %% q) < size q. Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), is_true (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R p q)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) *) by rewrite ltn_modp. Qed. Lemma modp_mod p q : (p %% q) %% q = p %% q. Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R (@modp R p q) q) (@modp R p q) *) by case: (eqVneq q 0) => [-> | qn0]; rewrite ?modp0 // modp_small ?ltn_modp. Qed. Lemma leq_modp m d : size (m %% d) <= size m. Proof. (* Goal: is_true (leq (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R m d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) m))) *) rewrite /modp unlock redivp_def /=; case: ifP; rewrite ?leq_rmodp //. (* Goal: forall _ : is_true (@in_mem (GRing.IntegralDomain.sort R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (@mem (GRing.IntegralDomain.sort R) (predPredType (GRing.IntegralDomain.sort R)) (@has_quality (S O) (GRing.IntegralDomain.sort R) (@GRing.unit (GRing.IntegralDomain.unitRingType R))))), is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@snd (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@pair (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R)))) (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@pair nat (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) O (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) m d))) (rdivp (GRing.IntegralDomain.ringType R) m d))) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) m d))) (rmodp (GRing.IntegralDomain.ringType R) m d)))))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) m))) *) move=> ud; rewrite size_scale ?leq_rmodp // invr_eq0 expf_neq0 //. (* Goal: is_true (negb (@eq_op (GRing.IntegralDomain.eqType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (GRing.zero (GRing.IntegralDomain.zmodType R)))) *) by apply: contraTneq ud => ->; rewrite unitr0. Qed. Lemma dvdp0 d : d %| 0. Proof. (* Goal: is_true (@dvdp R d (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) *) by rewrite /dvdp mod0p. Qed. Hint Resolve dvdp0 : core. Lemma dvd0p p : (0 %| p) = (p == 0). Proof. (* Goal: @eq bool (@dvdp R (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) p) (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) *) by rewrite /dvdp modp0. Qed. Lemma dvd0pP p : reflect (p = 0) (0 %| p). Proof. (* Goal: Bool.reflect (@eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (@dvdp R (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) p) *) by apply: (iffP idP); rewrite dvd0p; move/eqP. Qed. Lemma dvdpN0 p q : p %| q -> q != 0 -> p != 0. Proof. (* Goal: forall (_ : is_true (@dvdp R p q)) (_ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))), is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) by move=> pq hq; apply: contraL pq=> /eqP ->; rewrite dvd0p. Qed. Lemma dvdp1 d : (d %| 1) = ((size d) == 1%N). Proof. (* Goal: @eq bool (@dvdp R d (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d)) (S O)) *) rewrite /dvdp modpE; case ud: (lead_coef d \in GRing.unit); last exact: rdvdp1. (* Goal: @eq bool (@eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) d))) (rmodp (GRing.IntegralDomain.ringType R) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) d)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d)) (S O)) *) rewrite -size_poly_eq0 size_scale; first by rewrite size_poly_eq0 -rdvdp1. (* Goal: is_true (negb (@eq_op (GRing.IntegralDomain.eqType R) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (rscalp (GRing.IntegralDomain.ringType R) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) d))) (GRing.zero (GRing.IntegralDomain.zmodType R)))) *) by rewrite invr_eq0 expf_neq0 //; apply: contraTneq ud => ->; rewrite unitr0. Qed. Lemma dvd1p m : 1 %| m. Proof. (* Goal: is_true (@dvdp R (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) m) *) by rewrite /dvdp modp1. Qed. Lemma gtNdvdp p q : p != 0 -> size p < size q -> (q %| p) = false. Proof. (* Goal: forall (_ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))) (_ : is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))), @eq bool (@dvdp R q p) false *) by move=> nn0 hs; rewrite /dvdp; rewrite (modp_small hs); apply: negPf. Qed. Lemma modp_eq0P p q : reflect (p %% q = 0) (q %| p). Proof. (* Goal: Bool.reflect (@eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p q) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (@dvdp R q p) *) exact: (iffP eqP). Qed. Lemma modp_eq0 p q : (q %| p) -> p %% q = 0. Proof. (* Goal: forall _ : is_true (@dvdp R q p), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p q) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) by move/modp_eq0P. Qed. Lemma leq_divpl d p q : d %| p -> (size (p %/ d) <= size q) = (size p <= size (q * d)). Proof. (* Goal: forall _ : is_true (@dvdp R d p), @eq bool (leq (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d)))) *) case: (eqVneq d 0) => [-> | nd0]. (* Goal: forall _ : is_true (@dvdp R d p), @eq bool (leq (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d)))) *) (* Goal: forall _ : is_true (@dvdp R (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) p), @eq bool (leq (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))))) *) by move/dvd0pP->; rewrite divp0 size_poly0 !leq0n. (* Goal: forall _ : is_true (@dvdp R d p), @eq bool (leq (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d)))) *) move=> hd; rewrite leq_eqVlt ltn_divpl // (leq_eqVlt (size p)). (* Goal: @eq bool (orb (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d))))) (orb (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d)))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d))))) *) case lhs: (size p < size (q * d)); rewrite ?orbT ?orbF //. (* Goal: @eq bool (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d)))) *) have: (lead_coef d) ^+ (scalp p d) != 0 by rewrite expf_neq0 // lead_coef_eq0. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Ring.eqType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (@scalp R p d)) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))), @eq bool (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d)))) *) move/size_scale; move/(_ p)<-; rewrite divp_eq. (* Goal: @eq bool (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p d) d) (@modp R p d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d)))) *) move/modp_eq0P: hd->; rewrite addr0; case: (altP (p %/ d =P 0))=> [-> | quon0]. (* Goal: @eq bool (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p d) d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d)))) *) (* Goal: @eq bool (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d)))) *) rewrite mul0r size_poly0 eq_sym (eq_sym 0%N) size_poly_eq0. (* Goal: @eq bool (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p d) d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d)))) *) (* Goal: @eq bool (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d))) O) *) case: (altP (q =P 0)) => [-> | nq0]; first by rewrite mul0r size_poly0 eqxx. (* Goal: @eq bool (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p d) d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d)))) *) (* Goal: @eq bool false (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d))) O) *) by rewrite size_poly_eq0 mulf_eq0 (negPf nq0) (negPf nd0). (* Goal: @eq bool (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p d) d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d)))) *) case: (altP (q =P 0)) => [-> | nq0]. (* Goal: @eq bool (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p d) d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d)))) *) (* Goal: @eq bool (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p d) d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) d)))) *) by rewrite mul0r size_poly0 !size_poly_eq0 mulf_eq0 (negPf nd0) orbF. (* Goal: @eq bool (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p d) d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d)))) *) rewrite !size_mul //; move: nd0; rewrite -size_poly_gt0; move/prednK<-. (* Goal: @eq bool (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R p d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@eq_op nat_eqType (Nat.pred (addn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@divp R p d))) (S (Nat.pred (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d)))))) (Nat.pred (addn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) (S (Nat.pred (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d))))))) *) by rewrite !addnS /= eqn_add2r. Qed. Lemma dvdp_leq p q : q != 0 -> p %| q -> size p <= size q. Proof. (* Goal: forall (_ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))) (_ : is_true (@dvdp R p q)), is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) *) move=> nq0 /modp_eq0P => rpq; case: (ltnP (size p) (size q)). (* Goal: forall _ : is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))), is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) *) (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))), is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) *) by move/ltnW->. (* Goal: forall _ : is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))), is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) *) rewrite leq_eqVlt; case/orP; first by move/eqP->. (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))), is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) *) by move/modp_small; rewrite rpq => h; move: nq0; rewrite h eqxx. Qed. Lemma eq_dvdp c quo q p : c != 0 -> c *: p = quo * q -> q %| p. Proof. (* Goal: forall (_ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) c (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))))) (_ : @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R)))))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) quo q)), is_true (@dvdp R q p) *) move=> cn0; case: (eqVneq p 0) => [->|nz_quo def_quo] //. (* Goal: is_true (@dvdp R q p) *) pose p1 : {poly R} := lead_coef q ^+ scalp p q *: quo - c *: (p %/ q). (* Goal: is_true (@dvdp R q p) *) have E1: c *: (p %% q) = p1 * q. (* Goal: is_true (@dvdp R q p) *) (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c (@modp R p q)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p1 q) *) rewrite mulrDl {1}mulNr-scalerAl -def_quo scalerA mulrC -scalerA. (* Goal: is_true (@dvdp R q p) *) (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c (@modp R p q)) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@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))) c (@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.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@scalp R p q)) p)) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c (@divp R p q)) q))) *) by rewrite -scalerAl -scalerBr divp_eq addrAC subrr add0r. (* Goal: is_true (@dvdp R q p) *) rewrite /dvdp; apply/idPn=> m_nz. (* Goal: False *) have: p1 * q != 0 by rewrite -E1 -mul_polyC mulf_neq0 // polyC_eq0. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Ring.eqType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p1 q) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R)))))), False *) rewrite mulf_eq0; case/norP=> p1_nz q_nz. (* Goal: False *) have := (ltn_modp p q); rewrite q_nz -(size_scale (p %% q) cn0) E1. (* Goal: forall _ : @eq bool (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p1 q)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) true, False *) by rewrite size_mul // polySpred // ltnNge leq_addl. Qed. Lemma dvdpp d : d %| d. Proof. (* Goal: is_true (@dvdp R d d) *) by rewrite /dvdp modpp. Qed. Hint Resolve dvdpp : core. Lemma divp_dvd p q : (p %| q) -> ((q %/ p) %| q). Lemma dvdp_mull m d n : d %| n -> d %| m * n. Lemma dvdp_mulr n d m : d %| m -> d %| m * n. Proof. (* Goal: forall _ : is_true (@dvdp R d m), is_true (@dvdp R d (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) *) by move=> hdm; rewrite mulrC dvdp_mull. Qed. Hint Resolve dvdp_mull dvdp_mulr : core. Lemma dvdp_mul d1 d2 m1 m2 : d1 %| m1 -> d2 %| m2 -> d1 * d2 %| m1 * m2. Lemma dvdp_addr m d n : d %| m -> (d %| m + n) = (d %| n). Lemma dvdp_addl n d m : d %| n -> (d %| m + n) = (d %| m). Proof. (* Goal: forall _ : is_true (@dvdp R d n), @eq bool (@dvdp R d (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) m n)) (@dvdp R d m) *) by rewrite addrC; apply: dvdp_addr. Qed. Lemma dvdp_add d m n : d %| m -> d %| n -> d %| m + n. Proof. (* Goal: forall (_ : is_true (@dvdp R d m)) (_ : is_true (@dvdp R d n)), is_true (@dvdp R d (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) m n)) *) by move/dvdp_addr->. Qed. Lemma dvdp_add_eq d m n : d %| m + n -> (d %| m) = (d %| n). Proof. (* Goal: forall _ : is_true (@dvdp R d (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) m n)), @eq bool (@dvdp R d m) (@dvdp R d n) *) by move=> ?; apply/idP/idP; [move/dvdp_addr <-| move/dvdp_addl <-]. Qed. Lemma dvdp_subr d m n : d %| m -> (d %| m - n) = (d %| n). Proof. (* Goal: forall _ : is_true (@dvdp R d m), @eq bool (@dvdp R d (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) m (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) n))) (@dvdp R d n) *) by move=> ?; apply dvdp_add_eq; rewrite -addrA addNr simp. Qed. Lemma dvdp_subl d m n : d %| n -> (d %| m - n) = (d %| m). Proof. (* Goal: forall _ : is_true (@dvdp R d n), @eq bool (@dvdp R d (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) m (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) n))) (@dvdp R d m) *) by move/dvdp_addl<-; rewrite subrK. Qed. Lemma dvdp_sub d m n : d %| m -> d %| n -> d %| m - n. Proof. (* Goal: forall (_ : is_true (@dvdp R d m)) (_ : is_true (@dvdp R d n)), is_true (@dvdp R d (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) m (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) n))) *) by move=> *; rewrite dvdp_subl. Qed. Lemma dvdp_mod d n m : d %| n -> (d %| m) = (d %| m %% n). Lemma dvdp_trans : transitive (@dvdp R). Proof. (* Goal: @transitive (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@dvdp R) *) move=> n d m. (* Goal: forall (_ : is_true (@dvdp R d n)) (_ : is_true (@dvdp R n m)), is_true (@dvdp R d m) *) case: (altP (d =P 0)) => [-> | dn0]; first by move/dvd0pP->. (* Goal: forall (_ : is_true (@dvdp R d n)) (_ : is_true (@dvdp R n m)), is_true (@dvdp R d m) *) case: (altP (n =P 0)) => [-> | nn0]; first by move=> _ /dvd0pP ->. (* Goal: forall (_ : is_true (@dvdp R d n)) (_ : is_true (@dvdp R n m)), is_true (@dvdp R d m) *) rewrite dvdp_eq; set c1 := _ ^+ _; set q1 := _ %/ _; move/eqP=> Hq1. (* Goal: forall _ : is_true (@dvdp R n m), is_true (@dvdp R d m) *) rewrite dvdp_eq; set c2 := _ ^+ _; set q2 := _ %/ _; move/eqP=> Hq2. (* Goal: is_true (@dvdp R d m) *) have sn0 : c1 * c2 != 0 by rewrite mulf_neq0 // expf_neq0 // lead_coef_eq0. (* Goal: is_true (@dvdp R d m) *) by apply: (@eq_dvdp _ (q2 * q1) _ _ sn0); rewrite -scalerA Hq2 scalerAr Hq1 mulrA. Qed. Lemma dvdp_mulIl p q : p %| p * q. Proof. (* Goal: is_true (@dvdp R p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q)) *) by apply: dvdp_mulr; apply: dvdpp. Qed. Lemma dvdp_mulIr p q : q %| p * q. Proof. (* Goal: is_true (@dvdp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q)) *) by apply: dvdp_mull; apply: dvdpp. Qed. Lemma dvdp_mul2r r p q : r != 0 -> (p * r %| q * r) = (p %| q). Lemma dvdp_mul2l r p q: r != 0 -> (r * p %| r * q) = (p %| q). Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) r (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), @eq bool (@dvdp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) r p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) r q)) (@dvdp R p q) *) by rewrite ![r * _]GRing.mulrC; apply: dvdp_mul2r. Qed. Lemma ltn_divpr d p q : d %| q -> (size p < size (q %/ d)) = (size (p * d) < size q). Proof. (* Goal: forall _ : is_true (@dvdp R d q), @eq bool (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R q d)))) (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) *) by move=> dv_d_q; rewrite !ltnNge leq_divpl. Qed. Lemma dvdp_exp d k p : 0 < k -> d %| p -> d %| (p ^+ k). Proof. (* Goal: forall (_ : is_true (leq (S O) k)) (_ : is_true (@dvdp R d p)), is_true (@dvdp R d (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k)) *) by case: k => // k _ d_dv_m; rewrite exprS dvdp_mulr. Qed. Lemma dvdp_exp2l d k l : k <= l -> d ^+ k %| d ^+ l. Proof. (* Goal: forall _ : is_true (leq k l), is_true (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) d k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) d l)) *) by move/subnK <-; rewrite exprD dvdp_mull // ?lead_coef_exp ?unitrX. Qed. Lemma dvdp_Pexp2l d k l : 1 < size d -> (d ^+ k %| d ^+ l) = (k <= l). Proof. (* Goal: forall _ : is_true (leq (S (S O)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d))), @eq bool (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) d k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) d l)) (leq k l) *) move=> sd; case: leqP => [|gt_n_m]; first exact: dvdp_exp2l. (* Goal: @eq bool (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) d k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) d l)) false *) have dn0 : d != 0 by rewrite -size_poly_gt0; apply: ltn_trans sd. (* Goal: @eq bool (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) d k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) d l)) false *) rewrite gtNdvdp ?expf_neq0 // polySpred ?expf_neq0 // size_exp /=. (* Goal: is_true (leq (S (S (muln (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) d))) l))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) d k)))) *) rewrite [size (d ^+ k)]polySpred ?expf_neq0 // size_exp ltnS ltn_mul2l. (* Goal: is_true (andb (leq (S O) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) d)))) (leq (S l) k)) *) by move: sd; rewrite -subn_gt0 subn1; move->. Qed. Lemma dvdp_exp2r p q k : p %| q -> p ^+ k %| q ^+ k. Lemma dvdp_exp_sub p q k l: p != 0 -> (p ^+ k %| q * p ^+ l) = (p ^+ (k - l) %| q). Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), @eq bool (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l))) (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (subn k l)) q) *) move=> pn0; case: (leqP k l)=> hkl. (* Goal: @eq bool (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l))) (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (subn k l)) q) *) (* Goal: @eq bool (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l))) (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (subn k l)) q) *) move: (hkl); rewrite -subn_eq0; move/eqP->; rewrite expr0 dvd1p. (* Goal: @eq bool (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l))) (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (subn k l)) q) *) (* Goal: @eq bool (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l))) true *) apply: dvdp_mull; case: (ltnP 1%N (size p)) => sp. (* Goal: @eq bool (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l))) (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (subn k l)) q) *) (* Goal: is_true (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l)) *) (* Goal: is_true (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l)) *) by rewrite dvdp_Pexp2l. (* Goal: @eq bool (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l))) (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (subn k l)) q) *) (* Goal: is_true (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l)) *) move: sp; case esp: (size p) => [|sp]. (* Goal: @eq bool (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l))) (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (subn k l)) q) *) (* Goal: forall _ : is_true (leq (S sp) (S O)), is_true (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l)) *) (* Goal: forall _ : is_true (leq O (S O)), is_true (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l)) *) by move/eqP: esp; rewrite size_poly_eq0 (negPf pn0). (* Goal: @eq bool (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l))) (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (subn k l)) q) *) (* Goal: forall _ : is_true (leq (S sp) (S O)), is_true (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l)) *) rewrite ltnS leqn0; move/eqP=> sp0; move/eqP: esp; rewrite sp0. (* Goal: @eq bool (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l))) (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (subn k l)) q) *) (* Goal: forall _ : is_true (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (S O)), is_true (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l)) *) by case/size_poly1P => c cn0 ->; move/subnK: hkl<-; rewrite exprD dvdp_mulIr. (* Goal: @eq bool (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l))) (@dvdp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (subn k l)) q) *) rewrite -{1}[k](@subnK l) 1?ltnW// exprD dvdp_mul2r//. (* Goal: is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) elim: l {hkl}=> [|l ihl]; first by rewrite expr0 oner_eq0. (* Goal: is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (S l)) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) by rewrite exprS mulf_neq0. Qed. Lemma dvdp_XsubCl p x : ('X - x%:P) %| p = root p x. Proof. (* Goal: @eq bool (@dvdp R (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) x))) p) (@root (GRing.IntegralDomain.ringType R) p x) *) by rewrite dvdpE; apply: Ring.rdvdp_XsubCl. Qed. Lemma polyXsubCP p x : reflect (p.[x] = 0) (('X - x%:P) %| p). Lemma eqp_div_XsubC p c : (p == (p %/ ('X - c%:P)) * ('X - c%:P)) = ('X - c%:P %| p). Proof. (* Goal: @eq bool (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R p (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c)))) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c))))) (@dvdp R (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c))) p) *) by rewrite dvdp_eq lead_coefXsubC expr1n scale1r. Qed. Lemma root_factor_theorem p x : root p x = (('X - x%:P) %| p). Lemma uniq_roots_dvdp p rs : all (root p) rs -> uniq_roots rs -> (\prod_(z <- rs) ('X - z%:P)) %| p. Proof. (* Goal: forall (_ : is_true (@all (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@root (GRing.IntegralDomain.ringType R) p) rs)) (_ : is_true (@uniq_roots (GRing.IntegralDomain.unitRingType R) rs)), is_true (@dvdp R (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) rs (fun z : GRing.Ring.sort (GRing.IntegralDomain.ringType R) => @BigBody (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) z (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R))) true (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) z))))) p) *) move=> rrs; case/(uniq_roots_prod_XsubC rrs)=> q ->. (* Goal: is_true (@dvdp R (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) rs (fun z : GRing.Ring.sort (GRing.IntegralDomain.ringType R) => @BigBody (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) z (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R))) true (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) z))))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) q (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (GRing.one (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) rs (fun z : GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R) => @BigBody (GRing.Ring.sort (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) z (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) true (@GRing.add (poly_zmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polyX (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.opp (poly_zmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyC (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) z))))))) *) by apply: dvdp_mull; rewrite // (eqP (monic_prod_XsubC _)) unitr1. Qed. Lemma root_bigmul : forall x (ps : seq {poly R}), ~~root (\big[*%R/1]_(p <- ps) p) x = all (fun p => ~~ root p x) ps. Proof. (* Goal: forall (x : GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (ps : list (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)))), @eq bool (negb (@root (GRing.IntegralDomain.ringType R) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) ps (fun p : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) => @BigBody (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R))) true p)) x)) (@all (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (fun p : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) => negb (@root (GRing.IntegralDomain.ringType R) p x)) ps) *) move=> x; elim; first by rewrite big_nil root1. (* Goal: forall (a : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (l : list (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)))) (_ : @eq bool (negb (@root (GRing.IntegralDomain.ringType R) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) l (fun p : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) => @BigBody (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R))) true p)) x)) (@all (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (fun p : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) => negb (@root (GRing.IntegralDomain.ringType R) p x)) l)), @eq bool (negb (@root (GRing.IntegralDomain.ringType R) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) (@cons (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) a l) (fun p : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) => @BigBody (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R))) true p)) x)) (@all (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (fun p : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) => negb (@root (GRing.IntegralDomain.ringType R) p x)) (@cons (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) a l)) *) by move=> p ps ihp; rewrite big_cons /= rootM negb_or ihp. Qed. Lemma eqpP m n : reflect (exists2 c12, (c12.1 != 0) && (c12.2 != 0) & c12.1 *: m = c12.2 *: n) Lemma eqp_eq p q: p %= q -> (lead_coef q) *: p = (lead_coef p) *: q. Lemma eqpxx : reflexive (@eqp R). Proof. (* Goal: @reflexive (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@eqp R) *) by move=> p; rewrite /eqp dvdpp. Qed. Hint Resolve eqpxx : core. Lemma eqp_sym : symmetric (@eqp R). Proof. (* Goal: @symmetric (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@eqp R) *) by move=> p q; rewrite /eqp andbC. Qed. Lemma eqp_trans : transitive (@eqp R). Proof. (* Goal: @transitive (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@eqp R) *) move=> p q r; case/andP=> Dp pD; case/andP=> Dq qD. (* Goal: is_true (@eqp R q r) *) by rewrite /eqp (dvdp_trans Dp) // (dvdp_trans qD). Qed. Lemma eqp_ltrans : left_transitive (@eqp R). Proof. (* Goal: @left_transitive (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@eqp R) *) move=> p q r pq. (* Goal: @eq bool (@eqp R p pq) (@eqp R q pq) *) by apply/idP/idP=> e; apply: eqp_trans e; rewrite // eqp_sym. Qed. Lemma eqp_rtrans : right_transitive (@eqp R). Proof. (* Goal: @right_transitive (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@eqp R) *) by move=> x y xy z; rewrite eqp_sym (eqp_ltrans xy) eqp_sym. Qed. Lemma eqp0 : forall p, (p %= 0) = (p == 0). Proof. (* Goal: forall p : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)), @eq bool (@eqp R p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) *) move=> p; case: eqP; move/eqP=> Ep; first by rewrite (eqP Ep) eqpxx. (* Goal: @eq bool (@eqp R p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) false *) by apply/negP; case/andP=> _; rewrite /dvdp modp0 (negPf Ep). Qed. Lemma eqp01 : 0 %= (1 : {poly R}) = false. Proof. (* Goal: @eq bool (@eqp R (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)) : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)))) false *) case abs : (0 %= 1) => //; case/eqpP: abs=> [[c1 c2]] /andP [c1n0 c2n0] /=. (* Goal: forall _ : @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c2 (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))), @eq bool true false *) by rewrite scaler0 alg_polyC; move/eqP; rewrite eq_sym polyC_eq0 (negbTE c2n0). Qed. Lemma eqp_scale p c : c != 0 -> c *: p %= p. Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) c (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))), is_true (@eqp R (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c p) p) *) move=> c0; apply/eqpP; exists (1, c); first by rewrite c0 oner_eq0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R)))))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@fst (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (@pair (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (GRing.one (GRing.IntegralDomain.ringType R)) c)) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c p)) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@snd (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (@pair (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (GRing.one (GRing.IntegralDomain.ringType R)) c)) p) *) by rewrite scale1r. Qed. Lemma eqp_size p q : p %= q -> size p = size q. Proof. (* Goal: forall _ : is_true (@eqp R p q), @eq nat (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) *) case: (q =P 0); move/eqP => Eq; first by rewrite (eqP Eq) eqp0; move/eqP->. (* Goal: forall _ : is_true (@eqp R p q), @eq nat (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) *) rewrite eqp_sym; case: (p =P 0); move/eqP => Ep. (* Goal: forall _ : is_true (@eqp R q p), @eq nat (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) *) (* Goal: forall _ : is_true (@eqp R q p), @eq nat (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) *) by rewrite (eqP Ep) eqp0; move/eqP->. (* Goal: forall _ : is_true (@eqp R q p), @eq nat (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) *) by case/andP => Dp Dq; apply: anti_leq; rewrite !dvdp_leq. Qed. Lemma size_poly_eq1 p : (size p == 1%N) = (p %= 1). Lemma polyXsubC_eqp1 (x : R) : ('X - x%:P %= 1) = false. Proof. (* Goal: @eq bool (@eqp R (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) x))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) false *) by rewrite -size_poly_eq1 size_XsubC. Qed. Lemma dvdp_eqp1 p q : p %| q -> q %= 1 -> p %= 1. Proof. (* Goal: forall (_ : is_true (@dvdp R p q)) (_ : is_true (@eqp R q (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))))), is_true (@eqp R p (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) move=> dpq hq. (* Goal: is_true (@eqp R p (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) have sizeq : size q == 1%N by rewrite size_poly_eq1. (* Goal: is_true (@eqp R p (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) have n0q : q != 0. (* Goal: is_true (@eqp R p (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) (* Goal: is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) by case abs: (q == 0) => //; move: hq; rewrite (eqP abs) eqp01. (* Goal: is_true (@eqp R p (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) rewrite -size_poly_eq1 eqn_leq -{1}(eqP sizeq) dvdp_leq //=. (* Goal: is_true (leq (S O) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))) *) case p0 : (size p == 0%N); last by rewrite neq0_lt0n. (* Goal: is_true (leq (S O) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))) *) by move: dpq; rewrite size_poly_eq0 in p0; rewrite (eqP p0) dvd0p (negbTE n0q). Qed. Lemma eqp_dvdr q p d: p %= q -> d %| p = (d %| q). Proof. (* Goal: forall _ : is_true (@eqp R p q), @eq bool (@dvdp R d p) (@dvdp R d q) *) suff Hmn m n: m %= n -> (d %| m) -> (d %| n). (* Goal: forall (_ : is_true (@eqp R m n)) (_ : is_true (@dvdp R d m)), is_true (@dvdp R d n) *) (* Goal: forall _ : is_true (@eqp R p q), @eq bool (@dvdp R d p) (@dvdp R d q) *) by move=> mn; apply/idP/idP; apply: Hmn=> //; rewrite eqp_sym. (* Goal: forall (_ : is_true (@eqp R m n)) (_ : is_true (@dvdp R d m)), is_true (@dvdp R d n) *) by rewrite /eqp; case/andP=> pq qp dp; apply: (dvdp_trans dp). Qed. Lemma eqp_dvdl d2 d1 p : d1 %= d2 -> d1 %| p = (d2 %| p). Proof. (* Goal: forall _ : is_true (@eqp R d1 d2), @eq bool (@dvdp R d1 p) (@dvdp R d2 p) *) suff Hmn m n: m %= n -> (m %| p) -> (n %| p). (* Goal: forall (_ : is_true (@eqp R m n)) (_ : is_true (@dvdp R m p)), is_true (@dvdp R n p) *) (* Goal: forall _ : is_true (@eqp R d1 d2), @eq bool (@dvdp R d1 p) (@dvdp R d2 p) *) by move=> ?; apply/idP/idP; apply: Hmn; rewrite // eqp_sym. (* Goal: forall (_ : is_true (@eqp R m n)) (_ : is_true (@dvdp R m p)), is_true (@dvdp R n p) *) by rewrite /eqp; case/andP=> dd' d'd dp; apply: (dvdp_trans d'd). Qed. Lemma dvdp_scaler c m n : c != 0 -> m %| c *: n = (m %| n). Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) c (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))), @eq bool (@dvdp R m (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c n)) (@dvdp R m n) *) by move=> cn0; apply: eqp_dvdr; apply: eqp_scale. Qed. Lemma dvdp_scalel c m n : c != 0 -> (c *: m %| n) = (m %| n). Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) c (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))), @eq bool (@dvdp R (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c m) n) (@dvdp R m n) *) by move=> cn0; apply: eqp_dvdl; apply: eqp_scale. Qed. Lemma dvdp_opp d p : d %| (- p) = (d %| p). Proof. (* Goal: @eq bool (@dvdp R d (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) p)) (@dvdp R d p) *) by apply: eqp_dvdr; rewrite -scaleN1r eqp_scale ?oppr_eq0 ?oner_eq0. Qed. Lemma eqp_mul2r r p q : r != 0 -> (p * r %= q * r) = (p %= q). Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) r (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), @eq bool (@eqp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q r)) (@eqp R p q) *) by move=> nz_r; rewrite /eqp !dvdp_mul2r. Qed. Lemma eqp_mul2l r p q: r != 0 -> (r * p %= r * q) = (p %= q). Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) r (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), @eq bool (@eqp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) r p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) r q)) (@eqp R p q) *) by move=> nz_r; rewrite /eqp !dvdp_mul2l. Qed. Lemma eqp_mull r p q: (q %= r) -> (p * q %= p * r). Proof. (* Goal: forall _ : is_true (@eqp R q r), is_true (@eqp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) case/eqpP=> [[c d]] /andP [c0 d0 e]; apply/eqpP; exists (c, d); rewrite ?c0 //. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.base (GRing.IntegralDomain.ringType R) (@GRing.Lmodule.sort (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.class (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R)))))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@fst (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (@pair (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) c d)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q)) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@snd (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (@pair (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) c d)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) by rewrite scalerAr e -scalerAr. Qed. Lemma eqp_mulr q p r : (p %= q) -> (p * r %= q * r). Proof. (* Goal: forall _ : is_true (@eqp R p q), is_true (@eqp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q r)) *) by move=> epq; rewrite ![_ * r]mulrC eqp_mull. Qed. Lemma eqp_exp p q k : p %= q -> p ^+ k %= q ^+ k. Proof. (* Goal: forall _ : is_true (@eqp R p q), is_true (@eqp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) q k)) *) move=> pq; elim: k=> [|k ihk]; first by rewrite !expr0 eqpxx. (* Goal: is_true (@eqp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (S k)) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) q (S k))) *) by rewrite !exprS (@eqp_trans (q * p ^+ k)) // (eqp_mulr, eqp_mull). Qed. Lemma polyC_eqp1 (c : R) : (c%:P %= 1) = (c != 0). Proof. (* Goal: @eq bool (@eqp R (@polyC (GRing.IntegralDomain.ringType R) c) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) (negb (@eq_op (GRing.IntegralDomain.eqType R) c (GRing.zero (GRing.IntegralDomain.zmodType R)))) *) apply/eqpP/idP => [[[x y]] |nc0] /=. (* Goal: @ex2 (prod (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R)) (fun c12 : prod (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) => is_true (andb (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@fst (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) c12) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@snd (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) c12) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))))) (fun c12 : prod (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) => @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@fst (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) c12) (@polyC (GRing.IntegralDomain.ringType R) c)) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@snd (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) c12) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))))) *) (* Goal: forall (_ : is_true (andb (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) x (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) y (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))))) (_ : @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) x (@polyC (GRing.IntegralDomain.ringType R) c)) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) y (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))))), is_true (negb (@eq_op (GRing.IntegralDomain.eqType R) c (GRing.zero (GRing.IntegralDomain.zmodType R)))) *) case c0: (c == 0); rewrite // alg_polyC (eqP c0) scaler0. (* Goal: @ex2 (prod (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R)) (fun c12 : prod (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) => is_true (andb (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@fst (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) c12) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@snd (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) c12) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))))) (fun c12 : prod (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) => @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@fst (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) c12) (@polyC (GRing.IntegralDomain.ringType R) c)) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@snd (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) c12) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))))) *) (* Goal: forall (_ : is_true (andb (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) x (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) y (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))))) (_ : @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (GRing.zero (@GRing.Lmodule.zmodType (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lmodType (GRing.IntegralDomain.ringType R)))) (@polyC (GRing.IntegralDomain.ringType R) y)), is_true (negb true) *) by case/andP=> _ /=; move/negbTE<-; move/eqP; rewrite eq_sym polyC_eq0. (* Goal: @ex2 (prod (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R)) (fun c12 : prod (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) => is_true (andb (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@fst (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) c12) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@snd (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) c12) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))))) (fun c12 : prod (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) => @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@fst (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) c12) (@polyC (GRing.IntegralDomain.ringType R) c)) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@snd (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) c12) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))))) *) exists (1, c); first by rewrite nc0 /= oner_neq0. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@fst (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) (@pair (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (GRing.IntegralDomain.sort R) (GRing.one (GRing.IntegralDomain.ringType R)) c)) (@polyC (GRing.IntegralDomain.ringType R) c)) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@snd (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) (@pair (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (GRing.IntegralDomain.sort R) (GRing.one (GRing.IntegralDomain.ringType R)) c)) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) by rewrite alg_polyC scale1r. Qed. Lemma dvdUp d p: d %= 1 -> d %| p. Proof. (* Goal: forall _ : is_true (@eqp R d (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))), is_true (@dvdp R d p) *) by move/eqp_dvdl->; rewrite dvd1p. Qed. Lemma dvdp_size_eqp p q : p %| q -> size p == size q = (p %= q). Lemma eqp_root p q : p %= q -> root p =1 root q. Proof. (* Goal: forall _ : is_true (@eqp R p q), @eqfun bool (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@root (GRing.IntegralDomain.ringType R) p) (@root (GRing.IntegralDomain.ringType R) q) *) move/eqpP=> [[c d]] /andP [c0 d0 e] x; move/negPf:c0=>c0; move/negPf:d0=>d0. (* Goal: @eq bool (@root (GRing.IntegralDomain.ringType R) p x) (@root (GRing.IntegralDomain.ringType R) q x) *) rewrite rootE -[_==_]orFb -c0 -mulf_eq0 -hornerZ e hornerZ. (* Goal: @eq bool (@eq_op (GRing.Ring.eqType (GRing.IntegralDomain.ringType R)) (@GRing.mul (GRing.IntegralDomain.ringType R) (@snd (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (@pair (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) c d)) (@horner (GRing.IntegralDomain.ringType R) q x)) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))) (@root (GRing.IntegralDomain.ringType R) q x) *) by rewrite mulf_eq0 d0. Qed. Lemma eqp_rmod_mod p q : rmodp p q %= modp p q. Proof. (* Goal: is_true (@eqp R (rmodp (GRing.IntegralDomain.ringType R) p q) (@modp R p q)) *) rewrite modpE eqp_sym; case: ifP => ulcq //. (* Goal: is_true (@eqp R (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (rscalp (GRing.IntegralDomain.ringType R) p q))) (rmodp (GRing.IntegralDomain.ringType R) p q)) (rmodp (GRing.IntegralDomain.ringType R) p q)) *) apply: eqp_scale; rewrite invr_eq0 //. (* Goal: is_true (negb (@eq_op (GRing.UnitRing.eqType (GRing.IntegralDomain.unitRingType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (rscalp (GRing.IntegralDomain.ringType R) p q)) (GRing.zero (GRing.UnitRing.zmodType (GRing.IntegralDomain.unitRingType R))))) *) by apply: expf_neq0; apply: contraTneq ulcq => ->; rewrite unitr0. Qed. Lemma eqp_rdiv_div p q : rdivp p q %= divp p q. Proof. (* Goal: is_true (@eqp R (rdivp (GRing.IntegralDomain.ringType R) p q) (@divp R p q)) *) rewrite divpE eqp_sym; case: ifP=> ulcq //; apply: eqp_scale; rewrite invr_eq0 //. (* Goal: is_true (negb (@eq_op (GRing.UnitRing.eqType (GRing.IntegralDomain.unitRingType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) q) (rscalp (GRing.IntegralDomain.ringType R) p q)) (GRing.zero (GRing.UnitRing.zmodType (GRing.IntegralDomain.unitRingType R))))) *) by apply: expf_neq0; apply: contraTneq ulcq => ->; rewrite unitr0. Qed. Lemma dvd_eqp_divl d p q (dvd_dp : d %| q) (eq_pq : p %= q) : p %/ d %= q %/ d. Proof. (* Goal: is_true (@eqp R (@divp R p d) (@divp R q d)) *) case: (eqVneq q 0) eq_pq=> [->|q_neq0]; first by rewrite eqp0=> /eqP->. (* Goal: forall _ : is_true (@eqp R p q), is_true (@eqp R (@divp R p d) (@divp R q d)) *) have d_neq0: d != 0 by apply: contraL dvd_dp=> /eqP->; rewrite dvd0p. (* Goal: forall _ : is_true (@eqp R p q), is_true (@eqp R (@divp R p d) (@divp R q d)) *) move=> eq_pq; rewrite -(@eqp_mul2r d) // !divpK // ?(eqp_dvdr _ eq_pq) //. (* Goal: is_true (@eqp R (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (@scalp R p d)) p) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (@scalp R q d)) q)) *) rewrite (eqp_ltrans (eqp_scale _ _)) ?lc_expn_scalp_neq0 //. (* Goal: is_true (@eqp R p (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) d) (@scalp R q d)) q)) *) by rewrite (eqp_rtrans (eqp_scale _ _)) ?lc_expn_scalp_neq0. Qed. Definition gcdp_rec p q := let: (p1, q1) := if size p < size q then (q, p) else (p, q) in if p1 == 0 then q1 else let fix loop (n : nat) (pp qq : {poly R}) {struct n} := let rr := modp pp qq in if rr == 0 then qq else if n is n1.+1 then loop n1 qq rr else rr in loop (size p1) p1 q1. Definition gcdp := nosimpl gcdp_rec. Lemma gcd0p : left_id 0 gcdp. Proof. (* Goal: @left_id (GRing.Zmodule.sort (poly_zmodType (GRing.IntegralDomain.ringType R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) gcdp *) move=> p; rewrite /gcdp /gcdp_rec size_poly0 size_poly_gt0 if_neg. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (let 'pair p1 q1 := if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) p else @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) in if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then q1 else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p1)) p1 q1) p *) case: ifP => /= [_ | nzp]; first by rewrite eqxx. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)) else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) p *) by rewrite polySpred !(modp0, nzp) //; case: _.-1 => [|m]; rewrite mod0p eqxx. Qed. Lemma gcdp0 : right_id 0 gcdp. Proof. (* Goal: @right_id (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (GRing.Zmodule.sort (poly_zmodType (GRing.IntegralDomain.ringType R))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) gcdp *) move=> p; have:= gcd0p p; rewrite /gcdp /gcdp_rec size_poly0 size_poly_gt0. (* Goal: forall _ : @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (let 'pair p1 q1 := if negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) then @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) else @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) p in if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then q1 else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p1)) p1 q1) p, @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) O then @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) p else @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) in if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then q1 else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p1)) p1 q1) p *) by rewrite if_neg; case: ifP => /= p0; rewrite ?(eqxx, p0) // (eqP p0). Qed. Lemma gcdpE p q : gcdp p q = if size p < size q then gcdp (modp q p) p else gcdp (modp p q) q. Proof. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) pose gcdpE_rec := fix gcdpE_rec (n : nat) (pp qq : {poly R}) {struct n} := let rr := modp pp qq in if rr == 0 then qq else if n is n1.+1 then gcdpE_rec n1 qq rr else rr. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) have Irec: forall k l p q, size q <= k -> size q <= l -> size q < size p -> gcdpE_rec k p q = gcdpE_rec l p q. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: forall (k l : nat) (p q : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (_ : is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) k)) (_ : is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) l)) (_ : is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdpE_rec k p q) (gcdpE_rec l p q) *) + (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: forall (k l : nat) (p q : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (_ : is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) k)) (_ : is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) l)) (_ : is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdpE_rec k p q) (gcdpE_rec l p q) *) elim=> [|m Hrec] [|n] //= p1 q1. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S m))) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S n))) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec m q1 (@modp R p1 q1)) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec n q1 (@modp R p1 q1)) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S m))) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) O)) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec m q1 (@modp R p1 q1)) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else @modp R p1 q1) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) O)) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S n))) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else @modp R p1 q1) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec n q1 (@modp R p1 q1)) *) - (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S m))) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S n))) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec m q1 (@modp R p1 q1)) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec n q1 (@modp R p1 q1)) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S m))) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) O)) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec m q1 (@modp R p1 q1)) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else @modp R p1 q1) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) O)) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S n))) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else @modp R p1 q1) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec n q1 (@modp R p1 q1)) *) rewrite leqn0 size_poly_eq0; move/eqP=> -> _. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S m))) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S n))) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec m q1 (@modp R p1 q1)) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec n q1 (@modp R p1 q1)) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S m))) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) O)) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec m q1 (@modp R p1 q1)) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else @modp R p1 q1) *) (* Goal: forall _ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)) else @modp R p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)) else gcdpE_rec n (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) (@modp R p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) rewrite size_poly0 size_poly_gt0 modp0 => nzp. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S m))) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S n))) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec m q1 (@modp R p1 q1)) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec n q1 (@modp R p1 q1)) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S m))) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) O)) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec m q1 (@modp R p1 q1)) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else @modp R p1 q1) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) p1 (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)) else p1) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) p1 (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)) else gcdpE_rec n (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) p1) *) by rewrite (negPf nzp); case: n => [|n] /=; rewrite mod0p eqxx. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S m))) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S n))) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec m q1 (@modp R p1 q1)) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec n q1 (@modp R p1 q1)) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S m))) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) O)) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec m q1 (@modp R p1 q1)) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else @modp R p1 q1) *) - (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S m))) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S n))) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec m q1 (@modp R p1 q1)) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec n q1 (@modp R p1 q1)) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S m))) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) O)) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec m q1 (@modp R p1 q1)) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else @modp R p1 q1) *) rewrite leqn0 size_poly_eq0 => _; move/eqP=> ->. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S m))) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S n))) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec m q1 (@modp R p1 q1)) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec n q1 (@modp R p1 q1)) *) (* Goal: forall _ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)) else gcdpE_rec m (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) (@modp R p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)) else @modp R p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) *) rewrite size_poly0 size_poly_gt0 modp0 => nzp. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S m))) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S n))) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec m q1 (@modp R p1 q1)) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec n q1 (@modp R p1 q1)) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) p1 (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)) else gcdpE_rec m (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) p1) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) p1 (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)) else p1) *) by rewrite (negPf nzp); case: m {Hrec} => [|m] /=; rewrite mod0p eqxx. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: forall (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S m))) (_ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1)) (S n))) (_ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q1))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec m q1 (@modp R p1 q1)) (if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p1 q1) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then q1 else gcdpE_rec n q1 (@modp R p1 q1)) *) case: ifP => Epq Sm Sn Sq //; rewrite ?Epq //. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdpE_rec m q1 (@modp R p1 q1)) (gcdpE_rec n q1 (@modp R p1 q1)) *) case: (eqVneq q1 0) => [->|nzq]. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdpE_rec m q1 (@modp R p1 q1)) (gcdpE_rec n q1 (@modp R p1 q1)) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdpE_rec m (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) (@modp R p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) (gcdpE_rec n (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) (@modp R p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) by case: n m {Sm Sn Hrec} => [|m] [|n] //=; rewrite mod0p eqxx. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdpE_rec m q1 (@modp R p1 q1)) (gcdpE_rec n q1 (@modp R p1 q1)) *) apply: Hrec; last by rewrite ltn_modp. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p1 q1))) n) *) (* Goal: is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p1 q1))) m) *) by rewrite -ltnS (leq_trans _ Sm) // ltn_modp. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p1 q1))) n) *) by rewrite -ltnS (leq_trans _ Sn) // ltn_modp. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) case: (eqVneq p 0) => [-> | nzp]. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) else gcdp (@modp R (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) q) q) *) by rewrite mod0p modp0 gcd0p gcdp0 if_same. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) case: (eqVneq q 0) => [-> | nzq]. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) then gcdp (@modp R (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) p) p else gcdp (@modp R p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) *) by rewrite mod0p modp0 gcd0p gcdp0 if_same. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (gcdp p q) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then gcdp (@modp R q p) p else gcdp (@modp R p q) q) *) rewrite /gcdp /gcdp_rec. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) q p else @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p q in if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then q1 else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p1)) p1 q1) (if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R q p)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) then @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p (@modp R q p) else @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@modp R q p) p in if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then q1 else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p1)) p1 q1 else let 'pair p1 q1 := if leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) then @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) q (@modp R p q) else @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@modp R p q) q in if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then q1 else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p1)) p1 q1) *) case: ltnP; rewrite (negPf nzp, negPf nzq) //=. (* Goal: forall _ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) p q) (let 'pair p1 q1 := if leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) then @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) q (@modp R p q) else @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@modp R p q) q in if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then q1 else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)) p1 q1) *) (* Goal: forall _ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) q p) (let 'pair p1 q1 := if leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R q p)))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) then @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p (@modp R q p) else @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@modp R q p) p in if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then q1 else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)) p1 q1) *) move=> ltpq; rewrite ltn_modp (negPf nzp) //=. (* Goal: forall _ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) p q) (let 'pair p1 q1 := if leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) then @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) q (@modp R p q) else @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@modp R p q) q in if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then q1 else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)) p1 q1) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) q p) (if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then @modp R q p else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) p (@modp R q p)) *) rewrite -(ltn_predK ltpq) /=; case: eqP => [->|]. (* Goal: forall _ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) p q) (let 'pair p1 q1 := if leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) then @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) q (@modp R p q) else @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@modp R p q) q in if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then q1 else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)) p1 q1) *) (* Goal: forall _ : not (@eq (Equality.sort (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R q p) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n0 : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n0} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n0 with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q))) p (@modp R q p)) (if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then @modp R q p else (fix loop (n0 : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n0} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n0 with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) p (@modp R q p)) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p (if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) p (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) by case: (size p) => [|[|s]]; rewrite /= modp0 (negPf nzp) // mod0p eqxx. (* Goal: forall _ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) p q) (let 'pair p1 q1 := if leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) then @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) q (@modp R p q) else @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@modp R p q) q in if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then q1 else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)) p1 q1) *) (* Goal: forall _ : not (@eq (Equality.sort (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R q p) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n0 : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n0} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n0 with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q))) p (@modp R q p)) (if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then @modp R q p else (fix loop (n0 : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n0} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n0 with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) p (@modp R q p)) *) move/eqP=> nzqp; rewrite (negPf nzp). (* Goal: forall _ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) p q) (let 'pair p1 q1 := if leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) then @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) q (@modp R p q) else @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@modp R p q) q in if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then q1 else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)) p1 q1) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q))) p (@modp R q p)) ((fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) p (@modp R q p)) *) apply: Irec => //; last by rewrite ltn_modp. (* Goal: forall _ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) p q) (let 'pair p1 q1 := if leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) then @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) q (@modp R p q) else @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@modp R p q) q in if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then q1 else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)) p1 q1) *) (* Goal: is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R q p))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))) *) (* Goal: is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R q p))) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))) *) by rewrite -ltnS (ltn_predK ltpq) (leq_trans _ ltpq) ?leqW // ltn_modp. (* Goal: forall _ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) p q) (let 'pair p1 q1 := if leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) then @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) q (@modp R p q) else @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@modp R p q) q in if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then q1 else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)) p1 q1) *) (* Goal: is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R q p))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))) *) by rewrite ltnW // ltn_modp. (* Goal: forall _ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) p q) (let 'pair p1 q1 := if leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) then @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) q (@modp R p q) else @pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@modp R p q) q in if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p1 (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then q1 else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p1)) p1 q1) *) move=> leqp; rewrite ltn_modp (negPf nzq) //=. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) p q) (if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then @modp R p q else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) q (@modp R p q)) *) have p_gt0: size p > 0 by rewrite size_poly_gt0. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) p q) (if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then @modp R p q else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) q (@modp R p q)) *) rewrite -(prednK p_gt0) /=; case: eqP => [->|]. (* Goal: forall _ : not (@eq (Equality.sort (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p q) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n0 : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n0} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n0 with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))) q (@modp R p q)) (if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then @modp R p q else (fix loop (n0 : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n0} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n0 with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) q (@modp R p q)) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) q (if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) else (fix loop (n : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) q (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) by case: (size q) => [|[|s]]; rewrite /= modp0 (negPf nzq) // mod0p eqxx. (* Goal: forall _ : not (@eq (Equality.sort (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p q) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) ((fix loop (n0 : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n0} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n0 with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))) q (@modp R p q)) (if @eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) then @modp R p q else (fix loop (n0 : nat) (pp qq : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) {struct n0} : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) := if @eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R pp qq) (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) then qq else match n0 with | O => @modp R pp qq | S n1 => loop n1 qq (@modp R pp qq) end) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)) q (@modp R p q)) *) move/eqP=> nzpq; rewrite (negPf nzq); apply: Irec => //; rewrite ?ltn_modp //. (* Goal: is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q))) *) (* Goal: is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q))) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))) *) by rewrite -ltnS (prednK p_gt0) (leq_trans _ leqp) // ltn_modp. (* Goal: is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q))) *) by rewrite ltnW // ltn_modp. Qed. Lemma size_gcd1p p : size (gcdp 1 p) = 1%N. Proof. (* Goal: @eq nat (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) p))) (S O) *) rewrite gcdpE size_polyC oner_eq0 /= modp1; case: ltnP. (* Goal: forall _ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) (S O)), @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp (@modp R (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) p) p))) (S O) *) (* Goal: forall _ : is_true (leq (S (S O)) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))), @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))))) (S O) *) by rewrite gcd0p size_polyC oner_eq0. (* Goal: forall _ : is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) (S O)), @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp (@modp R (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) p) p))) (S O) *) move/size1_polyC=> e; rewrite e. (* Goal: @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp (@modp R (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) (@polyC (GRing.IntegralDomain.ringType R) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@polyseq (GRing.IntegralDomain.ringType R) p) O))) (@polyC (GRing.IntegralDomain.ringType R) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@polyseq (GRing.IntegralDomain.ringType R) p) O))))) (S O) *) case p00: (p`_0 == 0); first by rewrite (eqP p00) modp0 gcdp0 size_poly1. (* Goal: @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp (@modp R (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) (@polyC (GRing.IntegralDomain.ringType R) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@polyseq (GRing.IntegralDomain.ringType R) p) O))) (@polyC (GRing.IntegralDomain.ringType R) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@polyseq (GRing.IntegralDomain.ringType R) p) O))))) (S O) *) by rewrite modpC ?p00 // gcd0p size_polyC p00. Qed. Lemma size_gcdp1 p : size (gcdp p 1) = 1%N. Proof. (* Goal: @eq nat (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp p (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))))) (S O) *) rewrite gcdpE size_polyC oner_eq0 /= modp1; case: ltnP; last first. (* Goal: forall _ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))) (S O)), @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp (@modp R (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) p) p))) (S O) *) (* Goal: forall _ : is_true (leq (S O) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))), @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))))) (S O) *) by rewrite gcd0p size_polyC oner_eq0. (* Goal: forall _ : is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p))) (S O)), @eq nat (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp (@modp R (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) p) p))) (S O) *) rewrite ltnS leqn0 size_poly_eq0; move/eqP->; rewrite gcdp0 modp0 size_polyC. (* Goal: @eq nat (nat_of_bool (negb (@eq_op (GRing.Ring.eqType (GRing.IntegralDomain.ringType R)) (GRing.one (GRing.IntegralDomain.ringType R)) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)))))) (S O) *) by rewrite oner_eq0. Qed. Lemma gcdpp : idempotent gcdp. Proof. (* Goal: @idempotent (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) gcdp *) by move=> p; rewrite gcdpE ltnn modpp gcd0p. Qed. Lemma dvdp_gcdlr p q : (gcdp p q %| p) && (gcdp p q %| q). Proof. (* Goal: is_true (andb (@dvdp R (gcdp p q) p) (@dvdp R (gcdp p q) q)) *) elim: {p q}minn {-2}p {-2}q (leqnn (minn (size q) (size p))) => [|r Hrec] p q. (* Goal: forall _ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (S r)), is_true (andb (@dvdp R (gcdp p q) p) (@dvdp R (gcdp p q) q)) *) (* Goal: forall _ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) O), is_true (andb (@dvdp R (gcdp p q) p) (@dvdp R (gcdp p q) q)) *) rewrite geq_min !leqn0 !size_poly_eq0. (* Goal: forall _ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (S r)), is_true (andb (@dvdp R (gcdp p q) p) (@dvdp R (gcdp p q) q)) *) (* Goal: forall _ : is_true (orb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), is_true (andb (@dvdp R (gcdp p q) p) (@dvdp R (gcdp p q) q)) *) by case/pred2P=> ->; rewrite (gcdp0, gcd0p) dvdpp ?andbT /=. (* Goal: forall _ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (S r)), is_true (andb (@dvdp R (gcdp p q) p) (@dvdp R (gcdp p q) q)) *) case: (eqVneq p 0) => [-> _|nz_p]; first by rewrite gcd0p dvdpp andbT. (* Goal: forall _ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (S r)), is_true (andb (@dvdp R (gcdp p q) p) (@dvdp R (gcdp p q) q)) *) case: (eqVneq q 0) => [->|nz_q]; first by rewrite gcdp0 dvdpp /=. (* Goal: forall _ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) (S r)), is_true (andb (@dvdp R (gcdp p q) p) (@dvdp R (gcdp p q) q)) *) rewrite gcdpE minnC /minn; case: ltnP => [lt_pq | le_pq] le_qr. (* Goal: is_true (andb (@dvdp R (gcdp (@modp R p q) q) p) (@dvdp R (gcdp (@modp R p q) q) q)) *) (* Goal: is_true (andb (@dvdp R (gcdp (@modp R q p) p) p) (@dvdp R (gcdp (@modp R q p) p) q)) *) suffices: minn (size p) (size (q %% p)) <= r. (* Goal: is_true (andb (@dvdp R (gcdp (@modp R p q) q) p) (@dvdp R (gcdp (@modp R p q) q) q)) *) (* Goal: is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R q p)))) r) *) (* Goal: forall _ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R q p)))) r), is_true (andb (@dvdp R (gcdp (@modp R q p) p) p) (@dvdp R (gcdp (@modp R q p) p) q)) *) by move/Hrec; case/andP => E1 E2; rewrite E2 (dvdp_mod _ E2). (* Goal: is_true (andb (@dvdp R (gcdp (@modp R p q) q) p) (@dvdp R (gcdp (@modp R p q) q) q)) *) (* Goal: is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R q p)))) r) *) by rewrite geq_min orbC -ltnS (leq_trans _ le_qr) ?ltn_modp. (* Goal: is_true (andb (@dvdp R (gcdp (@modp R p q) q) p) (@dvdp R (gcdp (@modp R p q) q) q)) *) suffices: minn (size q) (size (p %% q)) <= r. (* Goal: is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R p q)))) r) *) (* Goal: forall _ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R p q)))) r), is_true (andb (@dvdp R (gcdp (@modp R p q) q) p) (@dvdp R (gcdp (@modp R p q) q) q)) *) by move/Hrec; case/andP => E1 E2; rewrite E2 andbT (dvdp_mod _ E2). (* Goal: is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R p q)))) r) *) by rewrite geq_min orbC -ltnS (leq_trans _ le_qr) ?ltn_modp. Qed. Lemma dvdp_gcdl p q : gcdp p q %| p. Proof. (* Goal: is_true (@dvdp R (gcdp p q) p) *) by case/andP: (dvdp_gcdlr p q). Qed. Lemma dvdp_gcdr p q :gcdp p q %| q. Proof. (* Goal: is_true (@dvdp R (gcdp p q) q) *) by case/andP: (dvdp_gcdlr p q). Qed. Lemma leq_gcdpl p q : p != 0 -> size (gcdp p q) <= size p. Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp p q))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))) *) by move=> pn0; move: (dvdp_gcdl p q); apply: dvdp_leq. Qed. Lemma leq_gcdpr p q : q != 0 -> size (gcdp p q) <= size q. Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp p q))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) *) by move=> qn0; move: (dvdp_gcdr p q); apply: dvdp_leq. Qed. Lemma dvdp_gcd p m n : p %| gcdp m n = (p %| m) && (p %| n). Proof. (* Goal: @eq bool (@dvdp R p (gcdp m n)) (andb (@dvdp R p m) (@dvdp R p n)) *) apply/idP/andP=> [dv_pmn | [dv_pm dv_pn]]. (* Goal: is_true (@dvdp R p (gcdp m n)) *) (* Goal: and (is_true (@dvdp R p m)) (is_true (@dvdp R p n)) *) by rewrite ?(dvdp_trans dv_pmn) ?dvdp_gcdl ?dvdp_gcdr. (* Goal: is_true (@dvdp R p (gcdp m n)) *) move: (leqnn (minn (size n) (size m))) dv_pm dv_pn. (* Goal: forall (_ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) n)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) m))) (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) n)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) m))))) (_ : is_true (@dvdp R p m)) (_ : is_true (@dvdp R p n)), is_true (@dvdp R p (gcdp m n)) *) elim: {m n}minn {-2}m {-2}n => [|r Hrec] m n. (* Goal: forall (_ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) n)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) m))) (S r))) (_ : is_true (@dvdp R p m)) (_ : is_true (@dvdp R p n)), is_true (@dvdp R p (gcdp m n)) *) (* Goal: forall (_ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) n)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) m))) O)) (_ : is_true (@dvdp R p m)) (_ : is_true (@dvdp R p n)), is_true (@dvdp R p (gcdp m n)) *) rewrite geq_min !leqn0 !size_poly_eq0. (* Goal: forall (_ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) n)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) m))) (S r))) (_ : is_true (@dvdp R p m)) (_ : is_true (@dvdp R p n)), is_true (@dvdp R p (gcdp m n)) *) (* Goal: forall (_ : is_true (orb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) n (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) m (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))) (_ : is_true (@dvdp R p m)) (_ : is_true (@dvdp R p n)), is_true (@dvdp R p (gcdp m n)) *) by case/pred2P=> ->; rewrite (gcdp0, gcd0p). (* Goal: forall (_ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) n)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) m))) (S r))) (_ : is_true (@dvdp R p m)) (_ : is_true (@dvdp R p n)), is_true (@dvdp R p (gcdp m n)) *) case: (eqVneq m 0) => [-> _|nz_m]; first by rewrite gcd0p /=. (* Goal: forall (_ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) n)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) m))) (S r))) (_ : is_true (@dvdp R p m)) (_ : is_true (@dvdp R p n)), is_true (@dvdp R p (gcdp m n)) *) case: (eqVneq n 0) => [->|nz_n]; first by rewrite gcdp0 /=. (* Goal: forall (_ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) n)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) m))) (S r))) (_ : is_true (@dvdp R p m)) (_ : is_true (@dvdp R p n)), is_true (@dvdp R p (gcdp m n)) *) rewrite gcdpE minnC /minn; case: ltnP => Cnm le_r dv_m dv_n. (* Goal: is_true (@dvdp R p (gcdp (@modp R m n) n)) *) (* Goal: is_true (@dvdp R p (gcdp (@modp R n m) m)) *) apply: Hrec => //; last by rewrite -(dvdp_mod _ dv_m). (* Goal: is_true (@dvdp R p (gcdp (@modp R m n) n)) *) (* Goal: is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) m)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R n m)))) r) *) by rewrite geq_min orbC -ltnS (leq_trans _ le_r) ?ltn_modp. (* Goal: is_true (@dvdp R p (gcdp (@modp R m n) n)) *) apply: Hrec => //; last by rewrite -(dvdp_mod _ dv_n). (* Goal: is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) n)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R m n)))) r) *) by rewrite geq_min orbC -ltnS (leq_trans _ le_r) ?ltn_modp. Qed. Lemma gcdpC : forall p q, gcdp p q %= gcdp q p. Proof. (* Goal: forall p q : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)), is_true (@eqp R (gcdp p q) (gcdp q p)) *) by move=> p q; rewrite /eqp !dvdp_gcd !dvdp_gcdl !dvdp_gcdr. Qed. Lemma gcd1p p : gcdp 1 p %= 1. Proof. (* Goal: is_true (@eqp R (gcdp (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) p) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) rewrite -size_poly_eq1 gcdpE size_poly1; case: ltnP. (* Goal: forall _ : is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (S O)), is_true (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp (@modp R (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) p) p))) (S O)) *) (* Goal: forall _ : is_true (leq (S (S O)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p))), is_true (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp (@modp R p (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))))) (S O)) *) by rewrite modp1 gcd0p size_poly1 eqxx. (* Goal: forall _ : is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (S O)), is_true (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp (@modp R (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) p) p))) (S O)) *) move/size1_polyC=> e; rewrite e. (* Goal: is_true (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp (@modp R (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) (@polyC (GRing.IntegralDomain.ringType R) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@polyseq (GRing.IntegralDomain.ringType R) p) O))) (@polyC (GRing.IntegralDomain.ringType R) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@polyseq (GRing.IntegralDomain.ringType R) p) O))))) (S O)) *) case p00: (p`_0 == 0); first by rewrite (eqP p00) modp0 gcdp0 size_poly1. (* Goal: is_true (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp (@modp R (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) (@polyC (GRing.IntegralDomain.ringType R) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@polyseq (GRing.IntegralDomain.ringType R) p) O))) (@polyC (GRing.IntegralDomain.ringType R) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@polyseq (GRing.IntegralDomain.ringType R) p) O))))) (S O)) *) by rewrite modpC ?p00 // gcd0p size_polyC p00. Qed. Lemma gcdp1 p : gcdp p 1 %= 1. Proof. (* Goal: is_true (@eqp R (gcdp p (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) by rewrite (eqp_ltrans (gcdpC _ _)) gcd1p. Qed. Lemma gcdp_addl_mul p q r: gcdp r (p * r + q) %= gcdp r q. Proof. (* Goal: is_true (@eqp R (gcdp r (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r) q)) (gcdp r q)) *) suff h m n d : gcdp d n %| gcdp d (m * d + n). (* Goal: is_true (@dvdp R (gcdp d n) (gcdp d (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m d) n))) *) (* Goal: is_true (@eqp R (gcdp r (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r) q)) (gcdp r q)) *) apply/andP; split => //; rewrite {2}(_: q = (-p) * r + (p * r + q)) ?H //. (* Goal: is_true (@dvdp R (gcdp d n) (gcdp d (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m d) n))) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) q (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) p) r) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r) q)) *) by rewrite GRing.mulNr GRing.addKr. (* Goal: is_true (@dvdp R (gcdp d n) (gcdp d (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m d) n))) *) by rewrite dvdp_gcd dvdp_gcdl /= dvdp_addr ?dvdp_gcdr ?dvdp_mull ?dvdp_gcdl. Qed. Lemma gcdp_addl m n : gcdp m (m + n) %= gcdp m n. Proof. (* Goal: is_true (@eqp R (gcdp m (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) m n)) (gcdp m n)) *) by rewrite -{2}(mul1r m) gcdp_addl_mul. Qed. Lemma gcdp_addr m n : gcdp m (n + m) %= gcdp m n. Proof. (* Goal: is_true (@eqp R (gcdp m (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) n m)) (gcdp m n)) *) by rewrite addrC gcdp_addl. Qed. Lemma gcdp_mull m n : gcdp n (m * n) %= n. Proof. (* Goal: is_true (@eqp R (gcdp n (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) n) *) case: (eqVneq n 0) => [-> | nn0]; first by rewrite gcd0p mulr0 eqpxx. (* Goal: is_true (@eqp R (gcdp n (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) n) *) case: (eqVneq m 0) => [-> | mn0]; first by rewrite mul0r gcdp0 eqpxx. (* Goal: is_true (@eqp R (gcdp n (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) n) *) rewrite gcdpE modp_mull gcd0p size_mul //; case: ifP; first by rewrite eqpxx. (* Goal: forall _ : @eq bool (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) n))) (Nat.pred (addn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) m)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) n))))) false, is_true (@eqp R (gcdp (@modp R n (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) n) *) rewrite (polySpred mn0) addSn /= -{1}[size n]add0n ltn_add2r; move/negbT. (* Goal: forall _ : is_true (negb (leq (S O) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) m))))), is_true (@eqp R (gcdp (@modp R n (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) n) *) rewrite -ltnNge prednK ?size_poly_gt0 // leq_eqVlt ltnS leqn0 size_poly_eq0. (* Goal: forall _ : is_true (orb (@eq_op nat_eqType (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) m)) (S O)) (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) m (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), is_true (@eqp R (gcdp (@modp R n (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) n) *) rewrite (negPf mn0) orbF; case/size_poly1P=> c cn0 -> {mn0 m}; rewrite mul_polyC. (* Goal: is_true (@eqp R (gcdp (@modp R n (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c n)) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c n)) n) *) suff -> : n %% (c *: n) = 0 by rewrite gcd0p; apply: eqp_scale. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R n (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c n)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) *) by apply/modp_eq0P; rewrite dvdp_scalel. Qed. Lemma gcdp_mulr m n : gcdp n (n * m) %= n. Proof. (* Goal: is_true (@eqp R (gcdp n (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) n m)) n) *) by rewrite mulrC gcdp_mull. Qed. Lemma gcdp_scalel c m n : c != 0 -> gcdp (c *: m) n %= gcdp m n. Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) c (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))), is_true (@eqp R (gcdp (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c m) n) (gcdp m n)) *) move=> cn0; rewrite /eqp dvdp_gcd [gcdp m n %| _]dvdp_gcd !dvdp_gcdr !andbT. (* Goal: is_true (andb (@dvdp R (gcdp (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c m) n) m) (@dvdp R (gcdp m n) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c m))) *) apply/andP; split; last first. (* Goal: is_true (@dvdp R (gcdp (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c m) n) m) *) (* Goal: is_true (@dvdp R (gcdp m n) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c m)) *) by apply: dvdp_trans (dvdp_gcdl _ _) _; rewrite dvdp_scaler. (* Goal: is_true (@dvdp R (gcdp (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c m) n) m) *) by apply: dvdp_trans (dvdp_gcdl _ _) _; rewrite dvdp_scalel. Qed. Lemma gcdp_scaler c m n : c != 0 -> gcdp m (c *: n) %= gcdp m n. Lemma dvdp_gcd_idl m n : m %| n -> gcdp m n %= m. Proof. (* Goal: forall _ : is_true (@dvdp R m n), is_true (@eqp R (gcdp m n) m) *) case: (eqVneq m 0) => [-> | mn0]. (* Goal: forall _ : is_true (@dvdp R m n), is_true (@eqp R (gcdp m n) m) *) (* Goal: forall _ : is_true (@dvdp R (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) n), is_true (@eqp R (gcdp (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) n) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) *) by rewrite dvd0p => /eqP ->; rewrite gcdp0 eqpxx. (* Goal: forall _ : is_true (@dvdp R m n), is_true (@eqp R (gcdp m n) m) *) rewrite dvdp_eq; move/eqP; move/(f_equal (gcdp m)) => h. (* Goal: is_true (@eqp R (gcdp m n) m) *) apply: eqp_trans (gcdp_mull (n %/ m) _); rewrite -h eqp_sym gcdp_scaler //. (* Goal: is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) m) (@scalp R n m)) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) *) by rewrite expf_neq0 // lead_coef_eq0. Qed. Lemma dvdp_gcd_idr m n : n %| m -> gcdp m n %= n. Proof. (* Goal: forall _ : is_true (@dvdp R n m), is_true (@eqp R (gcdp m n) n) *) by move/dvdp_gcd_idl => h; apply: eqp_trans h; apply: gcdpC. Qed. Lemma gcdp_exp p k l : gcdp (p ^+ k) (p ^+ l) %= p ^+ minn k l. Proof. (* Goal: is_true (@eqp R (gcdp (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l)) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (minn k l))) *) wlog leqmn: k l / k <= l. (* Goal: is_true (@eqp R (gcdp (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l)) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (minn k l))) *) (* Goal: forall _ : forall (k l : nat) (_ : is_true (leq k l)), is_true (@eqp R (gcdp (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l)) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (minn k l))), is_true (@eqp R (gcdp (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l)) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (minn k l))) *) move=> hwlog; case: (leqP k l); first exact: hwlog. (* Goal: is_true (@eqp R (gcdp (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l)) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (minn k l))) *) (* Goal: forall _ : is_true (leq (S l) k), is_true (@eqp R (gcdp (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l)) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (minn k l))) *) by move/ltnW; rewrite minnC; move/hwlog=> h; apply: eqp_trans h; apply: gcdpC. (* Goal: is_true (@eqp R (gcdp (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p l)) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (minn k l))) *) rewrite (minn_idPl leqmn); move/subnK: leqmn<-; rewrite exprD. (* Goal: is_true (@eqp R (gcdp (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p (subn l k)) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k))) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) p k)) *) by apply: eqp_trans (gcdp_mull _ _) _; apply: eqpxx. Qed. Lemma gcdp_eq0 p q : gcdp p q == 0 = (p == 0) && (q == 0). Lemma eqp_gcdr p q r : q %= r -> gcdp p q %= gcdp p r. Proof. (* Goal: forall _ : is_true (@eqp R q r), is_true (@eqp R (gcdp p q) (gcdp p r)) *) move=> eqr; rewrite /eqp !(dvdp_gcd, dvdp_gcdl, andbT) /=. (* Goal: is_true (andb (@dvdp R (gcdp p q) r) (@dvdp R (gcdp p r) q)) *) by rewrite -(eqp_dvdr _ eqr) dvdp_gcdr (eqp_dvdr _ eqr) dvdp_gcdr. Qed. Lemma eqp_gcdl r p q : p %= q -> gcdp p r %= gcdp q r. Proof. (* Goal: forall _ : is_true (@eqp R p q), is_true (@eqp R (gcdp p r) (gcdp q r)) *) move=> eqr; rewrite /eqp !(dvdp_gcd, dvdp_gcdr, andbT) /=. (* Goal: is_true (andb (@dvdp R (gcdp p r) q) (@dvdp R (gcdp q r) p)) *) by rewrite -(eqp_dvdr _ eqr) dvdp_gcdl (eqp_dvdr _ eqr) dvdp_gcdl. Qed. Lemma eqp_gcd p1 p2 q1 q2 : p1 %= p2 -> q1 %= q2 -> gcdp p1 q1 %= gcdp p2 q2. Proof. (* Goal: forall (_ : is_true (@eqp R p1 p2)) (_ : is_true (@eqp R q1 q2)), is_true (@eqp R (gcdp p1 q1) (gcdp p2 q2)) *) move=> e1 e2. (* Goal: is_true (@eqp R (gcdp p1 q1) (gcdp p2 q2)) *) by apply: eqp_trans (eqp_gcdr _ e2); apply: eqp_trans (eqp_gcdl _ e1). Qed. Lemma eqp_rgcd_gcd p q : rgcdp p q %= gcdp p q. Proof. (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) p q) (gcdp p q)) *) move: (leqnn (minn (size p) (size q))); move: {2}(minn (size p) (size q)) => n. (* Goal: forall _ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) n), is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) p q) (gcdp p q)) *) elim: n p q => [p q|n ihn p q hs]. (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) p q) (gcdp p q)) *) (* Goal: forall _ : is_true (leq (minn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))) O), is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) p q) (gcdp p q)) *) rewrite leqn0 /minn; case: ltnP => _; rewrite size_poly_eq0; move/eqP->. (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) p q) (gcdp p q)) *) (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (gcdp p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) q) (gcdp (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) q)) *) by rewrite gcd0p rgcd0p eqpxx. (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) p q) (gcdp p q)) *) (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (gcdp p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) by rewrite gcdp0 rgcdp0 eqpxx. (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) p q) (gcdp p q)) *) case: (eqVneq p 0) => [-> | pn0]; first by rewrite gcd0p rgcd0p eqpxx. (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) p q) (gcdp p q)) *) case: (eqVneq q 0) => [-> | qn0]; first by rewrite gcdp0 rgcdp0 eqpxx. (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) p q) (gcdp p q)) *) rewrite gcdpE rgcdpE; case: ltnP => sp. (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) (rmodp (GRing.IntegralDomain.ringType R) p q) q) (gcdp (@modp R p q) q)) *) (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) (rmodp (GRing.IntegralDomain.ringType R) q p) p) (gcdp (@modp R q p) p)) *) have e := (eqp_rmod_mod q p); move: (e); move/(eqp_gcdl p) => h. (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) (rmodp (GRing.IntegralDomain.ringType R) p q) q) (gcdp (@modp R p q) q)) *) (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) (rmodp (GRing.IntegralDomain.ringType R) q p) p) (gcdp (@modp R q p) p)) *) apply: eqp_trans h; apply: ihn; rewrite (eqp_size e) geq_min. (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) (rmodp (GRing.IntegralDomain.ringType R) p q) q) (gcdp (@modp R p q) q)) *) (* Goal: is_true (orb (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R q p))) n) (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) n)) *) by rewrite -ltnS (leq_trans _ hs) // (minn_idPl (ltnW _)) ?ltn_modp. (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) (rmodp (GRing.IntegralDomain.ringType R) p q) q) (gcdp (@modp R p q) q)) *) have e := (eqp_rmod_mod p q); move: (e); move/(eqp_gcdl q) => h. (* Goal: is_true (@eqp R (rgcdp (GRing.IntegralDomain.ringType R) (rmodp (GRing.IntegralDomain.ringType R) p q) q) (gcdp (@modp R p q) q)) *) apply: eqp_trans h; apply: ihn; rewrite (eqp_size e) geq_min. (* Goal: is_true (orb (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q))) n) (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)) n)) *) by rewrite -ltnS (leq_trans _ hs) // (minn_idPr _) ?ltn_modp. Qed. Lemma gcdp_modr m n : gcdp m (n %% m) %= gcdp m n. Proof. (* Goal: is_true (@eqp R (gcdp m (@modp R n m)) (gcdp m n)) *) case: (eqVneq m 0) => [-> | mn0]; first by rewrite modp0 eqpxx. (* Goal: is_true (@eqp R (gcdp m (@modp R n m)) (gcdp m n)) *) have : (lead_coef m) ^+ (scalp n m) != 0 by rewrite expf_neq0 // lead_coef_eq0. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Ring.eqType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) m) (@scalp R n m)) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))), is_true (@eqp R (gcdp m (@modp R n m)) (gcdp m n)) *) move/gcdp_scaler; move/(_ m n) => h; apply: eqp_trans h; rewrite divp_eq. (* Goal: is_true (@eqp R (gcdp m (@modp R n m)) (gcdp m (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R n m) m) (@modp R n m)))) *) by rewrite eqp_sym gcdp_addl_mul. Qed. Lemma gcdp_modl m n : gcdp (m %% n) n %= gcdp m n. Lemma gcdp_def d m n : d %| m -> d %| n -> (forall d', d' %| m -> d' %| n -> d' %| d) -> gcdp m n %= d. Proof. (* Goal: forall (_ : is_true (@dvdp R d m)) (_ : is_true (@dvdp R d n)) (_ : forall (d' : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (_ : is_true (@dvdp R d' m)) (_ : is_true (@dvdp R d' n)), is_true (@dvdp R d' d)), is_true (@eqp R (gcdp m n) d) *) move=> dm dn h; rewrite /eqp dvdp_gcd dm dn !andbT. (* Goal: is_true (@dvdp R (gcdp m n) d) *) by apply: h; [apply: dvdp_gcdl | apply: dvdp_gcdr]. Qed. Definition coprimep p q := size (gcdp p q) == 1%N. Lemma coprimep_size_gcd p q : coprimep p q -> size (gcdp p q) = 1%N. Proof. (* Goal: forall _ : is_true (coprimep p q), @eq nat (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp p q))) (S O) *) by rewrite /coprimep=> /eqP. Qed. Lemma coprimep_def p q : (coprimep p q) = (size (gcdp p q) == 1%N). Proof. (* Goal: @eq bool (coprimep p q) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp p q))) (S O)) *) done. Qed. Lemma coprimep_scalel c m n : c != 0 -> coprimep (c *: m) n = coprimep m n. Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) c (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))), @eq bool (coprimep (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c m) n) (coprimep m n) *) by move=> ?; rewrite !coprimep_def (eqp_size (gcdp_scalel _ _ _)). Qed. Lemma coprimep_scaler c m n: c != 0 -> coprimep m (c *: n) = coprimep m n. Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) c (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))), @eq bool (coprimep m (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) c n)) (coprimep m n) *) by move=> ?; rewrite !coprimep_def (eqp_size (gcdp_scaler _ _ _)). Qed. Lemma coprimepp p : coprimep p p = (size p == 1%N). Proof. (* Goal: @eq bool (coprimep p p) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)) (S O)) *) by rewrite coprimep_def gcdpp. Qed. Lemma gcdp_eqp1 p q : gcdp p q %= 1 = (coprimep p q). Proof. (* Goal: @eq bool (@eqp R (gcdp p q) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) (coprimep p q) *) by rewrite coprimep_def size_poly_eq1. Qed. Lemma coprimep_sym p q : coprimep p q = coprimep q p. Proof. (* Goal: @eq bool (coprimep p q) (coprimep q p) *) by rewrite -!gcdp_eqp1; apply: eqp_ltrans; rewrite gcdpC. Qed. Lemma coprime1p p : coprimep 1 p. Lemma coprimep1 p : coprimep p 1. Proof. (* Goal: is_true (coprimep p (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) by rewrite coprimep_sym; apply: coprime1p. Qed. Lemma coprimep0 p : coprimep p 0 = (p %= 1). Proof. (* Goal: @eq bool (coprimep p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (@eqp R p (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) by rewrite /coprimep gcdp0 size_poly_eq1. Qed. Lemma coprime0p p : coprimep 0 p = (p %= 1). Proof. (* Goal: @eq bool (coprimep (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) p) (@eqp R p (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) by rewrite coprimep_sym coprimep0. Qed. Lemma coprimepP p q : reflect (forall d, d %| p -> d %| q -> d %= 1) (coprimep p q). Lemma coprimepPn p q : p != 0 -> reflect (exists d, (d %| gcdp p q) && ~~ (d %= 1)) (~~ coprimep p q). Lemma coprimep_dvdl q p r : r %| q -> coprimep p q -> coprimep p r. Proof. (* Goal: forall (_ : is_true (@dvdp R r q)) (_ : is_true (coprimep p q)), is_true (coprimep p r) *) move=> rq cpq; apply/coprimepP=> d dp dr; move/coprimepP:cpq=> cpq'. (* Goal: is_true (@eqp R d (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) by apply: cpq'; rewrite // (dvdp_trans dr). Qed. Lemma coprimep_dvdr p q r : r %| p -> coprimep p q -> coprimep r q. Proof. (* Goal: forall (_ : is_true (@dvdp R r p)) (_ : is_true (coprimep p q)), is_true (coprimep r q) *) move=> rp; rewrite ![coprimep _ q]coprimep_sym. (* Goal: forall _ : is_true (coprimep q p), is_true (coprimep q r) *) by move/coprimep_dvdl; apply. Qed. Lemma coprimep_modl p q : coprimep (p %% q) q = coprimep p q. Proof. (* Goal: @eq bool (coprimep (@modp R p q) q) (coprimep p q) *) symmetry; rewrite !coprimep_def. (* Goal: @eq bool (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp p q))) (S O)) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp (@modp R p q) q))) (S O)) *) case: (ltnP (size p) (size q))=> hpq; first by rewrite modp_small. (* Goal: @eq bool (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp p q))) (S O)) (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (gcdp (@modp R p q) q))) (S O)) *) by rewrite gcdpE ltnNge hpq. Qed. Lemma coprimep_modr q p : coprimep q (p %% q) = coprimep q p. Proof. (* Goal: @eq bool (coprimep q (@modp R p q)) (coprimep q p) *) by rewrite ![coprimep q _]coprimep_sym coprimep_modl. Qed. Lemma rcoprimep_coprimep q p : rcoprimep q p = coprimep q p. Proof. (* Goal: @eq bool (rcoprimep (GRing.IntegralDomain.ringType R) q p) (coprimep q p) *) by rewrite /coprimep /rcoprimep; rewrite (eqp_size (eqp_rgcd_gcd _ _)). Qed. Lemma eqp_coprimepr p q r : q %= r -> coprimep p q = coprimep p r. Proof. (* Goal: forall _ : is_true (@eqp R q r), @eq bool (coprimep p q) (coprimep p r) *) by rewrite -!gcdp_eqp1; move/(eqp_gcdr p) => h1; apply: (eqp_ltrans h1). Qed. Lemma eqp_coprimepl p q r : q %= r -> coprimep q p = coprimep r p. Proof. (* Goal: forall _ : is_true (@eqp R q r), @eq bool (coprimep q p) (coprimep r p) *) by rewrite !(coprimep_sym _ p); apply: eqp_coprimepr. Qed. Fixpoint egcdp_rec p q k {struct k} : {poly R} * {poly R} := if k is k'.+1 then if q == 0 then (1, 0) else let: (u, v) := egcdp_rec q (p %% q) k' in (lead_coef q ^+ scalp p q *: v, (u - v * (p %/ q))) else (1, 0). Definition egcdp p q := if size q <= size p then egcdp_rec p q (size q) else let e := egcdp_rec q p (size p) in (e.2, e.1). Lemma egcdp0 p : egcdp p 0 = (1, 0). Proof. (* Goal: @eq (prod (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)))) (egcdp p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (@pair (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Zmodule.sort (poly_zmodType (GRing.IntegralDomain.ringType R))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) *) by rewrite /egcdp size_poly0. Qed. Lemma egcdp_recP : forall k p q, q != 0 -> size q <= k -> size q <= size p -> let e := (egcdp_rec p q k) in [/\ size e.1 <= size q, size e.2 <= size p & gcdp p q %= e.1 * p + e.2 * q]. Lemma egcdpP p q : p != 0 -> q != 0 -> forall (e := egcdp p q), [/\ size e.1 <= size q, size e.2 <= size p & gcdp p q %= e.1 * p + e.2 * q]. Proof. (* Goal: forall (_ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))) (_ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))), let e := egcdp p q in and3 (is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@fst (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) e))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q)))) (is_true (leq (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) e))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) p)))) (is_true (@eqp R (gcdp p q) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) e) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) e) q)))) *) move=> pn0 qn0; rewrite /egcdp; case: (leqP (size q) (size p)) => /= hp. (* Goal: and3 (is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec q p (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))) (is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@fst (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec q p (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))) (is_true (@eqp R (gcdp p q) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec q p (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec q p (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))) q)))) *) (* Goal: and3 (is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@fst (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec p q (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))) (is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec p q (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))) (is_true (@eqp R (gcdp p q) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec p q (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec p q (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))) q)))) *) by apply: egcdp_recP. (* Goal: and3 (is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec q p (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))) (is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@fst (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec q p (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))) (is_true (@eqp R (gcdp p q) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec q p (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec q p (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))) q)))) *) move/ltnW: hp => hp; case: (egcdp_recP pn0 (leqnn (size p)) hp) => h1 h2 h3. (* Goal: and3 (is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec q p (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) q)))) (is_true (leq (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@fst (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec q p (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))) (is_true (@eqp R (gcdp p q) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec q p (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec q p (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)))) q)))) *) by split => //; rewrite (eqp_ltrans (gcdpC _ _)) addrC. Qed. Lemma egcdpE p q (e := egcdp p q) : gcdp p q %= e.1 * p + e.2 * q. Proof. (* Goal: is_true (@eqp R (gcdp p q) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) e) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) e) q))) *) rewrite {}/e; have [-> /= | qn0] := eqVneq q 0. (* Goal: is_true (@eqp R (gcdp p q) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp p q)) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp p q)) q))) *) (* Goal: is_true (@eqp R (gcdp p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))) *) by rewrite gcdp0 egcdp0 mul1r mulr0 addr0. (* Goal: is_true (@eqp R (gcdp p q) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp p q)) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp p q)) q))) *) have [p0 | pn0] := eqVneq p 0; last by case: (egcdpP pn0 qn0). (* Goal: is_true (@eqp R (gcdp p q) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp p q)) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp p q)) q))) *) rewrite p0 gcd0p mulr0 add0r /egcdp size_poly0 leqn0 size_poly_eq0 (negPf qn0). (* Goal: is_true (@eqp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@pair (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@snd (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) O)) (@fst (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (egcdp_rec q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) O)))) q)) *) by rewrite /= mul1r. Qed. Lemma Bezoutp p q : exists u, u.1 * p + u.2 * q %= (gcdp p q). Proof. (* Goal: @ex (prod (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R)))) (fun u : prod (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) => is_true (@eqp R (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u) q)) (gcdp p q))) *) case: (eqVneq p 0) => [-> | pn0]. (* Goal: @ex (prod (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R)))) (fun u : prod (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) => is_true (@eqp R (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u) q)) (gcdp p q))) *) (* Goal: @ex (prod (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R)))) (fun u : prod (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) => is_true (@eqp R (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u) q)) (gcdp (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) q))) *) by rewrite gcd0p; exists (0, 1); rewrite mul0r mul1r add0r. (* Goal: @ex (prod (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R)))) (fun u : prod (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) => is_true (@eqp R (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u) q)) (gcdp p q))) *) case: (eqVneq q 0) => [-> | qn0]. (* Goal: @ex (prod (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R)))) (fun u : prod (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) => is_true (@eqp R (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u) q)) (gcdp p q))) *) (* Goal: @ex (prod (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R)))) (fun u : prod (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) => is_true (@eqp R (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) (gcdp p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))) *) by rewrite gcdp0; exists (1, 0); rewrite mul0r mul1r addr0. (* Goal: @ex (prod (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R)))) (fun u : prod (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) => is_true (@eqp R (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u) q)) (gcdp p q))) *) pose e := egcdp p q; exists e; rewrite eqp_sym. (* Goal: is_true (@eqp R (gcdp p q) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) e) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) e) q))) *) by case: (egcdpP pn0 qn0). Qed. Lemma Bezout_coprimepP : forall p q, reflect (exists u, u.1 * p + u.2 * q %= 1) (coprimep p q). Lemma coprimep_root p q x : coprimep p q -> root p x -> q.[x] != 0. Proof. (* Goal: forall (_ : is_true (coprimep p q)) (_ : is_true (@root (GRing.IntegralDomain.ringType R) p x)), is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@horner (GRing.IntegralDomain.ringType R) q x) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) *) case/Bezout_coprimepP=> [[u v] euv] px0. (* Goal: is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@horner (GRing.IntegralDomain.ringType R) q x) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) *) move/eqpP: euv => [[c1 c2]] /andP /= [c1n0 c2n0 e]. (* Goal: is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@horner (GRing.IntegralDomain.ringType R) q x) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) *) suffices: c1 * (v.[x] * q.[x]) != 0. (* Goal: is_true (negb (@eq_op (GRing.Ring.eqType (GRing.IntegralDomain.ringType R)) (@GRing.mul (GRing.IntegralDomain.ringType R) c1 (@GRing.mul (GRing.IntegralDomain.ringType R) (@horner (GRing.IntegralDomain.ringType R) v x) (@horner (GRing.IntegralDomain.ringType R) q x))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) *) (* Goal: forall _ : is_true (negb (@eq_op (GRing.Ring.eqType (GRing.IntegralDomain.ringType R)) (@GRing.mul (GRing.IntegralDomain.ringType R) c1 (@GRing.mul (GRing.IntegralDomain.ringType R) (@horner (GRing.IntegralDomain.ringType R) v x) (@horner (GRing.IntegralDomain.ringType R) q x))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))), is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@horner (GRing.IntegralDomain.ringType R) q x) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) *) by rewrite !mulf_eq0 !negb_or c1n0 /=; case/andP. (* Goal: is_true (negb (@eq_op (GRing.Ring.eqType (GRing.IntegralDomain.ringType R)) (@GRing.mul (GRing.IntegralDomain.ringType R) c1 (@GRing.mul (GRing.IntegralDomain.ringType R) (@horner (GRing.IntegralDomain.ringType R) v x) (@horner (GRing.IntegralDomain.ringType R) q x))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) *) move/(f_equal (fun t => horner t x)): e; rewrite /= !hornerZ hornerD. (* Goal: forall _ : @eq (GRing.IntegralDomain.sort R) (@GRing.mul (GRing.IntegralDomain.ringType R) c1 (@GRing.add (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)) (@horner (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) u p) x) (@horner (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) v q) x))) (@GRing.mul (GRing.IntegralDomain.ringType R) c2 (@horner (GRing.IntegralDomain.ringType R) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) x)), is_true (negb (@eq_op (GRing.Ring.eqType (GRing.IntegralDomain.ringType R)) (@GRing.mul (GRing.IntegralDomain.ringType R) c1 (@GRing.mul (GRing.IntegralDomain.ringType R) (@horner (GRing.IntegralDomain.ringType R) v x) (@horner (GRing.IntegralDomain.ringType R) q x))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) *) by rewrite !hornerM (eqP px0) mulr0 add0r hornerC mulr1; move->. Qed. Lemma Gauss_dvdpl p q d: coprimep d q -> (d %| p * q) = (d %| p). Lemma Gauss_dvdpr p q d: coprimep d q -> (d %| q * p) = (d %| p). Proof. (* Goal: forall _ : is_true (coprimep d q), @eq bool (@dvdp R d (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q p)) (@dvdp R d p) *) by rewrite mulrC; apply: Gauss_dvdpl. Qed. Lemma Gauss_dvdp m n p : coprimep m n -> (m * n %| p) = (m %| p) && (n %| p). Lemma Gauss_gcdpr p m n : coprimep p m -> gcdp p (m * n) %= gcdp p n. Proof. (* Goal: forall _ : is_true (coprimep p m), is_true (@eqp R (gcdp p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) (gcdp p n)) *) move=> co_pm; apply/eqP; rewrite /eqp !dvdp_gcd !dvdp_gcdl /= andbC. (* Goal: is_true (@eq_op bool_eqType (andb (@dvdp R (gcdp p n) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) (@dvdp R (gcdp p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) n)) true) *) rewrite dvdp_mull ?dvdp_gcdr // -(@Gauss_dvdpl _ m). (* Goal: is_true (coprimep (gcdp p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) m) *) (* Goal: is_true (@eq_op bool_eqType (andb true (@dvdp R (gcdp p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) n m))) true) *) by rewrite mulrC dvdp_gcdr. (* Goal: is_true (coprimep (gcdp p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) m) *) apply/coprimepP=> d; rewrite dvdp_gcd; case/andP=> hdp _ hdm. (* Goal: is_true (@eqp R d (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) by move/coprimepP: co_pm; apply. Qed. Lemma Gauss_gcdpl p m n : coprimep p n -> gcdp p (m * n) %= gcdp p m. Proof. (* Goal: forall _ : is_true (coprimep p n), is_true (@eqp R (gcdp p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n)) (gcdp p m)) *) by move=> co_pn; rewrite mulrC Gauss_gcdpr. Qed. Lemma coprimep_mulr p q r : coprimep p (q * r) = (coprimep p q && coprimep p r). Proof. (* Goal: @eq bool (coprimep p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q r)) (andb (coprimep p q) (coprimep p r)) *) apply/coprimepP/andP=> [hp | [/coprimepP-hq hr]]. (* Goal: forall (d : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (_ : is_true (@dvdp R d p)) (_ : is_true (@dvdp R d (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q r))), is_true (@eqp R d (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) (* Goal: and (is_true (coprimep p q)) (is_true (coprimep p r)) *) by split; apply/coprimepP=> d dp dq; rewrite hp //; [apply/dvdp_mulr | apply/dvdp_mull]. (* Goal: forall (d : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (_ : is_true (@dvdp R d p)) (_ : is_true (@dvdp R d (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q r))), is_true (@eqp R d (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) move=> d dp dqr; move/(_ _ dp) in hq. (* Goal: is_true (@eqp R d (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) rewrite Gauss_dvdpl in dqr; first exact: hq. (* Goal: is_true (coprimep d r) *) by move/coprimep_dvdr: hr; apply. Qed. Lemma coprimep_mull p q r: coprimep (q * r) p = (coprimep q p && coprimep r p). Proof. (* Goal: @eq bool (coprimep (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q r) p) (andb (coprimep q p) (coprimep r p)) *) by rewrite ![coprimep _ p]coprimep_sym coprimep_mulr. Qed. Lemma modp_coprime k u n : k != 0 -> (k * u) %% n %= 1 -> coprimep k n. Lemma coprimep_pexpl k m n : 0 < k -> coprimep (m ^+ k) n = coprimep m n. Proof. (* Goal: forall _ : is_true (leq (S O) k), @eq bool (coprimep (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) m k) n) (coprimep m n) *) case: k => // k _; elim: k => [|k IHk]; first by rewrite expr1. (* Goal: @eq bool (coprimep (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) m (S (S k))) n) (coprimep m n) *) by rewrite exprS coprimep_mull -IHk andbb. Qed. Lemma coprimep_pexpr k m n : 0 < k -> coprimep m (n ^+ k) = coprimep m n. Proof. (* Goal: forall _ : is_true (leq (S O) k), @eq bool (coprimep m (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) n k)) (coprimep m n) *) by move=> k_gt0; rewrite !(coprimep_sym m) coprimep_pexpl. Qed. Lemma coprimep_expl k m n : coprimep m n -> coprimep (m ^+ k) n. Proof. (* Goal: forall _ : is_true (coprimep m n), is_true (coprimep (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) m k) n) *) by case: k => [|k] co_pm; rewrite ?coprime1p // coprimep_pexpl. Qed. Lemma coprimep_expr k m n : coprimep m n -> coprimep m (n ^+ k). Proof. (* Goal: forall _ : is_true (coprimep m n), is_true (coprimep m (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) n k)) *) by rewrite !(coprimep_sym m); apply: coprimep_expl. Qed. Lemma gcdp_mul2l p q r : gcdp (p * q) (p * r) %= (p * gcdp q r). Proof. (* Goal: is_true (@eqp R (gcdp (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p (gcdp q r))) *) case: (eqVneq p 0)=> [->|hp]; first by rewrite !mul0r gcdp0 eqpxx. (* Goal: is_true (@eqp R (gcdp (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p (gcdp q r))) *) rewrite /eqp !dvdp_gcd !dvdp_mul2l // dvdp_gcdr dvdp_gcdl !andbT. (* Goal: is_true (@dvdp R (gcdp (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p (gcdp q r))) *) move: (Bezoutp q r) => [[u v]] huv. (* Goal: is_true (@dvdp R (gcdp (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p (gcdp q r))) *) rewrite eqp_sym in huv; rewrite (eqp_dvdr _ (eqp_mull _ huv)). (* Goal: is_true (@dvdp R (gcdp (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@pair (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u v)) q) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@pair (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u v)) r)))) *) rewrite mulrDr ![p * (_ * _)]mulrCA. (* Goal: is_true (@dvdp R (gcdp (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.IntegralDomain.comRingType R))) (@fst (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@pair (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u v)) (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.IntegralDomain.comRingType R))) p q)) (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.IntegralDomain.comRingType R))) (@snd (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@pair (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u v)) (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.IntegralDomain.comRingType R))) p r)))) *) by apply: dvdp_add; rewrite dvdp_mull// (dvdp_gcdr, dvdp_gcdl). Qed. Lemma gcdp_mul2r q r p : gcdp (q * p) (r * p) %= (gcdp q r * p). Proof. (* Goal: is_true (@eqp R (gcdp (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) r p)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (gcdp q r) p)) *) by rewrite ![_ * p]GRing.mulrC gcdp_mul2l. Qed. Lemma mulp_gcdr p q r : r * (gcdp p q) %= gcdp (r * p) (r * q). Proof. (* Goal: is_true (@eqp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) r (gcdp p q)) (gcdp (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) r p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) r q))) *) by rewrite eqp_sym gcdp_mul2l. Qed. Lemma mulp_gcdl p q r : (gcdp p q) * r %= gcdp (p * r) (q * r). Proof. (* Goal: is_true (@eqp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (gcdp p q) r) (gcdp (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q r))) *) by rewrite eqp_sym gcdp_mul2r. Qed. Lemma coprimep_div_gcd p q : (p != 0) || (q != 0) -> coprimep (p %/ (gcdp p q)) (q %/ gcdp p q). Proof. (* Goal: forall _ : is_true (orb (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))), is_true (coprimep (@divp R p (gcdp p q)) (@divp R q (gcdp p q))) *) move=> hpq. (* Goal: is_true (coprimep (@divp R p (gcdp p q)) (@divp R q (gcdp p q))) *) have gpq0: gcdp p q != 0 by rewrite gcdp_eq0 negb_and. (* Goal: is_true (coprimep (@divp R p (gcdp p q)) (@divp R q (gcdp p q))) *) rewrite -gcdp_eqp1 -(@eqp_mul2r (gcdp p q)) // mul1r. (* Goal: is_true (@eqp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (gcdp (@divp R p (gcdp p q)) (@divp R q (gcdp p q))) (gcdp p q)) (gcdp p q)) *) have: gcdp p q %| p by rewrite dvdp_gcdl. (* Goal: forall _ : is_true (@dvdp R (gcdp p q) p), is_true (@eqp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (gcdp (@divp R p (gcdp p q)) (@divp R q (gcdp p q))) (gcdp p q)) (gcdp p q)) *) have: gcdp p q %| q by rewrite dvdp_gcdr. (* Goal: forall (_ : is_true (@dvdp R (gcdp p q) q)) (_ : is_true (@dvdp R (gcdp p q) p)), is_true (@eqp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (gcdp (@divp R p (gcdp p q)) (@divp R q (gcdp p q))) (gcdp p q)) (gcdp p q)) *) rewrite !dvdp_eq eq_sym; move/eqP=> hq; rewrite eq_sym; move/eqP=> hp. (* Goal: is_true (@eqp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (gcdp (@divp R p (gcdp p q)) (@divp R q (gcdp p q))) (gcdp p q)) (gcdp p q)) *) rewrite (eqp_ltrans (mulp_gcdl _ _ _)) hq hp. (* Goal: is_true (@eqp R (gcdp (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) (gcdp p q)) (@scalp R p (gcdp p q))) p) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) (gcdp p q)) (@scalp R q (gcdp p q))) q)) (gcdp p q)) *) have lcn0 k : (lead_coef (gcdp p q)) ^+ k != 0. (* Goal: is_true (@eqp R (gcdp (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) (gcdp p q)) (@scalp R p (gcdp p q))) p) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) (gcdp p q)) (@scalp R q (gcdp p q))) q)) (gcdp p q)) *) (* Goal: is_true (negb (@eq_op (GRing.Ring.eqType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) (gcdp p q)) k) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) *) by rewrite expf_neq0 ?lead_coef_eq0. (* Goal: is_true (@eqp R (gcdp (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) (gcdp p q)) (@scalp R p (gcdp p q))) p) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.exp (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) (gcdp p q)) (@scalp R q (gcdp p q))) q)) (gcdp p q)) *) by apply: eqp_gcd; rewrite ?eqp_scale. Qed. Lemma divp_eq0 p q : (p %/ q == 0) = [|| p == 0, q ==0 | size p < size q]. Lemma dvdp_div_eq0 p q : q %| p -> (p %/ q == 0) = (p == 0). Proof. (* Goal: forall _ : is_true (@dvdp R q p), @eq bool (@eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p q) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) *) move=> dvdp_qp; have [->|p_neq0] := altP (p =P 0); first by rewrite div0p eqxx. (* Goal: @eq bool (@eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p q) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))))) false *) rewrite divp_eq0 ltnNge dvdp_leq // (negPf p_neq0) orbF /=. (* Goal: @eq bool (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) false *) by apply: contraTF dvdp_qp=> /eqP ->; rewrite dvd0p. Qed. Lemma Bezout_coprimepPn p q : p != 0 -> q != 0 -> reflect (exists2 uv : {poly R} * {poly R}, (0 < size uv.1 < size q) && (0 < size uv.2 < size p) & Lemma dvdp_pexp2r m n k : k > 0 -> (m ^+ k %| n ^+ k) = (m %| n). Lemma root_gcd p q x : root (gcdp p q) x = root p x && root q x. Proof. (* Goal: @eq bool (@root (GRing.IntegralDomain.ringType R) (gcdp p q) x) (andb (@root (GRing.IntegralDomain.ringType R) p x) (@root (GRing.IntegralDomain.ringType R) q x)) *) rewrite /= !root_factor_theorem; apply/idP/andP=> [dg| [dp dq]]. (* Goal: is_true (@dvdp R (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) x))) (gcdp p q)) *) (* Goal: and (is_true (@dvdp R (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) x))) p)) (is_true (@dvdp R (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) x))) q)) *) by split; apply: dvdp_trans dg _; rewrite ?(dvdp_gcdl, dvdp_gcdr). (* Goal: is_true (@dvdp R (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) x))) (gcdp p q)) *) have:= (Bezoutp p q)=> [[[u v]]]; rewrite eqp_sym=> e. (* Goal: is_true (@dvdp R (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) x))) (gcdp p q)) *) by rewrite (eqp_dvdr _ e) dvdp_addl dvdp_mull. Qed. Lemma root_biggcd : forall x (ps : seq {poly R}), root (\big[gcdp/0]_(p <- ps) p) x = all (fun p => root p x) ps. Proof. (* Goal: forall (x : GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (ps : list (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)))), @eq bool (@root (GRing.IntegralDomain.ringType R) (@BigOp.bigop (GRing.Zmodule.sort (poly_zmodType (GRing.IntegralDomain.ringType R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) ps (fun p : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) => @BigBody (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p gcdp true p)) x) (@all (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (fun p : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) => @root (GRing.IntegralDomain.ringType R) p x) ps) *) move=> x; elim; first by rewrite big_nil root0. (* Goal: forall (a : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (l : list (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)))) (_ : @eq bool (@root (GRing.IntegralDomain.ringType R) (@BigOp.bigop (GRing.Zmodule.sort (poly_zmodType (GRing.IntegralDomain.ringType R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) l (fun p : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) => @BigBody (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p gcdp true p)) x) (@all (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (fun p : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) => @root (GRing.IntegralDomain.ringType R) p x) l)), @eq bool (@root (GRing.IntegralDomain.ringType R) (@BigOp.bigop (GRing.Zmodule.sort (poly_zmodType (GRing.IntegralDomain.ringType R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))) (@cons (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) a l) (fun p : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) => @BigBody (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p gcdp true p)) x) (@all (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (fun p : @poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R)) => @root (GRing.IntegralDomain.ringType R) p x) (@cons (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) a l)) *) by move=> p ps ihp; rewrite big_cons /= root_gcd ihp. Qed. Fixpoint gdcop_rec q p k := if k is m.+1 then if coprimep p q then p else gdcop_rec q (divp p (gcdp p q)) m else (q == 0)%:R. Definition gdcop q p := gdcop_rec q p (size p). Variant gdcop_spec q p : {poly R} -> Type := GdcopSpec r of (dvdp r p) & ((coprimep r q) || (p == 0)) & (forall d, dvdp d p -> coprimep d q -> dvdp d r) : gdcop_spec q p r. Lemma gdcop0 q : gdcop q 0 = (q == 0)%:R. Proof. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R)))) (gdcop q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))) (@GRing.natmul (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) (nat_of_bool (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R)))))) *) by rewrite /gdcop size_poly0. Qed. Lemma gdcop_recP : forall q p k, size p <= k -> gdcop_spec q p (gdcop_rec q p k). Lemma gdcopP q p : gdcop_spec q p (gdcop q p). Proof. (* Goal: gdcop_spec q p (gdcop q p) *) by rewrite /gdcop; apply: gdcop_recP. Qed. Lemma coprimep_gdco p q : (q != 0)%B -> coprimep (gdcop p q) p. Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))), is_true (coprimep (gdcop p q) p) *) by move=> q_neq0; case: gdcopP=> d; rewrite (negPf q_neq0) orbF. Qed. Lemma size2_dvdp_gdco p q d : p != 0 -> size d = 2%N -> (d %| (gdcop q p)) = (d %| p) && ~~(d %| q). Lemma dvdp_gdco p q : (gdcop p q) %| q. Proof. (* Goal: is_true (@dvdp R (gdcop p q) q) *) by case: gdcopP. Qed. Lemma root_gdco p q x : p != 0 -> root (gdcop q p) x = root p x && ~~(root q x). Lemma dvdp_comp_poly r p q : (p %| q) -> (p \Po r) %| (q \Po r). Lemma gcdp_comp_poly r p q : gcdp p q \Po r %= gcdp (p \Po r) (q \Po r). Proof. (* Goal: is_true (@eqp R (@comp_poly (GRing.IntegralDomain.ringType R) r (gcdp p q)) (gcdp (@comp_poly (GRing.IntegralDomain.ringType R) r p) (@comp_poly (GRing.IntegralDomain.ringType R) r q))) *) apply/andP; split. (* Goal: is_true (@dvdp R (gcdp (@comp_poly (GRing.IntegralDomain.ringType R) r p) (@comp_poly (GRing.IntegralDomain.ringType R) r q)) (@comp_poly (GRing.IntegralDomain.ringType R) r (gcdp p q))) *) (* Goal: is_true (@dvdp R (@comp_poly (GRing.IntegralDomain.ringType R) r (gcdp p q)) (gcdp (@comp_poly (GRing.IntegralDomain.ringType R) r p) (@comp_poly (GRing.IntegralDomain.ringType R) r q))) *) by rewrite dvdp_gcd !dvdp_comp_poly ?dvdp_gcdl ?dvdp_gcdr. (* Goal: is_true (@dvdp R (gcdp (@comp_poly (GRing.IntegralDomain.ringType R) r p) (@comp_poly (GRing.IntegralDomain.ringType R) r q)) (@comp_poly (GRing.IntegralDomain.ringType R) r (gcdp p q))) *) case: (Bezoutp p q) => [[u v]] /andP []. (* Goal: forall (_ : is_true (@dvdp R (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@pair (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u v)) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@pair (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u v)) q)) (gcdp p q))) (_ : is_true (@dvdp R (gcdp p q) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@fst (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@pair (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u v)) p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@snd (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@pair (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u v)) q)))), is_true (@dvdp R (gcdp (@comp_poly (GRing.IntegralDomain.ringType R) r p) (@comp_poly (GRing.IntegralDomain.ringType R) r q)) (@comp_poly (GRing.IntegralDomain.ringType R) r (gcdp p q))) *) move/(dvdp_comp_poly r) => Huv _. (* Goal: is_true (@dvdp R (gcdp (@comp_poly (GRing.IntegralDomain.ringType R) r p) (@comp_poly (GRing.IntegralDomain.ringType R) r q)) (@comp_poly (GRing.IntegralDomain.ringType R) r (gcdp p q))) *) rewrite (dvdp_trans _ Huv) // comp_polyD !comp_polyM. (* Goal: is_true (@dvdp R (gcdp (@comp_poly (GRing.IntegralDomain.ringType R) r p) (@comp_poly (GRing.IntegralDomain.ringType R) r q)) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.ComRing.ringType (GRing.IntegralDomain.comRingType R))) (@comp_poly (GRing.ComRing.ringType (GRing.IntegralDomain.comRingType R)) r (@fst (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@pair (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u v))) (@comp_poly (GRing.ComRing.ringType (GRing.IntegralDomain.comRingType R)) r p)) (@GRing.mul (poly_ringType (GRing.ComRing.ringType (GRing.IntegralDomain.comRingType R))) (@comp_poly (GRing.ComRing.ringType (GRing.IntegralDomain.comRingType R)) r (@snd (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@pair (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) u v))) (@comp_poly (GRing.ComRing.ringType (GRing.IntegralDomain.comRingType R)) r q)))) *) by rewrite dvdp_add // dvdp_mull // (dvdp_gcdl,dvdp_gcdr). Qed. Lemma coprimep_comp_poly r p q : coprimep p q -> coprimep (p \Po r) (q \Po r). Proof. (* Goal: forall _ : is_true (coprimep p q), is_true (coprimep (@comp_poly (GRing.IntegralDomain.ringType R) r p) (@comp_poly (GRing.IntegralDomain.ringType R) r q)) *) rewrite -!gcdp_eqp1 -!size_poly_eq1 -!dvdp1; move/(dvdp_comp_poly r). (* Goal: forall _ : is_true (@dvdp R (@comp_poly (GRing.IntegralDomain.ringType R) r (gcdp p q)) (@comp_poly (GRing.IntegralDomain.ringType R) r (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))))), is_true (@dvdp R (gcdp (@comp_poly (GRing.IntegralDomain.ringType R) r p) (@comp_poly (GRing.IntegralDomain.ringType R) r q)) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) rewrite comp_polyC => Hgcd. (* Goal: is_true (@dvdp R (gcdp (@comp_poly (GRing.IntegralDomain.ringType R) r p) (@comp_poly (GRing.IntegralDomain.ringType R) r q)) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))) *) by apply: dvdp_trans Hgcd; case/andP: (gcdp_comp_poly r p q). Qed. Lemma coprimep_addl_mul p q r : coprimep r (p * r + q) = coprimep r q. Proof. (* Goal: @eq bool (coprimep r (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r) q)) (coprimep r q) *) by rewrite !coprimep_def (eqp_size (gcdp_addl_mul _ _ _)). Qed. Definition irreducible_poly p := (size p > 1) * (forall q, size q != 1%N -> q %| p -> q %= p) : Prop. Lemma irredp_neq0 p : irreducible_poly p -> p != 0. Proof. (* Goal: forall _ : irreducible_poly p, is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) by rewrite -size_poly_eq0 -lt0n => [[/ltnW]]. Qed. Definition apply_irredp p (irr_p : irreducible_poly p) := irr_p.2. Coercion apply_irredp : irreducible_poly >-> Funclass. Lemma modp_XsubC p c : p %% ('X - c%:P) = p.[c]%:P. Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c)))) (@polyC (GRing.IntegralDomain.ringType R) (@horner (GRing.IntegralDomain.ringType R) p c)) *) have: root (p - p.[c]%:P) c by rewrite /root !hornerE subrr. (* Goal: forall _ : is_true (@root (GRing.IntegralDomain.ringType R) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) p (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) (@horner (GRing.IntegralDomain.ringType R) p c)))) c), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c)))) (@polyC (GRing.IntegralDomain.ringType R) (@horner (GRing.IntegralDomain.ringType R) p c)) *) case/factor_theorem=> q /(canRL (subrK _)) Dp; rewrite modpE /= lead_coefXsubC. (* Goal: @eq (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (if @in_mem (GRing.IntegralDomain.sort R) (GRing.one (GRing.IntegralDomain.ringType R)) (@mem (GRing.IntegralDomain.sort R) (predPredType (GRing.IntegralDomain.sort R)) (@has_quality (S O) (GRing.IntegralDomain.sort R) (@GRing.unit (GRing.IntegralDomain.unitRingType R)))) then @GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@GRing.exp (GRing.IntegralDomain.ringType R) (GRing.one (GRing.IntegralDomain.ringType R)) (rscalp (GRing.IntegralDomain.ringType R) p (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c)))))) (rmodp (GRing.IntegralDomain.ringType R) p (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c)))) else rmodp (GRing.IntegralDomain.ringType R) p (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c)))) (@polyC (GRing.IntegralDomain.ringType R) (@horner (GRing.IntegralDomain.ringType R) p c)) *) rewrite GRing.unitr1 expr1n invr1 scale1r {1}Dp. (* Goal: @eq (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.IntegralDomain.sort R))) (rmodp (GRing.IntegralDomain.ringType R) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c)))) (@polyC (GRing.IntegralDomain.ringType R) (@horner (GRing.IntegralDomain.ringType R) p c))) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c)))) (@polyC (GRing.IntegralDomain.ringType R) (@horner (GRing.IntegralDomain.ringType R) p c)) *) rewrite RingMonic.rmodp_addl_mul_small // ?monicXsubC // size_XsubC size_polyC. (* Goal: is_true (leq (S (nat_of_bool (negb (@eq_op (GRing.Ring.eqType (GRing.IntegralDomain.ringType R)) (@horner (GRing.IntegralDomain.ringType R) p c) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))))) (S (S O))) *) by case: (p.[c] == 0). Qed. Lemma coprimep_XsubC p c : coprimep p ('X - c%:P) = ~~ root p c. Proof. (* Goal: @eq bool (coprimep p (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c)))) (negb (@root (GRing.IntegralDomain.ringType R) p c)) *) rewrite -coprimep_modl modp_XsubC /root -alg_polyC. (* Goal: @eq bool (coprimep (@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))) (@horner (GRing.IntegralDomain.ringType R) p c) (GRing.one (@GRing.Lalgebra.ringType (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lalgType (GRing.IntegralDomain.ringType R))))) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c)))) (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@horner (GRing.IntegralDomain.ringType R) p c) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) *) have [-> | /coprimep_scalel->] := altP eqP; last exact: coprime1p. (* Goal: @eq bool (coprimep (@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.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (GRing.one (@GRing.Lalgebra.ringType (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lalgType (GRing.IntegralDomain.ringType R))))) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c)))) (negb true) *) by rewrite scale0r /coprimep gcd0p size_XsubC. Qed. Lemma coprimepX p : coprimep p 'X = ~~ root p 0. Proof. (* Goal: @eq bool (coprimep p (polyX (GRing.IntegralDomain.ringType R))) (negb (@root (GRing.IntegralDomain.ringType R) p (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) *) by rewrite -['X]subr0 coprimep_XsubC. Qed. Lemma eqp_monic : {in monic &, forall p q, (p %= q) = (p == q)}. Lemma dvdp_mul_XsubC p q c : (p %| ('X - c%:P) * q) = ((if root p c then p %/ ('X - c%:P) else p) %| q). Proof. (* Goal: @eq bool (@dvdp R p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c))) q)) (@dvdp R (if @root (GRing.IntegralDomain.ringType R) p c then @divp R p (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c))) else p) q) *) case: ifPn => [| not_pc0]; last by rewrite Gauss_dvdpr ?coprimep_XsubC. (* Goal: forall _ : is_true (@root (GRing.IntegralDomain.ringType R) p c), @eq bool (@dvdp R p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c))) q)) (@dvdp R (@divp R p (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c)))) q) *) rewrite root_factor_theorem -eqp_div_XsubC mulrC => /eqP{1}->. (* Goal: @eq bool (@dvdp R (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.ComUnitRing.comRingType (GRing.IntegralDomain.comUnitRingType R)))) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c))) (@divp R p (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c))))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c))) q)) (@dvdp R (@divp R p (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) c)))) q) *) by rewrite dvdp_mul2l ?polyXsubC_eq0. Qed. Lemma dvdp_prod_XsubC (I : Type) (r : seq I) (F : I -> R) p : p %| \prod_(i <- r) ('X - (F i)%:P) -> {m | p %= \prod_(i <- mask m r) ('X - (F i)%:P)}. Proof. (* Goal: forall _ : is_true (@dvdp R p (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) I (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) r (fun i : I => @BigBody (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) I i (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R))) true (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) (F i))))))), @sig bitseq (fun m : bitseq => is_true (@eqp R p (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) I (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) (@mask I m r) (fun i : I => @BigBody (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) I i (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R))) true (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) (F i)))))))) *) elim: r => [|i r IHr] in p *. by rewrite big_nil dvdp1; exists nil; rewrite // big_nil -size_poly_eq1. rewrite big_cons dvdp_mul_XsubC root_factor_theorem -eqp_div_XsubC. case: eqP => [{2}-> | _] /IHr[m Dp]; last by exists (false :: m). by exists (true :: m); rewrite /= mulrC big_cons eqp_mul2l ?polyXsubC_eq0. Qed. Qed. Lemma irredp_XsubC (x : R) : irreducible_poly ('X - x%:P). Proof. (* Goal: irreducible_poly (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) x))) *) split=> [|d size_d d_dv_Xx]; first by rewrite size_XsubC. (* Goal: is_true (@eqp R d (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) x)))) *) have: ~ d %= 1 by apply/negP; rewrite -size_poly_eq1. (* Goal: forall _ : not (is_true (@eqp R d (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))))), is_true (@eqp R d (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) x)))) *) have [|m /=] := @dvdp_prod_XsubC _ [:: x] id d; first by rewrite big_seq1. (* Goal: forall (_ : is_true (@eqp R d (@BigOp.bigop (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (GRing.IntegralDomain.sort R) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))) (@mask (GRing.IntegralDomain.sort R) m (@cons (GRing.IntegralDomain.sort R) x (@nil (GRing.IntegralDomain.sort R)))) (fun i : GRing.IntegralDomain.sort R => @BigBody (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) (GRing.IntegralDomain.sort R) i (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R))) true (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) i))))))) (_ : not (is_true (@eqp R d (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))))), is_true (@eqp R d (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@polyC (GRing.IntegralDomain.ringType R) x)))) *) by case: m => [|[] [|_ _] /=]; rewrite (big_nil, big_seq1). Qed. Lemma irredp_XsubCP d p : irreducible_poly p -> d %| p -> {d %= 1} + {d %= p}. Proof. (* Goal: forall (_ : irreducible_poly p) (_ : is_true (@dvdp R d p)), sumbool (is_true (@eqp R d (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))))) (is_true (@eqp R d p)) *) move=> irred_p dvd_dp; have [] := boolP (_ %= 1); first by left. (* Goal: forall _ : is_true (negb (@eqp R d (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))))), sumbool (is_true false) (is_true (@eqp R d p)) *) by rewrite -size_poly_eq1=> /irred_p /(_ dvd_dp); right. Qed. End IDomainPseudoDivision. Hint Resolve eqpxx divp0 divp1 mod0p modp0 modp1 dvdp_mull dvdp_mulr dvdpp : core. Hint Resolve dvdp0 : core. End CommonIdomain. Module Idomain. Include IdomainDefs. Export IdomainDefs. Include WeakIdomain. Include CommonIdomain. End Idomain. Module IdomainMonic. Import Ring ComRing UnitRing IdomainDefs Idomain. Section MonicDivisor. Variable R : idomainType. Variable q : {poly R}. Hypothesis monq : q \is monic. Implicit Type p d r : {poly R}. Lemma divpE p : p %/ q = rdivp p q. Lemma modpE p : p %% q = rmodp p q. Lemma scalpE p : scalp p q = 0%N. Lemma divp_eq p : p = (p %/ q) * q + (p %% q). Lemma divpp p : q %/ q = 1. Lemma dvdp_eq p : (q %| p) = (p == (p %/ q) * q). Lemma dvdpP p : reflect (exists qq, p = qq * q) (q %| p). Lemma mulpK p : p * q %/ q = p. Lemma mulKp p : q * p %/ q = p. End MonicDivisor. End IdomainMonic. Module IdomainUnit. Import Ring ComRing UnitRing IdomainDefs Idomain. Section UnitDivisor. Variable R : idomainType. Variable d : {poly R}. Hypothesis ulcd : lead_coef d \in GRing.unit. Implicit Type p q r : {poly R}. Lemma divp_eq p : p = (p %/ d) * d + (p %% d). Lemma edivpP p q r : p = q * d + r -> size r < size d -> q = (p %/ d) /\ r = p %% d. Lemma divpP p q r : p = q * d + r -> size r < size d -> q = (p %/ d). Proof. (* Goal: forall (_ : @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d) r)) (_ : is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) r))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) q (@divp R p d) *) by move/edivpP=> h; case/h. Qed. Lemma modpP p q r : p = q * d + r -> size r < size d -> r = (p %% d). Proof. (* Goal: forall (_ : @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d) r)) (_ : is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) r))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d)))), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) r (@modp R p d) *) by move/edivpP=> h; case/h. Qed. Lemma ulc_eqpP p q : lead_coef q \is a GRing.unit -> Lemma dvdp_eq p : (d %| p) = (p == p %/ d * d). Lemma ucl_eqp_eq p q : lead_coef q \is a GRing.unit -> Proof. (* Goal: forall (_ : is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R)))))) (_ : is_true (@eqp R p q)), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.mul (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) p) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@lead_coef (GRing.IntegralDomain.ringType R) q))) q) *) move=> ulcq /eqp_eq; move/(congr1 ( *:%R (lead_coef q)^-1 )). (* Goal: forall _ : @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.IntegralDomain.ringType R))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.IntegralDomain.ringType R)))))) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@lead_coef (GRing.IntegralDomain.ringType R) q)) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@lead_coef (GRing.IntegralDomain.ringType R) q) p)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@lead_coef (GRing.IntegralDomain.ringType R) q)) (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@lead_coef (GRing.IntegralDomain.ringType R) p) q)), @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p (@GRing.scale (GRing.IntegralDomain.ringType R) (poly_lmodType (GRing.IntegralDomain.ringType R)) (@GRing.mul (GRing.IntegralDomain.ringType R) (@lead_coef (GRing.IntegralDomain.ringType R) p) (@GRing.inv (GRing.IntegralDomain.unitRingType R) (@lead_coef (GRing.IntegralDomain.ringType R) q))) q) *) by rewrite !scalerA mulrC divrr // scale1r mulrC. Qed. Lemma modp_scalel c p : (c *: p) %% d = c *: (p %% d). Lemma divp_scalel c p : (c *: p) %/ d = c *: (p %/ d). Lemma eqp_modpl p q : p %= q -> (p %% d) %= (q %% d). Proof. (* Goal: forall _ : is_true (@eqp R p q), is_true (@eqp R (@modp R p d) (@modp R q d)) *) case/eqpP=> [[c1 c2]] /andP /= [c1n0 c2n0 e]. (* Goal: is_true (@eqp R (@modp R p d) (@modp R q d)) *) by apply/eqpP; exists (c1, c2); rewrite ?c1n0 //= -!modp_scalel e. Qed. Lemma eqp_divl p q : p %= q -> (p %/ d) %= (q %/ d). Proof. (* Goal: forall _ : is_true (@eqp R p q), is_true (@eqp R (@divp R p d) (@divp R q d)) *) case/eqpP=> [[c1 c2]] /andP /= [c1n0 c2n0 e]. (* Goal: is_true (@eqp R (@divp R p d) (@divp R q d)) *) by apply/eqpP; exists (c1, c2); rewrite ?c1n0 // -!divp_scalel e. Qed. Lemma modp_opp p : (- p) %% d = - (p %% d). Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) p) d) (@GRing.opp (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@modp R p d)) *) by rewrite -mulN1r -[- (_ %% _)]mulN1r -polyC_opp !mul_polyC modp_scalel. Qed. Lemma divp_opp p : (- p) %/ d = - (p %/ d). Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) p) d) (@GRing.opp (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) (@divp R p d)) *) by rewrite -mulN1r -[- (_ %/ _)]mulN1r -polyC_opp !mul_polyC divp_scalel. Qed. Lemma modp_add p q : (p + q) %% d = p %% d + q %% d. Lemma divp_add p q : (p + q) %/ d = p %/ d + q %/ d. Lemma mulpK q : (q * d) %/ d = q. Lemma mulKp q : (d * q) %/ d = q. Lemma divp_addl_mul_small q r : size r < size d -> (q * d + r) %/ d = q. Proof. (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) r))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d) r) d) q *) by move=> srd; rewrite divp_add (divp_small srd) addr0 mulpK. Qed. Lemma modp_addl_mul_small q r : size r < size d -> (q * d + r) %% d = r. Proof. (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) r))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d) r) d) r *) by move=> srd; rewrite modp_add modp_mull add0r modp_small. Qed. Lemma divp_addl_mul q r : (q * d + r) %/ d = q + r %/ d. Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d) r) d) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) q (@divp R r d)) *) by rewrite divp_add mulpK. Qed. Lemma divpp : d %/ d = 1. Lemma leq_trunc_divp m : size (m %/ d * d) <= size m. Proof. (* Goal: is_true (leq (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R m d) d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) m))) *) have dn0 : d != 0. (* Goal: is_true (leq (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R m d) d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) m))) *) (* Goal: is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) d (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) by rewrite -lead_coef_eq0; apply: contraTneq ulcd => ->; rewrite unitr0. (* Goal: is_true (leq (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R m d) d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) m))) *) case q0 : (m %/ d == 0); first by rewrite (eqP q0) mul0r size_poly0 leq0n. (* Goal: is_true (leq (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R m d) d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) m))) *) rewrite {2}(divp_eq m) size_addl // size_mul ?q0 //; move/negbT: q0. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R m d) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))))), is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R m d)))) (Nat.pred (addn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@divp R m d))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d))))) *) rewrite -size_poly_gt0; move/prednK<-; rewrite addSn /=. (* Goal: is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R m d)))) (addn (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@divp R m d)))) (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) d)))) *) by move: dn0; rewrite -(ltn_modp m); move/ltn_addl->. Qed. Lemma dvdpP p : reflect (exists q, p = q * d) (d %| p). Lemma divpK p : d %| p -> p %/ d * d = p. Lemma divpKC p : d %| p -> d * (p %/ d) = p. Lemma dvdp_eq_div p q : d %| p -> (q == p %/ d) = (q * d == p). Lemma dvdp_eq_mul p q : d %| p -> (p == q * d) = (p %/ d == q). Proof. (* Goal: forall _ : is_true (@dvdp R d p), @eq bool (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d)) (@eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p d) q) *) by move=> dv_d_p; rewrite eq_sym -dvdp_eq_div // eq_sym. Qed. Lemma divp_mulA p q : d %| q -> p * (q %/ d) = p * q %/ d. Proof. (* Goal: forall _ : is_true (@dvdp R d q), @eq (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p (@divp R q d)) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) d) *) move=> hdm; apply/eqP; rewrite eq_sym -dvdp_eq_mul. (* Goal: is_true (@dvdp R d (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q)) *) (* Goal: is_true (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p (@divp R q d)) d)) *) by rewrite -mulrA divpK. (* Goal: is_true (@dvdp R d (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p q)) *) by move/divpK: hdm<-; rewrite mulrA dvdp_mull // dvdpp. Qed. Lemma divp_mulAC m n : d %| m -> m %/ d * n = m * n %/ d. Proof. (* Goal: forall _ : is_true (@dvdp R d m), @eq (GRing.Ring.sort (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R m d) n) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) m n) d) *) by move=> hdm; rewrite mulrC (mulrC m); apply: divp_mulA. Qed. Lemma divp_mulCA p q : d %| p -> d %| q -> p * (q %/ d) = q * (p %/ d). Proof. (* Goal: forall (_ : is_true (@dvdp R d p)) (_ : is_true (@dvdp R d q)), @eq (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p (@divp R q d)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q (@divp R p d)) *) by move=> hdp hdq; rewrite mulrC divp_mulAC // divp_mulA. Qed. Lemma modp_mul p q : (p * (q %% d)) %% d = (p * q) %% d. End UnitDivisor. Section MoreUnitDivisor. Variable R : idomainType. Variable d : {poly R}. Hypothesis ulcd : lead_coef d \in GRing.unit. Implicit Types p q : {poly R}. Lemma expp_sub m n : n <= m -> (d ^+ (m - n))%N = d ^+ m %/ d ^+ n. Proof. (* Goal: forall _ : is_true (leq n m), @eq (GRing.Ring.sort (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) d (subn m n)) (@divp R (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) d m) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) d n)) *) by move/subnK=> {2}<-; rewrite exprD mulpK // lead_coef_exp unitrX. Qed. Lemma divp_pmul2l p q : lead_coef q \in GRing.unit -> d * p %/ (d * q) = p %/ q. Proof. (* Goal: forall _ : is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) q) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R))))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d q)) (@divp R p q) *) move=> uq. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d q)) (@divp R p q) *) have udq: lead_coef (d * q) \in GRing.unit. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d q)) (@divp R p q) *) (* Goal: is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d q)) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R))))) *) by rewrite lead_coefM unitrM_comm ?ulcd //; red; rewrite mulrC. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d p) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d q)) (@divp R p q) *) rewrite {1}(divp_eq uq p) mulrDr mulrCA divp_addl_mul //. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (@divp R p q) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d (@modp R p q)) (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.IntegralDomain.comRingType R))) d q))) (@divp R p q) *) have dn0 : d != 0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (@divp R p q) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d (@modp R p q)) (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.IntegralDomain.comRingType R))) d q))) (@divp R p q) *) (* Goal: is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) d (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) by rewrite -lead_coef_eq0; apply: contraTneq ulcd => ->; rewrite unitr0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (@divp R p q) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d (@modp R p q)) (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.IntegralDomain.comRingType R))) d q))) (@divp R p q) *) have qn0 : q != 0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (@divp R p q) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d (@modp R p q)) (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.IntegralDomain.comRingType R))) d q))) (@divp R p q) *) (* Goal: is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) by rewrite -lead_coef_eq0; apply: contraTneq uq => ->; rewrite unitr0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (@divp R p q) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d (@modp R p q)) (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.IntegralDomain.comRingType R))) d q))) (@divp R p q) *) have dqn0 : d * q != 0 by rewrite mulf_eq0 negb_or dn0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (@divp R p q) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d (@modp R p q)) (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.IntegralDomain.comRingType R))) d q))) (@divp R p q) *) suff : size (d * (p %% q)) < size (d * q). (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d (@modp R p q))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d q)))) *) (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d (@modp R p q))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d q)))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (@divp R p q) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d (@modp R p q)) (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.IntegralDomain.comRingType R))) d q))) (@divp R p q) *) by rewrite ltnNge -divpN0 // negbK => /eqP ->; rewrite addr0. (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d (@modp R p q))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d q)))) *) case: (altP ( (p %% q) =P 0)) => [-> | rn0]. (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d (@modp R p q))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d q)))) *) (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d q)))) *) by rewrite mulr0 size_poly0 size_poly_gt0. (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d (@modp R p q))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) d q)))) *) rewrite !size_mul //; move: dn0; rewrite -size_poly_gt0. (* Goal: forall _ : is_true (leq (S O) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d))), is_true (leq (S (Nat.pred (addn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@modp R p q)))))) (Nat.pred (addn (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) d)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) q))))) *) by move/prednK<-; rewrite !addSn /= ltn_add2l ltn_modp. Qed. Lemma divp_pmul2r p q : lead_coef p \in GRing.unit -> q * d %/ (p * d) = q %/ p. Proof. (* Goal: forall _ : is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) p) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R))))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) q d) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p d)) (@divp R q p) *) by move=> uq; rewrite -!(mulrC d) divp_pmul2l. Qed. Lemma divp_divl r p q : lead_coef r \in GRing.unit -> lead_coef p \in GRing.unit -> Proof. (* Goal: forall (_ : is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@lead_coef (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) r) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R)))))) (_ : is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) p) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R)))))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q p) r) (@divp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) move=> ulcr ulcp. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q p) r) (@divp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) have e : q = (q %/ p %/ r) * (p * r) + ((q %/ p) %% r * p + q %% p). (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q p) r) (@divp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) q (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@divp R (@divp R q p) r) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@modp R (@divp R q p) r) p) (@modp R q p))) *) by rewrite addrA (mulrC p) mulrA -mulrDl; rewrite -divp_eq //; apply: divp_eq. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q p) r) (@divp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) have pn0 : p != 0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q p) r) (@divp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) (* Goal: is_true (negb (@eq_op (poly_eqType (GRing.IntegralDomain.ringType R)) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) by rewrite -lead_coef_eq0; apply: contraTneq ulcp => ->; rewrite unitr0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q p) r) (@divp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) have rn0 : r != 0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q p) r) (@divp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) (* Goal: is_true (negb (@eq_op (poly_eqType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) r (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))))) *) by rewrite -lead_coef_eq0; apply: contraTneq ulcr => ->; rewrite unitr0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q p) r) (@divp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) have s : size ((q %/ p) %% r * p + q %% p) < size (p * r). (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q p) r) (@divp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@modp R (@divp R q p) r) p) (@modp R q p))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)))) *) case: (altP ((q %/ p) %% r =P 0)) => [-> | qn0]. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q p) r) (@divp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@modp R (@divp R q p) r) p) (@modp R q p))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)))) *) (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) p) (@modp R q p))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)))) *) rewrite mul0r add0r size_mul // (polySpred rn0) addnS /=. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q p) r) (@divp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@modp R (@divp R q p) r) p) (@modp R q p))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)))) *) (* Goal: is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R q p)))) (addn (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) r))))) *) by apply: leq_trans (leq_addr _ _); rewrite ltn_modp. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q p) r) (@divp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@modp R (@divp R q p) r) p) (@modp R q p))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)))) *) rewrite size_addl mulrC. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q p) r) (@divp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R q p)))) (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.ComUnitRing.comRingType (GRing.IntegralDomain.comUnitRingType R)))) p (@modp R (@divp R q p) r))))) *) (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.ComUnitRing.comRingType (GRing.IntegralDomain.comUnitRingType R)))) p (@modp R (@divp R q p) r))))) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType R)) (@polyseq (GRing.IntegralDomain.ringType R) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)))) *) by rewrite !size_mul // (polySpred pn0) !addSn /= ltn_add2l ltn_modp. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q p) r) (@divp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R q p)))) (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.ComUnitRing.comRingType (GRing.IntegralDomain.comUnitRingType R)))) p (@modp R (@divp R q p) r))))) *) rewrite size_mul // (polySpred qn0) addnS /=. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q p) r) (@divp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) (* Goal: is_true (leq (S (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R q p)))) (addn (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.IntegralDomain.ringType R) p)) (Nat.pred (@size (GRing.IntegralDomain.sort R) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R (@divp R q p) r)))))) *) by apply: leq_trans (leq_addr _ _); rewrite ltn_modp. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q p) r) (@divp R q (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) p r)) *) case: (edivpP _ e s) => //; rewrite lead_coefM unitrM_comm ?ulcp //. (* Goal: @GRing.comm (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@lead_coef (GRing.IntegralDomain.ringType R) p) (@lead_coef (GRing.IntegralDomain.ringType R) r) *) by red; rewrite mulrC. Qed. Lemma divpAC p q : lead_coef p \in GRing.unit -> q %/ d %/ p = q %/ p %/ d. Proof. (* Goal: forall _ : is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@lead_coef (GRing.IntegralDomain.ringType R) p) (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R))))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R (@divp R q d) p) (@divp R (@divp R q p) d) *) by move=> ulcp; rewrite !divp_divl // mulrC. Qed. Lemma modp_scaler c p : c \in GRing.unit -> p %% (c *: d) = (p %% d). Proof. (* Goal: forall _ : is_true (@in_mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) c (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R))))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)) (@modp R p d) *) move=> cn0; case: (eqVneq d 0) => [-> | dn0]; first by rewrite scaler0 !modp0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)) (@modp R p d) *) have e : p = (c^-1 *: (p %/ d)) * (c *: d) + (p %% d). (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)) (@modp R p d) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) c) (@divp R p d)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)) (@modp R p d)) *) by rewrite scalerCA scalerA mulVr // scale1r -(divp_eq ulcd). (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)) (@modp R p d) *) suff s : size (p %% d) < size (c *: d). (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R p d)))) (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)))) *) (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@modp R p (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)) (@modp R p d) *) by rewrite (modpP _ e s) // -mul_polyC lead_coefM lead_coefC unitrM cn0. (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R p d)))) (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)))) *) by rewrite size_scale ?ltn_modp //; apply: contraTneq cn0 => ->; rewrite unitr0. Qed. Lemma divp_scaler c p : c \in GRing.unit -> p %/ (c *: d) = c^-1 *: (p %/ d). Proof. (* Goal: forall _ : is_true (@in_mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) c (@mem (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.IntegralDomain.unitRingType R)) (@GRing.unit (GRing.IntegralDomain.unitRingType R))))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) c) (@divp R p d)) *) move=> cn0; case: (eqVneq d 0) => [-> | dn0]. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) c) (@divp R p d)) *) (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) c) (@divp R p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType R))))) *) by rewrite scaler0 !divp0 scaler0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) c) (@divp R p d)) *) have e : p = (c^-1 *: (p %/ d)) * (c *: d) + (p %% d). (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) c) (@divp R p d)) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType R) (Phant (GRing.IntegralDomain.sort R))) p (@GRing.add (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) c) (@divp R p d)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)) (@modp R p d)) *) by rewrite scalerCA scalerA mulVr // scale1r -(divp_eq ulcd). (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) c) (@divp R p d)) *) suff s : size (p %% d) < size (c *: d). (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R p d)))) (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)))) *) (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))))))) (@divp R p (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@GRing.inv (GRing.IntegralDomain.unitRingType R) c) (@divp R p d)) *) by rewrite (divpP _ e s) // -mul_polyC lead_coefM lead_coefC unitrM cn0. (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@modp R p d)))) (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType R))) c d)))) *) by rewrite size_scale ?ltn_modp //; apply: contraTneq cn0 => ->; rewrite unitr0. Qed. End MoreUnitDivisor. End IdomainUnit. Module Field. Import Ring ComRing UnitRing. Include IdomainDefs. Export IdomainDefs. Include CommonIdomain. Section FieldDivision. Variable F : fieldType. Implicit Type p q r d : {poly F}. Lemma divp_eq p q : p = (p %/ q) * q + (p %% q). Lemma divp_modpP p q d r : p = q * d + r -> size r < size d -> q = (p %/ d) /\ r = p %% d. Proof. (* Goal: forall (_ : @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) p (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) q d) r)) (_ : is_true (leq (S (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) r))) (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) d)))), and (@eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) q (Field.divp (GRing.Field.idomainType F) p d)) (@eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) r (Field.modp (GRing.Field.idomainType F) p d)) *) move=> he hs; apply: IdomainUnit.edivpP => //; rewrite unitfE lead_coef_eq0. (* Goal: is_true (negb (@eq_op (poly_eqType (GRing.Field.ringType F)) d (GRing.zero (poly_zmodType (GRing.Field.ringType F))))) *) by rewrite -size_poly_gt0; apply: leq_trans hs. Qed. Lemma divpP p q d r : p = q * d + r -> size r < size d -> q = (p %/ d). Lemma modpP p q d r : p = q * d + r -> size r < size d -> r = (p %% d). Lemma eqpfP p q : p %= q -> p = (lead_coef p / lead_coef q) *: q. Proof. (* Goal: forall _ : is_true (Field.eqp (GRing.Field.idomainType F) p q), @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) p (@GRing.scale (GRing.Field.ringType F) (poly_lmodType (GRing.Field.ringType F)) (@GRing.mul (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) p) (@GRing.inv (GRing.Field.unitRingType F) (@lead_coef (GRing.Field.ringType F) q))) q) *) have [->|nz_q] := altP (q =P 0). (* Goal: forall _ : is_true (Field.eqp (GRing.Field.idomainType F) p q), @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) p (@GRing.scale (GRing.Field.ringType F) (poly_lmodType (GRing.Field.ringType F)) (@GRing.mul (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) p) (@GRing.inv (GRing.Field.unitRingType F) (@lead_coef (GRing.Field.ringType F) q))) q) *) (* Goal: forall _ : is_true (Field.eqp (GRing.Field.idomainType F) p (GRing.zero (poly_zmodType (GRing.Field.ringType F)))), @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) p (@GRing.scale (GRing.Field.ringType F) (poly_lmodType (GRing.Field.ringType F)) (@GRing.mul (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) p) (@GRing.inv (GRing.Field.unitRingType F) (@lead_coef (GRing.Field.ringType F) (GRing.zero (poly_zmodType (GRing.Field.ringType F)))))) (GRing.zero (poly_zmodType (GRing.Field.ringType F)))) *) by rewrite eqp0 => /eqP ->; rewrite scaler0. (* Goal: forall _ : is_true (Field.eqp (GRing.Field.idomainType F) p q), @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) p (@GRing.scale (GRing.Field.ringType F) (poly_lmodType (GRing.Field.ringType F)) (@GRing.mul (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) p) (@GRing.inv (GRing.Field.unitRingType F) (@lead_coef (GRing.Field.ringType F) q))) q) *) move/IdomainUnit.ucl_eqp_eq; apply; rewrite unitfE. (* Goal: is_true (negb (@eq_op (GRing.Field.eqType F) (@lead_coef (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) q) (GRing.zero (GRing.Field.zmodType F)))) *) by move: nz_q; rewrite -lead_coef_eq0 => nz_qT. Qed. Lemma dvdp_eq q p : (q %| p) = (p == p %/ q * q). Lemma eqpf_eq p q : reflect (exists2 c, c != 0 & p = c *: q) (p %= q). Lemma modp_scalel c p q : (c *: p) %% q = c *: (p %% q). Lemma mulpK p q : q != 0 -> p * q %/ q = p. Lemma mulKp p q : q != 0 -> q * p %/ q = p. Lemma divp_scalel c p q : (c *: p) %/ q = c *: (p %/ q). Lemma modp_scaler c p d : c != 0 -> p %% (c *: d) = (p %% d). Lemma divp_scaler c p d : c != 0 -> p %/ (c *: d) = c^-1 *: (p %/ d). Lemma eqp_modpl d p q : p %= q -> (p %% d) %= (q %% d). Lemma eqp_divl d p q : p %= q -> (p %/ d) %= (q %/ d). Lemma eqp_modpr d p q : p %= q -> (d %% p) %= (d %% q). Proof. (* Goal: forall _ : is_true (Field.eqp (GRing.Field.idomainType F) p q), is_true (Field.eqp (GRing.Field.idomainType F) (Field.modp (GRing.Field.idomainType F) d p) (Field.modp (GRing.Field.idomainType F) d q)) *) case/eqpP=> [[c1 c2]] /andP [c1n0 c2n0 e]. (* Goal: is_true (Field.eqp (GRing.Field.idomainType F) (Field.modp (GRing.Field.idomainType F) d p) (Field.modp (GRing.Field.idomainType F) d q)) *) have -> : p = (c1^-1 * c2) *: q by rewrite -scalerA -e scalerA mulVf // scale1r. (* Goal: is_true (Field.eqp (GRing.Field.idomainType F) (Field.modp (GRing.Field.idomainType F) d (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F)))) (@GRing.mul (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (@GRing.inv (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F)) c1) c2) q)) (Field.modp (GRing.Field.idomainType F) d q)) *) by rewrite modp_scaler ?eqpxx // mulf_eq0 negb_or invr_eq0 c1n0. Qed. Lemma eqp_mod p1 p2 q1 q2 : p1 %= p2 -> q1 %= q2 -> p1 %% q1 %= p2 %% q2. Lemma eqp_divr (d m n : {poly F}) : m %= n -> (d %/ m) %= (d %/ n). Proof. (* Goal: forall _ : is_true (Field.eqp (GRing.Field.idomainType F) m n), is_true (Field.eqp (GRing.Field.idomainType F) (Field.divp (GRing.Field.idomainType F) d m) (Field.divp (GRing.Field.idomainType F) d n)) *) case/eqpP=> [[c1 c2]] /andP [c1n0 c2n0 e]. (* Goal: is_true (Field.eqp (GRing.Field.idomainType F) (Field.divp (GRing.Field.idomainType F) d m) (Field.divp (GRing.Field.idomainType F) d n)) *) have -> : m = (c1^-1 * c2) *: n by rewrite -scalerA -e scalerA mulVf // scale1r. (* Goal: is_true (Field.eqp (GRing.Field.idomainType F) (Field.divp (GRing.Field.idomainType F) d (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F)))) (@GRing.mul (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (@GRing.inv (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F)) c1) c2) n)) (Field.divp (GRing.Field.idomainType F) d n)) *) by rewrite divp_scaler ?eqp_scale // ?invr_eq0 mulf_eq0 negb_or invr_eq0 c1n0. Qed. Lemma eqp_div p1 p2 q1 q2 : p1 %= p2 -> q1 %= q2 -> p1 %/ q1 %= p2 %/ q2. Lemma eqp_gdcor p q r : q %= r -> gdcop p q %= gdcop p r. Proof. (* Goal: forall _ : is_true (Field.eqp (GRing.Field.idomainType F) q r), is_true (Field.eqp (GRing.Field.idomainType F) (gdcop (GRing.Field.idomainType F) p q) (gdcop (GRing.Field.idomainType F) p r)) *) move=> eqr; rewrite /gdcop (eqp_size eqr). (* Goal: is_true (Field.eqp (GRing.Field.idomainType F) (gdcop_rec (GRing.Field.idomainType F) p q (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (@polyseq (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) r))) (gdcop_rec (GRing.Field.idomainType F) p r (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (@polyseq (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) r)))) *) move: (size r)=> n; elim: n p q r eqr => [|n ihn] p q r; first by rewrite eqpxx. (* Goal: forall _ : is_true (Field.eqp (GRing.Field.idomainType F) q r), is_true (Field.eqp (GRing.Field.idomainType F) (gdcop_rec (GRing.Field.idomainType F) p q (S n)) (gdcop_rec (GRing.Field.idomainType F) p r (S n))) *) move=> eqr /=; rewrite (eqp_coprimepl p eqr); case: ifP => _ //; apply: ihn. (* Goal: is_true (Field.eqp (GRing.Field.idomainType F) (@divp (GRing.Field.idomainType F) q (gcdp (GRing.Field.idomainType F) q p)) (@divp (GRing.Field.idomainType F) r (gcdp (GRing.Field.idomainType F) r p))) *) by apply: eqp_div => //; apply: eqp_gcdl. Qed. Lemma eqp_gdcol p q r : q %= r -> gdcop q p %= gdcop r p. Proof. (* Goal: forall _ : is_true (Field.eqp (GRing.Field.idomainType F) q r), is_true (Field.eqp (GRing.Field.idomainType F) (gdcop (GRing.Field.idomainType F) q p) (gdcop (GRing.Field.idomainType F) r p)) *) move=> eqr; rewrite /gdcop; move: (size p)=> n. (* Goal: is_true (Field.eqp (GRing.Field.idomainType F) (gdcop_rec (GRing.Field.idomainType F) q p n) (gdcop_rec (GRing.Field.idomainType F) r p n)) *) elim: n p q r eqr {1 3}p (eqpxx p) => [|n ihn] p q r eqr s esp /=. (* Goal: is_true (Field.eqp (GRing.Field.idomainType F) (if coprimep (GRing.Field.idomainType F) s q then s else gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) s (gcdp (GRing.Field.idomainType F) s q)) n) (if coprimep (GRing.Field.idomainType F) p r then p else gdcop_rec (GRing.Field.idomainType F) r (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p r)) n)) *) (* Goal: is_true (Field.eqp (GRing.Field.idomainType F) (@GRing.natmul (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (nat_of_bool (@eq_op (poly_eqType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))))))) (@GRing.natmul (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (nat_of_bool (@eq_op (poly_eqType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) r (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))))))) *) move: eqr; case: (eqVneq q 0)=> [-> | nq0 eqr] /=. (* Goal: is_true (Field.eqp (GRing.Field.idomainType F) (if coprimep (GRing.Field.idomainType F) s q then s else gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) s (gcdp (GRing.Field.idomainType F) s q)) n) (if coprimep (GRing.Field.idomainType F) p r then p else gdcop_rec (GRing.Field.idomainType F) r (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p r)) n)) *) (* Goal: is_true (Field.eqp (GRing.Field.idomainType F) (@GRing.natmul (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (nat_of_bool (@eq_op (poly_eqType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))))))) (@GRing.natmul (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (nat_of_bool (@eq_op (poly_eqType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) r (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))))))) *) (* Goal: forall _ : is_true (Field.eqp (GRing.Field.idomainType F) (GRing.zero (poly_zmodType (GRing.Field.ringType F))) r), is_true (Field.eqp (GRing.Field.idomainType F) (@GRing.natmul (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (nat_of_bool (@eq_op (poly_eqType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (GRing.zero (poly_zmodType (GRing.Field.ringType F))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))))))) (@GRing.natmul (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (nat_of_bool (@eq_op (poly_eqType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) r (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))))))) *) by rewrite eqp_sym eqp0; move->; rewrite eqxx eqpxx. (* Goal: is_true (Field.eqp (GRing.Field.idomainType F) (if coprimep (GRing.Field.idomainType F) s q then s else gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) s (gcdp (GRing.Field.idomainType F) s q)) n) (if coprimep (GRing.Field.idomainType F) p r then p else gdcop_rec (GRing.Field.idomainType F) r (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p r)) n)) *) (* Goal: is_true (Field.eqp (GRing.Field.idomainType F) (@GRing.natmul (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (nat_of_bool (@eq_op (poly_eqType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))))))) (@GRing.natmul (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (nat_of_bool (@eq_op (poly_eqType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) r (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))))))) *) suff rn0 : r != 0 by rewrite (negPf nq0) (negPf rn0) eqpxx. (* Goal: is_true (Field.eqp (GRing.Field.idomainType F) (if coprimep (GRing.Field.idomainType F) s q then s else gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) s (gcdp (GRing.Field.idomainType F) s q)) n) (if coprimep (GRing.Field.idomainType F) p r then p else gdcop_rec (GRing.Field.idomainType F) r (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p r)) n)) *) (* Goal: is_true (negb (@eq_op (poly_eqType (GRing.Field.ringType F)) r (GRing.zero (poly_zmodType (GRing.Field.ringType F))))) *) by apply: contraTneq eqr => ->; rewrite eqp0. (* Goal: is_true (Field.eqp (GRing.Field.idomainType F) (if coprimep (GRing.Field.idomainType F) s q then s else gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) s (gcdp (GRing.Field.idomainType F) s q)) n) (if coprimep (GRing.Field.idomainType F) p r then p else gdcop_rec (GRing.Field.idomainType F) r (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p r)) n)) *) rewrite (eqp_coprimepr _ eqr) (eqp_coprimepl _ esp); case: ifP=> _ //. (* Goal: is_true (Field.eqp (GRing.Field.idomainType F) (gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) s (gcdp (GRing.Field.idomainType F) s q)) n) (gdcop_rec (GRing.Field.idomainType F) r (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p r)) n)) *) by apply: ihn => //; apply: eqp_div => //; apply: eqp_gcd. Qed. Lemma eqp_rgdco_gdco q p : rgdcop q p %= gdcop q p. Lemma modp_opp p q : (- p) %% q = - (p %% q). Lemma divp_opp p q : (- p) %/ q = - (p %/ q). Lemma modp_add d p q : (p + q) %% d = p %% d + q %% d. Lemma modNp p q : (- p) %% q = - (p %% q). Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F)))))))) (Field.modp (GRing.Field.idomainType F) (@GRing.opp (poly_zmodType (GRing.Field.ringType F)) p) q) (@GRing.opp (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))))) (Field.modp (GRing.Field.idomainType F) p q)) *) by apply/eqP; rewrite -addr_eq0 -modp_add addNr mod0p. Qed. Lemma divp_add d p q : (p + q) %/ d = p %/ d + q %/ d. Lemma divp_addl_mul_small d q r : size r < size d -> (q * d + r) %/ d = q. Lemma modp_addl_mul_small d q r : size r < size d -> (q * d + r) %% d = r. Lemma divp_addl_mul d q r : d != 0 -> (q * d + r) %/ d = q + r %/ d. Lemma divpp d : d != 0 -> d %/ d = 1. Lemma leq_trunc_divp d m : size (m %/ d * d) <= size m. Lemma divpK d p : d %| p -> p %/ d * d = p. Lemma divpKC d p : d %| p -> d * (p %/ d) = p. Lemma dvdp_eq_div d p q : d != 0 -> d %| p -> (q == p %/ d) = (q * d == p). Lemma dvdp_eq_mul d p q : d != 0 -> d %| p -> (p == q * d) = (p %/ d == q). Lemma divp_mulA d p q : d %| q -> p * (q %/ d) = p * q %/ d. Lemma divp_mulAC d m n : d %| m -> m %/ d * n = m * n %/ d. Lemma divp_mulCA d p q : d %| p -> d %| q -> p * (q %/ d) = q * (p %/ d). Lemma expp_sub d m n : d != 0 -> m >= n -> (d ^+ (m - n))%N = d ^+ m %/ d ^+ n. Lemma divp_pmul2l d q p : d != 0 -> q != 0 -> d * p %/ (d * q) = p %/ q. Lemma divp_pmul2r d p q : d != 0 -> p != 0 -> q * d %/ (p * d) = q %/ p. Lemma divp_divl r p q : q %/ p %/ r = q %/ (p * r). Lemma divpAC d p q : q %/ d %/ p = q %/ p %/ d. Lemma edivp_def p q : edivp p q = (0%N, p %/ q, p %% q). Lemma divpE p q : p %/ q = (lead_coef q)^-(rscalp p q) *: (rdivp p q). Lemma modpE p q : p %% q = (lead_coef q)^-(rscalp p q) *: (rmodp p q). Lemma scalpE p q : scalp p q = 0%N. Variant edivp_spec m d : nat * {poly F} * {poly F} -> Type := EdivpSpec n q r of m = q * d + r & (d != 0) ==> (size r < size d) : edivp_spec m d (n, q, r). Lemma edivpP m d : edivp_spec m d (edivp m d). Lemma edivp_eq d q r : size r < size d -> edivp (q * d + r) d = (0%N, q, r). Lemma modp_mul p q m : (p * (q %% m)) %% m = (p * q) %% m. Lemma dvdpP p q : reflect (exists qq, p = qq * q) (q %| p). Lemma Bezout_eq1_coprimepP : forall p q, reflect (exists u, u.1 * p + u.2 * q = 1) (coprimep p q). Lemma dvdp_gdcor p q : q != 0 -> p %| (gdcop q p) * (q ^+ size p). Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (GRing.Field.ringType F)) q (GRing.zero (poly_zmodType (GRing.Field.ringType F))))), is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop (GRing.Field.idomainType F) q p) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p))))) *) move=> q_neq0; rewrite /gdcop. (* Goal: is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop_rec (GRing.Field.idomainType F) q p (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (@polyseq (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) p))) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p))))) *) elim: (size p) {-2 5}p (leqnn (size p))=> {p} [|n ihn] p. (* Goal: forall _ : is_true (leq (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p)) (S n)), is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop_rec (GRing.Field.idomainType F) q p (S n)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p))))) *) (* Goal: forall _ : is_true (leq (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p)) O), is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop_rec (GRing.Field.idomainType F) q p O) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p))))) *) rewrite size_poly_leq0; move/eqP->. (* Goal: forall _ : is_true (leq (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p)) (S n)), is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop_rec (GRing.Field.idomainType F) q p (S n)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p))))) *) (* Goal: is_true (Field.dvdp (GRing.Field.idomainType F) (GRing.zero (poly_zmodType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop_rec (GRing.Field.idomainType F) q (GRing.zero (poly_zmodType (GRing.Field.ringType F))) O) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) (GRing.zero (poly_zmodType (GRing.Field.ringType F)))))))) *) by rewrite size_poly0 /= dvd0p expr0 mulr1 (negPf q_neq0). (* Goal: forall _ : is_true (leq (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p)) (S n)), is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop_rec (GRing.Field.idomainType F) q p (S n)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p))))) *) move=> hsp /=; have [->|p_neq0] := altP (p =P 0). (* Goal: is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (if coprimep (GRing.Field.idomainType F) p q then p else gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q)) n) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) p))))) *) (* Goal: is_true (Field.dvdp (GRing.Field.idomainType F) (GRing.zero (poly_zmodType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (if coprimep (GRing.Field.idomainType F) (GRing.zero (poly_zmodType (GRing.Field.ringType F))) q then GRing.zero (poly_zmodType (GRing.Field.ringType F)) else gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) (GRing.zero (poly_zmodType (GRing.Field.ringType F))) (gcdp (GRing.Field.idomainType F) (GRing.zero (poly_zmodType (GRing.Field.ringType F))) q)) n) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) (GRing.zero (poly_zmodType (GRing.Field.ringType F)))))))) *) rewrite size_poly0 /= dvd0p expr0 mulr1 div0p /=. (* Goal: is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (if coprimep (GRing.Field.idomainType F) p q then p else gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q)) n) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) p))))) *) (* Goal: is_true (@eq_op (poly_eqType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (if coprimep (GRing.Field.idomainType F) (GRing.zero (poly_zmodType (GRing.Field.ringType F))) q then GRing.zero (poly_zmodType (GRing.Field.ringType F)) else gdcop_rec (GRing.Field.idomainType F) q (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Phant (GRing.Field.sort F))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Phant (GRing.Field.sort F))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F)))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F)))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))))) n) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))))) *) case: ifP=> // _; have := (ihn 0). (* Goal: is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (if coprimep (GRing.Field.idomainType F) p q then p else gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q)) n) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) p))))) *) (* Goal: forall _ : forall _ : is_true (leq (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) (GRing.zero (poly_zmodType (GRing.Field.ringType F))))) n), is_true (Field.dvdp (GRing.Field.idomainType F) (GRing.zero (poly_zmodType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop_rec (GRing.Field.idomainType F) q (GRing.zero (poly_zmodType (GRing.Field.ringType F))) n) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) (GRing.zero (poly_zmodType (GRing.Field.ringType F)))))))), is_true (@eq_op (poly_eqType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop_rec (GRing.Field.idomainType F) q (GRing.zero (@GRing.Zmodule.Pack (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Phant (GRing.Field.sort F))) (@GRing.Zmodule.Class (@poly_of (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Phant (GRing.Field.sort F))) (@Choice.Class (polynomial (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F)))) (polynomial_eqMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F)))) (polynomial_choiceMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (poly_zmodMixin (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))))) n) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))))) *) by rewrite size_poly0 expr0 mulr1 dvd0p=> /(_ isT). (* Goal: is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (if coprimep (GRing.Field.idomainType F) p q then p else gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q)) n) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) p))))) *) have [|ncop_pq] := boolP (coprimep _ _); first by rewrite dvdp_mulr ?dvdpp. (* Goal: is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q)) n) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) p))))) *) have g_gt1: (1 < size (gcdp p q))%N. (* Goal: is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q)) n) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) p))))) *) (* Goal: is_true (leq (S (S O)) (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (@polyseq (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (gcdp (GRing.Field.idomainType F) p q)))) *) have [|//|/eqP] := ltngtP; last by rewrite -coprimep_def (negPf ncop_pq). (* Goal: is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q)) n) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) p))))) *) (* Goal: forall _ : is_true (leq (S (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (@polyseq (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (gcdp (GRing.Field.idomainType F) p q)))) (S O)), is_true false *) by rewrite ltnS leqn0 size_poly_eq0 gcdp_eq0 (negPf p_neq0). (* Goal: is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q)) n) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) p))))) *) have sd : (size (p %/ gcdp p q) < size p)%N. (* Goal: is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q)) n) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) p))))) *) (* Goal: is_true (leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F)))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Field.divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q))))) (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p))) *) rewrite size_divp -?size_poly_eq0 -(subnKC g_gt1) // add2n /=. (* Goal: is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q)) n) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) p))))) *) (* Goal: is_true (leq (S (subn (@size (GRing.Field.sort F) (@polyseq (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) p)) (S (subn (@size (GRing.Field.sort F) (@polyseq (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (gcdp (GRing.Field.idomainType F) p q))) (S (S O)))))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) p))) *) by rewrite -[size _]prednK ?size_poly_gt0 // ltnS subSS leq_subr. (* Goal: is_true (Field.dvdp (GRing.Field.idomainType F) p (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q)) n) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) p))))) *) rewrite -{1}[p](divpK (dvdp_gcdl _ q)) -(subnKC sd) addSnnS exprD mulrA. (* Goal: is_true (Field.dvdp (GRing.Field.idomainType F) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (poly_lalgType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (Field.divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q)) (gcdp (GRing.Field.idomainType F) p q)) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (gdcop_rec (GRing.Field.idomainType F) q (@divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q)) n) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F)))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Field.divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q)))))) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (S (subn (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p)) (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F)))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Field.divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q)))))))))) *) rewrite dvdp_mul ?ihn //; first by rewrite -ltnS (leq_trans sd). (* Goal: is_true (@dvdp (GRing.Field.idomainType F) (gcdp (GRing.Field.idomainType F) p q) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) q (S (subn (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p)) (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F)))) (@polyseq (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Field.divp (GRing.Field.idomainType F) p (gcdp (GRing.Field.idomainType F) p q))))))))) *) by rewrite exprS dvdp_mulr // dvdp_gcdr. Qed. Lemma reducible_cubic_root p q : size p <= 4 -> 1 < size q < size p -> q %| p -> {r | root p r}. Proof. (* Goal: forall (_ : is_true (leq (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p)) (S (S (S (S O)))))) (_ : is_true (andb (leq (S (S O)) (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) q))) (leq (S (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) q))) (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p))))) (_ : is_true (Field.dvdp (GRing.Field.idomainType F) q p)), @sig (GRing.Ring.sort (GRing.Field.ringType F)) (fun r : GRing.Ring.sort (GRing.Field.ringType F) => is_true (@root (GRing.Field.ringType F) p r)) *) move=> p_le4 /andP[]; rewrite leq_eqVlt eq_sym. (* Goal: forall (_ : is_true (orb (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) q)) (S (S O))) (leq (S (S (S O))) (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) q))))) (_ : is_true (leq (S (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) q))) (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p)))) (_ : is_true (Field.dvdp (GRing.Field.idomainType F) q p)), @sig (GRing.Ring.sort (GRing.Field.ringType F)) (fun r : GRing.Ring.sort (GRing.Field.ringType F) => is_true (@root (GRing.Field.ringType F) p r)) *) have [/poly2_root[x qx0] _ _ | _ /= q_gt2 p_gt_q] := size q =P 2. (* Goal: forall _ : is_true (Field.dvdp (GRing.Field.idomainType F) q p), @sig (GRing.Field.sort F) (fun r : GRing.Field.sort F => is_true (@root (GRing.Field.ringType F) p r)) *) (* Goal: forall _ : is_true (Field.dvdp (GRing.Field.idomainType F) q p), @sig (GRing.Ring.sort (GRing.Field.ringType F)) (fun r : GRing.Ring.sort (GRing.Field.ringType F) => is_true (@root (GRing.Field.ringType F) p r)) *) by exists x; rewrite -!dvdp_XsubCl in qx0 *; apply: (dvdp_trans qx0). (* Goal: forall _ : is_true (Field.dvdp (GRing.Field.idomainType F) q p), @sig (GRing.Field.sort F) (fun r : GRing.Field.sort F => is_true (@root (GRing.Field.ringType F) p r)) *) case/dvdpP/sig_eqW=> r def_p; rewrite def_p. (* Goal: @sig (GRing.Field.sort F) (fun r0 : GRing.Field.sort F => is_true (@root (GRing.Field.ringType F) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r q) r0)) *) suffices /poly2_root[x rx0]: size r = 2 by exists x; rewrite rootM rx0. (* Goal: @eq nat (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) r)) (S (S O)) *) have /norP[nz_r nz_q]: ~~ [|| r == 0 | q == 0]. (* Goal: @eq nat (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) r)) (S (S O)) *) (* Goal: is_true (negb (orb (@eq_op (Choice.eqType (GRing.Ring.choiceType (poly_ringType (GRing.Field.ringType F)))) r (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))))) (@eq_op (poly_eqType (GRing.Field.ringType F)) q (GRing.zero (poly_zmodType (GRing.Field.ringType F)))))) *) by rewrite -mulf_eq0 -def_p -size_poly_gt0 (leq_ltn_trans _ p_gt_q). (* Goal: @eq nat (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) r)) (S (S O)) *) rewrite def_p size_mul // -subn1 leq_subLR ltn_subRL in p_gt_q p_le4. (* Goal: @eq nat (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) r)) (S (S O)) *) by apply/eqP; rewrite -(eqn_add2r (size q)) eqn_leq (leq_trans p_le4). Qed. Lemma cubic_irreducible p : 1 < size p <= 4 -> (forall x, ~~ root p x) -> irreducible_poly p. Proof. (* Goal: forall (_ : is_true (andb (leq (S (S O)) (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p))) (leq (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p)) (S (S (S (S O))))))) (_ : forall x : GRing.Ring.sort (GRing.Field.ringType F), is_true (negb (@root (GRing.Field.ringType F) p x))), irreducible_poly (GRing.Field.idomainType F) p *) move=> /andP[p_gt1 p_le4] root'p; split=> // q sz_q_neq1 q_dv_p. (* Goal: is_true (@eqp (GRing.Field.idomainType F) q p) *) have nz_p: p != 0 by rewrite -size_poly_gt0 ltnW. (* Goal: is_true (@eqp (GRing.Field.idomainType F) q p) *) have nz_q: q != 0 by apply: contraTneq q_dv_p => ->; rewrite dvd0p. (* Goal: is_true (@eqp (GRing.Field.idomainType F) q p) *) have q_gt1: size q > 1 by rewrite ltn_neqAle eq_sym sz_q_neq1 size_poly_gt0. (* Goal: is_true (@eqp (GRing.Field.idomainType F) q p) *) rewrite -dvdp_size_eqp // eqn_leq dvdp_leq //= leqNgt; apply/negP=> p_gt_q. (* Goal: False *) by have [|x /idPn//] := reducible_cubic_root p_le4 _ q_dv_p; rewrite q_gt1. Qed. Section FieldRingMap. Variable rR : ringType. Variable f : {rmorphism F -> rR}. Local Notation "p ^f" := (map_poly f p) : ring_scope. Implicit Type a b : {poly F}. Lemma redivp_map a b : redivp a^f b^f = (rscalp a b, (rdivp a b)^f, (rmodp a b)^f). Proof. (* Goal: @eq (prod (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR)))) (redivp rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)) (@pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) (rscalp (GRing.Field.ringType F) a b) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (rdivp (GRing.Field.ringType F) a b))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (rmodp (GRing.Field.ringType F) a b))) *) rewrite /rdivp /rscalp /rmodp !unlock map_poly_eq0 size_map_poly. (* Goal: @eq (prod (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR)))) (if @eq_op (poly_eqType (GRing.Field.ringType F)) b (GRing.zero (poly_zmodType (GRing.Field.ringType F))) then @pair (prod nat (GRing.Zmodule.sort (poly_zmodType rR))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (GRing.Zmodule.sort (poly_zmodType rR)) O (GRing.zero (poly_zmodType rR))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a) else redivp_rec rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b) O (GRing.zero (poly_zmodType rR)) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a) (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) a))) (@pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) (@fst nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F)))) (@fst (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F))))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F)))) (if @eq_op (poly_eqType (GRing.Field.ringType F)) b (GRing.zero (poly_zmodType (GRing.Field.ringType F))) then @pair (prod nat (GRing.Zmodule.sort (poly_zmodType (GRing.Field.ringType F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F)))) (@pair nat (GRing.Zmodule.sort (poly_zmodType (GRing.Field.ringType F))) O (GRing.zero (poly_zmodType (GRing.Field.ringType F)))) a else redivp_rec (GRing.Field.ringType F) b O (GRing.zero (poly_zmodType (GRing.Field.ringType F))) a (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) a))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (@snd nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F)))) (@fst (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F))))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F)))) (if @eq_op (poly_eqType (GRing.Field.ringType F)) b (GRing.zero (poly_zmodType (GRing.Field.ringType F))) then @pair (prod nat (GRing.Zmodule.sort (poly_zmodType (GRing.Field.ringType F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F)))) (@pair nat (GRing.Zmodule.sort (poly_zmodType (GRing.Field.ringType F))) O (GRing.zero (poly_zmodType (GRing.Field.ringType F)))) a else redivp_rec (GRing.Field.ringType F) b O (GRing.zero (poly_zmodType (GRing.Field.ringType F))) a (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) a))))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (@snd (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F))))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F)))) (if @eq_op (poly_eqType (GRing.Field.ringType F)) b (GRing.zero (poly_zmodType (GRing.Field.ringType F))) then @pair (prod nat (GRing.Zmodule.sort (poly_zmodType (GRing.Field.ringType F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F)))) (@pair nat (GRing.Zmodule.sort (poly_zmodType (GRing.Field.ringType F))) O (GRing.zero (poly_zmodType (GRing.Field.ringType F)))) a else redivp_rec (GRing.Field.ringType F) b O (GRing.zero (poly_zmodType (GRing.Field.ringType F))) a (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) a)))))) *) case: eqP; rewrite /= -(rmorph0 (map_poly_rmorphism f)) //; move/eqP=> q_nz. (* Goal: @eq (prod (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR)))) (redivp_rec rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b) O (@GRing.RMorphism.apply (poly_ringType (GRing.Field.ringType F)) (poly_ringType rR) (Phant (forall _ : GRing.Ring.sort (poly_ringType (GRing.Field.ringType F)), GRing.Ring.sort (poly_ringType rR))) (@map_poly_rmorphism (GRing.Field.ringType F) rR f) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) (@fst nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (redivp_rec (GRing.Field.ringType F) b O (GRing.zero (poly_zmodType (GRing.Field.ringType F))) a (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (@snd nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (redivp_rec (GRing.Field.ringType F) b O (GRing.zero (poly_zmodType (GRing.Field.ringType F))) a (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (@snd (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (redivp_rec (GRing.Field.ringType F) b O (GRing.zero (poly_zmodType (GRing.Field.ringType F))) a (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)))))) *) move: (size a) => m; elim: m 0%N 0 a => [|m IHm] qq r a /=. (* Goal: @eq (prod (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR)))) (if leq (S (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a)))) (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b))) then @pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) qq (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) r)) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a) else redivp_rec rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b) (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType rR)) (@GRing.mul (poly_ringType rR) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) r) (@polyC rR (@lead_coef rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))) (@GRing.scale rR (@GRing.Lalgebra.lmod_ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR)) (@lead_coef rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a)) (@GRing.exp (poly_ringType rR) (polyX rR) (subn (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a))) (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType rR)) (@GRing.mul (poly_ringType rR) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a) (@polyC rR (@lead_coef rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR))) (@GRing.mul (@GRing.Lalgebra.ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR)) (@GRing.scale rR (@GRing.Lalgebra.lmod_ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR)) (@lead_coef rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a)) (@GRing.exp (poly_ringType rR) (polyX rR) (subn (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a))) (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))) m) (@pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) (@fst nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else redivp_rec (GRing.Field.ringType F) b (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b))) m))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (@snd nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else redivp_rec (GRing.Field.ringType F) b (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b))) m))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (@snd (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else redivp_rec (GRing.Field.ringType F) b (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b))) m)))) *) (* Goal: @eq (prod (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR)))) (if leq (S (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a)))) (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b))) then @pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) qq (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) r)) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a) else @pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType rR)) (@GRing.mul (poly_ringType rR) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) r) (@polyC rR (@lead_coef rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))) (@GRing.scale rR (@GRing.Lalgebra.lmod_ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR)) (@lead_coef rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a)) (@GRing.exp (poly_ringType rR) (polyX rR) (subn (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a))) (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType rR)) (@GRing.mul (poly_ringType rR) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a) (@polyC rR (@lead_coef rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR))) (@GRing.mul (@GRing.Lalgebra.ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR)) (@GRing.scale rR (@GRing.Lalgebra.lmod_ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR)) (@lead_coef rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a)) (@GRing.exp (poly_ringType rR) (polyX rR) (subn (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a))) (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b))))) (@pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) (@fst nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b)))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (@snd nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b)))))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (@snd (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b))))))) *) rewrite -!mul_polyC !size_map_poly !lead_coef_map // -(map_polyXn f). (* Goal: @eq (prod (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR)))) (if leq (S (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a)))) (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b))) then @pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) qq (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) r)) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a) else redivp_rec rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b) (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType rR)) (@GRing.mul (poly_ringType rR) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) r) (@polyC rR (@lead_coef rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))) (@GRing.scale rR (@GRing.Lalgebra.lmod_ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR)) (@lead_coef rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a)) (@GRing.exp (poly_ringType rR) (polyX rR) (subn (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a))) (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType rR)) (@GRing.mul (poly_ringType rR) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a) (@polyC rR (@lead_coef rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR))) (@GRing.mul (@GRing.Lalgebra.ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR)) (@GRing.scale rR (@GRing.Lalgebra.lmod_ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR)) (@lead_coef rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a)) (@GRing.exp (poly_ringType rR) (polyX rR) (subn (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a))) (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))) m) (@pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) (@fst nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else redivp_rec (GRing.Field.ringType F) b (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b))) m))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (@snd nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else redivp_rec (GRing.Field.ringType F) b (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b))) m))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (@snd (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else redivp_rec (GRing.Field.ringType F) b (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b))) m)))) *) (* Goal: @eq (prod (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR)))) (if leq (S (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) qq (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) r)) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a) else @pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType rR)) (@GRing.mul (poly_ringType rR) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) r) (@polyC rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f (@lead_coef (GRing.Field.ringType F) b)))) (@GRing.mul (poly_ringType rR) (@polyC rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f (@lead_coef (GRing.Field.ringType F) a))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Ring.sort (GRing.Field.ringType F), GRing.Ring.sort rR)) f) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) b)))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType rR)) (@GRing.mul (poly_ringType rR) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a) (@polyC rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f (@lead_coef (GRing.Field.ringType F) b)))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR))) (@GRing.mul (@GRing.Lalgebra.ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR)) (@GRing.mul (poly_ringType rR) (@polyC rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f (@lead_coef (GRing.Field.ringType F) a))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Ring.sort (GRing.Field.ringType F), GRing.Ring.sort rR)) f) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) b)))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b))))) (@pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) (@fst nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) a)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) a)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b)))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (@snd nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) a)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) a)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b)))))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (@snd (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) a)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) a)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b))))))) *) by rewrite -!(map_polyC f) -!rmorphM -rmorphB -rmorphD; case: (_ < _). (* Goal: @eq (prod (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR)))) (if leq (S (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a)))) (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b))) then @pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) qq (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) r)) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a) else redivp_rec rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b) (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType rR)) (@GRing.mul (poly_ringType rR) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) r) (@polyC rR (@lead_coef rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))) (@GRing.scale rR (@GRing.Lalgebra.lmod_ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR)) (@lead_coef rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a)) (@GRing.exp (poly_ringType rR) (polyX rR) (subn (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a))) (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType rR)) (@GRing.mul (poly_ringType rR) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a) (@polyC rR (@lead_coef rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR))) (@GRing.mul (@GRing.Lalgebra.ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR)) (@GRing.scale rR (@GRing.Lalgebra.lmod_ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR)) (@lead_coef rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a)) (@GRing.exp (poly_ringType rR) (polyX rR) (subn (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a))) (@size (GRing.Ring.sort rR) (@polyseq rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))) m) (@pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) (@fst nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else redivp_rec (GRing.Field.ringType F) b (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b))) m))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (@snd nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else redivp_rec (GRing.Field.ringType F) b (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b))) m))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (@snd (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else redivp_rec (GRing.Field.ringType F) b (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.scale (GRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@lead_coef (GRing.Field.ringType F) a) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b))) m)))) *) rewrite -!mul_polyC !size_map_poly !lead_coef_map // -(map_polyXn f). (* Goal: @eq (prod (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR)))) (if leq (S (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) qq (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) r)) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a) else redivp_rec rR (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b) (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType rR)) (@GRing.mul (poly_ringType rR) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) r) (@polyC rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f (@lead_coef (GRing.Field.ringType F) b)))) (@GRing.mul (poly_ringType rR) (@polyC rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f (@lead_coef (GRing.Field.ringType F) a))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Ring.sort (GRing.Field.ringType F), GRing.Ring.sort rR)) f) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) b))))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType rR)) (@GRing.mul (poly_ringType rR) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) a) (@polyC rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f (@lead_coef (GRing.Field.ringType F) b)))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR))) (@GRing.mul (@GRing.Lalgebra.ringType rR (Phant (GRing.Ring.sort rR)) (poly_lalgType rR)) (@GRing.mul (poly_ringType rR) (@polyC rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f (@lead_coef (GRing.Field.ringType F) a))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Ring.sort (GRing.Field.ringType F), GRing.Ring.sort rR)) f) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) b)))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) b)))) m) (@pair (prod nat (@poly_of rR (Phant (GRing.Ring.sort rR)))) (@poly_of rR (Phant (GRing.Ring.sort rR))) (@pair nat (@poly_of rR (Phant (GRing.Ring.sort rR))) (@fst nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else redivp_rec (GRing.Field.ringType F) b (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) a)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) a)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b))) m))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (@snd nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else redivp_rec (GRing.Field.ringType F) b (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) a)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) a)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b))) m))))) (@map_poly (GRing.Field.ringType F) rR (@GRing.RMorphism.apply (GRing.Field.ringType F) rR (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort rR)) f) (@snd (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a))) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)) then @pair (prod nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) qq r) a else redivp_rec (GRing.Field.ringType F) b (S qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) r (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) a)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) a (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b))) (@GRing.opp (GRing.Ring.zmodType (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F)))) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) a)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) a)) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) b))))) b))) m)))) *) by rewrite -!(map_polyC f) -!rmorphM -rmorphB -rmorphD /= IHm; case: (_ < _). Qed. End FieldRingMap. Section FieldMap. Variable rR : idomainType. Variable f : {rmorphism F -> rR}. Local Notation "p ^f" := (map_poly f p) : ring_scope. Implicit Type a b : {poly F}. Lemma edivp_map a b : edivp a^f b^f = (0%N, (a %/ b)^f, (a %% b)^f). Proof. (* Goal: @eq (prod (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (@edivp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) a) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) b)) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR))))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) O (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.divp (GRing.Field.idomainType F) a b))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.modp (GRing.Field.idomainType F) a b))) *) case: (eqVneq b 0) => [-> | bn0]. (* Goal: @eq (prod (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (@edivp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) a) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) b)) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR))))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) O (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.divp (GRing.Field.idomainType F) a b))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.modp (GRing.Field.idomainType F) a b))) *) (* Goal: @eq (prod (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (@edivp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) a) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (GRing.zero (poly_zmodType (GRing.Field.ringType F))))) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR))))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) O (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.divp (GRing.Field.idomainType F) a (GRing.zero (poly_zmodType (GRing.Field.ringType F)))))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.modp (GRing.Field.idomainType F) a (GRing.zero (poly_zmodType (GRing.Field.ringType F)))))) *) rewrite (rmorph0 (map_poly_rmorphism f)) WeakIdomain.edivp_def !modp0 !divp0. (* Goal: @eq (prod (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (@edivp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) a) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) b)) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR))))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) O (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.divp (GRing.Field.idomainType F) a b))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.modp (GRing.Field.idomainType F) a b))) *) (* Goal: @eq (prod (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (@pair (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR))))))) (@pair nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR))))))) (@scalp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) a) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType rR))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) a)) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR))))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) O (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F))))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType (GRing.Field.idomainType F)))))))))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) a)) *) by rewrite (rmorph0 (map_poly_rmorphism f)) scalp0. (* Goal: @eq (prod (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (@edivp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) a) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) b)) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR))))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) O (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.divp (GRing.Field.idomainType F) a b))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.modp (GRing.Field.idomainType F) a b))) *) rewrite unlock redivp_map lead_coef_map rmorph_unit; last first. (* Goal: @eq (prod (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (@pair (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR))))))) (@pair nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR))))))) O (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR))) (@GRing.inv (GRing.IntegralDomain.unitRingType rR) (@GRing.exp (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort (GRing.IntegralDomain.ringType rR))) f (@lead_coef (GRing.Field.ringType F) b)) (rscalp (GRing.Field.ringType F) a b))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort (GRing.IntegralDomain.ringType rR))) f) (rdivp (GRing.Field.ringType F) a b)))) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR))) (@GRing.inv (GRing.IntegralDomain.unitRingType rR) (@GRing.exp (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort (GRing.IntegralDomain.ringType rR))) f (@lead_coef (GRing.Field.ringType F) b)) (rscalp (GRing.Field.ringType F) a b))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort (GRing.IntegralDomain.ringType rR))) f) (rmodp (GRing.Field.ringType F) a b)))) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR))))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) O (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.divp (GRing.Field.idomainType F) a b))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.modp (GRing.Field.idomainType F) a b))) *) (* Goal: is_true (@in_mem (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@lead_coef (GRing.Field.ringType F) b) (@mem (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (predPredType (GRing.UnitRing.sort (GRing.Field.unitRingType F))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.unit (GRing.Field.unitRingType F))))) *) by rewrite unitfE lead_coef_eq0. (* Goal: @eq (prod (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (@pair (prod nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))))))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR))))))) (@pair nat (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (@GRing.Lmodule.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)))) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR))))))) O (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR))) (@GRing.inv (GRing.IntegralDomain.unitRingType rR) (@GRing.exp (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort (GRing.IntegralDomain.ringType rR))) f (@lead_coef (GRing.Field.ringType F) b)) (rscalp (GRing.Field.ringType F) a b))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort (GRing.IntegralDomain.ringType rR))) f) (rdivp (GRing.Field.ringType F) a b)))) (@GRing.scale (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR)) (poly_lmodType (GRing.UnitRing.ringType (GRing.IntegralDomain.unitRingType rR))) (@GRing.inv (GRing.IntegralDomain.unitRingType rR) (@GRing.exp (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort (GRing.IntegralDomain.ringType rR))) f (@lead_coef (GRing.Field.ringType F) b)) (rscalp (GRing.Field.ringType F) a b))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.Ring.sort (GRing.IntegralDomain.ringType rR))) f) (rmodp (GRing.Field.ringType F) a b)))) (@pair (prod nat (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR))))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@pair nat (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) O (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.divp (GRing.Field.idomainType F) a b))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.modp (GRing.Field.idomainType F) a b))) *) rewrite modpE divpE !map_polyZ !rmorphV ?rmorphX // unitfE. (* Goal: is_true (negb (@eq_op (GRing.Field.eqType F) (@GRing.exp (GRing.Field.ringType F) (@lead_coef (GRing.Field.ringType F) b) (rscalp (GRing.Field.ringType F) a b)) (GRing.zero (GRing.Field.zmodType F)))) *) by rewrite expf_neq0 // lead_coef_eq0. Qed. Lemma scalp_map p q : scalp p^f q^f = scalp p q. Proof. (* Goal: @eq nat (@scalp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) (@scalp (GRing.Field.idomainType F) p q) *) by rewrite /scalp edivp_map edivp_def. Qed. Lemma map_divp p q : (p %/ q)^f = p^f %/ q^f. Proof. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.divp (GRing.Field.idomainType F) p q)) (Field.divp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) *) by rewrite /divp edivp_map edivp_def. Qed. Lemma map_modp p q : (p %% q)^f = p^f %% q^f. Proof. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.modp (GRing.Field.idomainType F) p q)) (Field.modp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) *) by rewrite /modp edivp_map edivp_def. Qed. Lemma egcdp_map p q : egcdp (map_poly f p) (map_poly f q) = (map_poly f (egcdp p q).1, map_poly f (egcdp p q).2). Proof. (* Goal: @eq (prod (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR)))) (egcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) (@pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@fst (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp (GRing.Field.idomainType F) p q))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@snd (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp (GRing.Field.idomainType F) p q)))) *) wlog le_qp: p q / size q <= size p. (* Goal: @eq (prod (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR)))) (egcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) (@pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@fst (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp (GRing.Field.idomainType F) p q))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@snd (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp (GRing.Field.idomainType F) p q)))) *) (* Goal: forall _ : forall (p q : @poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (_ : is_true (leq (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) q)) (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p)))), @eq (prod (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR)))) (egcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) (@pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@fst (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp (GRing.Field.idomainType F) p q))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@snd (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp (GRing.Field.idomainType F) p q)))), @eq (prod (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR)))) (egcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) (@pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@fst (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp (GRing.Field.idomainType F) p q))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@snd (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp (GRing.Field.idomainType F) p q)))) *) move=> IH; have [/IH// | lt_qp] := leqP (size q) (size p). (* Goal: @eq (prod (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR)))) (egcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) (@pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@fst (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp (GRing.Field.idomainType F) p q))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@snd (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp (GRing.Field.idomainType F) p q)))) *) (* Goal: @eq (prod (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR)))) (egcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) (@pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@fst (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp (GRing.Field.idomainType F) p q))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@snd (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp (GRing.Field.idomainType F) p q)))) *) have /IH := ltnW lt_qp; rewrite /egcdp !size_map_poly ltnW // leqNgt lt_qp /=. (* Goal: @eq (prod (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR)))) (egcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) (@pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@fst (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp (GRing.Field.idomainType F) p q))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@snd (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp (GRing.Field.idomainType F) p q)))) *) (* Goal: forall _ : @eq (prod (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR)))) (egcdp_rec rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) p))) (@pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@fst (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (egcdp_rec (GRing.Field.idomainType F) q p (@size (GRing.Field.sort F) (@polyseq (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) p))))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@snd (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (egcdp_rec (GRing.Field.idomainType F) q p (@size (GRing.Field.sort F) (@polyseq (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) p)))))), @eq (prod (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR)))) (@pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@snd (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (egcdp_rec rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) p)))) (@fst (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (egcdp_rec rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) p))))) (@pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@snd (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (egcdp_rec (GRing.Field.idomainType F) q p (@size (GRing.Field.sort F) (@polyseq (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) p))))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@fst (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (egcdp_rec (GRing.Field.idomainType F) q p (@size (GRing.Field.sort F) (@polyseq (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) p)))))) *) by case: (egcdp_rec _ _ _) => u v [-> ->]. (* Goal: @eq (prod (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR)))) (egcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) (@pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@fst (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp (GRing.Field.idomainType F) p q))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@snd (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp (GRing.Field.idomainType F) p q)))) *) rewrite /egcdp !size_map_poly {}le_qp; move: (size q) => n. (* Goal: @eq (prod (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR)))) (egcdp_rec rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q) n) (@pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@fst (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp_rec (GRing.Field.idomainType F) p q n))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@snd (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.IntegralDomain.sort (GRing.Field.idomainType F)))) (egcdp_rec (GRing.Field.idomainType F) p q n)))) *) elim: n => /= [|n IHn] in p q *; first by rewrite rmorph1 rmorph0. (* Goal: @eq (prod (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR)))) (if @eq_op (poly_eqType (GRing.IntegralDomain.ringType rR)) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType rR))) then @pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (GRing.one (@GRing.Lalgebra.ringType (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR)) (poly_lalgType (GRing.IntegralDomain.ringType rR)))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType rR))) else let 'pair u v := egcdp_rec rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q) (@modp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) n in @pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@GRing.scale (GRing.IntegralDomain.ringType rR) (poly_lmodType (GRing.IntegralDomain.ringType rR)) (@GRing.exp (GRing.IntegralDomain.ringType rR) (@lead_coef (GRing.IntegralDomain.ringType rR) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) (@scalp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q))) v) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType rR)) u (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType rR))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType rR)) v (@divp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)))))) (@pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@fst (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (if @eq_op (poly_eqType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) then @pair (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (GRing.one (@GRing.Lalgebra.ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) else let 'pair u v := egcdp_rec (GRing.Field.idomainType F) q (@modp (GRing.Field.idomainType F) p q) n in @pair (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@GRing.scale (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (poly_lmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (@GRing.exp (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (@lead_coef (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) q) (@scalp (GRing.Field.idomainType F) p q)) v) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) u (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) v (@divp (GRing.Field.idomainType F) p q))))))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@snd (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (if @eq_op (poly_eqType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) then @pair (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (GRing.one (@GRing.Lalgebra.ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F)) (poly_lalgType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))))) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) else let 'pair u v := egcdp_rec (GRing.Field.idomainType F) q (@modp (GRing.Field.idomainType F) p q) n in @pair (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@GRing.scale (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (poly_lmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (@GRing.exp (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (@lead_coef (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) q) (@scalp (GRing.Field.idomainType F) p q)) v) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) u (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) v (@divp (GRing.Field.idomainType F) p q)))))))) *) rewrite map_poly_eq0; have [_ | nz_q] := ifPn; first by rewrite rmorph1 rmorph0. (* Goal: @eq (prod (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR)))) (let 'pair u v := egcdp_rec rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q) (@modp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) n in @pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@GRing.scale (GRing.IntegralDomain.ringType rR) (poly_lmodType (GRing.IntegralDomain.ringType rR)) (@GRing.exp (GRing.IntegralDomain.ringType rR) (@lead_coef (GRing.IntegralDomain.ringType rR) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) (@scalp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q))) v) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType rR)) u (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType rR))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType rR)) v (@divp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)))))) (@pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@fst (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (let 'pair u v := egcdp_rec (GRing.Field.idomainType F) q (@modp (GRing.Field.idomainType F) p q) n in @pair (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@GRing.scale (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (poly_lmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (@GRing.exp (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (@lead_coef (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) q) (@scalp (GRing.Field.idomainType F) p q)) v) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) u (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) v (@divp (GRing.Field.idomainType F) p q))))))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@snd (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (let 'pair u v := egcdp_rec (GRing.Field.idomainType F) q (@modp (GRing.Field.idomainType F) p q) n in @pair (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@poly_of (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (Phant (GRing.Field.sort F))) (@GRing.scale (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (poly_lmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (@GRing.exp (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (@lead_coef (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) q) (@scalp (GRing.Field.idomainType F) p q)) v) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) u (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) v (@divp (GRing.Field.idomainType F) p q)))))))) *) rewrite -map_modp (IHn q (p %% q)); case: (egcdp_rec _ _ n) => u v /=. (* Goal: @eq (prod (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR)))) (@pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@GRing.scale (GRing.IntegralDomain.ringType rR) (poly_lmodType (GRing.IntegralDomain.ringType rR)) (@GRing.exp (GRing.IntegralDomain.ringType rR) (@lead_coef (GRing.IntegralDomain.ringType rR) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) (@scalp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) v)) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType rR)) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) u) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType rR))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType rR)) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) v) (@divp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)))))) (@pair (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@GRing.scale (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (poly_lmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (@GRing.exp (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (@lead_coef (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) q) (@scalp (GRing.Field.idomainType F) p q)) v)) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) u (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) v (@divp (GRing.Field.idomainType F) p q)))))) *) by rewrite map_polyZ lead_coef_map -rmorphX scalp_map rmorphB rmorphM -map_divp. Qed. Lemma dvdp_map p q : (p^f %| q^f) = (p %| q). Proof. (* Goal: @eq bool (Field.dvdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) (Field.dvdp (GRing.Field.idomainType F) p q) *) by rewrite /dvdp -map_modp map_poly_eq0. Qed. Lemma eqp_map p q : (p^f %= q^f) = (p %= q). Proof. (* Goal: @eq bool (Field.eqp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) (Field.eqp (GRing.Field.idomainType F) p q) *) by rewrite /eqp !dvdp_map. Qed. Lemma gcdp_map p q : (gcdp p q)^f = gcdp p^f q^f. Proof. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gcdp (GRing.Field.idomainType F) p q)) (gcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) *) wlog lt_p_q: p q / size p < size q. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gcdp (GRing.Field.idomainType F) p q)) (gcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) *) (* Goal: forall _ : forall (p q : @poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (_ : is_true (leq (S (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p))) (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) q)))), @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gcdp (GRing.Field.idomainType F) p q)) (gcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)), @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gcdp (GRing.Field.idomainType F) p q)) (gcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) *) move=> IHpq; case: (ltnP (size p) (size q)) => [|le_q_p]; first exact: IHpq. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gcdp (GRing.Field.idomainType F) p q)) (gcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gcdp (GRing.Field.idomainType F) p q)) (gcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) *) rewrite gcdpE (gcdpE p^f) !size_map_poly ltnNge le_q_p /= -map_modp. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gcdp (GRing.Field.idomainType F) p q)) (gcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gcdp (GRing.Field.idomainType F) (@modp (GRing.Field.idomainType F) p q) q)) (gcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.modp (GRing.Field.idomainType F) p q)) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) *) case: (eqVneq q 0) => [-> | q_nz]; first by rewrite rmorph0 !gcdp0. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gcdp (GRing.Field.idomainType F) p q)) (gcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gcdp (GRing.Field.idomainType F) (@modp (GRing.Field.idomainType F) p q) q)) (gcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.modp (GRing.Field.idomainType F) p q)) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) *) by rewrite IHpq ?ltn_modp. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gcdp (GRing.Field.idomainType F) p q)) (gcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) *) elim: {q}_.+1 p {-2}q (ltnSn (size q)) lt_p_q => // m IHm p q le_q_m lt_p_q. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gcdp (GRing.Field.idomainType F) p q)) (gcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) *) rewrite gcdpE (gcdpE p^f) !size_map_poly lt_p_q -map_modp. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gcdp (GRing.Field.idomainType F) (@modp (GRing.Field.idomainType F) q p) p)) (gcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.modp (GRing.Field.idomainType F) q p)) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p)) *) case: (eqVneq p 0) => [-> | q_nz]; first by rewrite rmorph0 !gcdp0. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gcdp (GRing.Field.idomainType F) (@modp (GRing.Field.idomainType F) q p) p)) (gcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (Field.modp (GRing.Field.idomainType F) q p)) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p)) *) by rewrite IHm ?(leq_trans lt_p_q) ?ltn_modp. Qed. Lemma coprimep_map p q : coprimep p^f q^f = coprimep p q. Proof. (* Goal: @eq bool (coprimep rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) (coprimep (GRing.Field.idomainType F) p q) *) by rewrite -!gcdp_eqp1 -eqp_map rmorph1 gcdp_map. Qed. Lemma gdcop_rec_map p q n : (gdcop_rec p q n)^f = (gdcop_rec p^f q^f n). Proof. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gdcop_rec (GRing.Field.idomainType F) p q n)) (gdcop_rec rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q) n) *) elim: n p q => [|n IH] => /= p q. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (if coprimep (GRing.Field.idomainType F) q p then q else gdcop_rec (GRing.Field.idomainType F) p (@divp (GRing.Field.idomainType F) q (gcdp (GRing.Field.idomainType F) q p)) n)) (if coprimep rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) then @map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q else gdcop_rec rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@divp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q) (gcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p))) n) *) (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (@GRing.natmul (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (nat_of_bool (@eq_op (poly_eqType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) p (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))))))) (@GRing.natmul (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType rR))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType rR))) (nat_of_bool (@eq_op (poly_eqType (GRing.IntegralDomain.ringType rR)) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType rR)))))) *) by rewrite map_poly_eq0; case: eqP; rewrite ?rmorph1 ?rmorph0. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (if coprimep (GRing.Field.idomainType F) q p then q else gdcop_rec (GRing.Field.idomainType F) p (@divp (GRing.Field.idomainType F) q (gcdp (GRing.Field.idomainType F) q p)) n)) (if coprimep rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) then @map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q else gdcop_rec rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@divp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q) (gcdp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p))) n) *) rewrite /coprimep -gcdp_map size_map_poly. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.IntegralDomain.sort rR))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (if @eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType (GRing.Field.idomainType F))) (@polyseq (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)) (gcdp (GRing.Field.idomainType F) q p))) (S O) then q else gdcop_rec (GRing.Field.idomainType F) p (@divp (GRing.Field.idomainType F) q (gcdp (GRing.Field.idomainType F) q p)) n)) (if @eq_op nat_eqType (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) (gcdp (GRing.Field.idomainType F) q p))) (S O) then @map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q else gdcop_rec rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@divp rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gcdp (GRing.Field.idomainType F) q p))) n) *) by case: eqP => Hq0 //; rewrite -map_divp -IH. Qed. Lemma gdcop_map p q : (gdcop p q)^f = (gdcop p^f q^f). Proof. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rR) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType rR)))) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) (gdcop (GRing.Field.idomainType F) p q)) (gdcop rR (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) p) (@map_poly (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (@GRing.RMorphism.apply (GRing.Field.ringType F) (GRing.IntegralDomain.ringType rR) (Phant (forall _ : GRing.Field.sort F, GRing.IntegralDomain.sort rR)) f) q)) *) by rewrite /gdcop gdcop_rec_map !size_map_poly. Qed. End FieldMap. End FieldDivision. End Field. Module ClosedField. Import Field. Section closed. Variable F : closedFieldType. Lemma root_coprimep (p q : {poly F}): (forall x, root p x -> q.[x] != 0) -> coprimep p q. Lemma coprimepP (p q : {poly F}): reflect (forall x, root p x -> q.[x] != 0) (coprimep p q). End closed. End ClosedField. End Pdiv. Export Pdiv.Field.
Require Export GeoCoq.Elements.OriginalProofs.lemma_26helper. Require Export GeoCoq.Elements.OriginalProofs.lemma_trichotomy1. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma proposition_26B : forall A B C D E F, Triangle A B C -> Triangle D E F -> CongA A B C D E F -> CongA B C A E F D -> Cong A B D E -> Cong B C E F /\ Cong A C D F /\ CongA B A C E D F. Proof. (* Goal: forall (A B C D E F : @Point Ax0) (_ : @Triangle Ax0 A B C) (_ : @Triangle Ax0 D E F) (_ : @CongA Ax0 A B C D E F) (_ : @CongA Ax0 B C A E F D) (_ : @Cong Ax0 A B D E), and (@Cong Ax0 B C E F) (and (@Cong Ax0 A C D F) (@CongA Ax0 B A C E D F)) *) intros. (* Goal: and (@Cong Ax0 B C E F) (and (@Cong Ax0 A C D F) (@CongA Ax0 B A C E D F)) *) assert (~ Lt E F B C) by (conclude lemma_26helper). (* Goal: and (@Cong Ax0 B C E F) (and (@Cong Ax0 A C D F) (@CongA Ax0 B A C E D F)) *) assert (CongA D E F A B C) by (conclude lemma_equalanglessymmetric). (* Goal: and (@Cong Ax0 B C E F) (and (@Cong Ax0 A C D F) (@CongA Ax0 B A C E D F)) *) assert (CongA E F D B C A) by (conclude lemma_equalanglessymmetric). (* Goal: and (@Cong Ax0 B C E F) (and (@Cong Ax0 A C D F) (@CongA Ax0 B A C E D F)) *) assert (Cong D E A B) by (conclude lemma_congruencesymmetric). (* Goal: and (@Cong Ax0 B C E F) (and (@Cong Ax0 A C D F) (@CongA Ax0 B A C E D F)) *) assert (~ Lt B C E F) by (conclude lemma_26helper). (* Goal: and (@Cong Ax0 B C E F) (and (@Cong Ax0 A C D F) (@CongA Ax0 B A C E D F)) *) assert (~ eq B C). (* Goal: and (@Cong Ax0 B C E F) (and (@Cong Ax0 A C D F) (@CongA Ax0 B A C E D F)) *) (* Goal: not (@eq Ax0 B C) *) { (* Goal: not (@eq Ax0 B C) *) intro. (* Goal: False *) assert (Col A B C) by (conclude_def Col ). (* Goal: False *) assert (nCol A B C) by (conclude_def Triangle ). (* Goal: False *) contradict. (* BG Goal: and (@Cong Ax0 B C E F) (and (@Cong Ax0 A C D F) (@CongA Ax0 B A C E D F)) *) } (* Goal: and (@Cong Ax0 B C E F) (and (@Cong Ax0 A C D F) (@CongA Ax0 B A C E D F)) *) assert (~ eq E F). (* Goal: and (@Cong Ax0 B C E F) (and (@Cong Ax0 A C D F) (@CongA Ax0 B A C E D F)) *) (* Goal: not (@eq Ax0 E F) *) { (* Goal: not (@eq Ax0 E F) *) intro. (* Goal: False *) assert (Col D E F) by (conclude_def Col ). (* Goal: False *) assert (nCol D E F) by (conclude_def Triangle ). (* Goal: False *) contradict. (* BG Goal: and (@Cong Ax0 B C E F) (and (@Cong Ax0 A C D F) (@CongA Ax0 B A C E D F)) *) } (* Goal: and (@Cong Ax0 B C E F) (and (@Cong Ax0 A C D F) (@CongA Ax0 B A C E D F)) *) assert (Cong B C E F) by (conclude lemma_trichotomy1). (* Goal: and (@Cong Ax0 B C E F) (and (@Cong Ax0 A C D F) (@CongA Ax0 B A C E D F)) *) assert (Cong B A E D) by (forward_using lemma_congruenceflip). (* Goal: and (@Cong Ax0 B C E F) (and (@Cong Ax0 A C D F) (@CongA Ax0 B A C E D F)) *) assert ((Cong A C D F /\ CongA B A C E D F /\ CongA B C A E F D)) by (conclude proposition_04). (* Goal: and (@Cong Ax0 B C E F) (and (@Cong Ax0 A C D F) (@CongA Ax0 B A C E D F)) *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.proposition_19. Require Export GeoCoq.Elements.OriginalProofs.lemma_lessthancongruence2. Section Euclid. Context `{Ax1:euclidean_neutral_ruler_compass}. Lemma lemma_legsmallerhypotenuse : forall A B C, Per A B C -> Lt A B A C /\ Lt B C A C. Proof. (* Goal: forall (A B C : @Point Ax) (_ : @Per Ax A B C), and (@Lt Ax A B A C) (@Lt Ax B C A C) *) intros. (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (Per C B A) by (conclude lemma_8_2). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) let Tf:=fresh in assert (Tf:exists D, (BetS C B D /\ Cong C B D B /\ Cong C A D A /\ neq B A)) by (conclude_def Per );destruct Tf as [D];spliter. (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (nCol A B C) by (conclude lemma_rightangleNC). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (Triangle A B C) by (conclude_def Triangle ). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (~ Col A C B). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) (* Goal: not (@Col Ax A C B) *) { (* Goal: not (@Col Ax A C B) *) intro. (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) } (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (Triangle A C B) by (conclude_def Triangle ). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert ((LtA C A B A B D /\ LtA B C A A B D)) by (conclude proposition_16). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (eq A A) by (conclude cn_equalityreflexive). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (eq C C) by (conclude cn_equalityreflexive). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (eq D D) by (conclude cn_equalityreflexive). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (~ eq B C). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) (* Goal: not (@eq Ax B C) *) { (* Goal: not (@eq Ax B C) *) intro. (* Goal: False *) assert (Col A B C) by (conclude_def Col ). (* Goal: False *) contradict. (* BG Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) } (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (neq B D) by (forward_using lemma_betweennotequal). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (Out B A A) by (conclude lemma_ray4). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (Out B C C) by (conclude lemma_ray4). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (Out B D D) by (conclude lemma_ray4). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (Cong B A B A) by (conclude cn_congruencereflexive). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (Cong B D B C) by (forward_using lemma_doublereverse). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (Cong A D A C) by (forward_using lemma_doublereverse). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (~ Col A B D). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) (* Goal: not (@Col Ax A B D) *) { (* Goal: not (@Col Ax A B D) *) 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 A) 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 A) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) } (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (CongA A B D A B C) by (conclude_def CongA ). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (CongA A B C A B D) by (conclude lemma_equalanglessymmetric). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (LtA B C A A B C) by (conclude lemma_angleorderrespectscongruence). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (Lt A B A C) by (conclude proposition_19). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (LtA C A B A B C) by (conclude lemma_angleorderrespectscongruence). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (~ Col B A C). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) (* Goal: not (@Col Ax B A C) *) { (* Goal: not (@Col Ax B A C) *) intro. (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) } (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (CongA B A C C A B) by (conclude lemma_ABCequalsCBA). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (LtA B A C A B C) by (conclude lemma_angleorderrespectscongruence2). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (~ Col C B A). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) (* Goal: not (@Col Ax C B A) *) { (* Goal: not (@Col Ax C B A) *) intro. (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) } (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (Triangle C B A) by (conclude_def Triangle ). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (CongA C B A A B C) by (conclude lemma_ABCequalsCBA). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (LtA B A C C B A) by (conclude lemma_angleorderrespectscongruence). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (Lt C B C A) by (conclude proposition_19). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (Cong C B B C) by (conclude cn_equalityreverse). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (Lt B C C A) by (conclude lemma_lessthancongruence2). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (Cong C A A C) by (conclude cn_equalityreverse). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) assert (Lt B C A C) by (conclude lemma_lessthancongruence). (* Goal: and (@Lt Ax A B A C) (@Lt Ax B C A C) *) close. Qed. End Euclid.
Require Export GeoCoq.Tarski_dev.Ch10_line_reflexivity. Require Import GeoCoq.Meta_theory.Dimension_axioms.upper_dim_2. Section T10_1. Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}. Lemma cop__cong_on_bissect : forall A B M P X, Coplanar A B X P -> Midpoint M A B -> Perp_at M A B P M -> Cong X A X B -> Col M P X. Proof. (* Goal: forall (A B M P X : @Tpoint Tn) (_ : @Coplanar Tn A B X P) (_ : @Midpoint Tn M A B) (_ : @Perp_at Tn M A B P M) (_ : @Cong Tn X A X B), @Col Tn M P X *) intros. (* Goal: @Col Tn M P X *) assert(X = M \/ ~ Col A B X /\ Perp_at M X M A B). (* Goal: @Col Tn M P X *) (* Goal: or (@eq (@Tpoint Tn) X M) (and (not (@Col Tn A B X)) (@Perp_at Tn M X M A B)) *) assert_diffs; apply(cong_perp_or_mid A B M X); Cong. (* Goal: @Col Tn M P X *) induction H3. (* Goal: @Col Tn M P X *) (* Goal: @Col Tn M P X *) treat_equalities; Col. (* Goal: @Col Tn M P X *) spliter. (* Goal: @Col Tn M P X *) apply perp_in_perp in H1. (* Goal: @Col Tn M P X *) apply perp_in_perp in H4. (* Goal: @Col Tn M P X *) assert_cols. (* Goal: @Col Tn M P X *) apply(cop_perp2__col _ _ _ A B); Perp; Cop. Qed. Lemma cong_cop_mid_perp__col : forall A B M P X, Coplanar A B X P -> Cong A X B X -> Midpoint M A B -> Perp A B P M -> Col M P X. Proof. (* Goal: forall (A B M P X : @Tpoint Tn) (_ : @Coplanar Tn A B X P) (_ : @Cong Tn A X B X) (_ : @Midpoint Tn M A B) (_ : @Perp Tn A B P M), @Col Tn M P X *) intros. (* Goal: @Col Tn M P X *) apply (cop__cong_on_bissect A B); Cong. (* Goal: @Perp_at Tn M A B P M *) apply l8_15_1; Col. Qed. Lemma cop__image_in_col : forall A B P P' Q Q' M, Coplanar A B P Q -> ReflectL_at M P P' A B -> ReflectL_at M Q Q' A B -> Col M P Q. Lemma l10_10_spec : forall A B P Q P' Q', ReflectL P' P A B -> ReflectL Q' Q A B -> Cong P Q P' Q'. Lemma l10_10 : forall A B P Q P' Q', Reflect P' P A B -> Reflect Q' Q A B -> Cong P Q P' Q'. Proof. (* Goal: forall (A B P Q P' Q' : @Tpoint Tn) (_ : @Reflect Tn P' P A B) (_ : @Reflect Tn Q' Q A B), @Cong Tn P Q P' Q' *) intros. (* Goal: @Cong Tn P Q P' Q' *) induction (eq_dec_points A B). (* Goal: @Cong Tn P Q P' Q' *) (* Goal: @Cong Tn P Q P' Q' *) subst. (* Goal: @Cong Tn P Q P' Q' *) (* Goal: @Cong Tn P Q P' Q' *) unfold Reflect in *. (* Goal: @Cong Tn P Q P' Q' *) (* Goal: @Cong Tn P Q P' Q' *) induction H. (* Goal: @Cong Tn P Q P' Q' *) (* Goal: @Cong Tn P Q P' Q' *) (* Goal: @Cong Tn P Q P' Q' *) intuition. (* Goal: @Cong Tn P Q P' Q' *) (* Goal: @Cong Tn P Q P' Q' *) induction H0. (* Goal: @Cong Tn P Q P' Q' *) (* Goal: @Cong Tn P Q P' Q' *) (* Goal: @Cong Tn P Q P' Q' *) intuition. (* Goal: @Cong Tn P Q P' Q' *) (* Goal: @Cong Tn P Q P' Q' *) spliter. (* Goal: @Cong Tn P Q P' Q' *) (* Goal: @Cong Tn P Q P' Q' *) apply l7_13 with B; apply l7_2;auto. (* Goal: @Cong Tn P Q P' Q' *) apply l10_10_spec with A B;try apply is_image_is_image_spec;assumption. Qed. Lemma image_preserves_bet : forall A B C A' B' C' X Y, ReflectL A A' X Y -> ReflectL B B' X Y -> ReflectL C C' X Y -> Bet A B C -> Bet A' B' C'. Lemma image_gen_preserves_bet : forall A B C A' B' C' X Y, Reflect A A' X Y -> Reflect B B' X Y -> Reflect C C' X Y -> Bet A B C -> Bet A' B' C'. Proof. (* Goal: forall (A B C A' B' C' X Y : @Tpoint Tn) (_ : @Reflect Tn A A' X Y) (_ : @Reflect Tn B B' X Y) (_ : @Reflect Tn C C' X Y) (_ : @Bet Tn A B C), @Bet Tn A' B' C' *) intros. (* Goal: @Bet Tn A' B' C' *) destruct (eq_dec_points X Y). (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) subst Y. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) apply image__midpoint in H. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) apply image__midpoint in H0. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) apply image__midpoint in H1. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) subst. (* Goal: @Bet Tn A' B' C' *) (* Goal: @Bet Tn A' B' C' *) apply l7_15 with A B C X; Midpoint. (* Goal: @Bet Tn A' B' C' *) eapply image_preserves_bet;try apply is_image_is_image_spec; eauto. Qed. Lemma image_preserves_col : forall A B C A' B' C' X Y, ReflectL A A' X Y -> ReflectL B B' X Y -> ReflectL C C' X Y -> Col A B C -> Col A' B' C'. Proof. (* Goal: forall (A B C A' B' C' X Y : @Tpoint Tn) (_ : @ReflectL Tn A A' X Y) (_ : @ReflectL Tn B B' X Y) (_ : @ReflectL Tn C C' X Y) (_ : @Col Tn A B C), @Col Tn A' B' C' *) intros. (* Goal: @Col Tn A' B' C' *) destruct H2 as [HBet|[HBet|HBet]]; [|apply col_permutation_2|apply col_permutation_1]; apply bet_col; eapply image_preserves_bet; eauto. Qed. Lemma image_gen_preserves_col : forall A B C A' B' C' X Y, Reflect A A' X Y -> Reflect B B' X Y -> Reflect C C' X Y -> Col A B C -> Col A' B' C'. Proof. (* Goal: forall (A B C A' B' C' X Y : @Tpoint Tn) (_ : @Reflect Tn A A' X Y) (_ : @Reflect Tn B B' X Y) (_ : @Reflect Tn C C' X Y) (_ : @Col Tn A B C), @Col Tn A' B' C' *) intros. (* Goal: @Col Tn A' B' C' *) destruct H2 as [HBet|[HBet|HBet]]; [|apply col_permutation_2|apply col_permutation_1]; apply bet_col; eapply image_gen_preserves_bet; eauto. Qed. Lemma image_gen_preserves_ncol : forall A B C A' B' C' X Y, Reflect A A' X Y -> Reflect B B' X Y -> Reflect C C' X Y -> ~ Col A B C -> ~ Col A' B' C'. Proof. (* Goal: forall (A B C A' B' C' X Y : @Tpoint Tn) (_ : @Reflect Tn A A' X Y) (_ : @Reflect Tn B B' X Y) (_ : @Reflect Tn C C' X Y) (_ : not (@Col Tn A B C)), not (@Col Tn A' B' C') *) intros. (* Goal: not (@Col Tn A' B' C') *) intro. (* Goal: False *) apply H2, image_gen_preserves_col with A' B' C' X Y; try (apply l10_4); assumption. Qed. Lemma image_gen_preserves_inter : forall A B C D I A' B' C' D' I' X Y, Reflect A A' X Y -> Reflect B B' X Y -> Reflect C C' X Y -> Reflect D D' X Y -> ~ Col A B C -> C <> D -> Col A B I -> Col C D I -> Col A' B' I' -> Col C' D' I' -> Reflect I I' X Y. Proof. (* Goal: forall (A B C D I A' B' C' D' I' X Y : @Tpoint Tn) (_ : @Reflect Tn A A' X Y) (_ : @Reflect Tn B B' X Y) (_ : @Reflect Tn C C' X Y) (_ : @Reflect Tn D D' X Y) (_ : not (@Col Tn A B C)) (_ : not (@eq (@Tpoint Tn) C D)) (_ : @Col Tn A B I) (_ : @Col Tn C D I) (_ : @Col Tn A' B' I') (_ : @Col Tn C' D' I'), @Reflect Tn I I' X Y *) intros. (* Goal: @Reflect Tn I I' X Y *) destruct (l10_6_existence X Y I) as [I0 HI0]; trivial. (* Goal: @Reflect Tn I I' X Y *) assert (I' = I0); [|subst; assumption]. (* Goal: @eq (@Tpoint Tn) I' I0 *) apply (l6_21 A' B' C' D'); trivial. (* Goal: @Col Tn C' D' I0 *) (* Goal: @Col Tn A' B' I0 *) (* Goal: not (@eq (@Tpoint Tn) C' D') *) (* Goal: not (@Col Tn A' B' C') *) apply image_gen_preserves_ncol with A B C X Y; assumption. (* Goal: @Col Tn C' D' I0 *) (* Goal: @Col Tn A' B' I0 *) (* Goal: not (@eq (@Tpoint Tn) C' D') *) intro; subst D'; apply H4, l10_2_uniqueness with X Y C'; assumption. (* Goal: @Col Tn C' D' I0 *) (* Goal: @Col Tn A' B' I0 *) apply image_gen_preserves_col with A B I X Y; assumption. (* Goal: @Col Tn C' D' I0 *) apply image_gen_preserves_col with C D I X Y; assumption. Qed. Lemma intersection_with_image_gen : forall A B C A' B' X Y, Reflect A A' X Y -> Reflect B B' X Y -> ~ Col A B A' -> Col A B C -> Col A' B' C -> Col C X Y. Proof. (* Goal: forall (A B C A' B' X Y : @Tpoint Tn) (_ : @Reflect Tn A A' X Y) (_ : @Reflect Tn B B' X Y) (_ : not (@Col Tn A B A')) (_ : @Col Tn A B C) (_ : @Col Tn A' B' C), @Col Tn C X Y *) intros. (* Goal: @Col Tn C X Y *) apply l10_8. (* Goal: @Reflect Tn C C X Y *) assert (Reflect A' A X Y) by (apply l10_4; assumption). (* Goal: @Reflect Tn C C X Y *) assert (~ Col A' B' A) by (apply image_gen_preserves_ncol with A B A' X Y; trivial). (* Goal: @Reflect Tn C C X Y *) assert_diffs. (* Goal: @Reflect Tn C C X Y *) apply image_gen_preserves_inter with A B A' B' A' B' A B; trivial. (* Goal: @Reflect Tn B' B X Y *) apply l10_4; assumption. Qed. Lemma image_preserves_midpoint : forall A B C A' B' C' X Y, ReflectL A A' X Y -> ReflectL B B' X Y -> ReflectL C C' X Y -> Midpoint A B C -> Midpoint A' B' C'. Lemma image_spec_preserves_per : forall A B C A' B' C' X Y, ReflectL A A' X Y -> ReflectL B B' X Y -> ReflectL C C' X Y -> Per A B C -> Per A' B' C'. Lemma image_preserves_per : forall A B C A' B' C' X Y, Reflect A A' X Y -> Reflect B B' X Y -> Reflect C C' X Y -> Per A B C -> Per A' B' C'. Proof. (* Goal: forall (A B C A' B' C' X Y : @Tpoint Tn) (_ : @Reflect Tn A A' X Y) (_ : @Reflect Tn B B' X Y) (_ : @Reflect Tn C C' X Y) (_ : @Per Tn A B C), @Per Tn A' B' C' *) intros. (* Goal: @Per Tn A' B' C' *) induction (eq_dec_points X Y). (* Goal: @Per Tn A' B' C' *) (* Goal: @Per Tn A' B' C' *) - (* Goal: @Per Tn A' B' C' *) induction H; induction H0; induction H1; spliter; [contradiction..|]. (* Goal: @Per Tn A' B' C' *) treat_equalities. (* Goal: @Per Tn A' B' C' *) apply midpoint_preserves_per with A B C X; [|apply l7_2..]; assumption. (* BG Goal: @Per Tn A' B' C' *) - (* Goal: @Per Tn A' B' C' *) induction H; induction H0; induction H1; spliter; [|contradiction..]. (* Goal: @Per Tn A' B' C' *) apply image_spec_preserves_per with A B C X Y; assumption. Qed. Lemma l10_12 : forall A B C A' B' C', Per A B C -> Per A' B' C' -> Cong A B A' B' -> Cong B C B' C' -> Cong A C A' C'. Lemma cong4_cop2__eq : forall A B C P Q, ~ Col A B C -> Cong A P B P -> Cong A P C P -> Coplanar A B C P -> Cong A Q B Q -> Cong A Q C Q -> Coplanar A B C Q -> P = Q. Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @Cong Tn A P B P) (_ : @Cong Tn A P C P) (_ : @Coplanar Tn A B C P) (_ : @Cong Tn A Q B Q) (_ : @Cong Tn A Q C Q) (_ : @Coplanar Tn A B C Q), @eq (@Tpoint Tn) P Q *) intros A B C P Q HNCol; intros. (* Goal: @eq (@Tpoint Tn) P Q *) destruct (eq_dec_points P Q); [assumption|]. (* Goal: @eq (@Tpoint Tn) P Q *) exfalso. (* Goal: False *) apply HNCol. (* Goal: @Col Tn A B C *) assert (Haux : forall R, Col P Q R -> Cong A R B R /\ Cong A R C R). (* Goal: @Col Tn A B C *) (* Goal: forall (R : @Tpoint Tn) (_ : @Col Tn P Q R), and (@Cong Tn A R B R) (@Cong Tn A R C R) *) intros R HR; split; apply cong_commutativity, (l4_17 P Q); Cong. (* Goal: @Col Tn A B C *) destruct (midpoint_existence A B) as [D]. (* Goal: @Col Tn A B C *) assert_diffs. (* Goal: @Col Tn A B C *) assert (HCol1 : Col P Q D). (* Goal: @Col Tn A B C *) (* Goal: @Col Tn P Q D *) { (* Goal: @Col Tn P Q D *) assert (Coplanar A B C D) by Cop. (* Goal: @Col Tn P Q D *) apply cong3_cop2__col with A B; Cong; apply coplanar_pseudo_trans with A B C; Cop. (* BG Goal: @Col Tn A B C *) } (* Goal: @Col Tn A B C *) destruct (diff_col_ex3 P Q D HCol1) as [R1]; spliter. (* Goal: @Col Tn A B C *) destruct (segment_construction R1 D R1 D) as [R2 []]. (* Goal: @Col Tn A B C *) assert_diffs. (* Goal: @Col Tn A B C *) assert (Col P Q R2) by ColR. (* Goal: @Col Tn A B C *) destruct (Haux R1); trivial. (* Goal: @Col Tn A B C *) destruct (Haux R2); trivial. (* Goal: @Col Tn A B C *) assert (Cong A R1 A R2). (* Goal: @Col Tn A B C *) (* Goal: @Cong Tn A R1 A R2 *) { (* Goal: @Cong Tn A R1 A R2 *) assert (Per A D R1) by (apply l8_2; exists B; split; Cong). (* Goal: @Cong Tn A R1 A R2 *) apply l10_12 with D D; Cong. (* Goal: @Per Tn A D R2 *) apply per_col with R1; ColR. (* BG Goal: @Col Tn A B C *) } (* Goal: @Col Tn A B C *) apply cong3_cop2__col with R1 R2; auto; [apply col_cop2__cop with P Q; auto..| |]. (* Goal: @Cong Tn C R1 C R2 *) (* Goal: @Cong Tn B R1 B R2 *) apply cong_transitivity with A R1; [|apply cong_transitivity with A R2]; Cong. (* Goal: @Cong Tn C R1 C R2 *) apply cong_transitivity with A R1; [|apply cong_transitivity with A R2]; Cong. Qed. Lemma l10_16 : forall A B C A' B' P, ~ Col A B C -> ~ Col A' B' P -> Cong A B A' B' -> exists C', Cong_3 A B C A' B' C' /\ OS A' B' P C' . Lemma cong_cop_image__col : forall A B P P' X, P <> P' -> Reflect P P' A B -> Cong P X P' X -> Coplanar A B P X -> Col A B X. Lemma cong_cop_per2_1 : forall A B X Y, A <> B -> Per A B X -> Per A B Y -> Cong B X B Y -> Coplanar A B X Y -> X = Y \/ Midpoint B X Y. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : @Per Tn A B X) (_ : @Per Tn A B Y) (_ : @Cong Tn B X B Y) (_ : @Coplanar Tn A B X Y), or (@eq (@Tpoint Tn) X Y) (@Midpoint Tn B X Y) *) intros. (* Goal: or (@eq (@Tpoint Tn) X Y) (@Midpoint Tn B X Y) *) eapply l7_20. (* Goal: @Cong Tn B X B Y *) (* Goal: @Col Tn X B Y *) apply col_permutation_5. (* Goal: @Cong Tn B X B Y *) (* Goal: @Col Tn X Y B *) apply (cop_per2__col A). (* Goal: @Cong Tn B X B Y *) (* Goal: @Per Tn Y B A *) (* Goal: @Per Tn X B A *) (* Goal: not (@eq (@Tpoint Tn) A B) *) (* Goal: @Coplanar Tn A X Y B *) Cop. (* Goal: @Cong Tn B X B Y *) (* Goal: @Per Tn Y B A *) (* Goal: @Per Tn X B A *) (* Goal: not (@eq (@Tpoint Tn) A B) *) assumption. (* Goal: @Cong Tn B X B Y *) (* Goal: @Per Tn Y B A *) (* Goal: @Per Tn X B A *) apply l8_2. (* Goal: @Cong Tn B X B Y *) (* Goal: @Per Tn Y B A *) (* Goal: @Per Tn A B X *) assumption. (* Goal: @Cong Tn B X B Y *) (* Goal: @Per Tn Y B A *) apply l8_2. (* Goal: @Cong Tn B X B Y *) (* Goal: @Per Tn A B Y *) assumption. (* Goal: @Cong Tn B X B Y *) assumption. Qed. Lemma cong_cop_per2 : forall A B X Y, A <> B -> Per A B X -> Per A B Y -> Cong B X B Y -> Coplanar A B X Y -> X = Y \/ ReflectL X Y A B. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : @Per Tn A B X) (_ : @Per Tn A B Y) (_ : @Cong Tn B X B Y) (_ : @Coplanar Tn A B X Y), or (@eq (@Tpoint Tn) X Y) (@ReflectL Tn X Y A B) *) intros. (* Goal: or (@eq (@Tpoint Tn) X Y) (@ReflectL Tn X Y A B) *) induction (cong_cop_per2_1 A B X Y H H0 H1 H2 H3). (* Goal: or (@eq (@Tpoint Tn) X Y) (@ReflectL Tn X Y A B) *) (* Goal: or (@eq (@Tpoint Tn) X Y) (@ReflectL Tn X Y A B) *) left; assumption. (* Goal: or (@eq (@Tpoint Tn) X Y) (@ReflectL Tn X Y A B) *) right. (* Goal: @ReflectL Tn X Y A B *) apply is_image_is_image_spec; auto. (* Goal: @Reflect Tn X Y A B *) apply l10_4, cong_midpoint__image; trivial. (* Goal: @Cong Tn A X A Y *) apply per_double_cong with B; assumption. Qed. Lemma cong_cop_per2_gen : forall A B X Y, A <> B -> Per A B X -> Per A B Y -> Cong B X B Y -> Coplanar A B X Y -> X = Y \/ Reflect X Y A B. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : @Per Tn A B X) (_ : @Per Tn A B Y) (_ : @Cong Tn B X B Y) (_ : @Coplanar Tn A B X Y), or (@eq (@Tpoint Tn) X Y) (@Reflect Tn X Y A B) *) intros. (* Goal: or (@eq (@Tpoint Tn) X Y) (@Reflect Tn X Y A B) *) induction (cong_cop_per2 A B X Y H H0 H1 H2 H3). (* Goal: or (@eq (@Tpoint Tn) X Y) (@Reflect Tn X Y A B) *) (* Goal: or (@eq (@Tpoint Tn) X Y) (@Reflect Tn X Y A B) *) left; assumption. (* Goal: or (@eq (@Tpoint Tn) X Y) (@Reflect Tn X Y A B) *) right. (* Goal: @Reflect Tn X Y A B *) apply is_image_is_image_spec; assumption. Qed. Lemma ex_perp_cop : forall A B C P, A <> B -> exists Q, Perp A B Q C /\ Coplanar A B P Q. Proof. (* Goal: forall (A B C P : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)), @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q)) *) intros A B C P HAB. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q)) *) destruct (col_dec A B C) as [HCol|HNCol]; [destruct (col_dec A B P) as [|HNCol]|]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q)) *) (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q)) *) (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q)) *) - (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q)) *) destruct (not_col_exists A B HAB) as [P' HNCol]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q)) *) destruct (l10_15 A B C P' HCol HNCol) as [Q []]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q)) *) exists Q. (* Goal: and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q) *) split; trivial. (* Goal: @Coplanar Tn A B P Q *) exists P; left; Col. (* BG Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q)) *) (* BG Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q)) *) - (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q)) *) destruct (l10_15 A B C P HCol HNCol) as [Q []]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q)) *) exists Q. (* Goal: and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q) *) split; [|apply os__coplanar]; assumption. (* BG Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q)) *) - (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q)) *) destruct (l8_18_existence A B C HNCol) as [Q []]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q)) *) exists Q. (* Goal: and (@Perp Tn A B Q C) (@Coplanar Tn A B P Q) *) split. (* Goal: @Coplanar Tn A B P Q *) (* Goal: @Perp Tn A B Q C *) Perp. (* Goal: @Coplanar Tn A B P Q *) exists Q; left; split; Col. Qed. Lemma hilbert_s_version_of_pasch_aux : forall A B C I P, Coplanar A B C P -> ~ Col A I P -> ~ Col B C P -> Bet B I C -> B <> I -> I <> C -> B <> C -> exists X, Col I P X /\ ((Bet A X B /\ A <> X /\ X <> B /\ A <> B) \/ (Bet A X C /\ A <> X /\ X <> C /\ A <> C)). Proof. (* Goal: forall (A B C I P : @Tpoint Tn) (_ : @Coplanar Tn A B C P) (_ : not (@Col Tn A I P)) (_ : not (@Col Tn B C P)) (_ : @Bet Tn B I C) (_ : not (@eq (@Tpoint Tn) B I)) (_ : not (@eq (@Tpoint Tn) I C)) (_ : not (@eq (@Tpoint Tn) B C)), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) intros A B C I P HCop HNC HNC' HBet HBI HIC HBC. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) assert (HTS : TS I P B C). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) (* Goal: @TS Tn I P B C *) { (* Goal: @TS Tn I P B C *) assert_cols; split; try (intro; apply HNC'; ColR). (* Goal: and (not (@Col Tn C I P)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T I P) (@Bet Tn B T C))) *) split; try (intro; apply HNC'; ColR). (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T I P) (@Bet Tn B T C)) *) exists I; Col. (* BG Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) } (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) assert (HCop1 : Coplanar A P B I) by (assert_diffs; apply col_cop__cop with C; Cop; Col). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) elim (two_sides_dec I P A B); intro HTS'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) { (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) destruct HTS' as [Hc1 [Hc2 [T [HCol HBet']]]]. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) exists T; split; Col. (* Goal: or (and (@Bet Tn A T B) (and (not (@eq (@Tpoint Tn) A T)) (and (not (@eq (@Tpoint Tn) T B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A T C) (and (not (@eq (@Tpoint Tn) A T)) (and (not (@eq (@Tpoint Tn) T C)) (not (@eq (@Tpoint Tn) A C))))) *) left; split; Col. (* Goal: and (not (@eq (@Tpoint Tn) A T)) (and (not (@eq (@Tpoint Tn) T B)) (not (@eq (@Tpoint Tn) A B))) *) split; try (intro; treat_equalities; Col). (* Goal: and (not (@eq (@Tpoint Tn) T B)) (not (@eq (@Tpoint Tn) A B)) *) split; intro; treat_equalities; Col. (* BG Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) } (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) { (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) rename HTS' into HOS. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) assert (HTS' : TS I P A C). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) (* Goal: @TS Tn I P A C *) { (* Goal: @TS Tn I P A C *) apply l9_8_2 with B; Col. (* Goal: @OS Tn I P B A *) unfold TS in HTS; spliter. (* Goal: @OS Tn I P B A *) apply cop__not_two_sides_one_side; Cop. (* Goal: not (@TS Tn I P B A) *) intro; apply HOS; apply l9_2; Col. (* BG Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) } (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) destruct HTS' as [Hc1 [Hc2 [T [HCol HBet']]]]. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn I P X) (or (and (@Bet Tn A X B) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A X C) (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) X C)) (not (@eq (@Tpoint Tn) A C))))))) *) exists T; split; Col. (* Goal: or (and (@Bet Tn A T B) (and (not (@eq (@Tpoint Tn) A T)) (and (not (@eq (@Tpoint Tn) T B)) (not (@eq (@Tpoint Tn) A B))))) (and (@Bet Tn A T C) (and (not (@eq (@Tpoint Tn) A T)) (and (not (@eq (@Tpoint Tn) T C)) (not (@eq (@Tpoint Tn) A C))))) *) right; split; Col. (* Goal: and (not (@eq (@Tpoint Tn) A T)) (and (not (@eq (@Tpoint Tn) T C)) (not (@eq (@Tpoint Tn) A C))) *) split; try (intro; treat_equalities; Col). (* Goal: and (not (@eq (@Tpoint Tn) T C)) (not (@eq (@Tpoint Tn) A C)) *) split; intro; treat_equalities; Col. Qed. Lemma hilbert_s_version_of_pasch : forall A B C P Q, Coplanar A B C P -> ~ Col C Q P -> ~ Col A B P -> BetS A Q B -> exists X, Col P Q X /\ (BetS A X C \/ BetS B X C). Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : @Coplanar Tn A B C P) (_ : not (@Col Tn C Q P)) (_ : not (@Col Tn A B P)) (_ : @BetS Tn A Q B), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn P Q X) (or (@BetS Tn A X C) (@BetS Tn B X C))) *) intros A B C P Q HCop HNC1 HNC2 HAQB. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn P Q X) (or (@BetS Tn A X C) (@BetS Tn B X C))) *) rewrite BetSEq in HAQB; spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn P Q X) (or (@BetS Tn A X C) (@BetS Tn B X C))) *) destruct (hilbert_s_version_of_pasch_aux C A B Q P) as [X [HPQX HBetS]]; Cop; try exists X; try split; Col; do 2 rewrite BetSEq; induction HBetS; spliter; repeat split; Between. Qed. Lemma two_sides_cases : forall O P A B, ~ Col O A B -> OS O P A B -> TS O A P B \/ TS O B P A. Proof. (* Goal: forall (O P A B : @Tpoint Tn) (_ : not (@Col Tn O A B)) (_ : @OS Tn O P A B), or (@TS Tn O A P B) (@TS Tn O B P A) *) intros. (* Goal: or (@TS Tn O A P B) (@TS Tn O B P A) *) assert (HCop := os__coplanar O P A B H0). (* Goal: or (@TS Tn O A P B) (@TS Tn O B P A) *) assert(TS O A P B \/ OS O A P B). (* Goal: or (@TS Tn O A P B) (@TS Tn O B P A) *) (* Goal: or (@TS Tn O A P B) (@OS Tn O A P B) *) { (* Goal: or (@TS Tn O A P B) (@OS Tn O A P B) *) apply(cop__one_or_two_sides O A P B); Col. (* Goal: not (@Col Tn P O A) *) (* Goal: @Coplanar Tn O A P B *) Cop. (* Goal: not (@Col Tn P O A) *) unfold OS in H0. (* Goal: not (@Col Tn P O A) *) ex_and H0 R. (* Goal: not (@Col Tn P O A) *) unfold TS in H0. (* Goal: not (@Col Tn P O A) *) spliter. (* Goal: not (@Col Tn P O A) *) Col. (* BG Goal: or (@TS Tn O A P B) (@TS Tn O B P A) *) } (* Goal: or (@TS Tn O A P B) (@TS Tn O B P A) *) induction H1. (* Goal: or (@TS Tn O A P B) (@TS Tn O B P A) *) (* Goal: or (@TS Tn O A P B) (@TS Tn O B P A) *) left; auto. (* Goal: or (@TS Tn O A P B) (@TS Tn O B P A) *) right. (* Goal: @TS Tn O B P A *) assert(TS O B P A \/ OS O B P A). (* Goal: @TS Tn O B P A *) (* Goal: or (@TS Tn O B P A) (@OS Tn O B P A) *) { (* Goal: or (@TS Tn O B P A) (@OS Tn O B P A) *) apply(cop__one_or_two_sides O B P A); Col. (* Goal: not (@Col Tn P O B) *) (* Goal: @Coplanar Tn O B P A *) Cop. (* Goal: not (@Col Tn P O B) *) unfold OS in H0. (* Goal: not (@Col Tn P O B) *) ex_and H0 R. (* Goal: not (@Col Tn P O B) *) unfold TS in H2. (* Goal: not (@Col Tn P O B) *) spliter. (* Goal: not (@Col Tn P O B) *) Col. (* BG Goal: @TS Tn O B P A *) } (* Goal: @TS Tn O B P A *) induction H2. (* Goal: @TS Tn O B P A *) (* Goal: @TS Tn O B P A *) assumption. (* Goal: @TS Tn O B P A *) assert(TS O P A B). (* Goal: @TS Tn O B P A *) (* Goal: @TS Tn O P A B *) { (* Goal: @TS Tn O P A B *) apply(l9_31 O A P B); auto. (* BG Goal: @TS Tn O B P A *) } (* Goal: @TS Tn O B P A *) apply l9_9 in H3. (* Goal: @TS Tn O B P A *) contradiction. Qed. Lemma not_par_two_sides : forall A B C D I, C <> D -> Col A B I -> Col C D I -> ~ Col A B C -> exists X, exists Y, Col C D X /\ Col C D Y /\ TS A B X Y. Proof. (* Goal: forall (A B C D I : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) C D)) (_ : @Col Tn A B I) (_ : @Col Tn C D I) (_ : not (@Col Tn A B C)), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn C D X) (and (@Col Tn C D Y) (@TS Tn A B X Y)))) *) intros A B C D I HCD HCol1 HCol2 HNC. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn C D X) (and (@Col Tn C D Y) (@TS Tn A B X Y)))) *) assert (HX : exists X, Col C D X /\ I <> X) by (exists C; split; try intro; treat_equalities; Col). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn C D X) (and (@Col Tn C D Y) (@TS Tn A B X Y)))) *) destruct HX as [X [HCol3 HIX]]. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn C D X) (and (@Col Tn C D Y) (@TS Tn A B X Y)))) *) destruct (symmetric_point_construction X I) as [Y HMid]. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn C D X) (and (@Col Tn C D Y) (@TS Tn A B X Y)))) *) exists X; exists Y; assert_diffs; assert_cols; do 2 (split; try ColR). (* Goal: @TS Tn A B X Y *) split; try (intro; assert (I = X) by (assert_diffs; assert_cols; apply l6_21 with A B C D; Col); Col). (* Goal: and (not (@Col Tn Y A B)) (@ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Y))) *) split; try (intro; assert (I = Y) by (assert_diffs; assert_cols; apply l6_21 with A B C D; Col; ColR); Col). (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A B) (@Bet Tn X T Y)) *) exists I; unfold Midpoint in HMid; spliter; split; Col; Between. Qed. Lemma cop_not_par_other_side : forall A B C D I P, C <> D -> Col A B I -> Col C D I -> ~ Col A B C -> ~ Col A B P -> Coplanar A B C P -> exists Q, Col C D Q /\ TS A B P Q. Proof. (* Goal: forall (A B C D I P : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) C D)) (_ : @Col Tn A B I) (_ : @Col Tn C D I) (_ : not (@Col Tn A B C)) (_ : not (@Col Tn A B P)) (_ : @Coplanar Tn A B C P), @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@TS Tn A B P Q)) *) intros A B C D I P HCD HCol1 HCol2 HNC1 HNC2 HCop. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@TS Tn A B P Q)) *) destruct (not_par_two_sides A B C D I HCD HCol1 HCol2 HNC1) as [X [Y [HCol3 [HCol4 HTS]]]]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@TS Tn A B P Q)) *) assert (Coplanar A B P X). (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@TS Tn A B P Q)) *) (* Goal: @Coplanar Tn A B P X *) apply coplanar_trans_1 with C; [Col|Cop|]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@TS Tn A B P Q)) *) (* Goal: @Coplanar Tn C A B X *) exists I; right; right; split; ColR. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@TS Tn A B P Q)) *) elim (two_sides_dec A B P X); intro HOS; [exists X; Col|]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@TS Tn A B P Q)) *) assert_diffs; apply cop__not_two_sides_one_side in HOS; Col; [|intro; unfold TS in HTS; intuition]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@TS Tn A B P Q)) *) exists Y; split; Col. (* Goal: @TS Tn A B P Y *) apply l9_8_2 with X; [|apply one_side_symmetry]; Col. Qed. Lemma cop_not_par_same_side : forall A B C D I P, C <> D -> Col A B I -> Col C D I -> ~ Col A B C -> ~ Col A B P -> Coplanar A B C P -> exists Q, Col C D Q /\ OS A B P Q. Proof. (* Goal: forall (A B C D I P : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) C D)) (_ : @Col Tn A B I) (_ : @Col Tn C D I) (_ : not (@Col Tn A B C)) (_ : not (@Col Tn A B P)) (_ : @Coplanar Tn A B C P), @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@OS Tn A B P Q)) *) intros A B C D I P HCD HCol1 HCol2 HNC1 HNC2 HCop. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@OS Tn A B P Q)) *) destruct (not_par_two_sides A B C D I HCD HCol1 HCol2 HNC1) as [X [Y [HCol3 [HCol4 HTS]]]]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@OS Tn A B P Q)) *) assert (Coplanar A B P X). (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@OS Tn A B P Q)) *) (* Goal: @Coplanar Tn A B P X *) apply coplanar_trans_1 with C; [Col|Cop|]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@OS Tn A B P Q)) *) (* Goal: @Coplanar Tn C A B X *) exists I; right; right; split; ColR. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@OS Tn A B P Q)) *) elim (one_side_dec A B P X); intro HTS2; [exists X; Col|]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@OS Tn A B P Q)) *) assert_diffs; apply cop__not_one_side_two_sides in HTS2; Col; [|intro; unfold TS in HTS; intuition]. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@OS Tn A B P Q)) *) exists Y; split; Col. (* Goal: @OS Tn A B P Y *) exists X; split; Side. Qed. End T10_1. Section T10_2D. Context `{T2D:Tarski_2D}. Lemma all_coplanar : forall A B C D, Coplanar A B C D. Proof. (* Goal: forall A B C D : @Tpoint Tn, @Coplanar Tn A B C D *) apply upper_dim_implies_all_coplanar; unfold upper_dim_axiom; apply upper_dim. Qed. Lemma per2__col : forall A B C X, Per A X C -> X <> C -> Per B X C -> Col A B X. Proof. (* Goal: forall (A B C X : @Tpoint Tn) (_ : @Per Tn A X C) (_ : not (@eq (@Tpoint Tn) X C)) (_ : @Per Tn B X C), @Col Tn A B X *) apply upper_dim_implies_per2__col; unfold upper_dim_axiom; apply upper_dim. Qed. Lemma perp2__col : forall X Y Z A B, Perp X Y A B -> Perp X Z A B -> Col X Y Z. Proof. (* Goal: forall (X Y Z A B : @Tpoint Tn) (_ : @Perp Tn X Y A B) (_ : @Perp Tn X Z A B), @Col Tn X Y Z *) intros X Y Z A B. (* Goal: forall (_ : @Perp Tn X Y A B) (_ : @Perp Tn X Z A B), @Col Tn X Y Z *) apply cop_perp2__col, all_coplanar. Qed. Lemma cong_on_bissect : forall A B M P X, Midpoint M A B -> Perp_at M A B P M -> Cong X A X B -> Col M P X. Proof. (* Goal: forall (A B M P X : @Tpoint Tn) (_ : @Midpoint Tn M A B) (_ : @Perp_at Tn M A B P M) (_ : @Cong Tn X A X B), @Col Tn M P X *) intros A B M P X. (* Goal: forall (_ : @Midpoint Tn M A B) (_ : @Perp_at Tn M A B P M) (_ : @Cong Tn X A X B), @Col Tn M P X *) apply cop__cong_on_bissect, all_coplanar. Qed. Lemma cong_mid_perp__col : forall A B M P X, Cong A X B X -> Midpoint M A B -> Perp A B P M -> Col M P X. Proof. (* Goal: forall (A B M P X : @Tpoint Tn) (_ : @Cong Tn A X B X) (_ : @Midpoint Tn M A B) (_ : @Perp Tn A B P M), @Col Tn M P X *) intros A B M P X. (* Goal: forall (_ : @Cong Tn A X B X) (_ : @Midpoint Tn M A B) (_ : @Perp Tn A B P M), @Col Tn M P X *) apply cong_cop_mid_perp__col, all_coplanar. Qed. Lemma image_in_col : forall A B P P' Q Q' M, ReflectL_at M P P' A B -> ReflectL_at M Q Q' A B -> Col M P Q. Proof. (* Goal: forall (A B P P' Q Q' M : @Tpoint Tn) (_ : @ReflectL_at Tn M P P' A B) (_ : @ReflectL_at Tn M Q Q' A B), @Col Tn M P Q *) intros A B P P' Q Q' M. (* Goal: forall (_ : @ReflectL_at Tn M P P' A B) (_ : @ReflectL_at Tn M Q Q' A B), @Col Tn M P Q *) apply cop__image_in_col, all_coplanar. Qed. Lemma cong_image__col : forall A B P P' X, P <> P' -> Reflect P P' A B -> Cong P X P' X -> Col A B X. Proof. (* Goal: forall (A B P P' X : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) P P')) (_ : @Reflect Tn P P' A B) (_ : @Cong Tn P X P' X), @Col Tn A B X *) intros. (* Goal: @Col Tn A B X *) assert (HCop := all_coplanar A B P X). (* Goal: @Col Tn A B X *) apply cong_cop_image__col with P P'; assumption. Qed. Lemma cong_per2_1 : forall A B X Y, A <> B -> Per A B X -> Per A B Y -> Cong B X B Y -> X = Y \/ Midpoint B X Y. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : @Per Tn A B X) (_ : @Per Tn A B Y) (_ : @Cong Tn B X B Y), or (@eq (@Tpoint Tn) X Y) (@Midpoint Tn B X Y) *) intros. (* Goal: or (@eq (@Tpoint Tn) X Y) (@Midpoint Tn B X Y) *) assert (HCop := all_coplanar A B X Y). (* Goal: or (@eq (@Tpoint Tn) X Y) (@Midpoint Tn B X Y) *) apply (cong_cop_per2_1 A); assumption. Qed. Lemma cong_per2 : forall A B X Y, A <> B -> Per A B X -> Per A B Y -> Cong B X B Y -> X = Y \/ ReflectL X Y A B. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : @Per Tn A B X) (_ : @Per Tn A B Y) (_ : @Cong Tn B X B Y), or (@eq (@Tpoint Tn) X Y) (@ReflectL Tn X Y A B) *) intros. (* Goal: or (@eq (@Tpoint Tn) X Y) (@ReflectL Tn X Y A B) *) assert (HCop := all_coplanar A B X Y). (* Goal: or (@eq (@Tpoint Tn) X Y) (@ReflectL Tn X Y A B) *) apply cong_cop_per2; assumption. Qed. Lemma cong_per2_gen : forall A B X Y, A <> B -> Per A B X -> Per A B Y -> Cong B X B Y -> X = Y \/ Reflect X Y A B. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : @Per Tn A B X) (_ : @Per Tn A B Y) (_ : @Cong Tn B X B Y), or (@eq (@Tpoint Tn) X Y) (@Reflect Tn X Y A B) *) intros. (* Goal: or (@eq (@Tpoint Tn) X Y) (@Reflect Tn X Y A B) *) assert (HCop := all_coplanar A B X Y). (* Goal: or (@eq (@Tpoint Tn) X Y) (@Reflect Tn X Y A B) *) apply cong_cop_per2_gen; assumption. Qed. Lemma not_two_sides_one_side : forall A B X Y, ~ Col X A B -> ~ Col Y A B -> ~ TS A B X Y -> OS A B X Y. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : not (@Col Tn X A B)) (_ : not (@Col Tn Y A B)) (_ : not (@TS Tn A B X Y)), @OS Tn A B X Y *) intros A B X Y. (* Goal: forall (_ : not (@Col Tn X A B)) (_ : not (@Col Tn Y A B)) (_ : not (@TS Tn A B X Y)), @OS Tn A B X Y *) apply cop__not_two_sides_one_side, all_coplanar. Qed. Lemma col_perp2__col : forall A B X Y P, Col A B P -> Perp A B X P -> Perp P A Y P -> Col Y X P. Proof. (* Goal: forall (A B X Y P : @Tpoint Tn) (_ : @Col Tn A B P) (_ : @Perp Tn A B X P) (_ : @Perp Tn P A Y P), @Col Tn Y X P *) apply upper_dim_implies_col_perp2__col; unfold upper_dim_axiom; apply upper_dim. Qed. Lemma hilbert_s_version_of_pasch_2D : forall A B C P Q, ~ Col C Q P -> ~ Col A B P -> BetS A Q B -> exists X, Col P Q X /\ (BetS A X C \/ BetS B X C). Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : not (@Col Tn C Q P)) (_ : not (@Col Tn A B P)) (_ : @BetS Tn A Q B), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn P Q X) (or (@BetS Tn A X C) (@BetS Tn B X C))) *) intros A B C P Q. (* Goal: forall (_ : not (@Col Tn C Q P)) (_ : not (@Col Tn A B P)) (_ : @BetS Tn A Q B), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn P Q X) (or (@BetS Tn A X C) (@BetS Tn B X C))) *) apply hilbert_s_version_of_pasch, all_coplanar. Qed. Lemma not_one_side_two_sides : forall A B X Y, ~ Col X A B -> ~ Col Y A B -> ~ OS A B X Y -> TS A B X Y. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : not (@Col Tn X A B)) (_ : not (@Col Tn Y A B)) (_ : not (@OS Tn A B X Y)), @TS Tn A B X Y *) apply upper_dim_implies_not_one_side_two_sides. (* Goal: @upper_dim_axiom Tn *) unfold upper_dim_axiom; apply upper_dim. Qed. Lemma one_or_two_sides : forall A B X Y, ~ Col X A B -> ~ Col Y A B -> TS A B X Y \/ OS A B X Y. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : not (@Col Tn X A B)) (_ : not (@Col Tn Y A B)), or (@TS Tn A B X Y) (@OS Tn A B X Y) *) apply upper_dim_implies_one_or_two_sides. (* Goal: @upper_dim_axiom Tn *) unfold upper_dim_axiom; apply upper_dim. Qed. Lemma not_par_other_side : forall A B C D I P, C <> D -> Col A B I -> Col C D I -> ~ Col A B C -> ~ Col A B P -> exists Q, Col C D Q /\ TS A B P Q. Proof. (* Goal: forall (A B C D I P : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) C D)) (_ : @Col Tn A B I) (_ : @Col Tn C D I) (_ : not (@Col Tn A B C)) (_ : not (@Col Tn A B P)), @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@TS Tn A B P Q)) *) intros. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@TS Tn A B P Q)) *) assert (HCop := all_coplanar A B C P). (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@TS Tn A B P Q)) *) apply cop_not_par_other_side with I; assumption. Qed. Lemma not_par_same_side : forall A B C D I P, C <> D -> Col A B I -> Col C D I -> ~ Col A B C -> ~ Col A B P -> exists Q, Col C D Q /\ OS A B P Q. Proof. (* Goal: forall (A B C D I P : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) C D)) (_ : @Col Tn A B I) (_ : @Col Tn C D I) (_ : not (@Col Tn A B C)) (_ : not (@Col Tn A B P)), @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@OS Tn A B P Q)) *) intros. (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@OS Tn A B P Q)) *) assert (HCop := all_coplanar A B C P). (* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => and (@Col Tn C D Q) (@OS Tn A B P Q)) *) apply cop_not_par_same_side with I; assumption. Qed. End T10_2D. Hint Resolve all_coplanar : cop.
Require Import Factorization_Synth. Require Import Comparator_Relation. Parameter BASE : BT. Definition b := base BASE. Definition Num := num BASE. Definition Val_bound := val_bound BASE. Lemma Comparator : forall (n : nat) (o : order) (X Y : Num n), {o' : order | R (exp b n) o (Val_bound n X) (Val_bound n Y) o'}. Proof. (* Goal: forall (n : nat) (o : order) (X Y : Num n), @sig order (fun o' : order => R (exp b n) o (Val_bound n X) (Val_bound n Y) o') *) intros n o X Y. (* Goal: @sig order (fun o' : order => R (exp b n) o (Val_bound n X) (Val_bound n Y) o') *) unfold R in |- *; unfold b in |- *; unfold Val_bound in |- *. (* Goal: @sig order (fun o' : order => @eq order o' (FR (exp (base BASE) n) o (val_bound BASE n X) (val_bound BASE n Y))) *) apply factorization_for_synthesis. (* Goal: proper order BASE (fun (n : nat) (a : order) (x y : inf n) (a' : order) => @eq order a' (FR n a x y)) *) (* Goal: factorizable order (fun (n : nat) (a : order) (x y : inf n) (a' : order) => @eq order a' (FR n a x y)) *) exact is_factorizable. (* Goal: proper order BASE (fun (n : nat) (a : order) (x y : inf n) (a' : order) => @eq order a' (FR n a x y)) *) exact (is_proper BASE). Qed.
Require Import Arith. Require Import ZArith. Require Import Wf_nat. Require Import lemmas. Require Import natZ. Require Import dec. Require Import list. Require Import exp. Require Import divides. Require Import prime. Require Import modulo. Require Import gcd. Lemma prime_div_or_gcd1 : forall (p : nat) (a : Z), Prime p -> ZDivides (Z_of_nat p) a \/ gcd (Z_of_nat p) a 1. Proof. (* Goal: forall (p : nat) (a : Z) (_ : Prime p), or (ZDivides (Z.of_nat p) a) (gcd (Z.of_nat p) a (S O)) *) intros. (* Goal: or (ZDivides (Z.of_nat p) a) (gcd (Z.of_nat p) a (S O)) *) elim (zdivdec a (Z_of_nat p)). (* Goal: forall _ : not (ZDivides (Z.of_nat p) a), or (ZDivides (Z.of_nat p) a) (gcd (Z.of_nat p) a (S O)) *) (* Goal: forall _ : ZDivides (Z.of_nat p) a, or (ZDivides (Z.of_nat p) a) (gcd (Z.of_nat p) a (S O)) *) left. (* Goal: forall _ : not (ZDivides (Z.of_nat p) a), or (ZDivides (Z.of_nat p) a) (gcd (Z.of_nat p) a (S O)) *) (* Goal: ZDivides (Z.of_nat p) a *) assumption. (* Goal: forall _ : not (ZDivides (Z.of_nat p) a), or (ZDivides (Z.of_nat p) a) (gcd (Z.of_nat p) a (S O)) *) right. (* Goal: gcd (Z.of_nat p) a (S O) *) unfold gcd in |- *. (* Goal: and (common_div (Z.of_nat p) a (S O)) (forall (e : nat) (_ : common_div (Z.of_nat p) a e), le e (S O)) *) unfold common_div in |- *. (* Goal: and (and (Divides (S O) (Z.abs_nat (Z.of_nat p))) (Divides (S O) (Z.abs_nat a))) (forall (e : nat) (_ : and (Divides e (Z.abs_nat (Z.of_nat p))) (Divides e (Z.abs_nat a))), le e (S O)) *) split. (* Goal: forall (e : nat) (_ : and (Divides e (Z.abs_nat (Z.of_nat p))) (Divides e (Z.abs_nat a))), le e (S O) *) (* Goal: and (Divides (S O) (Z.abs_nat (Z.of_nat p))) (Divides (S O) (Z.abs_nat a)) *) split. (* Goal: forall (e : nat) (_ : and (Divides e (Z.abs_nat (Z.of_nat p))) (Divides e (Z.abs_nat a))), le e (S O) *) (* Goal: Divides (S O) (Z.abs_nat a) *) (* Goal: Divides (S O) (Z.abs_nat (Z.of_nat p)) *) split with p. (* Goal: forall (e : nat) (_ : and (Divides e (Z.abs_nat (Z.of_nat p))) (Divides e (Z.abs_nat a))), le e (S O) *) (* Goal: Divides (S O) (Z.abs_nat a) *) (* Goal: @eq nat (Z.abs_nat (Z.of_nat p)) (Init.Nat.mul (S O) p) *) simpl in |- *. (* Goal: forall (e : nat) (_ : and (Divides e (Z.abs_nat (Z.of_nat p))) (Divides e (Z.abs_nat a))), le e (S O) *) (* Goal: Divides (S O) (Z.abs_nat a) *) (* Goal: @eq nat (Z.abs_nat (Z.of_nat p)) (Init.Nat.add p O) *) rewrite <- plus_n_O. (* Goal: forall (e : nat) (_ : and (Divides e (Z.abs_nat (Z.of_nat p))) (Divides e (Z.abs_nat a))), le e (S O) *) (* Goal: Divides (S O) (Z.abs_nat a) *) (* Goal: @eq nat (Z.abs_nat (Z.of_nat p)) p *) apply abs_inj. (* Goal: forall (e : nat) (_ : and (Divides e (Z.abs_nat (Z.of_nat p))) (Divides e (Z.abs_nat a))), le e (S O) *) (* Goal: Divides (S O) (Z.abs_nat a) *) split with (Zabs_nat a). (* Goal: forall (e : nat) (_ : and (Divides e (Z.abs_nat (Z.of_nat p))) (Divides e (Z.abs_nat a))), le e (S O) *) (* Goal: @eq nat (Z.abs_nat a) (Init.Nat.mul (S O) (Z.abs_nat a)) *) simpl in |- *. (* Goal: forall (e : nat) (_ : and (Divides e (Z.abs_nat (Z.of_nat p))) (Divides e (Z.abs_nat a))), le e (S O) *) (* Goal: @eq nat (Z.abs_nat a) (Init.Nat.add (Z.abs_nat a) O) *) apply plus_n_O. (* Goal: forall (e : nat) (_ : and (Divides e (Z.abs_nat (Z.of_nat p))) (Divides e (Z.abs_nat a))), le e (S O) *) intros. (* Goal: le e (S O) *) elim H1. (* Goal: forall (_ : Divides e (Z.abs_nat (Z.of_nat p))) (_ : Divides e (Z.abs_nat a)), le e (S O) *) intros. (* Goal: le e (S O) *) rewrite abs_inj in H2. (* Goal: le e (S O) *) elim (primediv1p p e). (* Goal: Divides e p *) (* Goal: Prime p *) (* Goal: forall _ : @eq nat e p, le e (S O) *) (* Goal: forall _ : @eq nat e (S O), le e (S O) *) intro. (* Goal: Divides e p *) (* Goal: Prime p *) (* Goal: forall _ : @eq nat e p, le e (S O) *) (* Goal: le e (S O) *) rewrite H4. (* Goal: Divides e p *) (* Goal: Prime p *) (* Goal: forall _ : @eq nat e p, le e (S O) *) (* Goal: le (S O) (S O) *) apply le_n. (* Goal: Divides e p *) (* Goal: Prime p *) (* Goal: forall _ : @eq nat e p, le e (S O) *) intro. (* Goal: Divides e p *) (* Goal: Prime p *) (* Goal: le e (S O) *) rewrite H4 in H3. (* Goal: Divides e p *) (* Goal: Prime p *) (* Goal: le e (S O) *) elim H0. (* Goal: Divides e p *) (* Goal: Prime p *) (* Goal: ZDivides (Z.of_nat p) a *) apply divzdiv. (* Goal: Divides e p *) (* Goal: Prime p *) (* Goal: Divides (Z.abs_nat (Z.of_nat p)) (Z.abs_nat a) *) rewrite abs_inj. (* Goal: Divides e p *) (* Goal: Prime p *) (* Goal: Divides p (Z.abs_nat a) *) assumption. (* Goal: Divides e p *) (* Goal: Prime p *) assumption. (* Goal: Divides e p *) assumption. Qed. Lemma divmultgcd : forall a b c : Z, a <> 0%Z -> ZDivides a (b * c) -> gcd a b 1 -> ZDivides a c. Proof. (* Goal: forall (a b c : Z) (_ : not (@eq Z a Z0)) (_ : ZDivides a (Z.mul b c)) (_ : gcd a b (S O)), ZDivides a c *) intros. (* Goal: ZDivides a c *) elim (gcd_lincomb a b 1). (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: forall (x : Z) (_ : @ex Z (fun b0 : Z => @eq Z (Z.of_nat (S O)) (Z.add (Z.mul a x) (Z.mul b b0)))), ZDivides a c *) intro alpha. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: forall _ : @ex Z (fun b0 : Z => @eq Z (Z.of_nat (S O)) (Z.add (Z.mul a alpha) (Z.mul b b0))), ZDivides a c *) intros. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: ZDivides a c *) elim H2. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: forall (x : Z) (_ : @eq Z (Z.of_nat (S O)) (Z.add (Z.mul a alpha) (Z.mul b x))), ZDivides a c *) intro beta. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: forall _ : @eq Z (Z.of_nat (S O)) (Z.add (Z.mul a alpha) (Z.mul b beta)), ZDivides a c *) intros. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: ZDivides a c *) elim H0. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: forall (x : Z) (_ : @eq Z (Z.mul b c) (Z.mul a x)), ZDivides a c *) intro y. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: forall _ : @eq Z (Z.mul b c) (Z.mul a y), ZDivides a c *) intros. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: ZDivides a c *) split with (c * alpha + y * beta)%Z. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: @eq Z c (Z.mul a (Z.add (Z.mul c alpha) (Z.mul y beta))) *) rewrite Zmult_plus_distr_r. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: @eq Z c (Z.add (Z.mul a (Z.mul c alpha)) (Z.mul a (Z.mul y beta))) *) rewrite Zmult_assoc. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: @eq Z c (Z.add (Z.mul (Z.mul a c) alpha) (Z.mul a (Z.mul y beta))) *) rewrite Zmult_assoc. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: @eq Z c (Z.add (Z.mul (Z.mul a c) alpha) (Z.mul (Z.mul a y) beta)) *) rewrite <- H4. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: @eq Z c (Z.add (Z.mul (Z.mul a c) alpha) (Z.mul (Z.mul b c) beta)) *) rewrite (Zmult_comm a c). (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: @eq Z c (Z.add (Z.mul (Z.mul c a) alpha) (Z.mul (Z.mul b c) beta)) *) rewrite (Zmult_comm b c). (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: @eq Z c (Z.add (Z.mul (Z.mul c a) alpha) (Z.mul (Z.mul c b) beta)) *) rewrite Zmult_assoc_reverse. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: @eq Z c (Z.add (Z.mul c (Z.mul a alpha)) (Z.mul (Z.mul c b) beta)) *) rewrite Zmult_assoc_reverse. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: @eq Z c (Z.add (Z.mul c (Z.mul a alpha)) (Z.mul c (Z.mul b beta))) *) rewrite <- Zmult_plus_distr_r. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: @eq Z c (Z.mul c (Z.add (Z.mul a alpha) (Z.mul b beta))) *) transitivity (c * 1)%Z. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: @eq Z (Z.mul c (Zpos xH)) (Z.mul c (Z.add (Z.mul a alpha) (Z.mul b beta))) *) (* Goal: @eq Z c (Z.mul c (Zpos xH)) *) rewrite Zmult_comm. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: @eq Z (Z.mul c (Zpos xH)) (Z.mul c (Z.add (Z.mul a alpha) (Z.mul b beta))) *) (* Goal: @eq Z c (Z.mul (Zpos xH) c) *) rewrite Zmult_1_l. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: @eq Z (Z.mul c (Zpos xH)) (Z.mul c (Z.add (Z.mul a alpha) (Z.mul b beta))) *) (* Goal: @eq Z c c *) reflexivity. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: @eq Z (Z.mul c (Zpos xH)) (Z.mul c (Z.add (Z.mul a alpha) (Z.mul b beta))) *) apply (f_equal (A:=Z)). (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) (* Goal: @eq Z (Zpos xH) (Z.add (Z.mul a alpha) (Z.mul b beta)) *) assumption. (* Goal: gcd a b (S O) *) (* Goal: not (@eq Z a Z0) *) assumption. (* Goal: gcd a b (S O) *) assumption. Qed. Lemma primedivmult : forall p n m : nat, Prime p -> Divides p (n * m) -> Divides p n \/ Divides p m. Proof. (* Goal: forall (p n m : nat) (_ : Prime p) (_ : Divides p (Init.Nat.mul n m)), or (Divides p n) (Divides p m) *) intros. (* Goal: or (Divides p n) (Divides p m) *) elim (prime_div_or_gcd1 p (Z_of_nat n)). (* Goal: Prime p *) (* Goal: forall _ : gcd (Z.of_nat p) (Z.of_nat n) (S O), or (Divides p n) (Divides p m) *) (* Goal: forall _ : ZDivides (Z.of_nat p) (Z.of_nat n), or (Divides p n) (Divides p m) *) left. (* Goal: Prime p *) (* Goal: forall _ : gcd (Z.of_nat p) (Z.of_nat n) (S O), or (Divides p n) (Divides p m) *) (* Goal: Divides p n *) rewrite <- (abs_inj p). (* Goal: Prime p *) (* Goal: forall _ : gcd (Z.of_nat p) (Z.of_nat n) (S O), or (Divides p n) (Divides p m) *) (* Goal: Divides (Z.abs_nat (Z.of_nat p)) n *) rewrite <- (abs_inj n). (* Goal: Prime p *) (* Goal: forall _ : gcd (Z.of_nat p) (Z.of_nat n) (S O), or (Divides p n) (Divides p m) *) (* Goal: Divides (Z.abs_nat (Z.of_nat p)) (Z.abs_nat (Z.of_nat n)) *) apply zdivdiv. (* Goal: Prime p *) (* Goal: forall _ : gcd (Z.of_nat p) (Z.of_nat n) (S O), or (Divides p n) (Divides p m) *) (* Goal: ZDivides (Z.of_nat p) (Z.of_nat n) *) assumption. (* Goal: Prime p *) (* Goal: forall _ : gcd (Z.of_nat p) (Z.of_nat n) (S O), or (Divides p n) (Divides p m) *) right. (* Goal: Prime p *) (* Goal: Divides p m *) rewrite <- (abs_inj p). (* Goal: Prime p *) (* Goal: Divides (Z.abs_nat (Z.of_nat p)) m *) rewrite <- (abs_inj m). (* Goal: Prime p *) (* Goal: Divides (Z.abs_nat (Z.of_nat p)) (Z.abs_nat (Z.of_nat m)) *) apply zdivdiv. (* Goal: Prime p *) (* Goal: ZDivides (Z.of_nat p) (Z.of_nat m) *) apply divmultgcd with (Z_of_nat n). (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) (* Goal: ZDivides (Z.of_nat p) (Z.mul (Z.of_nat n) (Z.of_nat m)) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) elim H. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) (* Goal: ZDivides (Z.of_nat p) (Z.mul (Z.of_nat n) (Z.of_nat m)) *) (* Goal: forall (_ : gt p (S O)) (_ : forall (q : nat) (_ : Divides q p), or (@eq nat q (S O)) (@eq nat q p)), not (@eq Z (Z.of_nat p) Z0) *) intros. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) (* Goal: ZDivides (Z.of_nat p) (Z.mul (Z.of_nat n) (Z.of_nat m)) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) apply Zgt_neq. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) (* Goal: ZDivides (Z.of_nat p) (Z.mul (Z.of_nat n) (Z.of_nat m)) *) (* Goal: Z.gt (Z.of_nat p) Z0 *) change (Z_of_nat p > Z_of_nat 0)%Z in |- *. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) (* Goal: ZDivides (Z.of_nat p) (Z.mul (Z.of_nat n) (Z.of_nat m)) *) (* Goal: Z.gt (Z.of_nat p) (Z.of_nat O) *) apply Znat.inj_gt. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) (* Goal: ZDivides (Z.of_nat p) (Z.mul (Z.of_nat n) (Z.of_nat m)) *) (* Goal: gt p O *) apply gt_trans with 1. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) (* Goal: ZDivides (Z.of_nat p) (Z.mul (Z.of_nat n) (Z.of_nat m)) *) (* Goal: gt (S O) O *) (* Goal: gt p (S O) *) assumption. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) (* Goal: ZDivides (Z.of_nat p) (Z.mul (Z.of_nat n) (Z.of_nat m)) *) (* Goal: gt (S O) O *) unfold gt in |- *. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) (* Goal: ZDivides (Z.of_nat p) (Z.mul (Z.of_nat n) (Z.of_nat m)) *) (* Goal: lt O (S O) *) unfold lt in |- *. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) (* Goal: ZDivides (Z.of_nat p) (Z.mul (Z.of_nat n) (Z.of_nat m)) *) (* Goal: le (S O) (S O) *) apply le_n. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) (* Goal: ZDivides (Z.of_nat p) (Z.mul (Z.of_nat n) (Z.of_nat m)) *) rewrite <- Znat.inj_mult. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) (* Goal: ZDivides (Z.of_nat p) (Z.of_nat (Init.Nat.mul n m)) *) apply divzdiv. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) (* Goal: Divides (Z.abs_nat (Z.of_nat p)) (Z.abs_nat (Z.of_nat (Init.Nat.mul n m))) *) rewrite abs_inj. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) (* Goal: Divides p (Z.abs_nat (Z.of_nat (Init.Nat.mul n m))) *) rewrite abs_inj. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) (* Goal: Divides p (Init.Nat.mul n m) *) assumption. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) (Z.of_nat n) (S O) *) assumption. (* Goal: Prime p *) assumption. Qed. Lemma mod_mult_inv_r : forall (a : Z) (p : nat), Prime p -> ~ Mod a 0 p -> exists ra : Z, Mod (a * ra) 1 p. Proof. (* Goal: forall (a : Z) (p : nat) (_ : Prime p) (_ : not (Mod a Z0 p)), @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) intros. (* Goal: @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) elim (prime_div_or_gcd1 p a). (* Goal: Prime p *) (* Goal: forall _ : gcd (Z.of_nat p) a (S O), @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) (* Goal: forall _ : ZDivides (Z.of_nat p) a, @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) intro. (* Goal: Prime p *) (* Goal: forall _ : gcd (Z.of_nat p) a (S O), @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) (* Goal: @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) elim H0. (* Goal: Prime p *) (* Goal: forall _ : gcd (Z.of_nat p) a (S O), @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) (* Goal: Mod a Z0 p *) elim H1. (* Goal: Prime p *) (* Goal: forall _ : gcd (Z.of_nat p) a (S O), @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) (* Goal: forall (x : Z) (_ : @eq Z a (Z.mul (Z.of_nat p) x)), Mod a Z0 p *) intros. (* Goal: Prime p *) (* Goal: forall _ : gcd (Z.of_nat p) a (S O), @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) (* Goal: Mod a Z0 p *) split with x. (* Goal: Prime p *) (* Goal: forall _ : gcd (Z.of_nat p) a (S O), @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) (* Goal: @eq Z a (Z.add Z0 (Z.mul (Z.of_nat p) x)) *) simpl in |- *. (* Goal: Prime p *) (* Goal: forall _ : gcd (Z.of_nat p) a (S O), @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) (* Goal: @eq Z a (Z.mul (Z.of_nat p) x) *) assumption. (* Goal: Prime p *) (* Goal: forall _ : gcd (Z.of_nat p) a (S O), @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) intro. (* Goal: Prime p *) (* Goal: @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) elim (gcd_lincomb (Z_of_nat p) a 1). (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: forall (x : Z) (_ : @ex Z (fun b : Z => @eq Z (Z.of_nat (S O)) (Z.add (Z.mul (Z.of_nat p) x) (Z.mul a b)))), @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) intro alpha. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: forall _ : @ex Z (fun b : Z => @eq Z (Z.of_nat (S O)) (Z.add (Z.mul (Z.of_nat p) alpha) (Z.mul a b))), @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) intros. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) elim H2. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: forall (x : Z) (_ : @eq Z (Z.of_nat (S O)) (Z.add (Z.mul (Z.of_nat p) alpha) (Z.mul a x))), @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) intro beta. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: forall _ : @eq Z (Z.of_nat (S O)) (Z.add (Z.mul (Z.of_nat p) alpha) (Z.mul a beta)), @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) intros. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: @ex Z (fun ra : Z => Mod (Z.mul a ra) (Zpos xH) p) *) unfold Mod in |- *. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: @ex Z (fun ra : Z => @ex Z (fun q : Z => @eq Z (Z.mul a ra) (Z.add (Zpos xH) (Z.mul (Z.of_nat p) q)))) *) split with beta. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: @ex Z (fun q : Z => @eq Z (Z.mul a beta) (Z.add (Zpos xH) (Z.mul (Z.of_nat p) q))) *) split with (- alpha)%Z. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: @eq Z (Z.mul a beta) (Z.add (Zpos xH) (Z.mul (Z.of_nat p) (Z.opp alpha))) *) simpl in H3. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: @eq Z (Z.mul a beta) (Z.add (Zpos xH) (Z.mul (Z.of_nat p) (Z.opp alpha))) *) rewrite H3. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: @eq Z (Z.mul a beta) (Z.add (Z.add (Z.mul (Z.of_nat p) alpha) (Z.mul a beta)) (Z.mul (Z.of_nat p) (Z.opp alpha))) *) rewrite (Zplus_comm (Z_of_nat p * alpha)). (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: @eq Z (Z.mul a beta) (Z.add (Z.add (Z.mul a beta) (Z.mul (Z.of_nat p) alpha)) (Z.mul (Z.of_nat p) (Z.opp alpha))) *) rewrite Zplus_assoc_reverse. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: @eq Z (Z.mul a beta) (Z.add (Z.mul a beta) (Z.add (Z.mul (Z.of_nat p) alpha) (Z.mul (Z.of_nat p) (Z.opp alpha)))) *) rewrite <- Zmult_plus_distr_r. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: @eq Z (Z.mul a beta) (Z.add (Z.mul a beta) (Z.mul (Z.of_nat p) (Z.add alpha (Z.opp alpha)))) *) rewrite Zplus_opp_r. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: @eq Z (Z.mul a beta) (Z.add (Z.mul a beta) (Z.mul (Z.of_nat p) Z0)) *) rewrite <- Zmult_0_r_reverse. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: @eq Z (Z.mul a beta) (Z.add (Z.mul a beta) Z0) *) rewrite <- Zplus_0_r_reverse. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) (* Goal: @eq Z (Z.mul a beta) (Z.mul a beta) *) reflexivity. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: not (@eq Z (Z.of_nat p) Z0) *) apply Zgt_neq. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: Z.gt (Z.of_nat p) Z0 *) change (Z_of_nat p > Z_of_nat 0)%Z in |- *. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: Z.gt (Z.of_nat p) (Z.of_nat O) *) apply Znat.inj_gt. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: gt p O *) apply gt_trans with 1. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: gt (S O) O *) (* Goal: gt p (S O) *) elim H. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: gt (S O) O *) (* Goal: forall (_ : gt p (S O)) (_ : forall (q : nat) (_ : Divides q p), or (@eq nat q (S O)) (@eq nat q p)), gt p (S O) *) intros. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: gt (S O) O *) (* Goal: gt p (S O) *) assumption. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: gt (S O) O *) unfold gt in |- *. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: lt O (S O) *) unfold lt in |- *. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) (* Goal: le (S O) (S O) *) apply le_n. (* Goal: Prime p *) (* Goal: gcd (Z.of_nat p) a (S O) *) assumption. (* Goal: Prime p *) assumption. Qed. Lemma mod_mult_cancel_r : forall (a b c : Z) (p : nat), Prime p -> ~ Mod c 0 p -> Mod (a * c) (b * c) p -> Mod a b p. Proof. (* Goal: forall (a b c : Z) (p : nat) (_ : Prime p) (_ : not (Mod c Z0 p)) (_ : Mod (Z.mul a c) (Z.mul b c) p), Mod a b p *) intros. (* Goal: Mod a b p *) elim (mod_mult_inv_r c p). (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: forall (x : Z) (_ : Mod (Z.mul c x) (Zpos xH) p), Mod a b p *) intro rc. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: forall _ : Mod (Z.mul c rc) (Zpos xH) p, Mod a b p *) intros. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: Mod a b p *) apply mod_trans with (a * c * rc)%Z. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: Mod (Z.mul (Z.mul a c) rc) b p *) (* Goal: Mod a (Z.mul (Z.mul a c) rc) p *) rewrite Zmult_assoc_reverse. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: Mod (Z.mul (Z.mul a c) rc) b p *) (* Goal: Mod a (Z.mul a (Z.mul c rc)) p *) pattern a at 1 in |- *. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: Mod (Z.mul (Z.mul a c) rc) b p *) (* Goal: (fun z : Z => Mod z (Z.mul a (Z.mul c rc)) p) a *) replace a with (a * 1)%Z. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: Mod (Z.mul (Z.mul a c) rc) b p *) (* Goal: @eq Z (Z.mul a (Zpos xH)) a *) (* Goal: Mod (Z.mul a (Zpos xH)) (Z.mul a (Z.mul c rc)) p *) apply mod_mult_compat. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: Mod (Z.mul (Z.mul a c) rc) b p *) (* Goal: @eq Z (Z.mul a (Zpos xH)) a *) (* Goal: Mod (Zpos xH) (Z.mul c rc) p *) (* Goal: Mod a a p *) apply mod_refl. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: Mod (Z.mul (Z.mul a c) rc) b p *) (* Goal: @eq Z (Z.mul a (Zpos xH)) a *) (* Goal: Mod (Zpos xH) (Z.mul c rc) p *) apply mod_sym. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: Mod (Z.mul (Z.mul a c) rc) b p *) (* Goal: @eq Z (Z.mul a (Zpos xH)) a *) (* Goal: Mod (Z.mul c rc) (Zpos xH) p *) assumption. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: Mod (Z.mul (Z.mul a c) rc) b p *) (* Goal: @eq Z (Z.mul a (Zpos xH)) a *) rewrite Zmult_comm. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: Mod (Z.mul (Z.mul a c) rc) b p *) (* Goal: @eq Z (Z.mul (Zpos xH) a) a *) apply Zmult_1_l. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: Mod (Z.mul (Z.mul a c) rc) b p *) apply mod_trans with (b * c * rc)%Z. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: Mod (Z.mul (Z.mul b c) rc) b p *) (* Goal: Mod (Z.mul (Z.mul a c) rc) (Z.mul (Z.mul b c) rc) p *) apply mod_mult_compat. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: Mod (Z.mul (Z.mul b c) rc) b p *) (* Goal: Mod rc rc p *) (* Goal: Mod (Z.mul a c) (Z.mul b c) p *) assumption. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: Mod (Z.mul (Z.mul b c) rc) b p *) (* Goal: Mod rc rc p *) apply mod_refl. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: Mod (Z.mul (Z.mul b c) rc) b p *) rewrite Zmult_assoc_reverse. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: Mod (Z.mul b (Z.mul c rc)) b p *) pattern b at 2 in |- *. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: (fun z : Z => Mod (Z.mul b (Z.mul c rc)) z p) b *) replace b with (b * 1)%Z. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: @eq Z (Z.mul b (Zpos xH)) b *) (* Goal: Mod (Z.mul b (Z.mul c rc)) (Z.mul b (Zpos xH)) p *) apply mod_mult_compat. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: @eq Z (Z.mul b (Zpos xH)) b *) (* Goal: Mod (Z.mul c rc) (Zpos xH) p *) (* Goal: Mod b b p *) apply mod_refl. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: @eq Z (Z.mul b (Zpos xH)) b *) (* Goal: Mod (Z.mul c rc) (Zpos xH) p *) assumption. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: @eq Z (Z.mul b (Zpos xH)) b *) rewrite Zmult_comm. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) (* Goal: @eq Z (Z.mul (Zpos xH) b) b *) apply Zmult_1_l. (* Goal: not (Mod c Z0 p) *) (* Goal: Prime p *) assumption. (* Goal: not (Mod c Z0 p) *) assumption. Qed. Lemma mod_mult_0 : forall (p : nat) (a b : Z), Prime p -> Mod (a * b) 0 p -> Mod a 0 p \/ Mod b 0 p. Proof. (* Goal: forall (p : nat) (a b : Z) (_ : Prime p) (_ : Mod (Z.mul a b) Z0 p), or (Mod a Z0 p) (Mod b Z0 p) *) intros. (* Goal: or (Mod a Z0 p) (Mod b Z0 p) *) elim (moddivmin (a * b) 0 p). (* Goal: forall (_ : forall _ : Mod (Z.mul a b) Z0 p, Divides p (Z.abs_nat (Z.sub (Z.mul a b) Z0))) (_ : forall _ : Divides p (Z.abs_nat (Z.sub (Z.mul a b) Z0)), Mod (Z.mul a b) Z0 p), or (Mod a Z0 p) (Mod b Z0 p) *) intros. (* Goal: or (Mod a Z0 p) (Mod b Z0 p) *) rewrite <- Zminus_0_l_reverse in H1. (* Goal: or (Mod a Z0 p) (Mod b Z0 p) *) rewrite abs_mult in H1. (* Goal: or (Mod a Z0 p) (Mod b Z0 p) *) elim (primedivmult p (Zabs_nat a) (Zabs_nat b)). (* Goal: Divides p (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat b)) *) (* Goal: Prime p *) (* Goal: forall _ : Divides p (Z.abs_nat b), or (Mod a Z0 p) (Mod b Z0 p) *) (* Goal: forall _ : Divides p (Z.abs_nat a), or (Mod a Z0 p) (Mod b Z0 p) *) left. (* Goal: Divides p (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat b)) *) (* Goal: Prime p *) (* Goal: forall _ : Divides p (Z.abs_nat b), or (Mod a Z0 p) (Mod b Z0 p) *) (* Goal: Mod a Z0 p *) elim (moddivmin a 0 p). (* Goal: Divides p (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat b)) *) (* Goal: Prime p *) (* Goal: forall _ : Divides p (Z.abs_nat b), or (Mod a Z0 p) (Mod b Z0 p) *) (* Goal: forall (_ : forall _ : Mod a Z0 p, Divides p (Z.abs_nat (Z.sub a Z0))) (_ : forall _ : Divides p (Z.abs_nat (Z.sub a Z0)), Mod a Z0 p), Mod a Z0 p *) intros. (* Goal: Divides p (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat b)) *) (* Goal: Prime p *) (* Goal: forall _ : Divides p (Z.abs_nat b), or (Mod a Z0 p) (Mod b Z0 p) *) (* Goal: Mod a Z0 p *) apply H5. (* Goal: Divides p (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat b)) *) (* Goal: Prime p *) (* Goal: forall _ : Divides p (Z.abs_nat b), or (Mod a Z0 p) (Mod b Z0 p) *) (* Goal: Divides p (Z.abs_nat (Z.sub a Z0)) *) rewrite <- Zminus_0_l_reverse. (* Goal: Divides p (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat b)) *) (* Goal: Prime p *) (* Goal: forall _ : Divides p (Z.abs_nat b), or (Mod a Z0 p) (Mod b Z0 p) *) (* Goal: Divides p (Z.abs_nat a) *) assumption. (* Goal: Divides p (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat b)) *) (* Goal: Prime p *) (* Goal: forall _ : Divides p (Z.abs_nat b), or (Mod a Z0 p) (Mod b Z0 p) *) right. (* Goal: Divides p (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat b)) *) (* Goal: Prime p *) (* Goal: Mod b Z0 p *) elim (moddivmin b 0 p). (* Goal: Divides p (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat b)) *) (* Goal: Prime p *) (* Goal: forall (_ : forall _ : Mod b Z0 p, Divides p (Z.abs_nat (Z.sub b Z0))) (_ : forall _ : Divides p (Z.abs_nat (Z.sub b Z0)), Mod b Z0 p), Mod b Z0 p *) intros. (* Goal: Divides p (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat b)) *) (* Goal: Prime p *) (* Goal: Mod b Z0 p *) apply H5. (* Goal: Divides p (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat b)) *) (* Goal: Prime p *) (* Goal: Divides p (Z.abs_nat (Z.sub b Z0)) *) rewrite <- Zminus_0_l_reverse. (* Goal: Divides p (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat b)) *) (* Goal: Prime p *) (* Goal: Divides p (Z.abs_nat b) *) assumption. (* Goal: Divides p (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat b)) *) (* Goal: Prime p *) assumption. (* Goal: Divides p (Init.Nat.mul (Z.abs_nat a) (Z.abs_nat b)) *) apply H1. (* Goal: Mod (Z.mul a b) Z0 p *) assumption. Qed. Lemma mod_not_exp_0 : forall p : nat, Prime p -> forall a : Z, ~ Mod a 0 p -> forall m : nat, ~ Mod (Exp a m) 0 p. Proof. (* Goal: forall (p : nat) (_ : Prime p) (a : Z) (_ : not (Mod a Z0 p)) (m : nat), not (Mod (Exp a m) Z0 p) *) intros p Hp a Ha. (* Goal: forall m : nat, not (Mod (Exp a m) Z0 p) *) simple induction m. (* Goal: forall (n : nat) (_ : not (Mod (Exp a n) Z0 p)), not (Mod (Exp a (S n)) Z0 p) *) (* Goal: not (Mod (Exp a O) Z0 p) *) simpl in |- *. (* Goal: forall (n : nat) (_ : not (Mod (Exp a n) Z0 p)), not (Mod (Exp a (S n)) Z0 p) *) (* Goal: not (Mod (Zpos xH) Z0 p) *) intro. (* Goal: forall (n : nat) (_ : not (Mod (Exp a n) Z0 p)), not (Mod (Exp a (S n)) Z0 p) *) (* Goal: False *) elim (mod_0not1 p). (* Goal: forall (n : nat) (_ : not (Mod (Exp a n) Z0 p)), not (Mod (Exp a (S n)) Z0 p) *) (* Goal: Mod Z0 (Zpos xH) p *) (* Goal: gt p (S O) *) elim Hp. (* Goal: forall (n : nat) (_ : not (Mod (Exp a n) Z0 p)), not (Mod (Exp a (S n)) Z0 p) *) (* Goal: Mod Z0 (Zpos xH) p *) (* Goal: forall (_ : gt p (S O)) (_ : forall (q : nat) (_ : Divides q p), or (@eq nat q (S O)) (@eq nat q p)), gt p (S O) *) intros. (* Goal: forall (n : nat) (_ : not (Mod (Exp a n) Z0 p)), not (Mod (Exp a (S n)) Z0 p) *) (* Goal: Mod Z0 (Zpos xH) p *) (* Goal: gt p (S O) *) assumption. (* Goal: forall (n : nat) (_ : not (Mod (Exp a n) Z0 p)), not (Mod (Exp a (S n)) Z0 p) *) (* Goal: Mod Z0 (Zpos xH) p *) apply mod_sym. (* Goal: forall (n : nat) (_ : not (Mod (Exp a n) Z0 p)), not (Mod (Exp a (S n)) Z0 p) *) (* Goal: Mod (Zpos xH) Z0 p *) assumption. (* Goal: forall (n : nat) (_ : not (Mod (Exp a n) Z0 p)), not (Mod (Exp a (S n)) Z0 p) *) simpl in |- *. (* Goal: forall (n : nat) (_ : not (Mod (Exp a n) Z0 p)), not (Mod (Z.mul a (Exp a n)) Z0 p) *) intros. (* Goal: not (Mod (Z.mul a (Exp a n)) Z0 p) *) intro. (* Goal: False *) elim (mod_mult_0 p a (Exp a n) Hp). (* Goal: Mod (Z.mul a (Exp a n)) Z0 p *) (* Goal: forall _ : Mod (Exp a n) Z0 p, False *) (* Goal: forall _ : Mod a Z0 p, False *) assumption. (* Goal: Mod (Z.mul a (Exp a n)) Z0 p *) (* Goal: forall _ : Mod (Exp a n) Z0 p, False *) assumption. (* Goal: Mod (Z.mul a (Exp a n)) Z0 p *) assumption. Qed. Lemma techlemma3 : forall (qlist : natlist) (a b : nat), 0 < a -> a < b -> Divides a b -> b = product qlist -> allPrime qlist -> exists qi : nat, inlist nat qi qlist /\ Divides a (multDrop qi qlist). Proof. (* Goal: forall (qlist : natlist) (a b : nat) (_ : lt O a) (_ : lt a b) (_ : Divides a b) (_ : @eq nat b (product qlist)) (_ : allPrime qlist), @ex nat (fun qi : nat => and (inlist nat qi qlist) (Divides a (multDrop qi qlist))) *) simple induction qlist. (* Goal: forall (a : nat) (l : list nat) (_ : forall (a0 b : nat) (_ : lt O a0) (_ : lt a0 b) (_ : Divides a0 b) (_ : @eq nat b (product l)) (_ : allPrime l), @ex nat (fun qi : nat => and (inlist nat qi l) (Divides a0 (multDrop qi l)))) (a0 b : nat) (_ : lt O a0) (_ : lt a0 b) (_ : Divides a0 b) (_ : @eq nat b (product (Cons nat a l))) (_ : allPrime (Cons nat a l)), @ex nat (fun qi : nat => and (inlist nat qi (Cons nat a l)) (Divides a0 (multDrop qi (Cons nat a l)))) *) (* Goal: forall (a b : nat) (_ : lt O a) (_ : lt a b) (_ : Divides a b) (_ : @eq nat b (product (Nil nat))) (_ : allPrime (Nil nat)), @ex nat (fun qi : nat => and (inlist nat qi (Nil nat)) (Divides a (multDrop qi (Nil nat)))) *) simpl in |- *. (* Goal: forall (a : nat) (l : list nat) (_ : forall (a0 b : nat) (_ : lt O a0) (_ : lt a0 b) (_ : Divides a0 b) (_ : @eq nat b (product l)) (_ : allPrime l), @ex nat (fun qi : nat => and (inlist nat qi l) (Divides a0 (multDrop qi l)))) (a0 b : nat) (_ : lt O a0) (_ : lt a0 b) (_ : Divides a0 b) (_ : @eq nat b (product (Cons nat a l))) (_ : allPrime (Cons nat a l)), @ex nat (fun qi : nat => and (inlist nat qi (Cons nat a l)) (Divides a0 (multDrop qi (Cons nat a l)))) *) (* Goal: forall (a b : nat) (_ : lt O a) (_ : lt a b) (_ : Divides a b) (_ : @eq nat b (S O)) (_ : allPrime (Nil nat)), @ex nat (fun qi : nat => and (inlist nat qi (Nil nat)) (Divides a (multDrop qi (Nil nat)))) *) intros. (* Goal: forall (a : nat) (l : list nat) (_ : forall (a0 b : nat) (_ : lt O a0) (_ : lt a0 b) (_ : Divides a0 b) (_ : @eq nat b (product l)) (_ : allPrime l), @ex nat (fun qi : nat => and (inlist nat qi l) (Divides a0 (multDrop qi l)))) (a0 b : nat) (_ : lt O a0) (_ : lt a0 b) (_ : Divides a0 b) (_ : @eq nat b (product (Cons nat a l))) (_ : allPrime (Cons nat a l)), @ex nat (fun qi : nat => and (inlist nat qi (Cons nat a l)) (Divides a0 (multDrop qi (Cons nat a l)))) *) (* Goal: @ex nat (fun qi : nat => and (inlist nat qi (Nil nat)) (Divides a (multDrop qi (Nil nat)))) *) rewrite H2 in H0. (* Goal: forall (a : nat) (l : list nat) (_ : forall (a0 b : nat) (_ : lt O a0) (_ : lt a0 b) (_ : Divides a0 b) (_ : @eq nat b (product l)) (_ : allPrime l), @ex nat (fun qi : nat => and (inlist nat qi l) (Divides a0 (multDrop qi l)))) (a0 b : nat) (_ : lt O a0) (_ : lt a0 b) (_ : Divides a0 b) (_ : @eq nat b (product (Cons nat a l))) (_ : allPrime (Cons nat a l)), @ex nat (fun qi : nat => and (inlist nat qi (Cons nat a l)) (Divides a0 (multDrop qi (Cons nat a l)))) *) (* Goal: @ex nat (fun qi : nat => and (inlist nat qi (Nil nat)) (Divides a (multDrop qi (Nil nat)))) *) elim (lt_not_le a 1). (* Goal: forall (a : nat) (l : list nat) (_ : forall (a0 b : nat) (_ : lt O a0) (_ : lt a0 b) (_ : Divides a0 b) (_ : @eq nat b (product l)) (_ : allPrime l), @ex nat (fun qi : nat => and (inlist nat qi l) (Divides a0 (multDrop qi l)))) (a0 b : nat) (_ : lt O a0) (_ : lt a0 b) (_ : Divides a0 b) (_ : @eq nat b (product (Cons nat a l))) (_ : allPrime (Cons nat a l)), @ex nat (fun qi : nat => and (inlist nat qi (Cons nat a l)) (Divides a0 (multDrop qi (Cons nat a l)))) *) (* Goal: le (S O) a *) (* Goal: lt a (S O) *) assumption. (* Goal: forall (a : nat) (l : list nat) (_ : forall (a0 b : nat) (_ : lt O a0) (_ : lt a0 b) (_ : Divides a0 b) (_ : @eq nat b (product l)) (_ : allPrime l), @ex nat (fun qi : nat => and (inlist nat qi l) (Divides a0 (multDrop qi l)))) (a0 b : nat) (_ : lt O a0) (_ : lt a0 b) (_ : Divides a0 b) (_ : @eq nat b (product (Cons nat a l))) (_ : allPrime (Cons nat a l)), @ex nat (fun qi : nat => and (inlist nat qi (Cons nat a l)) (Divides a0 (multDrop qi (Cons nat a l)))) *) (* Goal: le (S O) a *) unfold lt in H. (* Goal: forall (a : nat) (l : list nat) (_ : forall (a0 b : nat) (_ : lt O a0) (_ : lt a0 b) (_ : Divides a0 b) (_ : @eq nat b (product l)) (_ : allPrime l), @ex nat (fun qi : nat => and (inlist nat qi l) (Divides a0 (multDrop qi l)))) (a0 b : nat) (_ : lt O a0) (_ : lt a0 b) (_ : Divides a0 b) (_ : @eq nat b (product (Cons nat a l))) (_ : allPrime (Cons nat a l)), @ex nat (fun qi : nat => and (inlist nat qi (Cons nat a l)) (Divides a0 (multDrop qi (Cons nat a l)))) *) (* Goal: le (S O) a *) assumption. (* Goal: forall (a : nat) (l : list nat) (_ : forall (a0 b : nat) (_ : lt O a0) (_ : lt a0 b) (_ : Divides a0 b) (_ : @eq nat b (product l)) (_ : allPrime l), @ex nat (fun qi : nat => and (inlist nat qi l) (Divides a0 (multDrop qi l)))) (a0 b : nat) (_ : lt O a0) (_ : lt a0 b) (_ : Divides a0 b) (_ : @eq nat b (product (Cons nat a l))) (_ : allPrime (Cons nat a l)), @ex nat (fun qi : nat => and (inlist nat qi (Cons nat a l)) (Divides a0 (multDrop qi (Cons nat a l)))) *) intros qi restqs IH. (* Goal: forall (a b : nat) (_ : lt O a) (_ : lt a b) (_ : Divides a b) (_ : @eq nat b (product (Cons nat qi restqs))) (_ : allPrime (Cons nat qi restqs)), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) intros. (* Goal: @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) elim (divdec a qi). (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: forall _ : Divides qi a, @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) intro. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) elim H1. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: forall (x : nat) (_ : @eq nat b (Init.Nat.mul a x)), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) intro x. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: forall _ : @eq nat b (Init.Nat.mul a x), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) intros. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) elim H4. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: forall (x : nat) (_ : @eq nat a (Init.Nat.mul qi x)), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) intro y. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: forall _ : @eq nat a (Init.Nat.mul qi y), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) intros. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) elim (IH y (product restqs)). (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: forall (x : nat) (_ : and (inlist nat x restqs) (Divides y (multDrop x restqs))), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) intro qj. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: forall _ : and (inlist nat qj restqs) (Divides y (multDrop qj restqs)), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) intros. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) elim H7. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: forall (_ : inlist nat qj restqs) (_ : Divides y (multDrop qj restqs)), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) intros. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) split with qj. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: and (inlist nat qj (Cons nat qi restqs)) (Divides a (multDrop qj (Cons nat qi restqs))) *) split. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: Divides a (multDrop qj (Cons nat qi restqs)) *) (* Goal: inlist nat qj (Cons nat qi restqs) *) unfold inlist in |- *. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: Divides a (multDrop qj (Cons nat qi restqs)) *) (* Goal: exlist nat (fun b : nat => @eq nat qj b) (Cons nat qi restqs) *) simpl in |- *. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: Divides a (multDrop qj (Cons nat qi restqs)) *) (* Goal: or (@eq nat qj qi) (exlist nat (fun b : nat => @eq nat qj b) restqs) *) right. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: Divides a (multDrop qj (Cons nat qi restqs)) *) (* Goal: exlist nat (fun b : nat => @eq nat qj b) restqs *) assumption. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: Divides a (multDrop qj (Cons nat qi restqs)) *) rewrite H6. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) elim H9. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: forall (x : nat) (_ : @eq nat (multDrop qj restqs) (Init.Nat.mul y x)), Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) intro z. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: forall _ : @eq nat (multDrop qj restqs) (Init.Nat.mul y z), Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) intros. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) elim (eqdec qi qj). (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: forall _ : not (@eq nat qi qj), Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) (* Goal: forall _ : @eq nat qi qj, Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) intro. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: forall _ : not (@eq nat qi qj), Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) (* Goal: Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) rewrite H11. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: forall _ : not (@eq nat qi qj), Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) (* Goal: Divides (Init.Nat.mul qj y) (multDrop qj (Cons nat qj restqs)) *) rewrite multdrop_cons_eq. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: forall _ : not (@eq nat qi qj), Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) (* Goal: Divides (Init.Nat.mul qj y) (product restqs) *) rewrite <- (multdrop_mult restqs qj). (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: forall _ : not (@eq nat qi qj), Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) (* Goal: inlist nat qj restqs *) (* Goal: Divides (Init.Nat.mul qj y) (Init.Nat.mul qj (multDrop qj restqs)) *) split with z. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: forall _ : not (@eq nat qi qj), Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) (* Goal: inlist nat qj restqs *) (* Goal: @eq nat (Init.Nat.mul qj (multDrop qj restqs)) (Init.Nat.mul (Init.Nat.mul qj y) z) *) rewrite mult_assoc_reverse. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: forall _ : not (@eq nat qi qj), Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) (* Goal: inlist nat qj restqs *) (* Goal: @eq nat (Init.Nat.mul qj (multDrop qj restqs)) (Init.Nat.mul qj (Init.Nat.mul y z)) *) rewrite H10. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: forall _ : not (@eq nat qi qj), Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) (* Goal: inlist nat qj restqs *) (* Goal: @eq nat (Init.Nat.mul qj (Init.Nat.mul y z)) (Init.Nat.mul qj (Init.Nat.mul y z)) *) reflexivity. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: forall _ : not (@eq nat qi qj), Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) (* Goal: inlist nat qj restqs *) assumption. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: forall _ : not (@eq nat qi qj), Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) intro. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: Divides (Init.Nat.mul qi y) (multDrop qj (Cons nat qi restqs)) *) rewrite multdrop_cons_neq. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: not (@eq nat qj qi) *) (* Goal: Divides (Init.Nat.mul qi y) (Init.Nat.mul qi (multDrop qj restqs)) *) split with z. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: not (@eq nat qj qi) *) (* Goal: @eq nat (Init.Nat.mul qi (multDrop qj restqs)) (Init.Nat.mul (Init.Nat.mul qi y) z) *) rewrite mult_assoc_reverse. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: not (@eq nat qj qi) *) (* Goal: @eq nat (Init.Nat.mul qi (multDrop qj restqs)) (Init.Nat.mul qi (Init.Nat.mul y z)) *) rewrite H10. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: not (@eq nat qj qi) *) (* Goal: @eq nat (Init.Nat.mul qi (Init.Nat.mul y z)) (Init.Nat.mul qi (Init.Nat.mul y z)) *) reflexivity. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: not (@eq nat qj qi) *) intro. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: False *) elim H11. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: @eq nat qi qj *) rewrite H12. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) (* Goal: @eq nat qi qi *) reflexivity. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) elim (le_or_lt y 0). (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: forall _ : lt O y, lt O y *) (* Goal: forall _ : le y O, lt O y *) intro. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: forall _ : lt O y, lt O y *) (* Goal: lt O y *) elim (le_lt_or_eq y 0). (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: forall _ : lt O y, lt O y *) (* Goal: le y O *) (* Goal: forall _ : @eq nat y O, lt O y *) (* Goal: forall _ : lt y O, lt O y *) intro. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: forall _ : lt O y, lt O y *) (* Goal: le y O *) (* Goal: forall _ : @eq nat y O, lt O y *) (* Goal: lt O y *) elim (lt_n_O y). (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: forall _ : lt O y, lt O y *) (* Goal: le y O *) (* Goal: forall _ : @eq nat y O, lt O y *) (* Goal: lt y O *) assumption. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: forall _ : lt O y, lt O y *) (* Goal: le y O *) (* Goal: forall _ : @eq nat y O, lt O y *) intro. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: forall _ : lt O y, lt O y *) (* Goal: le y O *) (* Goal: lt O y *) rewrite H8 in H6. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: forall _ : lt O y, lt O y *) (* Goal: le y O *) (* Goal: lt O y *) rewrite <- mult_n_O in H6. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: forall _ : lt O y, lt O y *) (* Goal: le y O *) (* Goal: lt O y *) rewrite H6 in H. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: forall _ : lt O y, lt O y *) (* Goal: le y O *) (* Goal: lt O y *) elim (lt_n_O 0). (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: forall _ : lt O y, lt O y *) (* Goal: le y O *) (* Goal: lt O O *) assumption. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: forall _ : lt O y, lt O y *) (* Goal: le y O *) assumption. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: forall _ : lt O y, lt O y *) intro. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) (* Goal: lt O y *) assumption. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt y (product restqs) *) apply simpl_lt_mult_l with qi. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt (Init.Nat.mul qi y) (Init.Nat.mul qi (product restqs)) *) rewrite <- H6. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt a (Init.Nat.mul qi (product restqs)) *) simpl in H2. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt a (Init.Nat.mul qi (product restqs)) *) rewrite <- H2. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) (* Goal: lt a b *) assumption. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) simpl in H2. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) rewrite H5 in H2. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) rewrite H6 in H2. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: Divides y (product restqs) *) split with x. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: @eq nat (product restqs) (Init.Nat.mul y x) *) rewrite mult_assoc_reverse in H2. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: @eq nat (product restqs) (Init.Nat.mul y x) *) apply simpl_eq_mult_l with qi. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul y x)) *) (* Goal: lt O qi *) unfold allPrime in H3. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul y x)) *) (* Goal: lt O qi *) simpl in H3. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul y x)) *) (* Goal: lt O qi *) elim H3. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul y x)) *) (* Goal: forall (_ : Prime qi) (_ : alllist nat Prime restqs), lt O qi *) intros. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul y x)) *) (* Goal: lt O qi *) elim H7. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul y x)) *) (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) intros. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul y x)) *) (* Goal: lt O qi *) apply lt_trans with 1. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul y x)) *) (* Goal: lt (S O) qi *) (* Goal: lt O (S O) *) apply lt_O_Sn. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul y x)) *) (* Goal: lt (S O) qi *) assumption. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul y x)) *) symmetry in |- *. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) (* Goal: @eq nat (Init.Nat.mul qi (Init.Nat.mul y x)) (Init.Nat.mul qi (product restqs)) *) assumption. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) (* Goal: @eq nat (product restqs) (product restqs) *) reflexivity. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) unfold allPrime in H3. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) simpl in H3. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) elim H3. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: forall (_ : Prime qi) (_ : alllist nat Prime restqs), allPrime restqs *) intros. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) (* Goal: allPrime restqs *) assumption. (* Goal: forall _ : not (Divides qi a), @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) intros. (* Goal: @ex nat (fun qi0 : nat => and (inlist nat qi0 (Cons nat qi restqs)) (Divides a (multDrop qi0 (Cons nat qi restqs)))) *) split with qi. (* Goal: and (inlist nat qi (Cons nat qi restqs)) (Divides a (multDrop qi (Cons nat qi restqs))) *) split. (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) (* Goal: inlist nat qi (Cons nat qi restqs) *) unfold inlist in |- *. (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) (* Goal: exlist nat (fun b : nat => @eq nat qi b) (Cons nat qi restqs) *) simpl in |- *. (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) (* Goal: or (@eq nat qi qi) (exlist nat (fun b : nat => @eq nat qi b) restqs) *) left. (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) (* Goal: @eq nat qi qi *) elim (beq_nat_ok qi qi). (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) (* Goal: forall (_ : forall _ : @eq nat qi qi, istrue (Nat.eqb qi qi)) (_ : forall _ : istrue (Nat.eqb qi qi), @eq nat qi qi), @eq nat qi qi *) intros. (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) (* Goal: @eq nat qi qi *) reflexivity. (* Goal: Divides a (multDrop qi (Cons nat qi restqs)) *) rewrite multdrop_cons_eq. (* Goal: Divides a (product restqs) *) elim H1. (* Goal: forall (x : nat) (_ : @eq nat b (Init.Nat.mul a x)), Divides a (product restqs) *) intros. (* Goal: Divides a (product restqs) *) simpl in H2. (* Goal: Divides a (product restqs) *) unfold Divides in |- *. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) unfold allPrime in H3. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) simpl in H3. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) elim H3. (* Goal: forall (_ : Prime qi) (_ : alllist nat Prime restqs), @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) intros. (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) elim (primedivmult qi a x H6). (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: forall _ : Divides qi x, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: forall _ : Divides qi a, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) intro. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: forall _ : Divides qi x, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) elim H4. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: forall _ : Divides qi x, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) (* Goal: Divides qi a *) assumption. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: forall _ : Divides qi x, @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) intros. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) elim H8. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: forall (x0 : nat) (_ : @eq nat x (Init.Nat.mul qi x0)), @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) intro z. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: forall _ : @eq nat x (Init.Nat.mul qi z), @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) intros. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: @ex nat (fun q : nat => @eq nat (product restqs) (Init.Nat.mul a q)) *) split with z. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: @eq nat (product restqs) (Init.Nat.mul a z) *) rewrite H2 in H5. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: @eq nat (product restqs) (Init.Nat.mul a z) *) rewrite H9 in H5. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: @eq nat (product restqs) (Init.Nat.mul a z) *) rewrite (mult_assoc a qi) in H5. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: @eq nat (product restqs) (Init.Nat.mul a z) *) rewrite (mult_comm a) in H5. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: @eq nat (product restqs) (Init.Nat.mul a z) *) rewrite (mult_assoc_reverse qi a) in H5. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: @eq nat (product restqs) (Init.Nat.mul a z) *) apply simpl_eq_mult_l with qi. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: lt O qi *) elim H6. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: forall (_ : gt qi (S O)) (_ : forall (q : nat) (_ : Divides q qi), or (@eq nat q (S O)) (@eq nat q qi)), lt O qi *) intros. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: lt O qi *) apply lt_trans with 1. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: lt (S O) qi *) (* Goal: lt O (S O) *) apply lt_O_Sn. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) (* Goal: lt (S O) qi *) assumption. (* Goal: Divides qi (Init.Nat.mul a x) *) (* Goal: @eq nat (Init.Nat.mul qi (product restqs)) (Init.Nat.mul qi (Init.Nat.mul a z)) *) assumption. (* Goal: Divides qi (Init.Nat.mul a x) *) split with (product restqs). (* Goal: @eq nat (Init.Nat.mul a x) (Init.Nat.mul qi (product restqs)) *) rewrite <- H5. (* Goal: @eq nat b (Init.Nat.mul qi (product restqs)) *) assumption. Qed.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrbool ssrfun eqtype ssrnat seq choice fintype. From mathcomp Require Import div path bigop prime finset. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Delimit Scope group_scope with g. Delimit Scope Group_scope with G. Module GroupScope. Open Scope group_scope. End GroupScope. Import GroupScope. Reserved Notation "[ ~ x1 , x2 , .. , xn ]" (at level 0, format "'[ ' [ ~ x1 , '/' x2 , '/' .. , '/' xn ] ']'"). Reserved Notation "[ 1 gT ]" (at level 0, format "[ 1 gT ]"). Reserved Notation "[ 1 ]" (at level 0, format "[ 1 ]"). Reserved Notation "[ 'subg' G ]" (at level 0, format "[ 'subg' G ]"). Reserved Notation "A ^#" (at level 2, format "A ^#"). Reserved Notation "A :^ x" (at level 35, right associativity). Reserved Notation "x ^: B" (at level 35, right associativity). Reserved Notation "A :^: B" (at level 35, right associativity). Reserved Notation "#| B : A |" (at level 0, B, A at level 99, format "#| B : A |"). Reserved Notation "''N' ( A )" (at level 8, format "''N' ( A )"). Reserved Notation "''N_' G ( A )" (at level 8, G at level 2, format "''N_' G ( A )"). Reserved Notation "A <| B" (at level 70, no associativity). Reserved Notation "#[ x ]" (at level 0, format "#[ x ]"). Reserved Notation "A <*> B" (at level 40, left associativity). Reserved Notation "[ ~: A1 , A2 , .. , An ]" (at level 0, format "[ ~: '[' A1 , '/' A2 , '/' .. , '/' An ']' ]"). Reserved Notation "[ 'max' A 'of' G | gP ]" (at level 0, format "[ '[hv' 'max' A 'of' G '/ ' | gP ']' ]"). Reserved Notation "[ 'max' G | gP ]" (at level 0, format "[ '[hv' 'max' G '/ ' | gP ']' ]"). Reserved Notation "[ 'max' A 'of' G | gP & gQ ]" (at level 0, format "[ '[hv' 'max' A 'of' G '/ ' | gP '/ ' & gQ ']' ]"). Reserved Notation "[ 'max' G | gP & gQ ]" (at level 0, format "[ '[hv' 'max' G '/ ' | gP '/ ' & gQ ']' ]"). Reserved Notation "[ 'min' A 'of' G | gP ]" (at level 0, format "[ '[hv' 'min' A 'of' G '/ ' | gP ']' ]"). Reserved Notation "[ 'min' G | gP ]" (at level 0, format "[ '[hv' 'min' G '/ ' | gP ']' ]"). Reserved Notation "[ 'min' A 'of' G | gP & gQ ]" (at level 0, format "[ '[hv' 'min' A 'of' G '/ ' | gP '/ ' & gQ ']' ]"). Reserved Notation "[ 'min' G | gP & gQ ]" (at level 0, format "[ '[hv' 'min' G '/ ' | gP '/ ' & gQ ']' ]"). Module FinGroup. Record mixin_of (T : Type) : Type := BaseMixin { mul : T -> T -> T; one : T; inv : T -> T; _ : associative mul; _ : left_id one mul; _ : involutive inv; _ : {morph inv : x y / mul x y >-> mul y x} }. Structure base_type : Type := PackBase { sort : Type; _ : mixin_of sort; _ : Finite.class_of sort }. Definition arg_sort := sort. Definition mixin T := let: PackBase _ m _ := T return mixin_of (sort T) in m. Definition finClass T := let: PackBase _ _ m := T return Finite.class_of (sort T) in m. Structure type : Type := Pack { base : base_type; _ : left_inverse (one (mixin base)) (inv (mixin base)) (mul (mixin base)) }. Section Mixin. Variables (T : Type) (one : T) (mul : T -> T -> T) (inv : T -> T). Hypothesis mulA : associative mul. Hypothesis mul1 : left_id one mul. Hypothesis mulV : left_inverse one inv mul. Notation "1" := one. Infix "*" := mul. Notation "x ^-1" := (inv x). Lemma mk_invgK : involutive inv. Proof. (* Goal: @involutive T inv *) have mulV21 x: x^-1^-1 * 1 = x by rewrite -(mulV x) mulA mulV mul1. (* Goal: @involutive T inv *) by move=> x; rewrite -[_ ^-1]mulV21 -(mul1 1) mulA !mulV21. Qed. Lemma mk_invMg : {morph inv : x y / x * y >-> y * x}. Proof. (* Goal: @morphism_2 T T inv (fun x y : T => mul x y) (fun x y : T => mul y x) *) have mulxV x: x * x^-1 = 1 by rewrite -{1}[x]mk_invgK mulV. (* Goal: @morphism_2 T T inv (fun x y : T => mul x y) (fun x y : T => mul y x) *) move=> x y /=; rewrite -[y^-1 * _]mul1 -(mulV (x * y)) -2!mulA (mulA y). (* Goal: @eq T (inv (mul x y)) (mul (inv (mul x y)) (mul x (mul (mul y (inv y)) (inv x)))) *) by rewrite mulxV mul1 mulxV -(mulxV (x * y)) mulA mulV mul1. Qed. Definition Mixin := BaseMixin mulA mul1 mk_invgK mk_invMg. End Mixin. Definition pack_base T m := fun c cT & phant_id (Finite.class cT) c => @PackBase T m c. Definition clone_base T := fun bT & sort bT -> T => fun m c (bT' := @PackBase T m c) & phant_id bT' bT => bT'. Definition clone T := fun bT gT & sort bT * sort (base gT) -> T * T => fun m (gT' := @Pack bT m) & phant_id gT' gT => gT'. Section InheritedClasses. Variable bT : base_type. Local Notation T := (arg_sort bT). Local Notation rT := (sort bT). Local Notation class := (finClass bT). Canonical eqType := Equality.Pack class. Canonical choiceType := Choice.Pack class. Canonical countType := Countable.Pack class. Canonical finType := Finite.Pack class. Definition arg_eqType := Eval hnf in [eqType of T]. Definition arg_choiceType := Eval hnf in [choiceType of T]. Definition arg_countType := Eval hnf in [countType of T]. Definition arg_finType := Eval hnf in [finType of T]. End InheritedClasses. Module Import Exports. Coercion arg_sort : base_type >-> Sortclass. Coercion sort : base_type >-> Sortclass. Coercion mixin : base_type >-> mixin_of. Coercion base : type >-> base_type. Canonical eqType. Canonical choiceType. Canonical countType. Canonical finType. Coercion arg_eqType : base_type >-> Equality.type. Canonical arg_eqType. Coercion arg_choiceType : base_type >-> Choice.type. Canonical arg_choiceType. Coercion arg_countType : base_type >-> Countable.type. Canonical arg_countType. Coercion arg_finType : base_type >-> Finite.type. Canonical arg_finType. Bind Scope group_scope with sort. Bind Scope group_scope with arg_sort. Notation baseFinGroupType := base_type. Notation finGroupType := type. Notation BaseFinGroupType T m := (@pack_base T m _ _ id). Notation FinGroupType := Pack. Notation "[ 'baseFinGroupType' 'of' T ]" := (@clone_base T _ id _ _ id) (at level 0, format "[ 'baseFinGroupType' 'of' T ]") : form_scope. Notation "[ 'finGroupType' 'of' T ]" := (@clone T _ _ id _ id) (at level 0, format "[ 'finGroupType' 'of' T ]") : form_scope. End Exports. End FinGroup. Export FinGroup.Exports. Section ElementOps. Variable T : baseFinGroupType. Notation rT := (FinGroup.sort T). Definition oneg : rT := FinGroup.one T. Definition mulg : T -> T -> rT := FinGroup.mul T. Definition invg : T -> rT := FinGroup.inv T. Definition expgn_rec (x : T) n : rT := iterop n mulg x oneg. End ElementOps. Definition expgn := nosimpl expgn_rec. Notation "1" := (oneg _) : group_scope. Notation "x1 * x2" := (mulg x1 x2) : group_scope. Notation "x ^-1" := (invg x) : group_scope. Notation "x ^+ n" := (expgn x n) : group_scope. Notation "x ^- n" := (x ^+ n)^-1 : group_scope. Definition conjg (T : finGroupType) (x y : T) := y^-1 * (x * y). Notation "x1 ^ x2" := (conjg x1 x2) : group_scope. Definition commg (T : finGroupType) (x y : T) := x^-1 * x ^ y. Lemma mul1g : left_id 1 mulgT. Proof. by case: T => ? []. Qed. Proof. (* Goal: @left_id (FinGroup.sort T) (FinGroup.arg_sort T) (oneg T) (@mulg T) *) by case: T => ? []. Qed. Lemma invMg x y : (x * y)^-1 = y^-1 * x^-1. Proof. by case: T x y => ? []. Qed. Proof. (* Goal: @eq (FinGroup.sort T) (@invg T (@mulg T x y)) (@mulg T (@invg T y) (@invg T x)) *) by case: T x y => ? []. Qed. Lemma eq_invg_sym x y : (x^-1 == y) = (x == y^-1). Proof. (* Goal: @eq bool (@eq_op (FinGroup.eqType T) (@invg T x) y) (@eq_op (FinGroup.arg_eqType T) x (@invg T y)) *) by apply: (inv_eq invgK). Qed. Lemma invg1 : 1^-1 = 1 :> T. Proof. (* Goal: @eq (FinGroup.arg_sort T) (@invg T (oneg T)) (oneg T) *) by apply: invg_inj; rewrite -{1}[1^-1]mul1g invMg invgK mul1g. Qed. Lemma eq_invg1 x : (x^-1 == 1) = (x == 1). Proof. (* Goal: @eq bool (@eq_op (FinGroup.eqType T) (@invg T x) (oneg T)) (@eq_op (FinGroup.arg_eqType T) x (oneg T)) *) by rewrite eq_invg_sym invg1. Qed. Lemma mulg1 : right_id 1 mulgT. Proof. (* Goal: @right_id (FinGroup.arg_sort T) (FinGroup.sort T) (oneg T) (@mulg T) *) by move=> x; apply: invg_inj; rewrite invMg invg1 mul1g. Qed. Lemma expg0 x : x ^+ 0 = 1. Proof. by []. Qed. Proof. (* Goal: @eq (FinGroup.sort T) (@expgn T x O) (oneg T) *) by []. Qed. Lemma expgS x n : x ^+ n.+1 = x * x ^+ n. Proof. (* Goal: @eq (FinGroup.sort T) (@expgn T x (S n)) (@mulg T x (@expgn T x n)) *) by case: n => //; rewrite mulg1. Qed. Lemma expg1n n : 1 ^+ n = 1 :> T. Proof. (* Goal: @eq (FinGroup.arg_sort T) (@expgn T (oneg T) n) (oneg T) *) by elim: n => // n IHn; rewrite expgS mul1g. Qed. Lemma expgD x n m : x ^+ (n + m) = x ^+ n * x ^+ m. Proof. (* Goal: @eq (FinGroup.sort T) (@expgn T x (addn n m)) (@mulg T (@expgn T x n) (@expgn T x m)) *) by elim: n => [|n IHn]; rewrite ?mul1g // !expgS IHn mulgA. Qed. Lemma expgSr x n : x ^+ n.+1 = x ^+ n * x. Proof. (* Goal: @eq (FinGroup.sort T) (@expgn T x (S n)) (@mulg T (@expgn T x n) x) *) by rewrite -addn1 expgD expg1. Qed. Lemma expgM x n m : x ^+ (n * m) = x ^+ n ^+ m. Proof. (* Goal: @eq (FinGroup.sort T) (@expgn T x (muln n m)) (@expgn T (@expgn T x n) m) *) elim: m => [|m IHm]; first by rewrite muln0 expg0. (* Goal: @eq (FinGroup.sort T) (@expgn T x (muln n (S m))) (@expgn T (@expgn T x n) (S m)) *) by rewrite mulnS expgD IHm expgS. Qed. Lemma expgAC x m n : x ^+ m ^+ n = x ^+ n ^+ m. Proof. (* Goal: @eq (FinGroup.sort T) (@expgn T (@expgn T x m) n) (@expgn T (@expgn T x n) m) *) by rewrite -!expgM mulnC. Qed. Definition commute x y := x * y = y * x. Lemma commute_refl x : commute x x. Proof. (* Goal: commute x x *) by []. Qed. Lemma commute_sym x y : commute x y -> commute y x. Proof. (* Goal: forall _ : commute x y, commute y x *) by []. Qed. Lemma commute1 x : commute x 1. Proof. (* Goal: commute x (oneg T) *) by rewrite /commute mulg1 mul1g. Qed. Lemma commuteM x y z : commute x y -> commute x z -> commute x (y * z). Proof. (* Goal: forall (_ : commute x y) (_ : commute x z), commute x (@mulg T y z) *) by move=> cxy cxz; rewrite /commute -mulgA -cxz !mulgA cxy. Qed. Lemma commuteX x y n : commute x y -> commute x (y ^+ n). Proof. (* Goal: forall _ : commute x y, commute x (@expgn T y n) *) by move=> cxy; case: n; [apply: commute1 | elim=> // n; apply: commuteM]. Qed. Lemma commuteX2 x y m n : commute x y -> commute (x ^+ m) (y ^+ n). Proof. (* Goal: forall _ : commute x y, commute (@expgn T x m) (@expgn T y n) *) by move=> cxy; apply/commuteX/commute_sym/commuteX. Qed. Lemma expgVn x n : x^-1 ^+ n = x ^- n. Proof. (* Goal: @eq (FinGroup.sort T) (@expgn T (@invg T x) n) (@invg T (@expgn T x n)) *) by elim: n => [|n IHn]; rewrite ?invg1 // expgSr expgS invMg IHn. Qed. Lemma expgMn x y n : commute x y -> (x * y) ^+ n = x ^+ n * y ^+ n. Proof. (* Goal: forall _ : commute x y, @eq (FinGroup.sort T) (@expgn T (@mulg T x y) n) (@mulg T (@expgn T x n) (@expgn T y n)) *) move=> cxy; elim: n => [|n IHn]; first by rewrite mulg1. (* Goal: @eq (FinGroup.sort T) (@expgn T (@mulg T x y) (S n)) (@mulg T (@expgn T x (S n)) (@expgn T y (S n))) *) by rewrite !expgS IHn -mulgA (mulgA y) (commuteX _ (commute_sym cxy)) !mulgA. Qed. End PreGroupIdentities. Hint Resolve commute1 : core. Arguments invg_inj {T} [x1 x2]. Prenex Implicits commute invgK. Section GroupIdentities. Variable T : finGroupType. Implicit Types x y z : T. Local Notation mulgT := (@mulg T). Lemma mulVg : left_inverse 1 invg mulgT. Proof. (* Goal: @left_inverse (FinGroup.sort (FinGroup.base T)) (FinGroup.arg_sort (FinGroup.base T)) (FinGroup.sort (FinGroup.base T)) (oneg (FinGroup.base T)) (@invg (FinGroup.base T)) (@mulg (FinGroup.base T)) *) by case T. Qed. Lemma mulgV : right_inverse 1 invg mulgT. Proof. (* Goal: @right_inverse (FinGroup.arg_sort (FinGroup.base T)) (FinGroup.sort (FinGroup.base T)) (FinGroup.sort (FinGroup.base T)) (oneg (FinGroup.base T)) (@invg (FinGroup.base T)) (@mulg (FinGroup.base T)) *) by move=> x; rewrite -{1}(invgK x) mulVg. Qed. Lemma mulKg : left_loop invg mulgT. Proof. (* Goal: @left_loop (FinGroup.arg_sort (FinGroup.base T)) (FinGroup.arg_sort (FinGroup.base T)) (@invg (FinGroup.base T)) (@mulg (FinGroup.base T)) *) by move=> x y; rewrite mulgA mulVg mul1g. Qed. Lemma mulKVg : rev_left_loop invg mulgT. Proof. (* Goal: @rev_left_loop (FinGroup.arg_sort (FinGroup.base T)) (FinGroup.arg_sort (FinGroup.base T)) (@invg (FinGroup.base T)) (@mulg (FinGroup.base T)) *) by move=> x y; rewrite mulgA mulgV mul1g. Qed. Lemma mulgI : right_injective mulgT. Proof. (* Goal: @right_injective (FinGroup.arg_sort (FinGroup.base T)) (FinGroup.arg_sort (FinGroup.base T)) (FinGroup.sort (FinGroup.base T)) (@mulg (FinGroup.base T)) *) by move=> x; apply: can_inj (mulKg x). Qed. Lemma mulgK : right_loop invg mulgT. Proof. (* Goal: @right_loop (FinGroup.arg_sort (FinGroup.base T)) (FinGroup.arg_sort (FinGroup.base T)) (@invg (FinGroup.base T)) (@mulg (FinGroup.base T)) *) by move=> x y; rewrite -mulgA mulgV mulg1. Qed. Lemma mulgKV : rev_right_loop invg mulgT. Proof. (* Goal: @rev_right_loop (FinGroup.arg_sort (FinGroup.base T)) (FinGroup.arg_sort (FinGroup.base T)) (@invg (FinGroup.base T)) (@mulg (FinGroup.base T)) *) by move=> x y; rewrite -mulgA mulVg mulg1. Qed. Lemma mulIg : left_injective mulgT. Proof. (* Goal: @left_injective (FinGroup.arg_sort (FinGroup.base T)) (FinGroup.arg_sort (FinGroup.base T)) (FinGroup.sort (FinGroup.base T)) (@mulg (FinGroup.base T)) *) by move=> x; apply: can_inj (mulgK x). Qed. Lemma eq_invg_mul x y : (x^-1 == y :> T) = (x * y == 1 :> T). Proof. (* Goal: @eq bool (@eq_op (FinGroup.arg_eqType (FinGroup.base T)) (@invg (FinGroup.base T) x : FinGroup.arg_sort (FinGroup.base T)) (y : FinGroup.arg_sort (FinGroup.base T))) (@eq_op (FinGroup.arg_eqType (FinGroup.base T)) (@mulg (FinGroup.base T) x y : FinGroup.arg_sort (FinGroup.base T)) (oneg (FinGroup.base T) : FinGroup.arg_sort (FinGroup.base T))) *) by rewrite -(inj_eq (@mulgI x)) mulgV eq_sym. Qed. Lemma eq_mulgV1 x y : (x == y) = (x * y^-1 == 1 :> T). Proof. (* Goal: @eq bool (@eq_op (FinGroup.arg_eqType (FinGroup.base T)) x y) (@eq_op (FinGroup.arg_eqType (FinGroup.base T)) (@mulg (FinGroup.base T) x (@invg (FinGroup.base T) y) : FinGroup.arg_sort (FinGroup.base T)) (oneg (FinGroup.base T) : FinGroup.arg_sort (FinGroup.base T))) *) by rewrite -(inj_eq invg_inj) eq_invg_mul. Qed. Lemma eq_mulVg1 x y : (x == y) = (x^-1 * y == 1 :> T). Proof. (* Goal: @eq bool (@eq_op (FinGroup.arg_eqType (FinGroup.base T)) x y) (@eq_op (FinGroup.arg_eqType (FinGroup.base T)) (@mulg (FinGroup.base T) (@invg (FinGroup.base T) x) y : FinGroup.arg_sort (FinGroup.base T)) (oneg (FinGroup.base T) : FinGroup.arg_sort (FinGroup.base T))) *) by rewrite -eq_invg_mul invgK. Qed. Lemma commuteV x y : commute x y -> commute x y^-1. Proof. (* Goal: forall _ : @commute (FinGroup.base T) x y, @commute (FinGroup.base T) x (@invg (FinGroup.base T) y) *) by move=> cxy; apply: (@mulIg y); rewrite mulgKV -mulgA cxy mulKg. Qed. Lemma conjgC x y : x * y = y * x ^ y. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@mulg (FinGroup.base T) x y) (@mulg (FinGroup.base T) y (@conjg T x y)) *) by rewrite mulKVg. Qed. Lemma conjgCV x y : x * y = y ^ x^-1 * x. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@mulg (FinGroup.base T) x y) (@mulg (FinGroup.base T) (@conjg T y (@invg (FinGroup.base T) x)) x) *) by rewrite -mulgA mulgKV invgK. Qed. Lemma conjg1 x : x ^ 1 = x. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@conjg T x (oneg (FinGroup.base T))) x *) by rewrite conjgE commute1 mulKg. Qed. Lemma conj1g x : 1 ^ x = 1. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@conjg T (oneg (FinGroup.base T)) x) (oneg (FinGroup.base T)) *) by rewrite conjgE mul1g mulVg. Qed. Lemma conjMg x y z : (x * y) ^ z = x ^ z * y ^ z. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@conjg T (@mulg (FinGroup.base T) x y) z) (@mulg (FinGroup.base T) (@conjg T x z) (@conjg T y z)) *) by rewrite !conjgE !mulgA mulgK. Qed. Lemma conjgM x y z : x ^ (y * z) = (x ^ y) ^ z. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@conjg T x (@mulg (FinGroup.base T) y z)) (@conjg T (@conjg T x y) z) *) by rewrite !conjgE invMg !mulgA. Qed. Lemma conjVg x y : x^-1 ^ y = (x ^ y)^-1. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@conjg T (@invg (FinGroup.base T) x) y) (@invg (FinGroup.base T) (@conjg T x y)) *) by rewrite !conjgE !invMg invgK mulgA. Qed. Lemma conjJg x y z : (x ^ y) ^ z = (x ^ z) ^ y ^ z. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@conjg T (@conjg T x y) z) (@conjg T (@conjg T x z) (@conjg T y z)) *) by rewrite 2!conjMg conjVg. Qed. Lemma conjXg x y n : (x ^+ n) ^ y = (x ^ y) ^+ n. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@conjg T (@expgn (FinGroup.base T) x n) y) (@expgn (FinGroup.base T) (@conjg T x y) n) *) by elim: n => [|n IHn]; rewrite ?conj1g // !expgS conjMg IHn. Qed. Lemma conjgK : @right_loop T T invg conjg. Proof. (* Goal: @right_loop (FinGroup.arg_sort (FinGroup.base T)) (FinGroup.arg_sort (FinGroup.base T)) (@invg (FinGroup.base T)) (@conjg T) *) by move=> y x; rewrite -conjgM mulgV conjg1. Qed. Lemma conjgKV : @rev_right_loop T T invg conjg. Proof. (* Goal: @rev_right_loop (FinGroup.arg_sort (FinGroup.base T)) (FinGroup.arg_sort (FinGroup.base T)) (@invg (FinGroup.base T)) (@conjg T) *) by move=> y x; rewrite -conjgM mulVg conjg1. Qed. Lemma conjg_inj : @left_injective T T T conjg. Proof. (* Goal: @left_injective (FinGroup.arg_sort (FinGroup.base T)) (FinGroup.arg_sort (FinGroup.base T)) (FinGroup.arg_sort (FinGroup.base T)) (@conjg T) *) by move=> y; apply: can_inj (conjgK y). Qed. Lemma conjg_eq1 x y : (x ^ y == 1) = (x == 1). Proof. (* Goal: @eq bool (@eq_op (FinGroup.eqType (FinGroup.base T)) (@conjg T x y) (oneg (FinGroup.base T))) (@eq_op (FinGroup.arg_eqType (FinGroup.base T)) x (oneg (FinGroup.base T))) *) by rewrite (canF_eq (conjgK _)) conj1g. Qed. Lemma conjg_prod I r (P : pred I) F z : (\prod_(i <- r | P i) F i) ^ z = \prod_(i <- r | P i) (F i ^ z). Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@conjg T (@BigOp.bigop (FinGroup.sort (FinGroup.base T)) I (oneg (FinGroup.base T)) r (fun i : I => @BigBody (FinGroup.arg_sort (FinGroup.base T)) I i (@mulg (FinGroup.base T)) (P i) (F i))) z) (@BigOp.bigop (FinGroup.sort (FinGroup.base T)) I (oneg (FinGroup.base T)) r (fun i : I => @BigBody (FinGroup.arg_sort (FinGroup.base T)) I i (@mulg (FinGroup.base T)) (P i) (@conjg T (F i) z))) *) by apply: (big_morph (conjg^~ z)) => [x y|]; rewrite ?conj1g ?conjMg. Qed. Lemma commgEr x y : [~ x, y] = y^-1 ^ x * y. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@commg T x y) (@mulg (FinGroup.base T) (@conjg T (@invg (FinGroup.base T) y) x) y) *) by rewrite -!mulgA. Qed. Lemma commgC x y : x * y = y * x * [~ x, y]. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@mulg (FinGroup.base T) x y) (@mulg (FinGroup.base T) (@mulg (FinGroup.base T) y x) (@commg T x y)) *) by rewrite -mulgA !mulKVg. Qed. Lemma commgCV x y : x * y = [~ x^-1, y^-1] * (y * x). Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@mulg (FinGroup.base T) x y) (@mulg (FinGroup.base T) (@commg T (@invg (FinGroup.base T) x) (@invg (FinGroup.base T) y)) (@mulg (FinGroup.base T) y x)) *) by rewrite commgEl !mulgA !invgK !mulgKV. Qed. Lemma conjRg x y z : [~ x, y] ^ z = [~ x ^ z, y ^ z]. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@conjg T (@commg T x y) z) (@commg T (@conjg T x z) (@conjg T y z)) *) by rewrite !conjMg !conjVg. Qed. Lemma invg_comm x y : [~ x, y]^-1 = [~ y, x]. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@invg (FinGroup.base T) (@commg T x y)) (@commg T y x) *) by rewrite commgEr conjVg invMg invgK. Qed. Lemma commgP x y : reflect (commute x y) ([~ x, y] == 1 :> T). Proof. (* Goal: Bool.reflect (@commute (FinGroup.base T) x y) (@eq_op (FinGroup.arg_eqType (FinGroup.base T)) (@commg T x y : FinGroup.arg_sort (FinGroup.base T)) (oneg (FinGroup.base T) : FinGroup.arg_sort (FinGroup.base T))) *) by rewrite [[~ x, y]]mulgA -invMg -eq_mulVg1 eq_sym; apply: eqP. Qed. Lemma conjg_fixP x y : reflect (x ^ y = x) ([~ x, y] == 1 :> T). Proof. (* Goal: Bool.reflect (@eq (FinGroup.sort (FinGroup.base T)) (@conjg T x y) x) (@eq_op (FinGroup.arg_eqType (FinGroup.base T)) (@commg T x y : FinGroup.arg_sort (FinGroup.base T)) (oneg (FinGroup.base T) : FinGroup.arg_sort (FinGroup.base T))) *) by rewrite -eq_mulVg1 eq_sym; apply: eqP. Qed. Lemma commg1_sym x y : ([~ x, y] == 1 :> T) = ([~ y, x] == 1 :> T). Proof. (* Goal: @eq bool (@eq_op (FinGroup.arg_eqType (FinGroup.base T)) (@commg T x y : FinGroup.arg_sort (FinGroup.base T)) (oneg (FinGroup.base T) : FinGroup.arg_sort (FinGroup.base T))) (@eq_op (FinGroup.arg_eqType (FinGroup.base T)) (@commg T y x : FinGroup.arg_sort (FinGroup.base T)) (oneg (FinGroup.base T) : FinGroup.arg_sort (FinGroup.base T))) *) by rewrite -invg_comm (inv_eq invgK) invg1. Qed. Lemma commg1 x : [~ x, 1] = 1. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@commg T x (oneg (FinGroup.base T))) (oneg (FinGroup.base T)) *) exact/eqP/commgP. Qed. Lemma comm1g x : [~ 1, x] = 1. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@commg T (oneg (FinGroup.base T)) x) (oneg (FinGroup.base T)) *) by rewrite -invg_comm commg1 invg1. Qed. Lemma commgg x : [~ x, x] = 1. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@commg T x x) (oneg (FinGroup.base T)) *) exact/eqP/commgP. Qed. Lemma commgXg x n : [~ x, x ^+ n] = 1. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@commg T x (@expgn (FinGroup.base T) x n)) (oneg (FinGroup.base T)) *) exact/eqP/commgP/commuteX. Qed. Lemma commgVg x : [~ x, x^-1] = 1. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@commg T x (@invg (FinGroup.base T) x)) (oneg (FinGroup.base T)) *) exact/eqP/commgP/commuteV. Qed. Lemma commgXVg x n : [~ x, x ^- n] = 1. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base T)) (@commg T x (@invg (FinGroup.base T) (@expgn (FinGroup.base T) x n))) (oneg (FinGroup.base T)) *) exact/eqP/commgP/commuteV/commuteX. Qed. End GroupIdentities. Hint Rewrite mulg1 mul1g invg1 mulVg mulgV (@invgK) mulgK mulgKV invMg mulgA : gsimpl. Ltac gsimpl := autorewrite with gsimpl; try done. Definition gsimp := (mulg1 , mul1g, (invg1, @invgK), (mulgV, mulVg)). Definition gnorm := (gsimp, (mulgK, mulgKV, (mulgA, invMg))). Arguments mulgI [T]. Arguments mulIg [T]. Arguments conjg_inj {T} x [x1 x2]. Arguments commgP {T x y}. Arguments conjg_fixP {T x y}. Section Repr. Variable gT : baseFinGroupType. Implicit Type A : {set gT}. Definition repr A := if 1 \in A then 1 else odflt 1 [pick x in A]. Lemma mem_repr A x : x \in A -> repr A \in A. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType gT)) x (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A))), is_true (@in_mem (FinGroup.sort gT) (repr A) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A))) *) by rewrite /repr; case: ifP => // _; case: pickP => // A0; rewrite [x \in A]A0. Qed. Lemma card_mem_repr A : #|A| > 0 -> repr A \in A. Proof. (* Goal: forall _ : is_true (leq (S O) (@card (FinGroup.arg_finType gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A)))), is_true (@in_mem (FinGroup.sort gT) (repr A) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A))) *) by rewrite lt0n => /existsP[x]; apply: mem_repr. Qed. Lemma repr_set1 x : repr [set x] = x. Proof. (* Goal: @eq (FinGroup.sort gT) (repr (@set1 (FinGroup.arg_finType gT) x)) x *) by apply/set1P/card_mem_repr; rewrite cards1. Qed. Lemma repr_set0 : repr set0 = 1. Proof. (* Goal: @eq (FinGroup.sort gT) (repr (@set0 (FinGroup.arg_finType gT))) (oneg gT) *) by rewrite /repr; case: pickP => [x|_]; rewrite !inE. Qed. End Repr. Arguments mem_repr [gT A]. Section BaseSetMulDef. Variable gT : baseFinGroupType. Implicit Types A B : {set gT}. Definition set_mulg A B := mulg @2: (A, B). Definition set_invg A := invg @^-1: A. Lemma set_mul1g : left_id [set 1] set_mulg. Proof. (* Goal: @left_id (@set_of (FinGroup.finType gT) (Phant (Finite.sort (FinGroup.finType gT)))) (@set_of (FinGroup.arg_finType gT) (Phant (FinGroup.arg_sort gT))) (@set1 (FinGroup.finType gT) (oneg gT)) set_mulg *) move=> A; apply/setP=> y; apply/imset2P/idP=> [[_ x /set1P-> Ax ->] | Ay]. (* Goal: @imset2_spec (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (@mulg gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@set1 (FinGroup.finType gT) (oneg gT)))) (fun _ : Finite.sort (FinGroup.arg_finType gT) => @mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A)) y *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType gT)) (@mulg gT (oneg gT) x) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A))) *) by rewrite mul1g. (* Goal: @imset2_spec (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (@mulg gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@set1 (FinGroup.finType gT) (oneg gT)))) (fun _ : Finite.sort (FinGroup.arg_finType gT) => @mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A)) y *) by exists (1 : gT) y; rewrite ?(set11, mul1g). Qed. Lemma set_mulgA : associative set_mulg. Proof. (* Goal: @associative (@set_of (FinGroup.arg_finType gT) (Phant (FinGroup.arg_sort gT))) set_mulg *) move=> A B C; apply/setP=> y. (* Goal: @eq bool (@in_mem (Finite.sort (FinGroup.arg_finType gT)) y (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (set_mulg A (set_mulg B C))))) (@in_mem (Finite.sort (FinGroup.arg_finType gT)) y (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (set_mulg (set_mulg A B) C)))) *) apply/imset2P/imset2P=> [[x1 z Ax1 /imset2P[x2 x3 Bx2 Cx3 ->] ->]| [z x3]]. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType gT)) z (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (set_mulg A B))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType gT)) x3 (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) C)))) (_ : @eq (Finite.sort (FinGroup.arg_finType gT)) y (@mulg gT z x3)), @imset2_spec (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (@mulg gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A)) (fun _ : Finite.sort (FinGroup.arg_finType gT) => @mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (set_mulg B C))) y *) (* Goal: @imset2_spec (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (@mulg gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (set_mulg A B))) (fun _ : Finite.sort (FinGroup.arg_finType gT) => @mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) C)) (@mulg gT x1 (@mulg gT x2 x3)) *) by exists (x1 * x2) x3; rewrite ?mulgA //; apply/imset2P; exists x1 x2. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType gT)) z (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (set_mulg A B))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType gT)) x3 (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) C)))) (_ : @eq (Finite.sort (FinGroup.arg_finType gT)) y (@mulg gT z x3)), @imset2_spec (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (@mulg gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A)) (fun _ : Finite.sort (FinGroup.arg_finType gT) => @mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (set_mulg B C))) y *) case/imset2P=> x1 x2 Ax1 Bx2 -> Cx3 ->. (* Goal: @imset2_spec (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (@mulg gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A)) (fun _ : Finite.sort (FinGroup.arg_finType gT) => @mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (set_mulg B C))) (@mulg gT (@mulg gT x1 x2) x3) *) by exists x1 (x2 * x3); rewrite ?mulgA //; apply/imset2P; exists x2 x3. Qed. Lemma set_invgK : involutive set_invg. Proof. (* Goal: @involutive (@set_of (FinGroup.arg_finType gT) (Phant (FinGroup.arg_sort gT))) set_invg *) by move=> A; apply/setP=> x; rewrite !inE invgK. Qed. Lemma set_invgM : {morph set_invg : A B / set_mulg A B >-> set_mulg B A}. Proof. (* Goal: @morphism_2 (@set_of (FinGroup.arg_finType gT) (Phant (FinGroup.arg_sort gT))) (@set_of (FinGroup.arg_finType gT) (Phant (Finite.sort (FinGroup.arg_finType gT)))) set_invg (fun A B : @set_of (FinGroup.arg_finType gT) (Phant (FinGroup.arg_sort gT)) => set_mulg A B) (fun A B : @set_of (FinGroup.arg_finType gT) (Phant (Finite.sort (FinGroup.arg_finType gT))) => set_mulg B A) *) move=> A B; apply/setP=> z; rewrite inE. (* Goal: @eq bool (@in_mem (FinGroup.sort gT) (@invg gT z) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (set_mulg A B)))) (@in_mem (Finite.sort (FinGroup.arg_finType gT)) z (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (set_mulg (set_invg B) (set_invg A))))) *) apply/imset2P/imset2P=> [[x y Ax By /(canRL invgK)->] | [y x]]. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType gT)) y (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (set_invg B))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType gT)) x (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (set_invg A))))) (_ : @eq (Finite.sort (FinGroup.arg_finType gT)) z (@mulg gT y x)), @imset2_spec (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (FinGroup.finType gT) (@mulg gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A)) (fun _ : Finite.sort (FinGroup.arg_finType gT) => @mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) B)) (@invg gT z) *) (* Goal: @imset2_spec (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (@mulg gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (set_invg B))) (fun _ : Finite.sort (FinGroup.arg_finType gT) => @mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (set_invg A))) (@invg gT (@mulg gT x y)) *) by exists y^-1 x^-1; rewrite ?invMg // inE invgK. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType gT)) y (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (set_invg B))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType gT)) x (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (set_invg A))))) (_ : @eq (Finite.sort (FinGroup.arg_finType gT)) z (@mulg gT y x)), @imset2_spec (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (FinGroup.finType gT) (@mulg gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A)) (fun _ : Finite.sort (FinGroup.arg_finType gT) => @mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) B)) (@invg gT z) *) by rewrite !inE => By1 Ax1 ->; exists x^-1 y^-1; rewrite ?invMg. Qed. Definition group_set_baseGroupMixin : FinGroup.mixin_of (set_type gT) := FinGroup.BaseMixin set_mulgA set_mul1g set_invgK set_invgM. Canonical group_set_baseGroupType := Eval hnf in BaseFinGroupType (set_type gT) group_set_baseGroupMixin. Canonical group_set_of_baseGroupType := Eval hnf in [baseFinGroupType of {set gT}]. End BaseSetMulDef. Module GroupSet. Definition sort (gT : baseFinGroupType) := {set gT}. End GroupSet. Identity Coercion GroupSet_of_sort : GroupSet.sort >-> set_of. Module Type GroupSetBaseGroupSig. Definition sort gT := group_set_of_baseGroupType gT : Type. End GroupSetBaseGroupSig. Module MakeGroupSetBaseGroup (Gset_base : GroupSetBaseGroupSig). Identity Coercion of_sort : Gset_base.sort >-> FinGroup.arg_sort. End MakeGroupSetBaseGroup. Module Export GroupSetBaseGroup := MakeGroupSetBaseGroup GroupSet. Canonical group_set_eqType gT := Eval hnf in [eqType of GroupSet.sort gT]. Canonical group_set_choiceType gT := Eval hnf in [choiceType of GroupSet.sort gT]. Canonical group_set_countType gT := Eval hnf in [countType of GroupSet.sort gT]. Canonical group_set_finType gT := Eval hnf in [finType of GroupSet.sort gT]. Section GroupSetMulDef. Variable gT : finGroupType. Implicit Types A B : {set gT}. Implicit Type x y : gT. Definition lcoset A x := mulg x @: A. Definition rcoset A x := mulg^~ x @: A. Definition lcosets A B := lcoset A @: B. Definition rcosets A B := rcoset A @: B. Definition indexg B A := #|rcosets A B|. Definition conjugate A x := conjg^~ x @: A. Definition conjugates A B := conjugate A @: B. Definition class x B := conjg x @: B. Definition classes A := class^~ A @: A. Definition class_support A B := conjg @2: (A, B). Definition commg_set A B := commg @2: (A, B). Definition normaliser A := [set x | conjugate A x \subset A]. Definition centraliser A := \bigcap_(x in A) normaliser [set x]. Definition abelian A := A \subset centraliser A. Definition normal A B := (A \subset B) && (B \subset normaliser A). Definition normalised A := forall x, conjugate A x = A. Definition centralises x A := forall y, y \in A -> commute x y. Definition centralised A := forall x, centralises x A. End GroupSetMulDef. Arguments lcoset _ _%g _%g. Arguments rcoset _ _%g _%g. Arguments rcosets _ _%g _%g. Arguments lcosets _ _%g _%g. Arguments indexg _ _%g _%g. Arguments conjugate _ _%g _%g. Arguments conjugates _ _%g _%g. Arguments class _ _%g _%g. Arguments classes _ _%g. Arguments class_support _ _%g _%g. Arguments commg_set _ _%g _%g. Arguments normaliser _ _%g. Arguments centraliser _ _%g. Arguments abelian _ _%g. Arguments normal _ _%g _%g. Arguments normalised _ _%g. Arguments centralises _ _%g _%g. Arguments centralised _ _%g. Notation "[ 1 gT ]" := (1 : {set gT}) : group_scope. Notation "[ 1 ]" := [1 FinGroup.sort _] : group_scope. Notation "A ^#" := (A :\ 1) : group_scope. Notation "x *: A" := ([set x%g] * A) : group_scope. Notation "A :* x" := (A * [set x%g]) : group_scope. Notation "A :^ x" := (conjugate A x) : group_scope. Notation "x ^: B" := (class x B) : group_scope. Notation "A :^: B" := (conjugates A B) : group_scope. Notation "#| B : A |" := (indexg B A) : group_scope. Notation "''N' ( A )" := (normaliser A) : group_scope. Notation "''N_' G ( A )" := (G%g :&: 'N(A)) : group_scope. Notation "A <| B" := (normal A B) : group_scope. Notation "''C' ( A )" := (centraliser A) : group_scope. Notation "''C_' G ( A )" := (G%g :&: 'C(A)) : group_scope. Notation "''C_' ( G ) ( A )" := 'C_G(A) (only parsing) : group_scope. Notation "''C' [ x ]" := 'N([set x%g]) : group_scope. Notation "''C_' G [ x ]" := 'N_G([set x%g]) : group_scope. Notation "''C_' ( G ) [ x ]" := 'C_G[x] (only parsing) : group_scope. Prenex Implicits repr lcoset rcoset lcosets rcosets normal. Prenex Implicits conjugate conjugates class classes class_support. Prenex Implicits commg_set normalised centralised abelian. Section BaseSetMulProp. Variable gT : baseFinGroupType. Implicit Types A B C D : {set gT}. Implicit Type x y z : gT. Lemma mulsgP A B x : reflect (imset2_spec mulg (mem A) (fun _ => mem B) x) (x \in A * B). Proof. (* Goal: Bool.reflect (@imset2_spec (FinGroup.arg_finType gT) (FinGroup.arg_finType gT) (FinGroup.finType gT) (@mulg gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A)) (fun _ : Finite.sort (FinGroup.arg_finType gT) => @mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) B)) x) (@in_mem (FinGroup.arg_sort gT) x (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@mulg (group_set_of_baseGroupType gT) A B)))) *) exact: imset2P. Qed. Lemma mem_mulg A B x y : x \in A -> y \in B -> x * y \in A * B. Proof. (* Goal: forall (_ : is_true (@in_mem (FinGroup.arg_sort gT) x (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A)))) (_ : is_true (@in_mem (FinGroup.arg_sort gT) y (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) B)))), is_true (@in_mem (FinGroup.sort gT) (@mulg gT x y) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@mulg (group_set_of_baseGroupType gT) A B)))) *) by move=> Ax By; apply/mulsgP; exists x y. Qed. Lemma prodsgP (I : finType) (P : pred I) (A : I -> {set gT}) x : reflect (exists2 c, forall i, P i -> c i \in A i & x = \prod_(i | P i) c i) (x \in \prod_(i | P i) A i). Lemma mem_prodg (I : finType) (P : pred I) (A : I -> {set gT}) c : (forall i, P i -> c i \in A i) -> \prod_(i | P i) c i \in \prod_(i | P i) A i. Proof. (* Goal: forall _ : forall (i : Finite.sort I) (_ : is_true (P i)), is_true (@in_mem (Finite.sort (FinGroup.arg_finType gT)) (c i) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (A i)))), is_true (@in_mem (FinGroup.sort gT) (@BigOp.bigop (FinGroup.sort gT) (Finite.sort I) (oneg gT) (index_enum I) (fun i : Finite.sort I => @BigBody (FinGroup.arg_sort gT) (Finite.sort I) i (@mulg gT) (P i) (c i))) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType gT)) (Finite.sort I) (oneg (group_set_of_baseGroupType gT)) (index_enum I) (fun i : Finite.sort I => @BigBody (FinGroup.arg_sort (group_set_of_baseGroupType gT)) (Finite.sort I) i (@mulg (group_set_of_baseGroupType gT)) (P i) (A i)))))) *) by move=> Ac; apply/prodsgP; exists c. Qed. Lemma mulSg A B C : A \subset B -> A * C \subset B * C. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A)) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) B))), is_true (@subset (FinGroup.arg_finType gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@mulg (group_set_of_baseGroupType gT) A C))) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@mulg (group_set_of_baseGroupType gT) B C)))) *) exact: imset2Sl. Qed. Lemma mulgS A B C : B \subset C -> A * B \subset A * C. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) B)) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) C))), is_true (@subset (FinGroup.arg_finType gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@mulg (group_set_of_baseGroupType gT) A B))) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@mulg (group_set_of_baseGroupType gT) A C)))) *) exact: imset2Sr. Qed. Lemma mulgSS A B C D : A \subset B -> C \subset D -> A * C \subset B * D. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A)) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) B)))) (_ : is_true (@subset (FinGroup.arg_finType gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) C)) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) D)))), is_true (@subset (FinGroup.arg_finType gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@mulg (group_set_of_baseGroupType gT) A C))) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@mulg (group_set_of_baseGroupType gT) B D)))) *) exact: imset2S. Qed. Lemma mulg_subl A B : 1 \in B -> A \subset A * B. Proof. (* Goal: forall _ : is_true (@in_mem (FinGroup.sort gT) (oneg gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) B))), is_true (@subset (FinGroup.arg_finType gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A)) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@mulg (group_set_of_baseGroupType gT) A B)))) *) by move=> B1; rewrite -{1}(mulg1 A) mulgS ?sub1set. Qed. Lemma mulg_subr A B : 1 \in A -> B \subset A * B. Proof. (* Goal: forall _ : is_true (@in_mem (FinGroup.sort gT) (oneg gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A))), is_true (@subset (FinGroup.arg_finType gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) B)) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@mulg (group_set_of_baseGroupType gT) A B)))) *) by move=> A1; rewrite -{1}(mul1g B) mulSg ?sub1set. Qed. Lemma mulUg A B C : (A :|: B) * C = (A * C) :|: (B * C). Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType gT)) (@mulg (group_set_of_baseGroupType gT) (@setU (FinGroup.arg_finType gT) A B) C) (@setU (FinGroup.arg_finType gT) (@mulg (group_set_of_baseGroupType gT) A C) (@mulg (group_set_of_baseGroupType gT) B C)) *) exact: imset2Ul. Qed. Lemma mulgU A B C : A * (B :|: C) = (A * B) :|: (A * C). Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType gT)) (@mulg (group_set_of_baseGroupType gT) A (@setU (FinGroup.arg_finType gT) B C)) (@setU (FinGroup.arg_finType gT) (@mulg (group_set_of_baseGroupType gT) A B) (@mulg (group_set_of_baseGroupType gT) A C)) *) exact: imset2Ur. Qed. Lemma invUg A B : (A :|: B)^-1 = A^-1 :|: B^-1. Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType gT)) (@invg (group_set_of_baseGroupType gT) (@setU (FinGroup.arg_finType gT) A B)) (@setU (FinGroup.arg_finType gT) (@invg (group_set_of_baseGroupType gT) A) (@invg (group_set_of_baseGroupType gT) B)) *) exact: preimsetU. Qed. Lemma invIg A B : (A :&: B)^-1 = A^-1 :&: B^-1. Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType gT)) (@invg (group_set_of_baseGroupType gT) (@setI (FinGroup.arg_finType gT) A B)) (@setI (FinGroup.arg_finType gT) (@invg (group_set_of_baseGroupType gT) A) (@invg (group_set_of_baseGroupType gT) B)) *) exact: preimsetI. Qed. Lemma invDg A B : (A :\: B)^-1 = A^-1 :\: B^-1. Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType gT)) (@invg (group_set_of_baseGroupType gT) (@setD (FinGroup.arg_finType gT) A B)) (@setD (FinGroup.arg_finType gT) (@invg (group_set_of_baseGroupType gT) A) (@invg (group_set_of_baseGroupType gT) B)) *) exact: preimsetD. Qed. Lemma invCg A : (~: A)^-1 = ~: A^-1. Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType gT)) (@invg (group_set_of_baseGroupType gT) (@setC (FinGroup.arg_finType gT) A)) (@setC (FinGroup.arg_finType gT) (@invg (group_set_of_baseGroupType gT) A)) *) exact: preimsetC. Qed. Lemma invSg A B : (A^-1 \subset B^-1) = (A \subset B). Proof. (* Goal: @eq bool (@subset (FinGroup.arg_finType gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@invg (group_set_of_baseGroupType gT) A))) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@invg (group_set_of_baseGroupType gT) B)))) (@subset (FinGroup.arg_finType gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A)) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) B))) *) by rewrite !(sameP setIidPl eqP) -invIg (inj_eq invg_inj). Qed. Lemma mem_invg x A : (x \in A^-1) = (x^-1 \in A). Proof. (* Goal: @eq bool (@in_mem (FinGroup.arg_sort gT) x (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@invg (group_set_of_baseGroupType gT) A)))) (@in_mem (FinGroup.sort gT) (@invg gT x) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A))) *) by rewrite inE. Qed. Lemma memV_invg x A : (x^-1 \in A^-1) = (x \in A). Proof. (* Goal: @eq bool (@in_mem (FinGroup.sort gT) (@invg gT x) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@invg (group_set_of_baseGroupType gT) A)))) (@in_mem (FinGroup.arg_sort gT) x (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A))) *) by rewrite inE invgK. Qed. Lemma card_invg A : #|A^-1| = #|A|. Proof. (* Goal: @eq nat (@card (FinGroup.arg_finType gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) (@invg (group_set_of_baseGroupType gT) A)))) (@card (FinGroup.arg_finType gT) (@mem (Finite.sort (FinGroup.arg_finType gT)) (predPredType (Finite.sort (FinGroup.arg_finType gT))) (@SetDef.pred_of_set (FinGroup.arg_finType gT) A))) *) exact/card_preimset/invg_inj. Qed. Lemma set1gP x : reflect (x = 1) (x \in [1]). Proof. (* Goal: Bool.reflect (@eq (FinGroup.arg_sort gT) x (oneg gT)) (@in_mem (FinGroup.arg_sort gT) x (@mem (Finite.sort (FinGroup.finType gT)) (predPredType (Finite.sort (FinGroup.finType gT))) (@SetDef.pred_of_set (FinGroup.finType gT) (oneg (group_set_of_baseGroupType gT) : @set_of (FinGroup.finType gT) (Phant (FinGroup.sort gT)))))) *) exact: set1P. Qed. Lemma mulg_set1 x y : [set x] :* y = [set x * y]. Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType gT)) (@mulg (group_set_of_baseGroupType gT) (@set1 (FinGroup.arg_finType gT) x) (@set1 (FinGroup.arg_finType gT) y)) (@set1 (FinGroup.finType gT) (@mulg gT x y)) *) by rewrite [_ * _]imset2_set1l imset_set1. Qed. Lemma invg_set1 x : [set x]^-1 = [set x^-1]. Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType gT)) (@invg (group_set_of_baseGroupType gT) (@set1 (FinGroup.arg_finType gT) x)) (@set1 (FinGroup.finType gT) (@invg gT x)) *) by apply/setP=> y; rewrite !inE inv_eq //; apply: invgK. Qed. End BaseSetMulProp. Arguments set1gP {gT x}. Arguments mulsgP {gT A B x}. Arguments prodsgP {gT I P A x}. Section GroupSetMulProp. Variable gT : finGroupType. Implicit Types A B C D : {set gT}. Implicit Type x y z : gT. Lemma lcosetE A x : lcoset A x = x *: A. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@lcoset gT A x) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) A) *) by rewrite [_ * _]imset2_set1l. Qed. Lemma card_lcoset A x : #|x *: A| = #|A|. Proof. (* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) 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))) *) by rewrite -lcosetE (card_imset _ (mulgI _)). Qed. Lemma mem_lcoset A x y : (y \in x *: A) = (x^-1 * y \in A). Proof. (* Goal: @eq 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) A)))) (@in_mem (FinGroup.sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@invg (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)) A))) *) by rewrite -lcosetE [_ x](can_imset_pre _ (mulKg _)) inE. Qed. Lemma lcosetP A x y : reflect (exists2 a, a \in A & y = x * a) (y \in x *: A). Proof. (* Goal: Bool.reflect (@ex2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun a : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => is_true (@in_mem (Finite.sort (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)) A)))) (fun a : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (FinGroup.arg_sort (FinGroup.base gT)) y (@mulg (FinGroup.base gT) x a))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) A)))) *) by rewrite -lcosetE; apply: imsetP. Qed. Lemma lcosetsP A B C : reflect (exists2 x, x \in B & C = x *: A) (C \in lcosets A B). Proof. (* Goal: Bool.reflect (@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)) B)))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) C (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) A))) (@in_mem (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) C (@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))) (@lcosets gT A B)))) *) by apply: (iffP imsetP) => [] [x Bx ->]; exists x; rewrite ?lcosetE. Qed. Lemma lcosetM A x y : (x * y) *: A = x *: (y *: A). Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.finType (FinGroup.base gT)) (@mulg (FinGroup.base gT) x y)) A) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y) A)) *) by rewrite -mulg_set1 mulgA. Qed. Lemma lcoset1 A : 1 *: A = A. Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT))) A) A *) exact: mul1g. Qed. Lemma lcosetK : left_loop invg (fun x A => x *: A). Proof. (* Goal: @left_loop (FinGroup.arg_sort (FinGroup.base gT)) (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@invg (FinGroup.base gT)) (fun (x : FinGroup.arg_sort (FinGroup.base gT)) (A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) A) *) by move=> x A; rewrite -lcosetM mulVg mul1g. Qed. Lemma lcosetKV : rev_left_loop invg (fun x A => x *: A). Proof. (* Goal: @rev_left_loop (FinGroup.arg_sort (FinGroup.base gT)) (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@invg (FinGroup.base gT)) (fun (x : FinGroup.arg_sort (FinGroup.base gT)) (A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) A) *) by move=> x A; rewrite -lcosetM mulgV mul1g. Qed. Lemma lcoset_inj : right_injective (fun x A => x *: A). Proof. (* Goal: @right_injective (FinGroup.arg_sort (FinGroup.base gT)) (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (fun (x : FinGroup.arg_sort (FinGroup.base gT)) (A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) A) *) by move=> x; apply: can_inj (lcosetK x). Qed. Lemma lcosetS x A B : (x *: A \subset x *: B) = (A \subset B). 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) 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)) 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))) *) apply/idP/idP=> sAB; last exact: mulgS. (* 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)) 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 rewrite -(lcosetK x A) -(lcosetK x B) mulgS. Qed. Lemma sub_lcoset x A B : (A \subset x *: B) = (x^-1 *: A \subset B). 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.finType (FinGroup.base gT)) (@invg (FinGroup.base gT) x)) 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 rewrite -(lcosetS x^-1) lcosetK. Qed. Lemma sub_lcosetV x A B : (A \subset x^-1 *: B) = (x *: A \subset B). 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.finType (FinGroup.base gT)) (@invg (FinGroup.base gT) x)) 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) 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 rewrite sub_lcoset invgK. Qed. Lemma rcosetE A x : rcoset A x = A :* x. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@rcoset gT A x) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) *) by rewrite [_ * _]imset2_set1r. Qed. Lemma card_rcoset A x : #|A :* x| = #|A|. Proof. (* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@set1 (FinGroup.arg_finType (FinGroup.base 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)) A))) *) by rewrite -rcosetE (card_imset _ (mulIg _)). Qed. Lemma mem_rcoset A x y : (y \in A :* x) = (y * x^-1 \in A). Proof. (* Goal: @eq 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) y (@invg (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 -rcosetE [_ x](can_imset_pre A (mulgK _)) inE. Qed. Lemma rcosetP A x y : reflect (exists2 a, a \in A & y = a * x) (y \in A :* x). Proof. (* Goal: Bool.reflect (@ex2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun a : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => is_true (@in_mem (Finite.sort (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)) A)))) (fun a : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (FinGroup.arg_sort (FinGroup.base gT)) y (@mulg (FinGroup.base gT) a x))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))))) *) by rewrite -rcosetE; apply: imsetP. Qed. Lemma rcosetsP A B C : reflect (exists2 x, x \in B & C = A :* x) (C \in rcosets A B). Proof. (* Goal: Bool.reflect (@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)) B)))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) C (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) (@in_mem (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) C (@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))) (@rcosets gT A B)))) *) by apply: (iffP imsetP) => [] [x Bx ->]; exists x; rewrite ?rcosetE. Qed. Lemma rcosetM A x y : A :* (x * y) = A :* x :* y. Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@set1 (FinGroup.finType (FinGroup.base gT)) (@mulg (FinGroup.base gT) x y))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y)) *) by rewrite -mulg_set1 mulgA. Qed. Lemma rcoset1 A : A :* 1 = A. Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))) A *) exact: mulg1. Qed. Lemma rcosetK : right_loop invg (fun A x => A :* x). Proof. (* Goal: @right_loop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (@invg (FinGroup.base gT)) (fun (A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (x : FinGroup.arg_sort (FinGroup.base gT)) => @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) *) by move=> x A; rewrite -rcosetM mulgV mulg1. Qed. Lemma rcosetKV : rev_right_loop invg (fun A x => A :* x). Proof. (* Goal: @rev_right_loop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (@invg (FinGroup.base gT)) (fun (A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (x : FinGroup.arg_sort (FinGroup.base gT)) => @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) *) by move=> x A; rewrite -rcosetM mulVg mulg1. Qed. Lemma rcoset_inj : left_injective (fun A x => A :* x). Proof. (* Goal: @left_injective (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (fun (A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (x : FinGroup.arg_sort (FinGroup.base gT)) => @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) *) by move=> x; apply: can_inj (rcosetK x). Qed. Lemma rcosetS x A B : (A :* x \subset B :* x) = (A \subset B). 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@set1 (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)) B (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))))) (@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))) *) apply/idP/idP=> sAB; last exact: mulSg. (* 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)) 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 rewrite -(rcosetK x A) -(rcosetK x B) mulSg. Qed. Lemma sub_rcoset x A B : (A \subset B :* x) = (A :* x ^-1 \subset B). 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) B (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@set1 (FinGroup.finType (FinGroup.base gT)) (@invg (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)) B))) *) by rewrite -(rcosetS x^-1) rcosetK. Qed. Lemma sub_rcosetV x A B : (A \subset B :* x^-1) = (A :* x \subset B). 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) B (@set1 (FinGroup.finType (FinGroup.base gT)) (@invg (FinGroup.base gT) x)))))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@set1 (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)) B))) *) by rewrite sub_rcoset invgK. Qed. Lemma invg_lcosets A B : (lcosets A B)^-1 = rcosets A^-1 B^-1. Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (group_set_of_baseGroupType (FinGroup.base gT)))) (@invg (group_set_of_baseGroupType (group_set_of_baseGroupType (FinGroup.base gT))) (@lcosets gT A B)) (@rcosets gT (@invg (group_set_of_baseGroupType (FinGroup.base gT)) A) (@invg (group_set_of_baseGroupType (FinGroup.base gT)) B)) *) rewrite /A^-1/= -![_^-1](can_imset_pre _ invgK) -[RHS]imset_comp -imset_comp. (* Goal: @eq (@set_of (FinGroup.arg_finType (group_set_of_baseGroupType (FinGroup.base gT))) (Phant (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (group_set_of_baseGroupType (FinGroup.base gT))) (@funcomp (Finite.sort (FinGroup.arg_finType (group_set_of_baseGroupType (FinGroup.base gT)))) (Finite.sort (FinGroup.arg_finType (group_set_of_baseGroupType (FinGroup.base gT)))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) tt (@invg (group_set_of_baseGroupType (FinGroup.base gT))) (@lcoset 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))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@funcomp (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) tt (@rcoset gT (@set_invg (FinGroup.base gT) A)) (@invg (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.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 apply: eq_imset => x /=; rewrite lcosetE rcosetE invMg invg_set1. Qed. Lemma conjg_preim A x : A :^ x = (conjg^~ x^-1) @^-1: A. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT A x) (@preimset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (fun x0 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @conjg gT x0 (@invg (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))) *) exact: can_imset_pre (conjgK _). Qed. Lemma mem_conjg A x y : (y \in A :^ x) = (y ^ x^-1 \in A). Proof. (* Goal: @eq bool (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) y (@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)) (@conjugate gT A x)))) (@in_mem (FinGroup.sort (FinGroup.base gT)) (@conjg gT y (@invg (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 conjg_preim inE. Qed. Lemma mem_conjgV A x y : (y \in A :^ x^-1) = (y ^ x \in A). Proof. (* Goal: @eq bool (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) y (@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)) (@conjugate gT A (@invg (FinGroup.base gT) x))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) (@conjg gT y 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 mem_conjg invgK. Qed. Lemma memJ_conjg A x y : (y ^ x \in A :^ x) = (y \in A). Proof. (* Goal: @eq bool (@in_mem (FinGroup.sort (FinGroup.base gT)) (@conjg gT y 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)) (@conjugate gT A x)))) (@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)) A))) *) by rewrite mem_conjg conjgK. Qed. Lemma conjsgE A x : A :^ x = x^-1 *: (A :* x). Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT A x) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.finType (FinGroup.base gT)) (@invg (FinGroup.base gT) x)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) *) by apply/setP=> y; rewrite mem_lcoset mem_rcoset -mulgA mem_conjg. Qed. Lemma conjsg1 A : A :^ 1 = A. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT A (oneg (FinGroup.base gT))) A *) by rewrite conjsgE invg1 mul1g mulg1. Qed. Lemma conjsgM A x y : A :^ (x * y) = (A :^ x) :^ y. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT A (@mulg (FinGroup.base gT) x y)) (@conjugate gT (@conjugate gT A x) y) *) by rewrite !conjsgE invMg -!mulg_set1 !mulgA. Qed. Lemma conjsgK : @right_loop _ gT invg conjugate. Proof. (* Goal: @right_loop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (@invg (FinGroup.base gT)) (@conjugate gT) *) by move=> x A; rewrite -conjsgM mulgV conjsg1. Qed. Lemma conjsgKV : @rev_right_loop _ gT invg conjugate. Proof. (* Goal: @rev_right_loop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (@invg (FinGroup.base gT)) (@conjugate gT) *) by move=> x A; rewrite -conjsgM mulVg conjsg1. Qed. Lemma conjsg_inj : @left_injective _ gT _ conjugate. Proof. (* Goal: @left_injective (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT) *) by move=> x; apply: can_inj (conjsgK x). Qed. Lemma cardJg A x : #|A :^ x| = #|A|. 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)) (@conjugate gT A 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)) A))) *) by rewrite (card_imset _ (conjg_inj x)). Qed. Lemma conjSg A B x : (A :^ x \subset B :^ x) = (A \subset B). 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)) (@conjugate gT A 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)) (@conjugate gT B x)))) (@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 rewrite !conjsgE lcosetS rcosetS. Qed. Lemma properJ A B x : (A :^ x \proper B :^ x) = (A \proper B). Proof. (* Goal: @eq bool (@proper (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)) (@conjugate gT A 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)) (@conjugate gT B x)))) (@proper (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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 rewrite /proper !conjSg. Qed. Lemma sub_conjg A B x : (A :^ x \subset B) = (A \subset B :^ x^-1). 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)) (@conjugate 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)) 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)) 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)) (@conjugate gT B (@invg (FinGroup.base gT) x))))) *) by rewrite -(conjSg A _ x) conjsgKV. Qed. Lemma sub_conjgV A B x : (A :^ x^-1 \subset B) = (A \subset B :^ x). 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)) (@conjugate gT A (@invg (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)) 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)) 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)) (@conjugate gT B x)))) *) by rewrite -(conjSg _ B x) conjsgKV. Qed. Lemma conjg_set1 x y : [set x] :^ y = [set x ^ y]. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) y) (@set1 (FinGroup.finType (FinGroup.base gT)) (@conjg gT x y)) *) by rewrite [_ :^ _]imset_set1. Qed. Lemma conjs1g x : 1 :^ x = 1. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (oneg (group_set_of_baseGroupType (FinGroup.base gT))) x) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) by rewrite conjg_set1 conj1g. Qed. Lemma conjsg_eq1 A x : (A :^ x == 1%g) = (A == 1%g). Proof. (* Goal: @eq bool (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base gT))) (@conjugate gT A x) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) A (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) by rewrite (canF_eq (conjsgK x)) conjs1g. Qed. Lemma conjsMg A B x : (A * B) :^ x = A :^ x * B :^ x. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) x) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@conjugate gT A x) (@conjugate gT B x)) *) by rewrite !conjsgE !mulgA rcosetK. Qed. Lemma conjIg A B x : (A :&: B) :^ x = A :^ x :&: B :^ x. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) A B) x) (@setI (FinGroup.finType (FinGroup.base gT)) (@conjugate gT A x) (@conjugate gT B x)) *) by rewrite !conjg_preim preimsetI. Qed. Lemma conj0g x : set0 :^ x = set0. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@set0 (FinGroup.arg_finType (FinGroup.base gT))) x) (@set0 (FinGroup.finType (FinGroup.base gT))) *) exact: imset0. Qed. Lemma conjTg x : [set: gT] :^ x = [set: gT]. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) x) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) *) by rewrite conjg_preim preimsetT. Qed. Lemma bigcapJ I r (P : pred I) (B : I -> {set gT}) x : \bigcap_(i <- r | P i) (B i :^ x) = (\bigcap_(i <- r | P i) B i) :^ x. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@BigOp.bigop (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) I (@setTfor (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) r (fun i : I => @BigBody (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) I i (@setI (FinGroup.finType (FinGroup.base gT))) (P i) (@conjugate gT (B i) x))) (@conjugate gT (@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) (B i))) x) *) by rewrite (big_endo (conjugate^~ x)) => // [B1 B2|]; rewrite (conjTg, conjIg). Qed. Lemma conjUg A B x : (A :|: B) :^ x = A :^ x :|: B :^ x. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@setU (FinGroup.arg_finType (FinGroup.base gT)) A B) x) (@setU (FinGroup.finType (FinGroup.base gT)) (@conjugate gT A x) (@conjugate gT B x)) *) by rewrite !conjg_preim preimsetU. Qed. Lemma bigcupJ I r (P : pred I) (B : I -> {set gT}) x : \bigcup_(i <- r | P i) (B i :^ x) = (\bigcup_(i <- r | P i) B i) :^ x. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@BigOp.bigop (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) I (@set0 (FinGroup.finType (FinGroup.base gT))) r (fun i : I => @BigBody (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) I i (@setU (FinGroup.finType (FinGroup.base gT))) (P i) (@conjugate gT (B i) x))) (@conjugate gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) I (@set0 (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 (@setU (FinGroup.arg_finType (FinGroup.base gT))) (P i) (B i))) x) *) rewrite (big_endo (conjugate^~ x)) => // [B1 B2|]; first by rewrite conjUg. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@conjugate gT (@set0 (FinGroup.arg_finType (FinGroup.base gT))) x) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) *) exact: imset0. Qed. Lemma conjCg A x : (~: A) :^ x = ~: A :^ x. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@setC (FinGroup.arg_finType (FinGroup.base gT)) A) x) (@setC (FinGroup.finType (FinGroup.base gT)) (@conjugate gT A x)) *) by rewrite !conjg_preim preimsetC. Qed. Lemma conjDg A B x : (A :\: B) :^ x = A :^ x :\: B :^ x. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) A B) x) (@setD (FinGroup.finType (FinGroup.base gT)) (@conjugate gT A x) (@conjugate gT B x)) *) by rewrite !setDE !(conjCg, conjIg). Qed. Lemma conjD1g A x : A^# :^ x = (A :^ x)^#. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))) x) (@setD (FinGroup.finType (FinGroup.base gT)) (@conjugate gT A x) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))) *) by rewrite conjDg conjs1g. Qed. Lemma memJ_class x y A : y \in A -> x ^ y \in x ^: A. Proof. (* Goal: forall _ : is_true (@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)) A))), is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@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 A)))) *) exact: mem_imset. Qed. Lemma classS x A B : A \subset B -> x ^: A \subset x ^: 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 (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 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)) (@class gT x B)))) *) exact: imsetS. Qed. Lemma class_set1 x y : x ^: [set y] = [set x ^ y]. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class gT x (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y)) (@set1 (FinGroup.finType (FinGroup.base gT)) (@conjg gT x y)) *) exact: imset_set1. Qed. Lemma class1g x A : x \in A -> 1 ^: 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 (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class gT (oneg (FinGroup.base gT)) A) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) move=> Ax; apply/setP=> y. (* Goal: @eq bool (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) y (@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 (oneg (FinGroup.base gT)) A)))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) y (@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 apply/imsetP/set1P=> [[a Aa]|] ->; last exists x; rewrite ?conj1g. Qed. Lemma classVg x A : x^-1 ^: A = (x ^: A)^-1. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class gT (@invg (FinGroup.base gT) x) A) (@invg (group_set_of_baseGroupType (FinGroup.base gT)) (@class gT x A)) *) apply/setP=> xy; rewrite inE; apply/imsetP/imsetP=> [] [y Ay def_xy]. (* 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 (FinGroup.finType (FinGroup.base gT))) xy (@conjg gT (@invg (FinGroup.base gT) x) x0)) *) (* 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 (FinGroup.finType (FinGroup.base gT))) (@invg (FinGroup.base gT) xy) (@conjg gT x x0)) *) by rewrite def_xy conjVg invgK; exists y. (* 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 (FinGroup.finType (FinGroup.base gT))) xy (@conjg gT (@invg (FinGroup.base gT) x) x0)) *) by rewrite -[xy]invgK def_xy -conjVg; exists y. Qed. Lemma mem_classes x A : x \in A -> x ^: A \in classes 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 (@in_mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class gT x A) (@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 A)))) *) exact: mem_imset. Qed. Lemma memJ_class_support A B x y : x \in A -> y \in B -> x ^ y \in class_support A B. 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 (@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)) B)))), is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@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_support gT A B)))) *) by move=> Ax By; apply: mem_imset2. Qed. Lemma class_supportM A B C : class_support A (B * C) = class_support (class_support A B) C. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class_support gT A (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C)) (@class_support gT (@class_support gT A B) C) *) apply/setP=> x; apply/imset2P/imset2P=> [[a y Aa] | [y c]]. (* 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)) (@class_support gT A B))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) c (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) C)))) (_ : @eq (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@conjg gT y c)), @imset2_spec (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@conjg gT) (@mem (Finite.sort (FinGroup.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 _ : 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C))) x *) (* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C))))) (_ : @eq (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@conjg gT a y)), @imset2_spec (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@conjg gT) (@mem (Finite.sort (FinGroup.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 B))) (fun _ : 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)) C)) x *) case/mulsgP=> b c Bb Cc -> ->{x 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)) (@class_support gT A B))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) c (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) C)))) (_ : @eq (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@conjg gT y c)), @imset2_spec (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@conjg gT) (@mem (Finite.sort (FinGroup.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 _ : 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C))) x *) (* Goal: @imset2_spec (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@conjg gT) (@mem (Finite.sort (FinGroup.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 B))) (fun _ : 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)) C)) (@conjg gT a (@mulg (FinGroup.base gT) b c)) *) by exists (a ^ b) c; rewrite ?(mem_imset2, conjgM). (* 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)) (@class_support gT A B))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) c (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) C)))) (_ : @eq (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@conjg gT y c)), @imset2_spec (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@conjg gT) (@mem (Finite.sort (FinGroup.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 _ : 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C))) x *) case/imset2P=> a b Aa Bb -> Cc ->{x y}. (* Goal: @imset2_spec (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@conjg gT) (@mem (Finite.sort (FinGroup.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 _ : 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C))) (@conjg gT (@conjg gT a b) c) *) by exists a (b * c); rewrite ?(mem_mulg, conjgM). Qed. Lemma class_support_set1l A x : class_support [set x] A = x ^: A. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class_support gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) A) (@class gT x A) *) exact: imset2_set1l. Qed. Lemma class_support_set1r A x : class_support A [set x] = A :^ x. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class_support gT A (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@conjugate gT A x) *) exact: imset2_set1r. Qed. Lemma classM x A B : x ^: (A * B) = class_support (x ^: A) B. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class gT x (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B)) (@class_support gT (@class gT x A) B) *) by rewrite -!class_support_set1l class_supportM. Qed. Lemma class_lcoset x y A : x ^: (y *: A) = (x ^ y) ^: A. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class gT x (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y) A)) (@class gT (@conjg gT x y) A) *) by rewrite classM class_set1 class_support_set1l. Qed. Lemma class_rcoset x A y : x ^: (A :* y) = (x ^: A) :^ y. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class gT x (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@conjugate gT (@class gT x A) y) *) by rewrite -class_support_set1r classM. Qed. Lemma conjugatesS A B C : B \subset C -> A :^: B \subset A :^: C. 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)) C))), is_true (@subset (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))) (@conjugates gT A B))) (@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))) (@conjugates gT A C)))) *) exact: imsetS. Qed. Lemma conjugates_set1 A x : A :^: [set x] = [set A :^ x]. Proof. (* Goal: @eq (@set_of (set_of_finType (FinGroup.finType (FinGroup.base gT))) (Phant (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))))) (@conjugates gT A (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@set1 (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@conjugate gT A x)) *) exact: imset_set1. Qed. Lemma conjugates_conj A x B : (A :^ x) :^: B = A :^: (x *: B). Proof. (* Goal: @eq (@set_of (set_of_finType (FinGroup.finType (FinGroup.base gT))) (Phant (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))))) (@conjugates gT (@conjugate gT A x) B) (@conjugates gT A (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) B)) *) rewrite /conjugates [x *: B]imset2_set1l -imset_comp. (* Goal: @eq (@set_of (set_of_finType (FinGroup.finType (FinGroup.base gT))) (Phant (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@conjugate gT (@conjugate 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)) B))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@funcomp (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) tt (@conjugate gT A) (@mulg (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)) B))) *) by apply: eq_imset => y /=; rewrite conjsgM. Qed. Lemma class_supportEl A B : class_support A B = \bigcup_(x in A) x ^: B. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class_support gT A B) (@BigOp.bigop (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@set0 (FinGroup.finType (FinGroup.base gT))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@setU (FinGroup.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)) A))) (@class gT x B))) *) exact: curry_imset2l. Qed. Lemma class_supportEr A B : class_support A B = \bigcup_(x in B) A :^ x. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class_support gT A B) (@BigOp.bigop (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@set0 (FinGroup.finType (FinGroup.base gT))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@setU (FinGroup.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)) B))) (@conjugate gT A x))) *) exact: curry_imset2r. Qed. Definition group_set A := (1 \in A) && (A * A \subset A). Lemma group_setP A : reflect (1 \in A /\ {in A & A, forall x y, x * y \in A}) (group_set A). Proof. (* Goal: Bool.reflect (and (is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (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)) A)))) (@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)) 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)) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => is_true (@in_mem (FinGroup.sort (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)) A)))) (inPhantom (forall x y : FinGroup.arg_sort (FinGroup.base gT), is_true (@in_mem (FinGroup.sort (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)) A))))))) (group_set A) *) apply: (iffP andP) => [] [A1 AM]; split=> {A1}//. (* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A 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))) *) (* 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)) 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)) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => is_true (@in_mem (FinGroup.sort (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)) A)))) (inPhantom (forall x y : FinGroup.arg_sort (FinGroup.base gT), is_true (@in_mem (FinGroup.sort (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)) A))))) *) by move=> x y Ax Ay; apply: (subsetP AM); rewrite mem_mulg. (* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A 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 apply/subsetP=> _ /mulsgP[x y Ax Ay ->]; apply: AM. Qed. Structure group_type : Type := Group { gval :> GroupSet.sort gT; _ : group_set gval }. Definition group_of of phant gT : predArgType := group_type. Local Notation groupT := (group_of (Phant gT)). Identity Coercion type_of_group : group_of >-> group_type. Canonical group_subType := Eval hnf in [subType for gval]. Definition group_eqMixin := Eval hnf in [eqMixin of group_type by <:]. Canonical group_eqType := Eval hnf in EqType group_type group_eqMixin. Definition group_choiceMixin := [choiceMixin of group_type by <:]. Canonical group_choiceType := Eval hnf in ChoiceType group_type group_choiceMixin. Definition group_countMixin := [countMixin of group_type by <:]. Canonical group_countType := Eval hnf in CountType group_type group_countMixin. Canonical group_subCountType := Eval hnf in [subCountType of group_type]. Definition group_finMixin := [finMixin of group_type by <:]. Canonical group_finType := Eval hnf in FinType group_type group_finMixin. Canonical group_subFinType := Eval hnf in [subFinType of group_type]. Canonical group_of_subType := Eval hnf in [subType of groupT]. Canonical group_of_eqType := Eval hnf in [eqType of groupT]. Canonical group_of_choiceType := Eval hnf in [choiceType of groupT]. Canonical group_of_countType := Eval hnf in [countType of groupT]. Canonical group_of_subCountType := Eval hnf in [subCountType of groupT]. Canonical group_of_finType := Eval hnf in [finType of groupT]. Canonical group_of_subFinType := Eval hnf in [subFinType of groupT]. Definition group (A : {set gT}) gA : groupT := @Group A gA. Definition clone_group G := let: Group _ gP := G return {type of Group for G} -> groupT in fun k => k gP. Lemma group_inj : injective gval. Proof. exact: val_inj. Qed. Proof. (* Goal: @injective (GroupSet.sort (FinGroup.base gT)) group_type gval *) exact: val_inj. Qed. Lemma congr_group (H K : groupT) : H = K -> H :=: K. Proof. (* Goal: forall _ : @eq (group_of (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H K, @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (gval H) (gval K) *) exact: congr1. Qed. Lemma isgroupP A : reflect (exists G : groupT, A = G) (group_set A). Proof. (* Goal: Bool.reflect (@ex (group_of (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G : group_of (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) A (gval G))) (group_set A) *) by apply: (iffP idP) => [gA | [[B gB] -> //]]; exists (Group gA). Qed. Lemma group_set_one : group_set 1. Proof. (* Goal: is_true (group_set (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) by rewrite /group_set set11 mulg1 subxx. Qed. Canonical one_group := group group_set_one. Canonical set1_group := @group [set 1] group_set_one. Lemma group_setT (phT : phant gT) : group_set (setTfor phT). Proof. (* Goal: is_true (group_set (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) phT)) *) by apply/group_setP; split=> [|x y _ _]; rewrite inE. Qed. Canonical setT_group phT := group (group_setT phT). Definition generated A := \bigcap_(G : groupT | A \subset G) G. Definition gcore A B := \bigcap_(x in B) A :^ x. Definition joing A B := generated (A :|: B). Definition commutator A B := generated (commg_set A B). Definition cycle x := generated [set x]. Definition order x := #|cycle x|. Lemma group1 : 1 \in G. Proof. by case/group_setP: (valP G). Qed. Proof. (* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (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)))) *) by case/group_setP: (valP G). Qed. Lemma group1_class2 : 1 \in Gcl. Proof. by []. Qed. Proof. (* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (oneg (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) : pred (FinGroup.sort (FinGroup.base gT))))) *) by []. Qed. Lemma group1_eqType : (1 : gT : eqType) \in G. Proof. by []. Qed. Proof. (* Goal: is_true (@in_mem (Equality.sort (FinGroup.arg_eqType (FinGroup.base gT) : Equality.type)) (oneg (FinGroup.base gT) : Equality.sort (FinGroup.arg_eqType (FinGroup.base gT) : Equality.type)) (@mem (Finite.sort (FinGroup.arg_finType (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 []. Qed. Lemma group1_contra x : x \notin G -> x != 1. Proof. (* Goal: forall _ : is_true (negb (@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)))) *) by apply: contraNneq => ->. Qed. Lemma subG1 : (G \subset [1]) = (G :==: 1). 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.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))))))) (@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)))))) *) by rewrite eqEsubset sub1G andbT. Qed. Lemma setI1g : 1 :&: G = 1. Proof. exact: (setIidPl sub1G). Qed. Proof. (* 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)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) exact: (setIidPl sub1G). Qed. Lemma subG1_contra H : G \subset H -> G :!=: 1 -> H :!=: 1. 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 (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)))))))), is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H : @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 move=> sGH; rewrite -subG1; apply: contraNneq => <-. Qed. Lemma cardG_gt0 : 0 < #|G|. Proof. (* Goal: is_true (leq (S O) (@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 rewrite lt0n; apply/existsP; exists (1 : gT). Qed. Definition cardG_gt0_reduced : 0 < card (@mem gT (predPredType gT) G) := cardG_gt0. Lemma indexg_gt0 A : 0 < #|G : A|. Proof. (* Goal: is_true (leq (S O) (@indexg gT (@gval gT G) A)) *) rewrite lt0n; apply/existsP; exists A. (* Goal: is_true (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@rcosets gT A (@gval gT G)) A) *) by rewrite -{2}[A]mulg1 -rcosetE; apply: mem_imset. Qed. Lemma trivgP : reflect (G :=: 1) (G \subset [1]). Proof. (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT G) (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.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 rewrite subG1; apply: eqP. Qed. Lemma trivGP : reflect (G = 1%G) (G \subset [1]). Proof. (* Goal: Bool.reflect (@eq (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) G (one_group 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.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 rewrite subG1; apply: eqP. Qed. Lemma proper1G : ([1] \proper G) = (G :!=: 1). Proof. (* Goal: @eq bool (@proper (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)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) (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))))))) *) by rewrite properEneq sub1G andbT eq_sym. Qed. Lemma trivgPn : reflect (exists2 x, x \in G & x != 1) (G :!=: 1). Proof. (* Goal: Bool.reflect (@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 (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) x (oneg (FinGroup.base gT)))))) (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))))))) *) rewrite -subG1. (* Goal: Bool.reflect (@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 (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) x (oneg (FinGroup.base gT)))))) (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 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))))))) *) by apply: (iffP subsetPn) => [] [x Gx x1]; exists x; rewrite ?inE in x1 *. Qed. Qed. Lemma trivg_card_le1 : (G :==: 1) = (#|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)))))) (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)))) (S O)) *) by rewrite eq_sym eqEcard cards1 sub1G. Qed. Lemma trivg_card1 : (G :==: 1) = (#|G| == 1%N). 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)))))) (@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 G)))) (S O)) *) by rewrite trivg_card_le1 eqn_leq cardG_gt0 andbT. Qed. Lemma cardG_gt1 : (#|G| > 1) = (G :!=: 1). Proof. (* Goal: @eq bool (leq (S (S O)) (@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))))) (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))))))) *) by rewrite trivg_card_le1 ltnNge. Qed. Lemma card_le1_trivg : #|G| <= 1 -> G :=: 1. Proof. (* 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)))) (S O)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) by rewrite -trivg_card_le1; move/eqP. Qed. Lemma card1_trivg : #|G| = 1%N -> G :=: 1. Proof. (* Goal: forall _ : @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)))) (S O), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) by move=> G1; rewrite card_le1_trivg ?G1. Qed. Lemma mulG_subl A : A \subset A * 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)) 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@gval gT G))))) *) exact: mulg_subl group1. Qed. Lemma mulG_subr A : A \subset G * A. 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)) 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) A)))) *) exact: mulg_subr group1. Qed. Lemma mulGid : G * G = G. Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT G)) (@gval gT G) *) by apply/eqP; rewrite eqEsubset mulG_subr andbT; case/andP: (valP G). Qed. Lemma mulGS A B : (G * A \subset G * B) = (A \subset G * B). Lemma mulSG A B : (A * G \subset B * G) = (A \subset B * G). Lemma mul_subG A B : A \subset G -> B \subset G -> A * B \subset 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)) 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))))) (_ : 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)) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A 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)))) *) by move=> sAG sBG; rewrite -mulGid mulgSS. Qed. Lemma groupM x y : x \in G -> y \in G -> x * y \in G. 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)) (@gval gT G))))) (_ : is_true (@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 G))))), is_true (@in_mem (FinGroup.sort (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)))) *) by case/group_setP: (valP G) x y. Qed. Lemma groupX x n : x \in G -> x ^+ n \in G. 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)) (@gval gT G)))), is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base 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)))) *) by move=> Gx; elim: n => [|n IHn]; rewrite ?group1 // expgS groupM. Qed. Lemma groupVr x : x \in G -> x^-1 \in G. 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)) (@gval gT G)))), is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@invg (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)))) *) move=> Gx; rewrite -(mul1g x^-1) -mem_rcoset ((G :* x =P G) _) //. (* Goal: is_true (@eq_op (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@gval gT G)) *) by rewrite eqEcard card_rcoset leqnn mul_subG ?sub1set. Qed. Lemma groupVl x : x^-1 \in G -> x \in G. Proof. (* Goal: forall _ : is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@invg (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 (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)))) *) by move/groupVr; rewrite invgK. Qed. Lemma groupV x : (x^-1 \in G) = (x \in G). Proof. (* Goal: @eq bool (@in_mem (FinGroup.sort (FinGroup.base gT)) (@invg (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)))) (@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)))) *) by apply/idP/idP; [apply: groupVl | apply: groupVr]. Qed. Lemma groupMl x y : x \in G -> (x * y \in G) = (y \in G). 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)) (@gval gT G)))), @eq bool (@in_mem (FinGroup.sort (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)))) (@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 G)))) *) move=> Gx; apply/idP/idP=> [Gxy|]; last exact: groupM. (* Goal: is_true (@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 G)))) *) by rewrite -(mulKg x y) groupM ?groupVr. Qed. Lemma groupMr x y : x \in G -> (y * x \in G) = (y \in G). 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)) (@gval gT G)))), @eq bool (@in_mem (FinGroup.sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) y 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 (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 G)))) *) by move=> Gx; rewrite -[_ \in G]groupV invMg groupMl groupV. Qed. Definition in_group := (group1, groupV, (groupMl, groupX)). Lemma groupJ x y : x \in G -> y \in G -> x ^ y \in G. 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)) (@gval gT G))))) (_ : is_true (@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 G))))), is_true (@in_mem (FinGroup.sort (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)) (@gval gT G)))) *) by move=> Gx Gy; rewrite !in_group. Qed. Lemma groupJr x y : y \in G -> (x ^ y \in G) = (x \in G). Proof. (* Goal: forall _ : is_true (@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 G)))), @eq bool (@in_mem (FinGroup.sort (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)) (@gval gT G)))) (@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)))) *) by move=> Gy; rewrite groupMl (groupMr, groupV). Qed. Lemma groupR x y : x \in G -> y \in G -> [~ x, y] \in G. 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)) (@gval gT G))))) (_ : is_true (@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 G))))), is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@commg 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)))) *) by move=> Gx Gy; rewrite !in_group. Qed. Lemma group_prod I r (P : pred I) F : (forall i, P i -> F i \in G) -> \prod_(i <- r | P i) F i \in G. Proof. (* Goal: forall _ : forall (i : I) (_ : is_true (P i)), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (F 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)))), is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) I (oneg (FinGroup.base gT)) r (fun i : I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) I i (@mulg (FinGroup.base gT)) (P i) (F 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=> G_P; elim/big_ind: _ => //; apply: groupM. Qed. Lemma inv_subG A : (A^-1 \subset G) = (A \subset G). 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)) (@invg (group_set_of_baseGroupType (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)))) (@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)))) *) by rewrite -{1}invGid invSg. Qed. Lemma invg_lcoset x : (x *: G)^-1 = G :* x^-1. Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@invg (group_set_of_baseGroupType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@gval gT G))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.finType (FinGroup.base gT)) (@invg (FinGroup.base gT) x))) *) by rewrite invMg invGid invg_set1. Qed. Lemma invg_rcoset x : (G :* x)^-1 = x^-1 *: G. Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@invg (group_set_of_baseGroupType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.finType (FinGroup.base gT)) (@invg (FinGroup.base gT) x)) (@gval gT G)) *) by rewrite invMg invGid invg_set1. Qed. Lemma memV_lcosetV x y : (y^-1 \in x^-1 *: G) = (y \in G :* x). Proof. (* Goal: @eq bool (@in_mem (FinGroup.sort (FinGroup.base gT)) (@invg (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)) (@set1 (FinGroup.finType (FinGroup.base gT)) (@invg (FinGroup.base gT) x)) (@gval gT G))))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))))) *) by rewrite -invg_rcoset memV_invg. Qed. Lemma memV_rcosetV x y : (y^-1 \in G :* x^-1) = (y \in x *: G). Proof. (* Goal: @eq bool (@in_mem (FinGroup.sort (FinGroup.base gT)) (@invg (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 G) (@set1 (FinGroup.finType (FinGroup.base gT)) (@invg (FinGroup.base gT) x)))))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@gval gT G))))) *) by rewrite -invg_lcoset memV_invg. Qed. Lemma mulSgGid A x : x \in A -> A \subset G -> A * G = G. 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 (@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 (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@gval gT G)) (@gval gT G) *) move=> Ax sAG; apply/eqP; rewrite eqEsubset -{2}mulGid mulSg //=. (* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@gval gT G))))) *) apply/subsetP=> y Gy; rewrite -(mulKVg x y) mem_mulg // groupMr // groupV. (* 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)))) *) exact: (subsetP sAG). Qed. Lemma mulGSgid A x : x \in A -> A \subset G -> G * A = G. 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 (@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 (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) A) (@gval gT G) *) rewrite -memV_invg -invSg invGid => Ax sAG. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) A) (@gval gT G) *) by apply: invg_inj; rewrite invMg invGid (mulSgGid Ax). Qed. Lemma lcoset_refl x : x \in x *: G. Proof. (* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@gval gT G))))) *) by rewrite mem_lcoset mulVg group1. Qed. Lemma lcoset_sym x y : (x \in y *: G) = (y \in x *: G). Proof. (* Goal: @eq 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y) (@gval gT G))))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@gval gT G))))) *) by rewrite !mem_lcoset -groupV invMg invgK. Qed. Lemma lcoset_eqP {x y} : reflect (x *: G = y *: G) (x \in y *: G). Proof. (* Goal: Bool.reflect (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@gval gT G)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y) (@gval gT G))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y) (@gval gT G))))) *) suffices <-: (x *: G == y *: G) = (x \in y *: G) by apply: eqP. (* Goal: @eq bool (@eq_op (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@gval gT G)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y) (@gval gT G))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y) (@gval gT G))))) *) by rewrite eqEsubset !mulSG !sub1set lcoset_sym andbb. Qed. Lemma lcoset_transl x y z : x \in y *: G -> (x \in z *: G) = (y \in z *: G). 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y) (@gval gT G))))), @eq 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) z) (@gval gT G))))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) z) (@gval gT G))))) *) by move=> Gyx; rewrite -2!(lcoset_sym z) (lcoset_eqP Gyx). Qed. Lemma lcoset_trans x y z : x \in y *: G -> y \in z *: G -> x \in z *: G. 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y) (@gval gT G)))))) (_ : is_true (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) z) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) z) (@gval gT G))))) *) by move/lcoset_transl->. Qed. Lemma lcoset_id x : x \in G -> x *: G = G. 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)) (@gval gT G)))), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@gval gT G)) (@gval gT G) *) by move=> Gx; rewrite (lcoset_eqP (_ : x \in 1 *: G)) mul1g. Qed. Lemma rcoset_refl x : x \in G :* x. Proof. (* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))))) *) by rewrite mem_rcoset mulgV group1. Qed. Lemma rcoset_sym x y : (x \in G :* y) = (y \in G :* x). Proof. (* Goal: @eq 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))))) *) by rewrite -!memV_lcosetV lcoset_sym. Qed. Lemma rcoset_eqP {x y} : reflect (G :* x = G :* y) (x \in G :* y). Proof. (* Goal: Bool.reflect (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))))) *) suffices <-: (G :* x == G :* y) = (x \in G :* y) by apply: eqP. (* Goal: @eq bool (@eq_op (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))))) *) by rewrite eqEsubset !mulGS !sub1set rcoset_sym andbb. Qed. Lemma rcoset_transl x y z : x \in G :* y -> (x \in G :* z) = (y \in G :* z). 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))))), @eq 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) z))))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) z))))) *) by move=> Gyx; rewrite -2!(rcoset_sym z) (rcoset_eqP Gyx). Qed. Lemma rcoset_trans x y z : x \in G :* y -> y \in G :* z -> x \in G :* z. 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y)))))) (_ : is_true (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) z)))))), 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) z))))) *) by move/rcoset_transl->. Qed. Lemma rcoset_id x : x \in G -> G :* x = G. 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)) (@gval gT G)))), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@gval gT G) *) by move=> Gx; rewrite (rcoset_eqP (_ : x \in G :* 1)) mulg1. Qed. Variant rcoset_repr_spec x : gT -> Type := RcosetReprSpec g : g \in G -> rcoset_repr_spec x (g * x). Lemma mem_repr_rcoset x : repr (G :* x) \in G :* x. Proof. (* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (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 G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))))) *) exact: mem_repr (rcoset_refl x). Qed. Lemma repr_rcosetP x : rcoset_repr_spec x (repr (G :* x)). Proof. (* Goal: rcoset_repr_spec x (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) *) by rewrite -[repr _](mulgKV x); split; rewrite -mem_rcoset mem_repr_rcoset. Qed. Lemma rcoset_repr x : G :* (repr (G :* x)) = G :* x. Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.finType (FinGroup.base gT)) (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) *) exact/rcoset_eqP/mem_repr_rcoset. Qed. Lemma mem_rcosets A x : (G :* x \in rcosets G A) = (x \in G * A). Lemma mem_lcosets A x : (x *: G \in lcosets G A) = (x \in A * G). Proof. (* Goal: @eq bool (@in_mem (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@gval gT G)) (@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))) (@lcosets gT (@gval gT G) A)))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@gval gT G))))) *) rewrite -[LHS]memV_invg invg_lcoset invg_lcosets. (* Goal: @eq bool (@in_mem (FinGroup.sort (group_set_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.finType (FinGroup.base gT)) (@invg (FinGroup.base gT) x))) (@mem (Finite.sort (FinGroup.arg_finType (group_set_baseGroupType (FinGroup.base gT)))) (predPredType (Finite.sort (FinGroup.arg_finType (group_set_baseGroupType (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.arg_finType (group_set_baseGroupType (FinGroup.base gT))) (@rcosets gT (@invg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G)) (@invg (group_set_of_baseGroupType (FinGroup.base gT)) A))))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@gval gT G))))) *) by rewrite -[RHS]memV_invg invMg invGid mem_rcosets. Qed. Lemma group_setJ A x : group_set (A :^ x) = group_set A. Proof. (* Goal: @eq bool (@group_set gT (@conjugate gT A x)) (@group_set gT A) *) by rewrite /group_set mem_conjg conj1g -conjsMg conjSg. Qed. Lemma group_set_conjG x : group_set (G :^ x). Proof. (* Goal: is_true (@group_set gT (@conjugate gT (@gval gT G) x)) *) by rewrite group_setJ groupP. Qed. Canonical conjG_group x := group (group_set_conjG x). Lemma conjGid : {in G, normalised G}. 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 (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@gval gT G) x) (@gval gT G)) (inPhantom (@normalised gT (@gval gT G))) *) by move=> x Gx; apply/setP=> y; rewrite mem_conjg groupJr ?groupV. Qed. Lemma conj_subG x A : x \in G -> A \subset G -> A :^ x \subset G. 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)) (@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))))), 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)) (@conjugate 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 sAG; rewrite -(conjGid Gx) conjSg. Qed. Lemma class1G : 1 ^: G = 1. Proof. exact: class1g group1. Qed. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class gT (oneg (FinGroup.base gT)) (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) exact: class1g group1. Qed. Lemma classGidl x y : y \in G -> (x ^ y) ^: G = x ^: G. Proof. (* Goal: forall _ : is_true (@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 G)))), @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class gT (@conjg gT x y) (@gval gT G)) (@class gT x (@gval gT G)) *) by move=> Gy; rewrite -class_lcoset lcoset_id. Qed. Lemma classGidr x : {in G, normalised (x ^: G)}. 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 x0 : FinGroup.arg_sort (FinGroup.base gT) => @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@class gT x (@gval gT G)) x0) (@class gT x (@gval gT G))) (inPhantom (@normalised gT (@class gT x (@gval gT G)))) *) by move=> y Gy /=; rewrite -class_rcoset rcoset_id. Qed. Lemma class_refl x : x \in x ^: G. Proof. (* Goal: is_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 x (@gval gT G))))) *) by apply/imsetP; exists 1; rewrite ?conjg1. Qed. Hint Resolve class_refl : core. Lemma class_eqP x y : reflect (x ^: G = y ^: G) (x \in y ^: G). Proof. (* Goal: Bool.reflect (@eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class gT x (@gval gT G)) (@class gT y (@gval gT G))) (@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))))) *) by apply: (iffP idP) => [/imsetP[z Gz ->] | <-]; rewrite ?class_refl ?classGidl. Qed. Lemma class_sym x y : (x \in y ^: G) = (y \in x ^: G). Proof. (* Goal: @eq bool (@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))))) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) y (@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))))) *) by apply/idP/idP=> /class_eqP->. Qed. Lemma class_transl x y z : x \in y ^: G -> (x \in z ^: G) = (y \in z ^: G). Proof. (* Goal: forall _ : is_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))))), @eq bool (@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 z (@gval gT G))))) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) y (@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 z (@gval gT G))))) *) by rewrite -!(class_sym z) => /class_eqP->. Qed. Lemma class_trans x y z : x \in y ^: G -> y \in z ^: G -> x \in z ^: G. Proof. (* Goal: forall (_ : is_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)))))) (_ : is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) y (@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 z (@gval gT G)))))), is_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 z (@gval gT G))))) *) by move/class_transl->. Qed. Lemma repr_class x : {y | y \in G & repr (x ^: G) = x ^ y}. Proof. (* Goal: @sig2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (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)) (@gval gT G))))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (FinGroup.sort (FinGroup.base gT)) (@repr (FinGroup.base gT) (@class gT x (@gval gT G))) (@conjg gT x y)) *) set z := repr _; have: #|[set y in G | z == x ^ y]| > 0. (* Goal: forall _ : is_true (leq (S O) (@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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => 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)))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) z (@conjg gT x y)))))))), @sig2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (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)) (@gval gT G))))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (FinGroup.sort (FinGroup.base gT)) z (@conjg gT x y)) *) (* Goal: is_true (leq (S O) (@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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => 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)))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) z (@conjg gT x y)))))))) *) have: z \in x ^: G by apply: (mem_repr x). (* Goal: forall _ : is_true (leq (S O) (@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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => 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)))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) z (@conjg gT x y)))))))), @sig2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (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)) (@gval gT G))))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (FinGroup.sort (FinGroup.base gT)) z (@conjg gT x y)) *) (* Goal: forall _ : is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) z (@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))))), is_true (leq (S O) (@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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => 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)))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) z (@conjg gT x y)))))))) *) by case/imsetP=> y Gy ->; rewrite (cardD1 y) inE Gy eqxx. (* Goal: forall _ : is_true (leq (S O) (@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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => 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)))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) z (@conjg gT x y)))))))), @sig2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (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)) (@gval gT G))))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (FinGroup.sort (FinGroup.base gT)) z (@conjg gT x y)) *) by move/card_mem_repr; move: (repr _) => y /setIdP[Gy /eqP]; exists y. Qed. Lemma classG_eq1 x : (x ^: G == 1) = (x == 1). Proof. (* Goal: @eq bool (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base gT))) (@class gT x (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq_op (FinGroup.arg_eqType (FinGroup.base gT)) x (oneg (FinGroup.base gT))) *) apply/eqP/eqP=> [xG1 | ->]; last exact: class1G. (* Goal: @eq (Equality.sort (FinGroup.arg_eqType (FinGroup.base gT))) x (oneg (FinGroup.base gT)) *) by have:= class_refl x; rewrite xG1 => /set1P. Qed. Lemma class_subG x A : x \in G -> A \subset G -> x ^: A \subset G. 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)) (@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))))), 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)) (@class gT x 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)))) *) move=> Gx sAG; apply/subsetP=> _ /imsetP[y Ay ->]. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (@conjg gT x y) (@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)) (@gval gT G)))) *) by rewrite groupJ // (subsetP sAG). Qed. Lemma repr_classesP xG : reflect (repr xG \in G /\ xG = repr xG ^: G) (xG \in classes G). Proof. (* Goal: Bool.reflect (and (is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@repr (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))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) xG (@class gT (@repr (FinGroup.base gT) xG) (@gval gT G)))) (@in_mem (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (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))))) *) apply: (iffP imsetP) => [[x Gx ->] | []]; last by exists (repr xG). (* Goal: and (is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@repr (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)) (@gval gT G))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@class gT x (@gval gT G)) (@class gT (@repr (FinGroup.base gT) (@class gT x (@gval gT G))) (@gval gT G))) *) by have [y Gy ->] := repr_class x; rewrite classGidl ?groupJ. Qed. Lemma mem_repr_classes xG : xG \in classes G -> repr xG \in xG. Proof. (* Goal: forall _ : is_true (@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))))), is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@repr (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)) xG))) *) by case/repr_classesP=> _ {2}->; apply: class_refl. Qed. Lemma classes_gt0 : 0 < #|classes G|. Proof. (* Goal: is_true (leq (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 (@gval gT G)))))) *) by rewrite (cardsD1 1) classes1. Qed. Lemma classes_gt1 : (#|classes G| > 1) = (G :!=: 1). Proof. (* Goal: @eq bool (leq (S (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 (@gval gT G)))))) (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))))))) *) rewrite (cardsD1 1) classes1 ltnS lt0n cards_eq0. (* Goal: @eq bool (negb (@eq_op (set_of_eqType (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT)))) (@setD (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT))) (@classes gT (@gval gT G)) (@set1 (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@set0 (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT)))))) (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) *) apply/set0Pn/trivgPn=> [[xG /setD1P[nt_xG]] | [x Gx ntx]]. (* Goal: @ex (Finite.sort (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT)))) (fun x : Finite.sort (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT))) => is_true (@in_mem (Finite.sort (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT)))) x (@mem (Finite.sort (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT)))) (predPredType (Finite.sort (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT))) (@setD (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT))) (@classes gT (@gval gT G)) (@set1 (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))))))) *) (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT)))) xG (@mem (Finite.sort (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT)))) (predPredType (Finite.sort (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT))) (@classes gT (@gval gT G))))), @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 (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) x (oneg (FinGroup.base gT))))) *) by case/imsetP=> x Gx def_xG; rewrite def_xG classG_eq1 in nt_xG; exists x. (* Goal: @ex (Finite.sort (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT)))) (fun x : Finite.sort (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT))) => is_true (@in_mem (Finite.sort (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT)))) x (@mem (Finite.sort (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT)))) (predPredType (Finite.sort (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT))) (@setD (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT))) (@classes gT (@gval gT G)) (@set1 (FinGroup.finType (group_set_of_baseGroupType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))))))) *) by exists (x ^: G); rewrite !inE classG_eq1 ntx; apply: mem_imset. Qed. Lemma mem_class_support A x : x \in A -> x \in class_support A G. 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 (@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_support gT A (@gval gT G))))) *) by move=> Ax; rewrite -[x]conjg1 memJ_class_support. Qed. Lemma class_supportGidl A x : x \in G -> class_support (A :^ x) G = class_support A G. 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)) (@gval gT G)))), @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class_support gT (@conjugate gT A x) (@gval gT G)) (@class_support gT A (@gval gT G)) *) by move=> Gx; rewrite -class_support_set1r -class_supportM lcoset_id. Qed. Lemma class_supportGidr A : {in G, normalised (class_support A G)}. 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 (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@class_support gT A (@gval gT G)) x) (@class_support gT A (@gval gT G))) (inPhantom (@normalised gT (@class_support gT A (@gval gT G)))) *) by move=> x Gx /=; rewrite -class_support_set1r -class_supportM rcoset_id. Qed. Lemma class_support_subG A : A \subset G -> class_support A G \subset 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)) 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)))), 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)) (@class_support gT A (@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 move=> sAG; rewrite class_supportEr; apply/bigcupsP=> x Gx; apply: conj_subG. Qed. Lemma sub_class_support A : A \subset class_support A 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)) 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)) (@class_support gT A (@gval gT G))))) *) by rewrite class_supportEr (bigcup_max 1) ?conjsg1. Qed. Lemma class_support_id : class_support G G = G. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class_support gT (@gval gT G) (@gval gT G)) (@gval gT G) *) by apply/eqP; rewrite eqEsubset sub_class_support class_support_subG. Qed. Lemma class_supportD1 A : (class_support A G)^# = cover (A^# :^: G). Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@setD (FinGroup.finType (FinGroup.base gT)) (@class_support gT A (@gval gT G)) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))) (@cover (FinGroup.finType (FinGroup.base gT)) (@conjugates gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))) (@gval gT G))) *) rewrite cover_imset class_supportEr setDE big_distrl /=. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (@set0 (FinGroup.finType (FinGroup.base gT))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) i (@setU (FinGroup.finType (FinGroup.base gT))) (@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)))) (@setI (FinGroup.finType (FinGroup.base gT)) (@conjugate gT A i) (@setC (FinGroup.finType (FinGroup.base gT)) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT))))))) (@BigOp.bigop (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (@set0 (FinGroup.finType (FinGroup.base gT))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) i (@setU (FinGroup.finType (FinGroup.base gT))) (@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)))) (@conjugate gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))) i))) *) by apply: eq_bigr => x _; rewrite -setDE conjD1g. Qed. Inductive subg_of : predArgType := Subg x & x \in G. Definition sgval u := let: Subg x _ := u in x. Canonical subg_subType := Eval hnf in [subType for sgval]. Definition subg_eqMixin := Eval hnf in [eqMixin of subg_of by <:]. Canonical subg_eqType := Eval hnf in EqType subg_of subg_eqMixin. Definition subg_choiceMixin := [choiceMixin of subg_of by <:]. Canonical subg_choiceType := Eval hnf in ChoiceType subg_of subg_choiceMixin. Definition subg_countMixin := [countMixin of subg_of by <:]. Canonical subg_countType := Eval hnf in CountType subg_of subg_countMixin. Canonical subg_subCountType := Eval hnf in [subCountType of subg_of]. Definition subg_finMixin := [finMixin of subg_of by <:]. Canonical subg_finType := Eval hnf in FinType subg_of subg_finMixin. Canonical subg_subFinType := Eval hnf in [subFinType of subg_of]. Lemma subgP u : sgval u \in G. Proof. (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (sgval 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 G)))) *) exact: valP. Qed. Lemma subg_inj : injective sgval. Proof. (* Goal: @injective (FinGroup.arg_sort (FinGroup.base gT)) subg_of sgval *) exact: val_inj. Qed. Lemma congr_subg u v : u = v -> sgval u = sgval v. Proof. (* Goal: forall _ : @eq subg_of u v, @eq (FinGroup.arg_sort (FinGroup.base gT)) (sgval u) (sgval v) *) exact: congr1. Qed. Definition subg_one := Subg group1. Definition subg_inv u := Subg (groupVr (subgP u)). Definition subg_mul u v := Subg (groupM (subgP u) (subgP v)). Lemma subg_oneP : left_id subg_one subg_mul. Proof. (* Goal: @left_id subg_of subg_of subg_one subg_mul *) by move=> u; apply: val_inj; apply: mul1g. Qed. Lemma subg_invP : left_inverse subg_one subg_inv subg_mul. Proof. (* Goal: @left_inverse subg_of subg_of subg_of subg_one subg_inv subg_mul *) by move=> u; apply: val_inj; apply: mulVg. Qed. Lemma subg_mulP : associative subg_mul. Proof. (* Goal: @associative subg_of subg_mul *) by move=> u v w; apply: val_inj; apply: mulgA. Qed. Definition subFinGroupMixin := FinGroup.Mixin subg_mulP subg_oneP subg_invP. Lemma valgM : {in setT &, {morph val : x y / (x : subg_of) * y >-> x * y}}. Proof. (* Goal: @prop_in2 (Finite.sort (@subFinType_finType (FinGroup.arg_choiceType (FinGroup.base gT)) (fun x : FinGroup.arg_sort (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)) (@gval gT G)))) subg_subFinType)) (@mem (Finite.sort (@subFinType_finType (FinGroup.arg_choiceType (FinGroup.base gT)) (fun x : FinGroup.arg_sort (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)) (@gval gT G)))) subg_subFinType)) (predPredType (Finite.sort (@subFinType_finType (FinGroup.arg_choiceType (FinGroup.base gT)) (fun x : FinGroup.arg_sort (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)) (@gval gT G)))) subg_subFinType))) (@SetDef.pred_of_set (@subFinType_finType (FinGroup.arg_choiceType (FinGroup.base gT)) (fun x : FinGroup.arg_sort (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)) (@gval gT G)))) subg_subFinType) (@setTfor (@subFinType_finType (FinGroup.arg_choiceType (FinGroup.base gT)) (fun x : FinGroup.arg_sort (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)) (@gval gT G)))) subg_subFinType) (Phant (Finite.sort (@subFinType_finType (FinGroup.arg_choiceType (FinGroup.base gT)) (fun x : FinGroup.arg_sort (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)) (@gval gT G)))) subg_subFinType)))))) (fun (x : @sub_sort (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (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)) (@gval gT G)))) subg_subType) (y : @sub_sort (FinGroup.arg_sort (FinGroup.base gT)) (fun x0 : FinGroup.arg_sort (FinGroup.base gT) => @in_mem (FinGroup.arg_sort (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)) (@gval gT G)))) subg_subType) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x0 : FinGroup.arg_sort (FinGroup.base gT) => @in_mem (FinGroup.arg_sort (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)) (@gval gT G)))) subg_subType ((fun (x0 : @sub_sort (FinGroup.arg_sort (FinGroup.base gT)) (fun x0 : FinGroup.arg_sort (FinGroup.base gT) => @in_mem (FinGroup.arg_sort (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)) (@gval gT G)))) subg_subType) (y0 : @sub_sort (FinGroup.arg_sort (FinGroup.base gT)) (fun x1 : FinGroup.arg_sort (FinGroup.base gT) => @in_mem (FinGroup.arg_sort (FinGroup.base gT)) x1 (@mem (Finite.sort (FinGroup.arg_finType (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)))) subg_subType) => @mulg subBaseFinGroupType (x0 : subg_of) y0) x y)) ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x0 y0) (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x0 : FinGroup.arg_sort (FinGroup.base gT) => @in_mem (FinGroup.arg_sort (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)) (@gval gT G)))) subg_subType x) (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x0 : FinGroup.arg_sort (FinGroup.base gT) => @in_mem (FinGroup.arg_sort (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)) (@gval gT G)))) subg_subType y))) (inPhantom (@morphism_2 (@sub_sort (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (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)) (@gval gT G)))) subg_subType) (FinGroup.arg_sort (FinGroup.base gT)) (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (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)) (@gval gT G)))) subg_subType) (fun (x : @sub_sort (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (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)) (@gval gT G)))) subg_subType) (y : @sub_sort (FinGroup.arg_sort (FinGroup.base gT)) (fun x0 : FinGroup.arg_sort (FinGroup.base gT) => @in_mem (FinGroup.arg_sort (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)) (@gval gT G)))) subg_subType) => @mulg subBaseFinGroupType (x : subg_of) y) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y))) *) by []. Qed. Definition subg : gT -> subg_of := insubd (1 : subg_of). Lemma subgK x : x \in G -> val (subg x) = x. 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)) (@gval gT G)))), @eq (FinGroup.arg_sort (FinGroup.base gT)) (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (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)) (@gval gT G)))) subg_subType (subg x)) x *) by move=> Gx; rewrite insubdK. Qed. Lemma sgvalK : cancel sgval subg. Proof. (* Goal: @cancel (FinGroup.arg_sort (FinGroup.base gT)) subg_of sgval subg *) by case=> x Gx; apply: val_inj; apply: subgK. Qed. Lemma subg_default x : (x \in G) = false -> val (subg x) = 1. Proof. (* Goal: forall _ : @eq 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)) (@gval gT G)))) false, @eq (FinGroup.arg_sort (FinGroup.base gT)) (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (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)) (@gval gT G)))) subg_subType (subg x)) (oneg (FinGroup.base gT)) *) by move=> Gx; rewrite val_insubd Gx. Qed. Lemma subgM : {in G &, {morph subg : 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)) (@gval gT G))) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @eq subg_of (subg ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x0 y0) x y)) ((fun x0 y0 : subg_of => @mulg subBaseFinGroupType x0 y0) (subg x) (subg y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base gT)) subg_of subg (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y) (fun x y : subg_of => @mulg subBaseFinGroupType x y))) *) by move=> x y Gx Gy; apply: val_inj; rewrite /= !subgK ?groupM. Qed. End OneGroup. Hint Resolve group1 : core. Lemma groupD1_inj G H : G^# = H^# -> G :=: H. Proof. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT G) (@gval gT H) *) by move/(congr1 (setU 1)); rewrite !setD1K. Qed. Lemma invMG G H : (G * H)^-1 = H * G. Proof. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@invg (group_set_of_baseGroupType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT G)) *) by rewrite invMg !invGid. Qed. Lemma mulSGid G H : H \subset G -> H * 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 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 (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT G)) (@gval gT G) *) exact: mulSgGid (group1 H). Qed. Lemma mulGSid G H : H \subset G -> G * H = 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)))), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (@gval gT G) *) exact: mulGSgid (group1 H). Qed. Lemma mulGidPl G H : reflect (G * H = G) (H \subset G). Proof. (* Goal: Bool.reflect (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (@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)) (@gval gT G)))) *) by apply: (iffP idP) => [|<-]; [apply: mulGSid | apply: mulG_subr]. Qed. Lemma mulGidPr G H : reflect (G * H = H) (G \subset H). Proof. (* Goal: Bool.reflect (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (@gval gT H)) (@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)))) *) by apply: (iffP idP) => [|<-]; [apply: mulSGid | apply: mulG_subl]. Qed. Lemma comm_group_setP G H : reflect (commute G H) (group_set (G * H)). Proof. (* Goal: Bool.reflect (@commute (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (@group_set gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))) *) rewrite /group_set (subsetP (mulG_subl _ _)) ?group1 // andbC. (* Goal: Bool.reflect (@commute (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) true) *) have <-: #|G * H| <= #|H * G| by rewrite -invMG card_invg. (* Goal: Bool.reflect (@commute (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) (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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT G))))))) *) by rewrite -mulgA mulGS mulgA mulSG -eqEcard eq_sym; apply: eqP. Qed. Lemma card_lcosets G H : #|lcosets H G| = #|G : H|. Proof. (* 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))) (@lcosets gT (@gval gT H) (@gval gT G))))) (@indexg gT (@gval gT G) (@gval gT H)) *) by rewrite -card_invg invg_lcosets !invGid. Qed. Lemma group_modl A B G : A \subset G -> A * (B :&: G) = A * B :&: 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)) 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 (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@setI (FinGroup.arg_finType (FinGroup.base gT)) B (@gval gT G))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT G)) *) move=> sAG; apply/eqP; rewrite eqEsubset subsetI mulgS ?subsetIl //. (* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@setI (FinGroup.arg_finType (FinGroup.base gT)) B (@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))))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@setI (FinGroup.arg_finType (FinGroup.base gT)) B (@gval gT G))))))) *) rewrite -{2}mulGid mulgSS ?subsetIr //. (* Goal: is_true (andb (andb true 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@setI (FinGroup.arg_finType (FinGroup.base gT)) B (@gval gT G))))))) *) apply/subsetP => _ /setIP[/mulsgP[a b Aa Bb ->] Gab]. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) a 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@setI (FinGroup.arg_finType (FinGroup.base gT)) B (@gval gT G)))))) *) by rewrite mem_mulg // inE Bb -(groupMl _ (subsetP sAG _ Aa)). Qed. Lemma group_modr A B G : B \subset G -> (G :&: A) * B = G :&: A * 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)) (@gval gT G)))), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) A) B) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B)) *) move=> sBG; apply: invg_inj; rewrite !(invMg, invIg) invGid !(setIC G). (* Goal: @eq (FinGroup.arg_sort (group_set_baseGroupType (FinGroup.base gT))) (@mulg (group_set_baseGroupType (FinGroup.base gT)) (@invg (group_set_baseGroupType (FinGroup.base gT)) B) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@invg (group_set_of_baseGroupType (FinGroup.base gT)) A) (@gval gT G))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@invg (group_set_of_baseGroupType (FinGroup.base gT)) B) (@invg (group_set_of_baseGroupType (FinGroup.base gT)) A)) (@gval gT G)) *) by rewrite group_modl // -invGid invSg. Qed. End GroupProp. Hint Resolve group1 group1_class1 group1_class12 group1_class12 : core. Hint Resolve group1_eqType group1_finType : core. Hint Resolve cardG_gt0 cardG_gt0_reduced indexg_gt0 : core. Notation "G :^ x" := (conjG_group G x) : Group_scope. Notation "[ 'subg' G ]" := (subg_of G) : type_scope. Notation "[ 'subg' G ]" := [set: subg_of G] : group_scope. Notation "[ 'subg' G ]" := [set: subg_of G]%G : Group_scope. Prenex Implicits subg sgval subg_of. Bind Scope group_scope with subg_of. Arguments subgK {gT G}. Arguments sgvalK {gT G}. Arguments subg_inj {gT G} [u1 u2] eq_u12 : rename. Arguments trivgP {gT G}. Arguments trivGP {gT G}. Arguments lcoset_eqP {gT G x y}. Arguments rcoset_eqP {gT G x y}. Arguments mulGidPl [gT G H]. Arguments mulGidPr [gT G H]. Arguments comm_group_setP {gT G H}. Arguments class_eqP {gT G x y}. Arguments repr_classesP {gT G xG}. Section GroupInter. Variable gT : finGroupType. Implicit Types A B : {set gT}. Implicit Types G H : {group gT}. Lemma group_setI G H : group_set (G :&: H). Proof. (* Goal: is_true (@group_set gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H))) *) 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)))) (@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)))))) (_ : 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)))) (@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 H)))))), 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)))) (@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 H))))) *) by case/andP=> Gx Hx; rewrite !groupMl. Qed. Canonical setI_group G H := group (group_setI G H). Section Nary. Variables (I : finType) (P : pred I) (F : I -> {group gT}). Lemma group_set_bigcap : group_set (\bigcap_(i | P i) F i). Proof. (* Goal: is_true (@group_set gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) i (@setI (FinGroup.arg_finType (FinGroup.base gT))) (P i) (@gval gT (F i))))) *) by elim/big_rec: _ => [|i G _ gG]; rewrite -1?(insubdK 1%G gG) groupP. Qed. Canonical bigcap_group := group group_set_bigcap. End Nary. Canonical generated_group A : {group _} := Eval hnf in [group of <<A>>]. Canonical gcore_group G A : {group _} := Eval hnf in [group of gcore G A]. Canonical commutator_group A B : {group _} := Eval hnf in [group of [~: A, B]]. Canonical joing_group A B : {group _} := Eval hnf in [group of A <*> B]. Canonical cycle_group x : {group _} := Eval hnf in [group of <[x]>]. Definition joinG G H := joing_group G H. Definition subgroups A := [set G : {group gT} | G \subset A]. Lemma order_gt0 (x : gT) : 0 < #[x]. Proof. (* Goal: is_true (leq (S O) (@order gT x)) *) exact: cardG_gt0. Qed. End GroupInter. Hint Resolve order_gt0 : core. Arguments generated_group _ _%g. Arguments joing_group _ _%g _%g. Arguments subgroups _ _%g. Notation "G :&: H" := (setI_group G H) : Group_scope. Notation "<< A >>" := (generated_group A) : Group_scope. Notation "<[ x ] >" := (cycle_group x) : Group_scope. Notation "[ ~: A1 , A2 , .. , An ]" := (commutator_group .. (commutator_group A1 A2) .. An) : Group_scope. Notation "A <*> B" := (joing_group A B) : Group_scope. Notation "G * H" := (joinG G H) : Group_scope. Prenex Implicits joinG subgroups. Notation "\prod_ ( i <- r | P ) F" := (\big[joinG/1%G]_(i <- r | P%B) F%G) : Group_scope. Notation "\prod_ ( i <- r ) F" := (\big[joinG/1%G]_(i <- r) F%G) : Group_scope. Notation "\prod_ ( m <= i < n | P ) F" := (\big[joinG/1%G]_(m <= i < n | P%B) F%G) : Group_scope. Notation "\prod_ ( m <= i < n ) F" := (\big[joinG/1%G]_(m <= i < n) F%G) : Group_scope. Notation "\prod_ ( i | P ) F" := (\big[joinG/1%G]_(i | P%B) F%G) : Group_scope. Notation "\prod_ i F" := (\big[joinG/1%G]_i F%G) : Group_scope. Notation "\prod_ ( i : t | P ) F" := (\big[joinG/1%G]_(i : t | P%B) F%G) (only parsing) : Group_scope. Notation "\prod_ ( i : t ) F" := (\big[joinG/1%G]_(i : t) F%G) (only parsing) : Group_scope. Notation "\prod_ ( i < n | P ) F" := (\big[joinG/1%G]_(i < n | P%B) F%G) : Group_scope. Notation "\prod_ ( i < n ) F" := (\big[joinG/1%G]_(i < n) F%G) : Group_scope. Notation "\prod_ ( i 'in' A | P ) F" := (\big[joinG/1%G]_(i in A | P%B) F%G) : Group_scope. Notation "\prod_ ( i 'in' A ) F" := (\big[joinG/1%G]_(i in A) F%G) : Group_scope. Section Lagrange. Variable gT : finGroupType. Implicit Types G H K : {group gT}. Lemma LagrangeI G H : (#|G :&: H| * #|G : H|)%N = #|G|. Proof. (* 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) (@indexg gT (@gval gT G) (@gval gT H))) (@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 -[#|G|]sum1_card (partition_big_imset (rcoset 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) (@indexg gT (@gval gT G) (@gval gT H))) (@BigOp.bigop nat (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) O (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 nat (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) j addn (@in_mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) j (@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))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@rcoset 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)) (@gval gT G))))))) (@BigOp.bigop nat (FinGroup.arg_sort (FinGroup.base gT)) O (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody nat (FinGroup.arg_sort (FinGroup.base gT)) i addn (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)))) (@rcoset gT (@gval gT H) i) j)) (S O))))) *) rewrite mulnC -sum_nat_const; apply: eq_bigr => _ /rcosetsP[x Gx ->]. (* 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) (@BigOp.bigop nat (FinGroup.arg_sort (FinGroup.base gT)) O (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody nat (FinGroup.arg_sort (FinGroup.base gT)) i addn (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)))) (@rcoset gT (@gval gT H) i) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) (S O))) *) rewrite -(card_rcoset _ x) -sum1_card; apply: eq_bigl => 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) 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 G)))) (@eq_op (Finite.eqType (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@rcoset gT (@gval gT H) y) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *) by rewrite rcosetE (sameP eqP rcoset_eqP) group_modr (sub1set, inE). Qed. Lemma divgI G H : #|G| %/ #|G :&: H| = #|G : H|. Proof. (* Goal: @eq nat (divn (@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 gT)) (@mem (Finite.sort (FinGroup.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) (@gval gT H)))))) (@indexg gT (@gval gT G) (@gval gT H)) *) by rewrite -(LagrangeI G H) mulKn ?cardG_gt0. Qed. Lemma divg_index G H : #|G| %/ #|G : H| = #|G :&: H|. Proof. (* Goal: @eq nat (divn (@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)))) (@indexg gT (@gval gT G) (@gval gT H))) (@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 G) (@gval gT H))))) *) by rewrite -(LagrangeI G H) mulnK. Qed. Lemma dvdn_indexg G H : #|G : H| %| #|G|. Proof. (* Goal: is_true (dvdn (@indexg gT (@gval gT G) (@gval gT H)) (@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 rewrite -(LagrangeI G H) dvdn_mull. Qed. Theorem Lagrange G H : H \subset G -> (#|H| * #|G : H|)%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)))), @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)) (@gval gT H)))) (@indexg gT (@gval gT G) (@gval gT H))) (@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/setIidPr=> sHG; rewrite -{1}sHG LagrangeI. Qed. Lemma cardSg G H : H \subset G -> #|H| %| #|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 (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 H)))) (@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/Lagrange <-; rewrite dvdn_mulr. Qed. Lemma lognSg p G H : G \subset H -> logn p #|G| <= logn p #|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 (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 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 H)))))) *) by move=> sGH; rewrite dvdn_leq_log ?cardSg. Qed. Lemma piSg G H : G \subset H -> {subset \pi(gval G) <= \pi(gval 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)))), @sub_mem nat (@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 G)))))) (@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)))))) *) move=> sGH p; rewrite !mem_primes !cardG_gt0 => /and3P[-> _ pG]. (* Goal: is_true (andb true (andb true (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 H))))))) *) exact: dvdn_trans (cardSg sGH). Qed. Lemma divgS G H : H \subset G -> #|G| %/ #|H| = #|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 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 nat (divn (@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 gT)) (@mem (Finite.sort (FinGroup.arg_finType (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))))) (@indexg gT (@gval gT G) (@gval gT H)) *) by move/Lagrange <-; rewrite mulKn. Qed. Lemma divg_indexS G H : H \subset G -> #|G| %/ #|G : 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)) (@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 nat (divn (@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)))) (@indexg gT (@gval gT G) (@gval gT H))) (@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/Lagrange <-; rewrite mulnK. Qed. Lemma coprimeSg G H p : H \subset G -> coprime #|G| p -> coprime #|H| p. 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 (coprime (@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 (coprime (@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)))) p) *) by move=> sHG; apply: coprime_dvdl (cardSg sHG). Qed. Lemma coprimegS G H p : H \subset G -> coprime p #|G| -> coprime p #|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 (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 G)))))), 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 H))))) *) by move=> sHG; apply: coprime_dvdr (cardSg sHG). Qed. Lemma indexJg G H x : #|G :^ x : H :^ x| = #|G : H|. Proof. (* Goal: @eq nat (@indexg gT (@conjugate gT (@gval gT G) x) (@conjugate gT (@gval gT H) x)) (@indexg gT (@gval gT G) (@gval gT H)) *) by rewrite -!divgI -conjIg !cardJg. Qed. Lemma indexgg G : #|G : G| = 1%N. Proof. (* Goal: @eq nat (@indexg gT (@gval gT G) (@gval gT G)) (S O) *) by rewrite -divgS // divnn cardG_gt0. Qed. Lemma rcosets_id G : rcosets G G = [set G : {set gT}]. Proof. (* Goal: @eq (@set_of (set_of_finType (FinGroup.finType (FinGroup.base gT))) (Phant (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))))) (@rcosets gT (@gval gT G) (@gval gT G)) (@set1 (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) *) apply/esym/eqP; rewrite eqEcard sub1set [#|_|]indexgg cards1 andbT. (* Goal: is_true (@in_mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@gval gT G) (@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))) (@rcosets gT (@gval gT G) (@gval gT G))))) *) by apply/rcosetsP; exists 1; rewrite ?mulg1. Qed. Lemma Lagrange_index G H K : H \subset G -> K \subset H -> (#|G : H| * #|H : K|)%N = #|G : 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)) (@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)) (@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))))), @eq nat (muln (@indexg gT (@gval gT G) (@gval gT H)) (@indexg gT (@gval gT H) (@gval gT K))) (@indexg gT (@gval gT G) (@gval gT K)) *) move=> sHG sKH; apply/eqP; rewrite mulnC -(eqn_pmul2l (cardG_gt0 K)). (* Goal: is_true (@eq_op nat_eqType (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 K)))) (muln (@indexg gT (@gval gT H) (@gval gT K)) (@indexg gT (@gval gT G) (@gval gT H)))) (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 K)))) (@indexg gT (@gval gT G) (@gval gT K)))) *) by rewrite mulnA !Lagrange // (subset_trans sKH). Qed. Lemma indexgI G H : #|G : G :&: H| = #|G : H|. Proof. (* Goal: @eq nat (@indexg gT (@gval gT G) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H))) (@indexg gT (@gval gT G) (@gval gT H)) *) by rewrite -divgI divgS ?subsetIl. Qed. Lemma indexgS G H K : H \subset K -> #|G : K| %| #|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 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)))), is_true (dvdn (@indexg gT (@gval gT G) (@gval gT K)) (@indexg gT (@gval gT G) (@gval gT H))) *) move=> sHK; rewrite -(@dvdn_pmul2l #|G :&: K|) ?cardG_gt0 // LagrangeI. (* 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 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT K))))) (@indexg gT (@gval gT G) (@gval gT H)))) *) by rewrite -(Lagrange (setIS G sHK)) mulnAC LagrangeI dvdn_mulr. Qed. Lemma indexSg G H K : H \subset K -> K \subset G -> #|K : H| %| #|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 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))))) (_ : 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 (dvdn (@indexg gT (@gval gT K) (@gval gT H)) (@indexg gT (@gval gT G) (@gval gT H))) *) move=> sHK sKG; rewrite -(@dvdn_pmul2l #|H|) ?cardG_gt0 //. (* Goal: is_true (dvdn (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 H)))) (@indexg gT (@gval gT K) (@gval gT H))) (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 H)))) (@indexg gT (@gval gT G) (@gval gT H)))) *) by rewrite !Lagrange ?(cardSg, subset_trans sHK). Qed. Lemma indexg_eq1 G H : (#|G : H| == 1%N) = (G \subset H). Proof. (* Goal: @eq bool (@eq_op nat_eqType (@indexg gT (@gval gT G) (@gval gT H)) (S O)) (@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)))) *) rewrite eqn_leq -(leq_pmul2l (cardG_gt0 (G :&: H))) LagrangeI muln1. (* Goal: @eq bool (andb (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)))) (@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 G H)))))) (leq (S O) (@indexg gT (@gval gT G) (@gval gT H)))) (@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)))) *) by rewrite indexg_gt0 andbT (sameP setIidPl eqP) eqEcard subsetIl. Qed. Lemma indexg_gt1 G H : (#|G : H| > 1) = ~~ (G \subset H). Proof. (* Goal: @eq bool (leq (S (S O)) (@indexg gT (@gval gT G) (@gval gT H))) (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 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))))) *) by rewrite -indexg_eq1 eqn_leq indexg_gt0 andbT -ltnNge. Qed. Lemma index1g G H : H \subset G -> #|G : H| = 1%N -> H :=: 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))))) (_ : @eq nat (@indexg gT (@gval gT G) (@gval gT H)) (S O)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT G) *) by move=> sHG iHG; apply/eqP; rewrite eqEsubset sHG -indexg_eq1 iHG. Qed. Lemma indexg1 G : #|G : 1| = #|G|. Proof. (* Goal: @eq nat (@indexg gT (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@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 rewrite -divgS ?sub1G // cards1 divn1. Qed. Lemma indexMg G A : #|G * A : G| = #|A : G|. Proof. (* Goal: @eq nat (@indexg gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) A) (@gval gT G)) (@indexg gT A (@gval gT G)) *) apply/eq_card/setP/eqP; rewrite eqEsubset andbC imsetS ?mulG_subr //. (* Goal: is_true (andb true (@subset (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))) (@rcosets gT (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) A)))) (@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))) (@rcosets gT (@gval gT G) A))))) *) by apply/subsetP=> _ /rcosetsP[x GAx ->]; rewrite mem_rcosets. Qed. Lemma rcosets_partition_mul G H : partition (rcosets H G) (H * G). Lemma rcosets_partition G H : H \subset G -> partition (rcosets H 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 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 (@partition (FinGroup.finType (FinGroup.base gT)) (@rcosets gT (@gval gT H) (@gval gT G)) (@gval gT G)) *) by move=> sHG; have:= rcosets_partition_mul G H; rewrite mulSGid. Qed. Lemma LagrangeMl G H : (#|G| * #|H : G|)%N = #|G * H|. Proof. (* 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)) (@gval gT G)))) (@indexg gT (@gval gT H) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) *) rewrite mulnC -(card_uniform_partition _ (rcosets_partition_mul H G)) //. (* Goal: @prop_in1 (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))) (@rcosets gT (@gval gT G) (@gval gT H)))) (fun A : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT)))) => @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)) 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)) (@gval gT G))))) (inPhantom (forall A : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT)))), @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)) 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)) (@gval gT G)))))) *) by move=> _ /rcosetsP[x Hx ->]; rewrite card_rcoset. Qed. Lemma LagrangeMr G H : (#|G : H| * #|H|)%N = #|G * H|. Proof. (* Goal: @eq nat (muln (@indexg gT (@gval gT G) (@gval gT H)) (@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))))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) *) by rewrite mulnC LagrangeMl -card_invg invMg !invGid. Qed. Lemma mul_cardG G H : (#|G| * #|H| = #|G * H|%g * #|G :&: H|)%N. Proof. (* 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)) (@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 H))))) (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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) (@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 G) (@gval gT H)))))) *) by rewrite -LagrangeMr -(LagrangeI G H) -mulnA mulnC. Qed. Lemma dvdn_cardMg G H : #|G * H| %| #|G| * #|H|. Proof. (* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) (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 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 H)))))) *) by rewrite mul_cardG dvdn_mulr. Qed. Lemma cardMg_divn G H : #|G * H| = (#|G| * #|H|) %/ #|G :&: H|. Proof. (* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) (divn (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 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 H))))) (@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 G) (@gval gT H)))))) *) by rewrite mul_cardG mulnK ?cardG_gt0. Qed. Lemma cardIg_divn G H : #|G :&: H| = (#|G| * #|H|) %/ #|G * H|. Proof. (* 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) (divn (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 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 H))))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))))) *) by rewrite mul_cardG mulKn // (cardD1 (1 * 1)) mem_mulg. Qed. Lemma TI_cardMg G H : G :&: H = 1 -> #|G * H| = (#|G| * #|H|)%N. 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) (@gval gT H)) (oneg (group_set_of_baseGroupType (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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) (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 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 H))))) *) by move=> tiGH; rewrite mul_cardG tiGH cards1 muln1. Qed. Lemma cardMg_TI G H : #|G| * #|H| <= #|G * H| -> G :&: H = 1. Lemma coprime_TIg G H : coprime #|G| #|H| -> G :&: H = 1. Proof. (* Goal: forall _ : is_true (coprime (@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 gT)) (@mem (Finite.sort (FinGroup.arg_finType (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))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) move=> coGH; apply/eqP; rewrite trivg_card1 -dvdn1 -{}(eqnP coGH). (* 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 (@setI_group gT G H))))) (gcdn (@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 gT)) (@mem (Finite.sort (FinGroup.arg_finType (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 dvdn_gcd /= {2}setIC !cardSg ?subsetIl. Qed. Lemma prime_TIg G H : prime #|G| -> ~~ (G \subset H) -> G :&: H = 1. Proof. (* Goal: forall (_ : is_true (prime (@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 (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 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)))))), @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 H)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) case/primeP=> _ /(_ _ (cardSg (subsetIl G H))). (* Goal: forall (_ : is_true (orb (@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 (@setI_group gT G H))))) (S O)) (@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 (@setI_group gT G H))))) (@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 (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 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)))))), @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 H)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) rewrite (sameP setIidPl eqP) eqEcard subsetIl => /pred2P[/card1_trivg|] //= ->. (* Goal: forall _ : is_true (negb (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 G)))) (@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)))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) by case/negP. Qed. Lemma prime_meetG G H : prime #|G| -> G :&: H != 1 -> G \subset H. Proof. (* Goal: forall (_ : is_true (prime (@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 (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 (@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)))) *) by move=> prG; apply: contraR; move/prime_TIg->. Qed. Lemma coprime_cardMg G H : coprime #|G| #|H| -> #|G * H| = (#|G| * #|H|)%N. Proof. (* Goal: forall _ : is_true (coprime (@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 gT)) (@mem (Finite.sort (FinGroup.arg_finType (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 (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))) (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 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 H))))) *) by move=> coGH; rewrite TI_cardMg ?coprime_TIg. Qed. Lemma coprime_index_mulG G H K : H \subset G -> K \subset G -> coprime #|G : H| #|G : K| -> H * K = 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)) (@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 (coprime (@indexg gT (@gval gT G) (@gval gT H)) (@indexg gT (@gval gT G) (@gval gT K)))), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)) (@gval gT G) *) move=> sHG sKG co_iG_HK; apply/eqP; rewrite eqEcard mul_subG //=. (* 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 G)))) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)))))) *) rewrite -(@leq_pmul2r #|H :&: K|) ?cardG_gt0 // -mul_cardG. (* Goal: is_true (leq (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)) (@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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@gval gT K)))))) (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 H)))) (@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)))))) *) rewrite -(Lagrange sHG) -(LagrangeI K H) mulnAC setIC -mulnA. (* Goal: is_true (leq (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 H)))) (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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))))) (@indexg gT (@gval gT G) (@gval gT H)))) (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 H)))) (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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@gval gT H))))) (@indexg gT (@gval gT K) (@gval gT H))))) *) rewrite !leq_pmul2l ?cardG_gt0 // dvdn_leq // -(Gauss_dvdr _ co_iG_HK). (* Goal: is_true (dvdn (@indexg gT (@gval gT G) (@gval gT H)) (muln (@indexg gT (@gval gT G) (@gval gT K)) (@indexg gT (@gval gT K) (@gval gT H)))) *) by rewrite -(indexgI K) Lagrange_index ?indexgS ?subsetIl ?subsetIr. Qed. End Lagrange. Section GeneratedGroup. Variable gT : finGroupType. Implicit Types x y z : gT. Implicit Types A B C D : {set gT}. Implicit Types G H K : {group gT}. Lemma subset_gen A : A \subset <<A>>. 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)) 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 A)))) *) exact/bigcapsP. Qed. Lemma sub_gen A B : A \subset B -> A \subset <<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 (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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)) (@generated gT B)))) *) by move/subset_trans=> -> //; apply: subset_gen. Qed. Lemma mem_gen x A : x \in A -> x \in <<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 (@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 A)))) *) exact: subsetP (subset_gen A) x. Qed. Lemma generatedP x A : reflect (forall G, A \subset G -> x \in G) (x \in <<A>>). Proof. (* Goal: Bool.reflect (forall (G : @group_of gT (Phant (FinGroup.arg_sort (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)) 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))))), 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))))) (@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 A)))) *) exact: bigcapP. Qed. Lemma gen_subG A G : (<<A>> \subset G) = (A \subset G). 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)) (@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)) (@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)) 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)))) *) apply/idP/idP=> [|sAG]; first exact: subset_trans (subset_gen A). (* 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)) (@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)) (@gval gT G)))) *) by apply/subsetP=> x /generatedP; apply. Qed. Lemma genGid G : <<G>> = G. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@generated gT (@gval gT G)) (@gval gT G) *) by apply/eqP; rewrite eqEsubset gen_subG subset_gen andbT. Qed. Lemma genGidG G : <<G>>%G = G. Proof. (* Goal: @eq (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@generated_group gT (@gval gT G)) G *) by apply: val_inj; apply: genGid. Qed. Lemma gen_set_id A : group_set A -> <<A>> = A. Proof. (* Goal: forall _ : is_true (@group_set gT A), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@generated gT A) A *) by move=> gA; apply: (genGid (group gA)). Qed. Lemma genS A B : A \subset B -> <<A>> \subset <<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 (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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)))) *) by move=> sAB; rewrite gen_subG sub_gen. Qed. Lemma gen0 : <<set0>> = 1 :> {set gT}. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@generated gT (@set0 (FinGroup.arg_finType (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) by apply/eqP; rewrite eqEsubset sub1G gen_subG sub0set. Qed. Lemma gen_expgs A : {n | <<A>> = (1 |: A) ^+ n}. Lemma gen_prodgP A x : reflect (exists n, exists2 c, forall i : 'I_n, c i \in A & x = \prod_i c i) (x \in <<A>>). Lemma genD A B : A \subset <<A :\: B>> -> <<A :\: B>> = <<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)) (@generated gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) A B))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@generated gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) A B)) (@generated gT A) *) by move=> sAB; apply/eqP; rewrite eqEsubset genS (subsetDl, gen_subG). Qed. Lemma genV A : <<A^-1>> = <<A>>. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@generated gT (@invg (group_set_of_baseGroupType (FinGroup.base gT)) A)) (@generated gT A) *) apply/eqP; rewrite eqEsubset !gen_subG -!(invSg _ <<_>>) invgK. (* 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)) 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)) (@invg (group_set_of_baseGroupType (FinGroup.base gT)) (@generated gT A))))) (@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)) (@invg (group_set_of_baseGroupType (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)) (@invg (group_set_of_baseGroupType (FinGroup.base gT)) (@generated gT (@invg (group_set_of_baseGroupType (FinGroup.base gT)) A))))))) *) by rewrite !invGid !subset_gen. Qed. Lemma genJ A z : <<A :^z>> = <<A>> :^ z. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@generated gT (@conjugate gT A z)) (@conjugate gT (@generated gT A) z) *) by apply/eqP; rewrite eqEsubset sub_conjg !gen_subG conjSg -?sub_conjg !sub_gen. Qed. Lemma conjYg A B z : (A <*> B) :^z = A :^ z <*> B :^ z. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@joing gT A B) z) (@joing gT (@conjugate gT A z) (@conjugate gT B z)) *) by rewrite -genJ conjUg. Qed. Lemma genD1 A x : x \in <<A :\ x>> -> <<A :\ x>> = <<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)) (@generated gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@generated gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@generated gT A) *) move=> gA'x; apply/eqP; rewrite eqEsubset genS; last by rewrite subsetDl. (* 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)) (@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 (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))))))) *) rewrite gen_subG; apply/subsetP=> y Ay. (* Goal: 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 (@generated_group gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))))))) *) by case: (y =P x) => [-> //|]; move/eqP=> nyx; rewrite mem_gen // !inE nyx. Qed. Lemma genD1id A : <<A^#>> = <<A>>. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@generated gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT))))) (@generated gT A) *) by rewrite genD1 ?group1. Qed. Notation joingT := (@joing gT) (only parsing). Notation joinGT := (@joinG gT) (only parsing). Lemma joingE A B : A <*> B = <<A :|: B>>. Proof. by []. Qed. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT A B) (@generated gT (@setU (FinGroup.arg_finType (FinGroup.base gT)) A B)) *) by []. Qed. Lemma joingC : commutative joingT. Proof. (* Goal: @commutative (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT) *) by move=> A B; rewrite /joing setUC. Qed. Lemma joing_idr A B : A <*> <<B>> = A <*> B. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT A (@generated gT B)) (@joing gT A B) *) apply/eqP; rewrite eqEsubset gen_subG subUset gen_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)) 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)) (@joing gT A B)))) (@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)) B)) (@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 A B))))) (@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)) (@joing gT A B))) (@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 A (@generated gT B)))))) *) by rewrite -subUset subset_gen genS // setUS // subset_gen. Qed. Lemma joing_idl A B : <<A>> <*> B = A <*> B. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT (@generated gT A) B) (@joing gT A B) *) by rewrite -!(joingC B) joing_idr. Qed. Lemma joing_subl A B : A \subset A <*> B. 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)) 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)) (@joing gT A B)))) *) by rewrite sub_gen ?subsetUl. Qed. Lemma joing_subr A B : B \subset A <*> B. 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)) 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)) (@joing gT A B)))) *) by rewrite sub_gen ?subsetUr. Qed. Lemma join_subG A B G : (A <*> B \subset G) = (A \subset G) && (B \subset G). 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)) (@joing gT A 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)))) (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)) 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)))) (@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)) (@gval gT G))))) *) by rewrite gen_subG subUset. Qed. Lemma joing_idPl G A : reflect (G <*> A = G) (A \subset G). Proof. (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT (@gval gT G) A) (@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)) 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)))) *) apply: (iffP idP) => [sHG | <-]; last by rewrite joing_subr. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT (@gval gT G) A) (@gval gT G) *) by rewrite joingE (setUidPl sHG) genGid. Qed. Lemma joing_idPr A G : reflect (A <*> G = G) (A \subset G). Proof. (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT A (@gval gT G)) (@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)) 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 rewrite joingC; apply: joing_idPl. Qed. Lemma joing_subP A B G : reflect (A \subset G /\ B \subset G) (A <*> B \subset 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)) 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))))) (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)) (@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)) (@joing gT A 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)))) *) by rewrite join_subG; apply: andP. Qed. Lemma joing_sub A B C : A <*> B = C -> A \subset C /\ B \subset C. Proof. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT A B) C, 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)) 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)) C)))) (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)) C)))) *) by move <-; apply/joing_subP. Qed. Lemma genDU A B C : A \subset C -> <<C :\: A>> = <<B>> -> <<A :|: B>> = <<C>>. 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)) C)))) (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@generated gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) C A)) (@generated gT B)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@generated gT (@setU (FinGroup.arg_finType (FinGroup.base gT)) A B)) (@generated gT C) *) move=> sAC; rewrite -joingE -joing_idr => <- {B}; rewrite joing_idr. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT A (@setD (FinGroup.arg_finType (FinGroup.base gT)) C A)) (@generated gT C) *) by congr <<_>>; rewrite setDE setUIr setUCr setIT; apply/setUidPr. Qed. Lemma joingA : associative joingT. Proof. (* Goal: @associative (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT) *) by move=> A B C; rewrite joing_idl joing_idr /joing setUA. Qed. Lemma joing1G G : 1 <*> G = G. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@gval gT G)) (@gval gT G) *) by rewrite -gen0 joing_idl /joing set0U genGid. Qed. Lemma joingG1 G : G <*> 1 = G. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@gval gT G) *) by rewrite joingC joing1G. Qed. Lemma genM_join G H : <<G * H>> = G <*> H. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@generated gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))) (@joing gT (@gval gT G) (@gval gT H)) *) apply/eqP; rewrite eqEsubset gen_subG /= -{1}[G <*> H]mulGid. (* Goal: is_true (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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@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)) (@gval gT (@joing_group gT (@gval gT G) (@gval gT H))) (@gval gT (@joing_group gT (@gval gT G) (@gval gT H))))))) (@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)) (@joing gT (@gval gT G) (@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)) (@generated gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))))))) *) rewrite genS; last by rewrite subUset mulG_subl mulG_subr. (* Goal: is_true (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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@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)) (@gval gT (@joing_group gT (@gval gT G) (@gval gT H))) (@gval gT (@joing_group gT (@gval gT G) (@gval gT H))))))) true) *) by rewrite mulgSS ?(sub_gen, subsetUl, subsetUr). Qed. Lemma mulG_subG G H K : (G * H \subset K) = (G \subset K) && (H \subset K). 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@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)))) (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 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 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)) (@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))))) *) by rewrite -gen_subG genM_join join_subG. Qed. Lemma mulGsubP K H G : reflect (K \subset G /\ H \subset G) (K * H \subset 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 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 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@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 mulG_subG; apply: andP. Qed. Lemma mulG_sub K H A : K * H = A -> K \subset A /\ H \subset A. Proof. (* Goal: forall _ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H)) A, 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 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)) 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 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)) A)))) *) by move <-; rewrite mulG_subl mulG_subr. Qed. Lemma trivMg G H : (G * H == 1) = (G :==: 1) && (H :==: 1). Proof. (* Goal: @eq bool (@eq_op (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (andb (@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 gT))) (@gval gT H : @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 rewrite !eqEsubset -{2}[1]mulGid mulgSS ?sub1G // !andbT mulG_subG. Qed. Lemma comm_joingE G H : commute G H -> G <*> H = G * H. Proof. (* Goal: forall _ : @commute (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT (@gval gT G) (@gval gT H)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) *) by move/comm_group_setP=> gGH; rewrite -genM_join; apply: (genGid (group gGH)). Qed. Lemma joinGC : commutative joinGT. Proof. (* Goal: @commutative (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joinG gT) *) by move=> G H; apply: val_inj; apply: joingC. Qed. Lemma joinGA : associative joinGT. Proof. (* Goal: @associative (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joinG gT) *) by move=> G H K; apply: val_inj; apply: joingA. Qed. Lemma join1G : left_id 1%G joinGT. Proof. (* Goal: @left_id (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (one_group gT) (@joinG gT) *) by move=> G; apply: val_inj; apply: joing1G. Qed. Lemma joinG1 : right_id 1%G joinGT. Proof. (* Goal: @right_id (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (one_group gT) (@joinG gT) *) by move=> G; apply: val_inj; apply: joingG1. Qed. Canonical joinG_law := Monoid.Law joinGA join1G joinG1. Canonical joinG_abelaw := Monoid.ComLaw joinGC. Lemma bigprodGEgen I r (P : pred I) (F : I -> {set gT}) : (\prod_(i <- r | P i) <<F i>>)%G :=: << \bigcup_(i <- r | P i) F i >>. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I (one_group gT) r (fun i : I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I i (@joinG gT) (P i) (@generated_group gT (F i))))) (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) I (@set0 (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 (@setU (FinGroup.arg_finType (FinGroup.base gT))) (P i) (F i)))) *) elim/big_rec2: _ => /= [|i A _ _ ->]; first by rewrite gen0. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@generated gT (F i)) (@generated gT A)) (@generated gT (@setU (FinGroup.arg_finType (FinGroup.base gT)) (F i) A)) *) by rewrite joing_idl joing_idr. Qed. Lemma bigprodGE I r (P : pred I) (F : I -> {group gT}) : (\prod_(i <- r | P i) F i)%G :=: << \bigcup_(i <- r | P i) F i >>. Lemma mem_commg A B x y : x \in A -> y \in B -> [~ x, y] \in [~: A, B]. 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 (@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)) B)))), is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@commg 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)) (@commutator gT A B)))) *) by move=> Ax By; rewrite mem_gen ?mem_imset2. Qed. Lemma commSg A B C : A \subset B -> [~: A, C] \subset [~: B, C]. 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 (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@commutator gT A C))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@commutator gT B C)))) *) by move=> sAC; rewrite genS ?imset2S. Qed. Lemma commgS A B C : B \subset C -> [~: A, B] \subset [~: A, C]. 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)) C))), 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)) (@commutator gT A 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)) (@commutator gT A C)))) *) by move=> sBC; rewrite genS ?imset2S. Qed. Lemma commgSS A B C D : A \subset B -> C \subset D -> [~: A, C] \subset [~: B, D]. 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 (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) C)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) D)))), 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)) (@commutator gT A C))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@commutator gT B D)))) *) by move=> sAB sCD; rewrite genS ?imset2S. Qed. Lemma der1_subG G : [~: G, 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)) (@commutator gT (@gval gT G) (@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=> _ /imset2P[x y Gx Gy ->]; apply: groupR. Qed. Lemma comm_subG A B G : A \subset G -> B \subset G -> [~: A, B] \subset 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)) 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))))) (_ : 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)) (@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)) (@commutator gT A 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)))) *) by move=> sAG sBG; apply: subset_trans (der1_subG G); apply: commgSS. Qed. Lemma commGC A B : [~: A, B] = [~: B, A]. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@commutator gT A B) (@commutator gT B A) *) rewrite -[[~: A, B]]genV; congr <<_>>; apply/setP=> z; rewrite inE. (* Goal: @eq bool (@in_mem (FinGroup.sort (FinGroup.base gT)) (@invg (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)) (@commg_set gT A B)))) (@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)) (@commg_set gT B A)))) *) by apply/imset2P/imset2P=> [] [x y Ax Ay]; last rewrite -{1}(invgK z); rewrite -invg_comm => /invg_inj->; exists y x. Qed. Lemma conjsRg A B x : [~: A, B] :^ x = [~: A :^ x, B :^ x]. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@commutator gT A B) x) (@commutator gT (@conjugate gT A x) (@conjugate gT B x)) *) wlog suffices: A B x / [~: A, B] :^ x \subset [~: A :^ x, B :^ x]. (* 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)) (@conjugate gT (@commutator gT A 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)) (@commutator gT (@conjugate gT A x) (@conjugate gT B x))))) *) (* Goal: forall _ : forall (A B : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (x : FinGroup.arg_sort (FinGroup.base gT)), 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)) (@conjugate gT (@commutator gT A 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)) (@commutator gT (@conjugate gT A x) (@conjugate gT B x))))), @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@commutator gT A B) x) (@commutator gT (@conjugate gT A x) (@conjugate gT B x)) *) move=> subJ; apply/eqP; rewrite eqEsubset subJ /= -sub_conjgV. (* 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)) (@conjugate gT (@commutator gT A 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)) (@commutator gT (@conjugate gT A x) (@conjugate gT B x))))) *) (* 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)) (@conjugate gT (@commutator gT (@conjugate gT A x) (@conjugate gT B x)) (@invg (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)) (@commutator gT A B)))) *) by rewrite -{2}(conjsgK x A) -{2}(conjsgK x B). (* 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)) (@conjugate gT (@commutator gT A 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)) (@commutator gT (@conjugate gT A x) (@conjugate gT B x))))) *) rewrite -genJ gen_subG; apply/subsetP=> _ /imsetP[_ /imset2P[y z Ay Bz ->] ->]. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@conjg gT (@commg gT y z) 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 (@commutator_group gT (@conjugate gT A x) (@conjugate gT B x)))))) *) by rewrite conjRg mem_commg ?memJ_conjg. Qed. End GeneratedGroup. Arguments gen_prodgP {gT A x}. Arguments joing_idPl {gT G A}. Arguments joing_idPr {gT A G}. Arguments mulGsubP {gT K H G}. Arguments joing_subP {gT A B G}. Section Cycles. Variable gT : finGroupType. Implicit Types x y : gT. Implicit Types G : {group gT}. Import Monoid.Theory. Lemma cycle1 : <[1]> = [1 gT]. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@cycle gT (oneg (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) *) exact: genGid. Qed. Lemma order1 : #[1 : gT] = 1%N. Proof. (* Goal: @eq nat (@order gT (oneg (FinGroup.base gT) : FinGroup.arg_sort (FinGroup.base gT))) (S O) *) by rewrite /order cycle1 cards1. Qed. Lemma cycle_id x : x \in <[x]>. Proof. (* 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)) (@cycle gT x)))) *) by rewrite mem_gen // set11. Qed. Lemma mem_cycle x i : x ^+ i \in <[x]>. Proof. (* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@expgn (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)) (@cycle gT x)))) *) by rewrite groupX // cycle_id. Qed. Lemma cycle_subG x G : (<[x]> \subset G) = (x \in G). 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)) (@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)) (@gval gT G)))) (@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)))) *) by rewrite gen_subG sub1set. Qed. Lemma cycle_eq1 x : (<[x]> == 1) = (x == 1). Proof. (* Goal: @eq bool (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@cycle gT x) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq_op (FinGroup.arg_eqType (FinGroup.base gT)) x (oneg (FinGroup.base gT))) *) by rewrite eqEsubset sub1G andbT cycle_subG inE. Qed. Lemma order_eq1 x : (#[x] == 1%N) = (x == 1). Proof. (* Goal: @eq bool (@eq_op nat_eqType (@order gT x) (S O)) (@eq_op (FinGroup.arg_eqType (FinGroup.base gT)) x (oneg (FinGroup.base gT))) *) by rewrite -trivg_card1 cycle_eq1. Qed. Lemma order_gt1 x : (#[x] > 1) = (x != 1). Proof. (* Goal: @eq bool (leq (S (S O)) (@order gT x)) (negb (@eq_op (FinGroup.arg_eqType (FinGroup.base gT)) x (oneg (FinGroup.base gT)))) *) by rewrite ltnNge -trivg_card_le1 cycle_eq1. Qed. Lemma cycle_traject x : <[x]> =i traject (mulg x) 1 #[x]. Lemma cycle2g x : #[x] = 2 -> <[x]> = [set 1; x]. Proof. (* Goal: forall _ : @eq nat (@order gT x) (S (S O)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@cycle gT x) (@setU (FinGroup.finType (FinGroup.base gT)) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT))) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) *) by move=> ox; apply/setP=> y; rewrite cycle_traject ox !inE mulg1. Qed. Lemma cyclePmin x y : y \in <[x]> -> {i | i < #[x] & y = x ^+ i}. Proof. (* Goal: forall _ : is_true (@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)) (@cycle gT x)))), @sig2 nat (fun i : nat => is_true (leq (S i) (@order gT x))) (fun i : nat => @eq (FinGroup.arg_sort (FinGroup.base gT)) y (@expgn (FinGroup.base gT) x i)) *) rewrite cycle_traject; set tx := traject _ _ #[x] => tx_y; pose i := index y tx. (* Goal: @sig2 nat (fun i : nat => is_true (leq (S i) (@order gT x))) (fun i : nat => @eq (FinGroup.arg_sort (FinGroup.base gT)) y (@expgn (FinGroup.base gT) x i)) *) have lt_i_x : i < #[x] by rewrite -index_mem size_traject in tx_y. (* Goal: @sig2 nat (fun i : nat => is_true (leq (S i) (@order gT x))) (fun i : nat => @eq (FinGroup.arg_sort (FinGroup.base gT)) y (@expgn (FinGroup.base gT) x i)) *) by exists i; rewrite // [x ^+ i]iteropE /= -(nth_traject _ lt_i_x) nth_index. Qed. Lemma cycleP x y : reflect (exists i, y = x ^+ i) (y \in <[x]>). Proof. (* Goal: Bool.reflect (@ex nat (fun i : nat => @eq (FinGroup.arg_sort (FinGroup.base gT)) y (@expgn (FinGroup.base gT) x i))) (@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)) (@cycle gT x)))) *) by apply: (iffP idP) => [/cyclePmin[i _]|[i ->]]; [exists i | apply: mem_cycle]. Qed. Lemma expg_order x : x ^+ #[x] = 1. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (@order gT x)) (oneg (FinGroup.base gT)) *) have: uniq (traject (mulg x) 1 #[x]). (* Goal: forall _ : is_true (@uniq (FinGroup.arg_eqType (FinGroup.base gT)) (@traject (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) x) (oneg (FinGroup.base gT)) (@order gT x))), @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (@order gT x)) (oneg (FinGroup.base gT)) *) (* Goal: is_true (@uniq (FinGroup.arg_eqType (FinGroup.base gT)) (@traject (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) x) (oneg (FinGroup.base gT)) (@order gT x))) *) by apply/card_uniqP; rewrite size_traject -(eq_card (cycle_traject x)). (* Goal: forall _ : is_true (@uniq (FinGroup.arg_eqType (FinGroup.base gT)) (@traject (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) x) (oneg (FinGroup.base gT)) (@order gT x))), @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (@order gT x)) (oneg (FinGroup.base gT)) *) case/cyclePmin: (mem_cycle x #[x]) => [] [//|i] ltix. (* Goal: forall (_ : @eq (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (@order gT x)) (@expgn (FinGroup.base gT) x (S i))) (_ : is_true (@uniq (FinGroup.arg_eqType (FinGroup.base gT)) (@traject (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) x) (oneg (FinGroup.base gT)) (@order gT x)))), @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (@order gT x)) (oneg (FinGroup.base gT)) *) rewrite -(subnKC ltix) addSnnS /= expgD; move: (_ - _) => j x_j1. (* Goal: forall _ : is_true (andb (negb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (oneg (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (seq_predType (FinGroup.arg_eqType (FinGroup.base gT))) (@traject (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) x) (@mulg (FinGroup.base gT) x (oneg (FinGroup.base gT))) (addn_rec i (S j)))))) (@uniq (FinGroup.arg_eqType (FinGroup.base gT)) (@traject (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) x) (@mulg (FinGroup.base gT) x (oneg (FinGroup.base gT))) (addn_rec i (S j))))), @eq (FinGroup.sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@expgn (FinGroup.base gT) x (S i)) (@expgn (FinGroup.base gT) x (S j))) (oneg (FinGroup.base gT)) *) case/andP=> /trajectP[]; exists j; first exact: leq_addl. (* Goal: @eq (Equality.sort (FinGroup.arg_eqType (FinGroup.base gT))) (oneg (FinGroup.base gT)) (@iter (Equality.sort (FinGroup.arg_eqType (FinGroup.base gT))) j (@mulg (FinGroup.base gT) x) (@mulg (FinGroup.base gT) x (oneg (FinGroup.base gT)))) *) by apply: (mulgI (x ^+ i.+1)); rewrite -iterSr iterS -iteropE -expgS mulg1. Qed. Lemma expg_mod p k x : x ^+ p = 1 -> x ^+ (k %% p) = x ^+ k. Proof. (* Goal: forall _ : @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x p) (oneg (FinGroup.base gT)), @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (modn k p)) (@expgn (FinGroup.base gT) x k) *) move=> xp. (* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (modn k p)) (@expgn (FinGroup.base gT) x k) *) by rewrite {2}(divn_eq k p) expgD mulnC expgM xp expg1n mul1g. Qed. Lemma expg_mod_order x i : x ^+ (i %% #[x]) = x ^+ i. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (modn i (@order gT x))) (@expgn (FinGroup.base gT) x i) *) by rewrite expg_mod // expg_order. Qed. Lemma invg_expg x : x^-1 = x ^+ #[x].-1. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@invg (FinGroup.base gT) x) (@expgn (FinGroup.base gT) x (Nat.pred (@order gT x))) *) by apply/eqP; rewrite eq_invg_mul -expgS prednK ?expg_order. Qed. Lemma invg2id x : #[x] = 2 -> x^-1 = x. Proof. (* Goal: forall _ : @eq nat (@order gT x) (S (S O)), @eq (FinGroup.sort (FinGroup.base gT)) (@invg (FinGroup.base gT) x) x *) by move=> ox; rewrite invg_expg ox. Qed. Lemma cycleX x i : <[x ^+ i]> \subset <[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)) (@cycle gT (@expgn (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)) (@cycle gT x)))) *) by rewrite cycle_subG; apply: mem_cycle. Qed. Lemma cycleV x : <[x^-1]> = <[x]>. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@cycle gT (@invg (FinGroup.base gT) x)) (@cycle gT x) *) by apply/eqP; rewrite eq_sym eqEsubset !cycle_subG groupV -groupV !cycle_id. Qed. Lemma orderV x : #[x^-1] = #[x]. Proof. (* Goal: @eq nat (@order gT (@invg (FinGroup.base gT) x)) (@order gT x) *) by rewrite /order cycleV. Qed. Lemma cycleJ x y : <[x ^ y]> = <[x]> :^ y. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@cycle gT (@conjg gT x y)) (@conjugate gT (@cycle gT x) y) *) by rewrite -genJ conjg_set1. Qed. Lemma orderJ x y : #[x ^ y] = #[x]. Proof. (* Goal: @eq nat (@order gT (@conjg gT x y)) (@order gT x) *) by rewrite /order cycleJ cardJg. Qed. End Cycles. Section Normaliser. Variable gT : finGroupType. Implicit Types x y z : gT. Implicit Types A B C D : {set gT}. Implicit Type G H K : {group gT}. Lemma normP x A : reflect (A :^ x = A) (x \in 'N(A)). Proof. (* Goal: Bool.reflect (@eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT A x) A) (@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)) (@normaliser gT A)))) *) suffices ->: (x \in 'N(A)) = (A :^ x == A) by apply: eqP. (* Goal: @eq 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)) (@normaliser gT A)))) (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base gT))) (@conjugate gT A x) A) *) by rewrite eqEcard cardJg leqnn andbT inE. Qed. Arguments normP {x A}. Lemma group_set_normaliser A : group_set 'N(A). Proof. (* Goal: is_true (@group_set gT (@normaliser gT A)) *) apply/group_setP; split=> [|x y Nx Ny]; rewrite inE ?conjsg1 //. (* 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)) (@conjugate gT A (@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)) A))) *) by rewrite conjsgM !(normP _). Qed. Canonical normaliser_group A := group (group_set_normaliser A). Lemma normsP A B : reflect {in A, normalised B} (A \subset 'N(B)). 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)) A)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT B x) B) (inPhantom (@normalised 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)) 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 B)))) *) apply: (iffP subsetP) => nBA x Ax; last by rewrite inE nBA //. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT B x) B *) by apply/normP; apply: nBA. Qed. Arguments normsP {A B}. Lemma memJ_norm x y A : x \in 'N(A) -> (y ^ x \in A) = (y \in 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)) (@normaliser gT A)))), @eq bool (@in_mem (FinGroup.sort (FinGroup.base gT)) (@conjg gT y 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))) (@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)) A))) *) by move=> Nx; rewrite -{1}(normP Nx) memJ_conjg. Qed. Lemma norms_cycle x y : (<[y]> \subset 'N(<[x]>)) = (x ^ y \in <[x]>). 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)) (@cycle 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)) (@normaliser gT (@cycle gT x))))) (@in_mem (FinGroup.sort (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)) (@cycle gT x)))) *) by rewrite cycle_subG inE -cycleJ cycle_subG. Qed. Lemma norm1 : 'N(1) = setT :> {set gT}. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@normaliser gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) *) by apply/setP=> x; rewrite !inE conjs1g subxx. Qed. Lemma norms1 A : A \subset 'N(1). 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)) 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 (oneg (group_set_of_baseGroupType (FinGroup.base gT))))))) *) by rewrite norm1 subsetT. Qed. Lemma normCs A : 'N(~: A) = 'N(A). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@normaliser gT (@setC (FinGroup.arg_finType (FinGroup.base gT)) A)) (@normaliser gT A) *) by apply/setP=> x; rewrite -groupV !inE conjCg setCS sub_conjg. Qed. Lemma normG G : G \subset 'N(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)) (@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 G))))) *) by apply/normsP; apply: conjGid. Qed. Lemma normT : 'N([set: gT]) = [set: gT]. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@normaliser gT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) *) by apply/eqP; rewrite -subTset normG. Qed. Lemma normsG A G : A \subset G -> A \subset '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)) 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)))), 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))))) *) by move=> sAG; apply: subset_trans (normG G). Qed. Lemma normC A B : A \subset 'N(B) -> commute A 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)) (@normaliser gT B)))), @commute (group_set_of_baseGroupType (FinGroup.base gT)) A B *) move/subsetP=> nBA; apply/setP=> u. (* Goal: @eq bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B)))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) B A)))) *) apply/mulsgP/mulsgP=> [[x y Ax By] | [y x By Ax]] -> {u}. (* Goal: @imset2_spec (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@mulg (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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 _ : 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)) B)) (@mulg (FinGroup.base gT) y x) *) (* Goal: @imset2_spec (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@mulg (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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 _ : 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)) (@mulg (FinGroup.base gT) x y) *) by exists (y ^ x^-1) x; rewrite -?conjgCV // memJ_norm // groupV nBA. (* Goal: @imset2_spec (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@mulg (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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 _ : 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)) B)) (@mulg (FinGroup.base gT) y x) *) by exists x (y ^ x); rewrite -?conjgC // memJ_norm // nBA. Qed. Lemma norm_joinEl G H : G \subset 'N(H) -> G <*> H = 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))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT (@gval gT G) (@gval gT H)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) *) by move/normC/comm_joingE. Qed. Lemma norm_joinEr G H : H \subset 'N(G) -> G <*> H = 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 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 G))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT (@gval gT G) (@gval gT H)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) *) by move/normC=> cHG; apply: comm_joingE. Qed. Lemma norm_rlcoset G x : x \in 'N(G) -> G :* x = x *: G. 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)) (@normaliser gT (@gval gT G))))), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@gval gT G)) *) by rewrite -sub1set => /normC. Qed. Lemma rcoset_mul G x y : x \in 'N(G) -> (G :* x) * (G :* y) = G :* (x * y). 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)) (@normaliser gT (@gval gT G))))), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.finType (FinGroup.base gT)) (@mulg (FinGroup.base gT) x y))) *) move/norm_rlcoset=> GxxG. (* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.finType (FinGroup.base gT)) (@mulg (FinGroup.base gT) x y))) *) by rewrite mulgA -(mulgA _ _ G) -GxxG mulgA mulGid -mulgA mulg_set1. Qed. Lemma normJ A x : 'N(A :^ x) = 'N(A) :^ x. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@normaliser gT (@conjugate gT A x)) (@conjugate gT (@normaliser gT A) x) *) by apply/setP=> y; rewrite mem_conjg !inE -conjsgM conjgCV conjsgM conjSg. Qed. Lemma norm_conj_norm x A B : x \in 'N(A) -> (A \subset 'N(B :^ x)) = (A \subset 'N(B)). 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)) (@normaliser gT A)))), @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)) (@normaliser gT (@conjugate gT B x))))) (@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 B)))) *) by move=> Nx; rewrite normJ -sub_conjgV (normP _) ?groupV. Qed. Lemma norm_gen A : 'N(A) \subset 'N(<<A>>). 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)) (@normaliser 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 (@generated gT A))))) *) by apply/normsP=> x Nx; rewrite -genJ (normP Nx). Qed. Lemma class_norm x G : G \subset 'N(x ^: 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)) (@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 (@class gT x (@gval gT G)))))) *) by apply/normsP=> y; apply: classGidr. Qed. Lemma class_normal x G : x \in G -> x ^: G <| G. 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)) (@gval gT G)))), is_true (@normal gT (@class gT x (@gval gT G)) (@gval gT G)) *) by move=> Gx; rewrite /normal class_norm class_subG. Qed. Lemma class_sub_norm G A x : G \subset 'N(A) -> (x ^: G \subset A) = (x \in 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 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 A)))), @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)) (@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))) (@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))) *) move=> nAG; apply/subsetP/idP=> [-> // | Ax xy]; first exact: class_refl. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) xy (@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))))), is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) xy (@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)) A))) *) by case/imsetP=> y Gy ->; rewrite memJ_norm ?(subsetP nAG). Qed. Lemma class_support_norm A G : G \subset 'N(class_support A 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)) (@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 (@class_support gT A (@gval gT G)))))) *) by apply/normsP; apply: class_supportGidr. Qed. Lemma class_support_sub_norm A B G : A \subset G -> B \subset 'N(G) -> class_support A B \subset 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)) 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))))) (_ : 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)) (@normaliser 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)) (@class_support gT A 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)))) *) move=> sAG nGB; rewrite class_supportEr. (* 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)) (@BigOp.bigop (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@set0 (FinGroup.finType (FinGroup.base gT))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@setU (FinGroup.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)) B))) (@conjugate 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 apply/bigcupsP=> x Bx; rewrite -(normsP nGB x Bx) conjSg. Qed. Section norm_trans. Variables (A B C D : {set gT}). Hypotheses (nBA : A \subset 'N(B)) (nCA : A \subset 'N(C)). Lemma norms_gen : A \subset 'N(<<B>>). 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)) 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 (@generated gT B))))) *) exact: subset_trans nBA (norm_gen B). Qed. Lemma norms_norm : A \subset 'N('N(B)). 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)) 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 (@normaliser gT B))))) *) by apply/normsP=> x Ax; rewrite -normJ (normsP nBA). Qed. Lemma normsI : A \subset 'N(B :&: C). 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)) 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 (@setI (FinGroup.arg_finType (FinGroup.base gT)) B C))))) *) by apply/normsP=> x Ax; rewrite conjIg !(normsP _ x Ax). Qed. Lemma normsU : A \subset 'N(B :|: C). 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)) 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 (@setU (FinGroup.arg_finType (FinGroup.base gT)) B C))))) *) by apply/normsP=> x Ax; rewrite conjUg !(normsP _ x Ax). Qed. Lemma normsIs : B \subset 'N(D) -> A :&: B \subset 'N(C :&: D). 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)) (@normaliser gT D)))), 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)) A 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 (@setI (FinGroup.arg_finType (FinGroup.base gT)) C D))))) *) move/normsP=> nDB; apply/normsP=> x; case/setIP=> Ax Bx. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) C D) x) (@setI (FinGroup.arg_finType (FinGroup.base gT)) C D) *) by rewrite conjIg (normsP nCA) ?nDB. Qed. Lemma normsD : A \subset 'N(B :\: C). 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)) 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 (@setD (FinGroup.arg_finType (FinGroup.base gT)) B C))))) *) by apply/normsP=> x Ax; rewrite conjDg !(normsP _ x Ax). Qed. Lemma normsM : A \subset 'N(B * C). 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)) 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 (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C))))) *) by apply/normsP=> x Ax; rewrite conjsMg !(normsP _ x Ax). Qed. Lemma normsY : A \subset 'N(B <*> C). 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)) 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 (@joing gT B C))))) *) by apply/normsP=> x Ax; rewrite -genJ conjUg !(normsP _ x Ax). Qed. Lemma normsR : A \subset 'N([~: B, C]). 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)) 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 (@commutator gT B C))))) *) by apply/normsP=> x Ax; rewrite conjsRg !(normsP _ x Ax). Qed. Lemma norms_class_support : A \subset 'N(class_support B C). 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)) 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 (@class_support gT B C))))) *) apply/subsetP=> x Ax; rewrite inE sub_conjg class_supportEr. (* 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)) (@BigOp.bigop (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@set0 (FinGroup.finType (FinGroup.base gT))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@setU (FinGroup.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)) C))) (@conjugate gT B 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)) (@conjugate gT (@BigOp.bigop (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@set0 (FinGroup.finType (FinGroup.base gT))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@setU (FinGroup.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)) C))) (@conjugate gT B x))) (@invg (FinGroup.base gT) x))))) *) apply/bigcupsP=> y Cy; rewrite -sub_conjg -conjsgM conjgC conjsgM. (* 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)) (@conjugate gT (@conjugate gT B x) (@conjg gT y 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.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@set0 (FinGroup.finType (FinGroup.base gT))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@setU (FinGroup.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)) C))) (@conjugate gT B x)))))) *) by rewrite (normsP nBA) // bigcup_sup ?memJ_norm ?(subsetP nCA). Qed. End norm_trans. Lemma normsIG A B G : A \subset 'N(B) -> A :&: G \subset 'N(B :&: 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)) 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 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (@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 (@setI (FinGroup.arg_finType (FinGroup.base gT)) B (@gval gT G)))))) *) by move/normsIs->; rewrite ?normG. Qed. Lemma normsGI A B G : A \subset 'N(B) -> G :&: A \subset 'N(G :&: 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)) (@normaliser gT 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)) (@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)) (@normaliser gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) B))))) *) by move=> nBA; rewrite !(setIC G) normsIG. Qed. Lemma norms_bigcap I r (P : pred I) A (B_ : I -> {set gT}) : A \subset \bigcap_(i <- r | P i) 'N(B_ i) -> A \subset 'N(\bigcap_(i <- r | P i) B_ i). 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)) (@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) (@normaliser gT (B_ 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)) 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 (@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) (B_ i))))))) *) elim/big_rec2: _ => [|i B N _ IH /subsetIP[nBiA /IH]]; last exact: normsI. (* 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)) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (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)) 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 (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))))) *) by rewrite normT. Qed. Lemma norms_bigcup I r (P : pred I) A (B_ : I -> {set gT}) : A \subset \bigcap_(i <- r | P i) 'N(B_ i) -> A \subset 'N(\bigcup_(i <- r | P i) B_ i). 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)) (@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) (@normaliser gT (B_ 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)) 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 (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) I (@set0 (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 (@setU (FinGroup.arg_finType (FinGroup.base gT))) (P i) (B_ i))))))) *) move=> nBA; rewrite -normCs setC_bigcup norms_bigcap //. (* 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)) 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)) (@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) (@normaliser gT (@setC (FinGroup.arg_finType (FinGroup.base gT)) (B_ i)))))))) *) by rewrite (eq_bigr _ (fun _ _ => normCs _)). Qed. Lemma normsD1 A B : A \subset 'N(B) -> A \subset '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)) (@normaliser gT 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)) (@normaliser gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) B (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))))))) *) by move/normsD->; rewrite ?norms1. Qed. Lemma normD1 A : 'N(A^#) = 'N(A). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@normaliser gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT))))) (@normaliser gT A) *) apply/eqP; rewrite eqEsubset normsD1 //. (* 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)) (@normaliser gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@set1 (FinGroup.finType (FinGroup.base gT)) (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)) (@normaliser gT A)))) true) *) rewrite -{2}(setID A 1) setIC normsU //; apply/normsP=> x _; apply/setP=> y. (* Goal: @eq bool (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) y (@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)) (@conjugate gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) A) x)))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) y (@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)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) A)))) *) by rewrite conjIg conjs1g !inE mem_conjg; case: eqP => // ->; rewrite conj1g. Qed. Lemma normalP A B : reflect (A \subset B /\ {in B, normalised A}) (A <| B). 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)) 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)) B)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT A x) A) (inPhantom (@normalised gT A)))) (@normal gT A B) *) by apply: (iffP andP)=> [] [sAB]; move/normsP. Qed. Lemma normal_sub A B : A <| B -> A \subset B. Proof. (* Goal: forall _ : is_true (@normal gT 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 normal_norm A B : A <| B -> B \subset 'N(A). Proof. (* Goal: forall _ : is_true (@normal gT 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)) 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 A)))) *) by case/andP. Qed. Lemma normalS G H K : K \subset H -> H \subset G -> K <| G -> K <| 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 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))))) (_ : is_true (@normal gT (@gval gT K) (@gval gT G))), is_true (@normal gT (@gval gT K) (@gval gT H)) *) by move=> sKH sHG /andP[_ nKG]; rewrite /(K <| _) sKH (subset_trans sHG). Qed. Lemma normal1 G : 1 <| G. Proof. (* Goal: is_true (@normal gT (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@gval gT G)) *) by rewrite /normal sub1set group1 norms1. Qed. Lemma normal_refl G : G <| G. Proof. (* Goal: is_true (@normal gT (@gval gT G) (@gval gT G)) *) by rewrite /(G <| _) normG subxx. Qed. Lemma normalG G : G <| 'N(G). Proof. (* Goal: is_true (@normal gT (@gval gT G) (@normaliser gT (@gval gT G))) *) by rewrite /(G <| _) normG subxx. Qed. Lemma normalSG G H : H \subset G -> H <| 'N_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 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 H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@gval gT H)))) *) by move=> sHG; rewrite /normal subsetI sHG normG subsetIr. Qed. Lemma normalJ A B x : (A :^ x <| B :^ x) = (A <| B). Proof. (* Goal: @eq bool (@normal gT (@conjugate gT A x) (@conjugate gT B x)) (@normal gT A B) *) by rewrite /normal normJ !conjSg. Qed. Lemma normalM G A B : A <| G -> B <| G -> A * B <| G. Proof. (* Goal: forall (_ : is_true (@normal gT A (@gval gT G))) (_ : is_true (@normal gT B (@gval gT G))), is_true (@normal gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT G)) *) by case/andP=> sAG nAG /andP[sBG nBG]; rewrite /normal mul_subG ?normsM. Qed. Lemma normalY G A B : A <| G -> B <| G -> A <*> B <| G. Proof. (* Goal: forall (_ : is_true (@normal gT A (@gval gT G))) (_ : is_true (@normal gT B (@gval gT G))), is_true (@normal gT (@joing gT A B) (@gval gT G)) *) by case/andP=> sAG ? /andP[sBG ?]; rewrite /normal join_subG sAG sBG ?normsY. Qed. Lemma normalYl G H : (H <| H <*> G) = (G \subset 'N(H)). Proof. (* Goal: @eq bool (@normal gT (@gval gT H) (@joing gT (@gval gT H) (@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 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 rewrite /normal joing_subl join_subG normG. Qed. Lemma normalYr G H : (H <| G <*> H) = (G \subset 'N(H)). Proof. (* Goal: @eq bool (@normal gT (@gval gT H) (@joing gT (@gval gT G) (@gval gT H))) (@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 rewrite joingC normalYl. Qed. Lemma normalI G A B : A <| G -> B <| G -> A :&: B <| G. Proof. (* Goal: forall (_ : is_true (@normal gT A (@gval gT G))) (_ : is_true (@normal gT B (@gval gT G))), is_true (@normal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) A B) (@gval gT G)) *) by case/andP=> sAG nAG /andP[_ nBG]; rewrite /normal subIset ?sAG // normsI. Qed. Lemma norm_normalI G A : G \subset 'N(A) -> G :&: 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 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 A)))), is_true (@normal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) A) (@gval gT G)) *) by move=> nAG; rewrite /normal subsetIl normsI ?normG. Qed. Lemma normalGI G H A : H \subset G -> A <| G -> H :&: A <| 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 (@normal gT A (@gval gT G))), is_true (@normal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) A) (@gval gT H)) *) by move=> sHG /andP[_ nAG]; apply: norm_normalI (subset_trans sHG nAG). Qed. Lemma normal_subnorm G H : (H <| 'N_G(H)) = (H \subset G). Proof. (* Goal: @eq bool (@normal gT (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@gval gT H)))) (@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 /normal subsetIr subsetI normG !andbT. Qed. Lemma normalD1 A G : (A^# <| G) = (A <| G). Proof. (* Goal: @eq bool (@normal gT (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))) (@gval gT G)) (@normal gT A (@gval gT G)) *) by rewrite /normal normD1 subDset (setUidPr (sub1G G)). Qed. Lemma gcore_sub A G : gcore A G \subset A. 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)) (@gcore gT A (@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))) *) by rewrite (bigcap_min 1) ?conjsg1. Qed. Lemma gcore_norm A G : G \subset 'N(gcore A 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)) (@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 (@gcore gT A (@gval gT G)))))) *) apply/subsetP=> x Gx; rewrite inE; apply/bigcapsP=> y Gy. (* 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)) (@conjugate gT (@gcore gT A (@gval gT G)) 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)) (@conjugate gT A y)))) *) by rewrite sub_conjg -conjsgM bigcap_inf ?groupM ?groupV. Qed. Lemma gcore_normal A G : A \subset G -> gcore A 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)) 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)))), is_true (@normal gT (@gcore gT A (@gval gT G)) (@gval gT G)) *) by move=> sAG; rewrite /normal gcore_norm (subset_trans (gcore_sub A G)). Qed. Lemma gcore_max A B G : B \subset A -> G \subset 'N(B) -> B \subset gcore 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)) 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 (@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 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)) B)) (@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)) (@gcore gT A (@gval gT G))))) *) move=> sBA nBG; apply/bigcapsP=> y Gy. (* 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)) 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)) (@conjugate gT A y)))) *) by rewrite -sub_conjgV (normsP nBG) ?groupV. Qed. Lemma sub_gcore A B G : G \subset 'N(B) -> (B \subset gcore A G) = (B \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)) (@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 B)))), @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)) B)) (@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)) (@gcore gT A (@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)) 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))) *) move=> nBG; apply/idP/idP=> [sBAG | sBA]; last exact: gcore_max. (* 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)) 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))) *) exact: subset_trans (gcore_sub A G). Qed. Lemma rcoset_index2 G H x : H \subset G -> #|G : H| = 2 -> x \in G :\: H -> H :* x = G :\: H. Lemma index2_normal G H : H \subset G -> #|G : H| = 2 -> H <| 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))))) (_ : @eq nat (@indexg gT (@gval gT G) (@gval gT H)) (S (S O))), is_true (@normal gT (@gval gT H) (@gval gT G)) *) move=> sHG indexHG; rewrite /normal sHG; apply/subsetP=> x Gx. (* 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)) (@normaliser gT (@gval gT H))))) *) case Hx: (x \in H); first by rewrite inE conjGid. (* 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)) (@normaliser gT (@gval gT H))))) *) rewrite inE conjsgE mulgA -sub_rcosetV -invg_rcoset. (* 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)) (@invg (group_set_of_baseGroupType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (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) (@set1 (FinGroup.finType (FinGroup.base gT)) (@invg (FinGroup.base gT) x)))))) *) by rewrite !(rcoset_index2 sHG) ?inE ?groupV ?Hx // invDg !invGid. Qed. Lemma cent1P x y : reflect (commute x y) (x \in 'C[y]). Proof. (* Goal: Bool.reflect (@commute (FinGroup.base gT) x y) (@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)) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))))) *) rewrite inE conjg_set1 sub1set inE (sameP eqP conjg_fixP)commg1_sym. (* Goal: Bool.reflect (@commute (FinGroup.base gT) x y) (@eq_op (FinGroup.arg_eqType (FinGroup.base gT)) (@commg gT x y) (oneg (FinGroup.base gT))) *) exact: commgP. Qed. Lemma cent1E x y : (x \in 'C[y]) = (x * y == y * x). Proof. (* Goal: @eq 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)) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@mulg (FinGroup.base gT) x y) (@mulg (FinGroup.base gT) y x)) *) by rewrite (sameP (cent1P x y) eqP). Qed. Lemma cent1C x y : (x \in 'C[y]) = (y \in 'C[x]). Proof. (* Goal: @eq 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)) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))))) (@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)) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))))) *) by rewrite !cent1E eq_sym. Qed. Canonical centraliser_group A : {group _} := Eval hnf in [group of 'C(A)]. Lemma cent_set1 x : 'C([set x]) = 'C[x]. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@centraliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) *) by apply: big_pred1 => y /=; rewrite inE. Qed. Lemma cent1J x y : 'C[x ^ y] = 'C[x] :^ y. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@normaliser gT (@set1 (FinGroup.finType (FinGroup.base gT)) (@conjg gT x y))) (@conjugate gT (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) y) *) by rewrite -conjg_set1 normJ. Qed. Lemma centP A x : reflect (centralises x A) (x \in 'C(A)). Proof. (* Goal: Bool.reflect (@centralises gT x A) (@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)) (@centraliser gT A)))) *) by apply: (iffP bigcapP) => cxA y /cxA/cent1P. Qed. Lemma centsP A B : reflect {in A, centralised B} (A \subset 'C(B)). 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)) A)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @centralises gT x B) (inPhantom (@centralised 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)) 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)) (@centraliser gT B)))) *) by apply: (iffP subsetP) => cAB x /cAB/centP. Qed. Lemma centsC A B : (A \subset 'C(B)) = (B \subset 'C(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)) 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)) (@centraliser 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)) (@centraliser gT A)))) *) by apply/centsP/centsP=> cAB x ? y ?; rewrite /commute -cAB. Qed. Lemma cents1 A : A \subset 'C(1). 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)) 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)) (@centraliser gT (oneg (group_set_of_baseGroupType (FinGroup.base gT))))))) *) by rewrite centsC sub1G. Qed. Lemma cent1T : 'C(1) = setT :> {set gT}. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@centraliser gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) *) by apply/eqP; rewrite -subTset cents1. Qed. Lemma cent11T : 'C[1] = setT :> {set gT}. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@normaliser gT (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) *) by rewrite -cent_set1 cent1T. Qed. Lemma cent_sub A : 'C(A) \subset 'N(A). 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)) (@centraliser 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 A)))) *) apply/subsetP=> x /centP cAx; rewrite inE. (* 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)) (@conjugate 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)) A))) *) by apply/subsetP=> _ /imsetP[y Ay ->]; rewrite /conjg -cAx ?mulKg. Qed. Lemma cents_norm A B : A \subset 'C(B) -> A \subset '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)) (@centraliser gT 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)) (@normaliser gT B)))) *) by move=> cAB; apply: subset_trans (cent_sub B). Qed. Lemma centC A B : A \subset 'C(B) -> commute A 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)) (@centraliser gT B)))), @commute (group_set_of_baseGroupType (FinGroup.base gT)) A B *) by move=> cAB; apply: normC (cents_norm cAB). Qed. Lemma cent_joinEl G H : G \subset 'C(H) -> G <*> H = 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)) (@centraliser gT (@gval gT H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT (@gval gT G) (@gval gT H)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) *) by move=> cGH; apply: norm_joinEl (cents_norm cGH). Qed. Lemma cent_joinEr G H : H \subset 'C(G) -> G <*> H = 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 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)) (@centraliser gT (@gval gT G))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT (@gval gT G) (@gval gT H)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) *) by move=> cGH; apply: norm_joinEr (cents_norm cGH). Qed. Lemma centJ A x : 'C(A :^ x) = 'C(A) :^ x. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@centraliser gT (@conjugate gT A x)) (@conjugate gT (@centraliser gT A) x) *) apply/setP=> y; rewrite mem_conjg; apply/centP/centP=> cAy z Az. (* Goal: @commute (FinGroup.base gT) y z *) (* Goal: @commute (FinGroup.base gT) (@conjg gT y (@invg (FinGroup.base gT) x)) z *) by apply: (conjg_inj x); rewrite 2!conjMg conjgKV cAy ?memJ_conjg. (* Goal: @commute (FinGroup.base gT) y z *) by apply: (conjg_inj x^-1); rewrite 2!conjMg cAy -?mem_conjg. Qed. Lemma cent_norm A : 'N(A) \subset 'N('C(A)). 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)) (@normaliser 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 (@centraliser gT A))))) *) by apply/normsP=> x nCx; rewrite -centJ (normP nCx). Qed. Lemma norms_cent A B : A \subset 'N(B) -> A \subset 'N('C(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)) (@normaliser gT 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)) (@normaliser gT (@centraliser gT B))))) *) by move=> nBA; apply: subset_trans nBA (cent_norm B). Qed. Lemma cent_normal A : 'C(A) <| 'N(A). Proof. (* Goal: is_true (@normal gT (@centraliser gT A) (@normaliser gT A)) *) by rewrite /(_ <| _) cent_sub cent_norm. Qed. Lemma centS A B : B \subset A -> 'C(A) \subset 'C(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))), 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)) (@centraliser 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)) (@centraliser gT B)))) *) by move=> sAB; rewrite centsC (subset_trans sAB) 1?centsC. Qed. Lemma centsS A B C : A \subset B -> C \subset 'C(B) -> C \subset 'C(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 (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) C)) (@mem (Finite.sort (FinGroup.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 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)) C)) (@mem (Finite.sort (FinGroup.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 A)))) *) by move=> sAB cCB; apply: subset_trans cCB (centS sAB). Qed. Lemma centSS A B C D : A \subset C -> B \subset D -> C \subset 'C(D) -> A \subset 'C(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)) C)))) (_ : 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)) D)))) (_ : 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)) C)) (@mem (Finite.sort (FinGroup.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 D))))), 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)) (@centraliser gT B)))) *) by move=> sAC sBD cCD; apply: subset_trans (centsS sBD cCD). Qed. Lemma centI A B : 'C(A) <*> 'C(B) \subset 'C(A :&: B). 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 (@centraliser gT A) (@centraliser 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)) (@centraliser gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) A B))))) *) by rewrite gen_subG subUset !centS ?(subsetIl, subsetIr). Qed. Lemma centU A B : 'C(A :|: B) = 'C(A) :&: 'C(B). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@centraliser gT (@setU (FinGroup.arg_finType (FinGroup.base gT)) A B)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT A) (@centraliser gT B)) *) apply/eqP; rewrite eqEsubset subsetI 2?centS ?(subsetUl, subsetUr) //=. (* 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT A) (@centraliser gT B)))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@setU (FinGroup.arg_finType (FinGroup.base gT)) A B))))) *) by rewrite centsC subUset -centsC subsetIl -centsC subsetIr. Qed. Lemma cent_gen A : 'C(<<A>>) = 'C(A). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@centraliser gT (@generated gT A)) (@centraliser gT A) *) by apply/setP=> x; rewrite -!sub1set centsC gen_subG centsC. Qed. Lemma cent_cycle x : 'C(<[x]>) = 'C[x]. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@centraliser gT (@cycle gT x)) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) *) by rewrite cent_gen cent_set1. Qed. Lemma sub_cent1 A x : (A \subset 'C[x]) = (x \in 'C(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)) 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 (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))))) (@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)) (@centraliser gT A)))) *) by rewrite -cent_cycle centsC cycle_subG. Qed. Lemma cents_cycle x y : commute x y -> <[x]> \subset 'C(<[y]>). Proof. (* Goal: forall _ : @commute (FinGroup.base gT) x y, 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)) (@centraliser gT (@cycle gT y))))) *) by move=> cxy; rewrite cent_cycle cycle_subG; apply/cent1P. Qed. Lemma cycle_abelian x : abelian <[x]>. Proof. (* Goal: is_true (@abelian gT (@cycle gT x)) *) exact: cents_cycle. Qed. Lemma centY A B : 'C(A <*> B) = 'C(A) :&: 'C(B). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@centraliser gT (@joing gT A B)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT A) (@centraliser gT B)) *) by rewrite cent_gen centU. Qed. Lemma centM G H : 'C(G * H) = 'C(G) :&: 'C(H). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@centraliser gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT G)) (@centraliser gT (@gval gT H))) *) by rewrite -cent_gen genM_join centY. Qed. Lemma cent_classP x G : reflect (x ^: G = [set x]) (x \in 'C(G)). Proof. (* Goal: Bool.reflect (@eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class gT x (@gval gT G)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)) (@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)) (@centraliser gT (@gval gT G))))) *) apply: (iffP (centP _ _)) => [Cx | Cx1 y Gy]. (* Goal: @commute (FinGroup.base gT) x y *) (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@class gT x (@gval gT G)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) *) apply/eqP; rewrite eqEsubset sub1set class_refl andbT. (* Goal: @commute (FinGroup.base gT) x y *) (* 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)) (@class gT x (@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)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *) by apply/subsetP=> _ /imsetP[y Gy ->]; rewrite inE conjgE Cx ?mulKg. (* Goal: @commute (FinGroup.base gT) x y *) by apply/commgP/conjg_fixP/set1P; rewrite -Cx1; apply/imsetP; exists y. Qed. Lemma commG1P A B : reflect ([~: A, B] = 1) (A \subset 'C(B)). Proof. (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@commutator gT A B) (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)) 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)) (@centraliser gT B)))) *) apply: (iffP (centsP A B)) => [cAB | cAB1 x Ax y By]. (* Goal: @commute (FinGroup.base gT) x y *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@commutator gT A B) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) apply/trivgP; rewrite gen_subG; apply/subsetP=> _ /imset2P[x y Ax Ay ->]. (* Goal: @commute (FinGroup.base gT) x y *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@commg 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 (one_group gT))))) *) by rewrite inE; apply/commgP; apply: cAB. (* Goal: @commute (FinGroup.base gT) x y *) by apply/commgP; rewrite -in_set1 -[[set 1]]cAB1 mem_commg. Qed. Lemma abelianE A : abelian A = (A \subset 'C(A)). Proof. by []. Qed. Proof. (* Goal: @eq bool (@abelian gT A) (@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)) (@centraliser gT A)))) *) by []. Qed. Lemma abelianS A B : A \subset B -> abelian B -> abelian 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 (@abelian gT B)), is_true (@abelian gT A) *) by move=> sAB; apply: centSS. Qed. Lemma abelianJ A x : abelian (A :^ x) = abelian A. Proof. (* Goal: @eq bool (@abelian gT (@conjugate gT A x)) (@abelian gT A) *) by rewrite /abelian centJ conjSg. Qed. Lemma abelian_gen A : abelian <<A>> = abelian A. Proof. (* Goal: @eq bool (@abelian gT (@generated gT A)) (@abelian gT A) *) by rewrite /abelian cent_gen gen_subG. Qed. Lemma abelianY A B : abelian (A <*> B) = [&& abelian A, abelian B & B \subset 'C(A)]. Lemma abelianM G H : abelian (G * H) = [&& abelian G, abelian H & H \subset 'C(G)]. Proof. (* Goal: @eq bool (@abelian gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H))) (andb (@abelian gT (@gval gT G)) (andb (@abelian gT (@gval gT H)) (@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)) (@centraliser gT (@gval gT G))))))) *) by rewrite -abelian_gen genM_join abelianY. Qed. Section SubAbelian. Variable A B C : {set gT}. Hypothesis cAA : abelian A. Lemma sub_abelian_cent : C \subset A -> A \subset 'C(C). 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)) C)) (@mem (Finite.sort (FinGroup.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 (@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)) (@centraliser gT C)))) *) by move=> sCA; rewrite centsC (subset_trans sCA). Qed. Lemma sub_abelian_cent2 : B \subset A -> C \subset A -> B \subset 'C(C). 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 (@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)) C)) (@mem (Finite.sort (FinGroup.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 (@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)) (@centraliser gT C)))) *) by move=> sBA; move/sub_abelian_cent; apply: subset_trans. Qed. Lemma sub_abelian_norm : C \subset A -> A \subset 'N(C). 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)) C)) (@mem (Finite.sort (FinGroup.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 (@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 C)))) *) by move=> sCA; rewrite cents_norm ?sub_abelian_cent. Qed. Lemma sub_abelian_normal : (C \subset A) = (C <| 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)) C)) (@mem (Finite.sort (FinGroup.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))) (@normal gT C A) *) by rewrite /normal; case sHG: (C \subset A); rewrite // sub_abelian_norm. Qed. End SubAbelian. End Normaliser. Arguments normP {gT x A}. Arguments centP {gT A x}. Arguments normsP {gT A B}. Arguments cent1P {gT x y}. Arguments normalP {gT A B}. Arguments centsP {gT A B}. Arguments commG1P {gT A B}. Arguments normaliser_group _ _%g. Arguments centraliser_group _ _%g. Notation "''N' ( A )" := (normaliser_group A) : Group_scope. Notation "''C' ( A )" := (centraliser_group A) : Group_scope. Notation "''C' [ x ]" := (normaliser_group [set x%g]) : Group_scope. Notation "''N_' G ( A )" := (setI_group G 'N(A)) : Group_scope. Notation "''C_' G ( A )" := (setI_group G 'C(A)) : Group_scope. Notation "''C_' ( G ) ( A )" := (setI_group G 'C(A)) (only parsing) : Group_scope. Notation "''C_' G [ x ]" := (setI_group G 'C[x]) : Group_scope. Notation "''C_' ( G ) [ x ]" := (setI_group G 'C[x]) (only parsing) : Group_scope. Hint Resolve normG normal_refl : core. Section MinMaxGroup. Variable gT : finGroupType. Implicit Types gP : pred {group gT}. Definition maxgroup A gP := maxset (fun A => group_set A && gP <<A>>%G) A. Definition mingroup A gP := minset (fun A => group_set A && gP <<A>>%G) A. Variable gP : pred {group gT}. Arguments gP G%G. Lemma ex_maxgroup : (exists G, gP G) -> {G : {group gT} | maxgroup G gP}. Proof. (* Goal: forall _ : @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (gP G)), @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (maxgroup (@gval gT G) gP)) *) move=> exP; have [A maxA]: {A | maxgroup A gP}. (* Goal: @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (maxgroup (@gval gT G) gP)) *) (* Goal: @sig (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (fun A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) => is_true (maxgroup A gP)) *) apply: ex_maxset; case: exP => G gPG. (* Goal: @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (maxgroup (@gval gT G) gP)) *) (* Goal: @ex (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (fun A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) => is_true (andb (@group_set gT A) (gP (@generated_group gT A)))) *) by exists (G : {set gT}); rewrite groupP genGidG. (* Goal: @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (maxgroup (@gval gT G) gP)) *) by exists <<A>>%G; rewrite /= gen_set_id; case/andP: (maxsetp maxA). Qed. Lemma ex_mingroup : (exists G, gP G) -> {G : {group gT} | mingroup G gP}. Proof. (* Goal: forall _ : @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (gP G)), @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (mingroup (@gval gT G) gP)) *) move=> exP; have [A minA]: {A | mingroup A gP}. (* Goal: @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (mingroup (@gval gT G) gP)) *) (* Goal: @sig (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (fun A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) => is_true (mingroup A gP)) *) apply: ex_minset; case: exP => G gPG. (* Goal: @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (mingroup (@gval gT G) gP)) *) (* Goal: @ex (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (fun A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) => is_true (andb (@group_set gT A) (gP (@generated_group gT A)))) *) by exists (G : {set gT}); rewrite groupP genGidG. (* Goal: @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (mingroup (@gval gT G) gP)) *) by exists <<A>>%G; rewrite /= gen_set_id; case/andP: (minsetp minA). Qed. Variable G : {group gT}. Lemma mingroupP : reflect (gP G /\ forall H, gP H -> H \subset G -> H :=: G) (mingroup G gP). Proof. (* Goal: Bool.reflect (and (is_true (gP G)) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (gP 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 (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT G))) (mingroup (@gval gT G) gP) *) apply: (iffP minsetP); rewrite /= groupP genGidG /= => [] [-> minG]. (* Goal: and (is_true true) (forall (B : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (andb (@group_set gT B) (gP (@generated_group gT B)))) (_ : 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)) B)) (@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 (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) B (@gval gT G)) *) (* Goal: and (is_true true) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (gP H)) (_ : 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)) (@gval gT G))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@gval gT G)) *) by split=> // H gPH sGH; apply: minG; rewrite // groupP genGidG. (* Goal: and (is_true true) (forall (B : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (andb (@group_set gT B) (gP (@generated_group gT B)))) (_ : 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)) B)) (@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 (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) B (@gval gT G)) *) by split=> // A; case/andP=> gA gPA; rewrite -(gen_set_id gA); apply: minG. Qed. Lemma maxgroupP : reflect (gP G /\ forall H, gP H -> G \subset H -> H :=: G) (maxgroup G gP). Proof. (* Goal: Bool.reflect (and (is_true (gP G)) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (gP 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)) (@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 G))) (maxgroup (@gval gT G) gP) *) apply: (iffP maxsetP); rewrite /= groupP genGidG /= => [] [-> maxG]. (* Goal: and (is_true true) (forall (B : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (andb (@group_set gT B) (gP (@generated_group gT B)))) (_ : 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)) B)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) B (@gval gT G)) *) (* Goal: and (is_true true) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (gP H)) (_ : 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)) (@gval gT H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@gval gT G)) *) by split=> // H gPH sGH; apply: maxG; rewrite // groupP genGidG. (* Goal: and (is_true true) (forall (B : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (andb (@group_set gT B) (gP (@generated_group gT B)))) (_ : 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)) B)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) B (@gval gT G)) *) by split=> // A; case/andP=> gA gPA; rewrite -(gen_set_id gA); apply: maxG. Qed. Lemma maxgroupp : maxgroup G gP -> gP G. Proof. by case/maxgroupP. Qed. Proof. (* Goal: forall _ : is_true (maxgroup (@gval gT G) gP), is_true (gP G) *) by case/maxgroupP. Qed. Hypothesis gPG : gP G. Lemma maxgroup_exists : {H : {group gT} | maxgroup H gP & G \subset H}. Proof. (* Goal: @sig2 (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (maxgroup (@gval gT H) gP)) (fun H : @group_of gT (Phant (FinGroup.arg_sort (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 H))))) *) have [A maxA sGA]: {A | maxgroup A gP & G \subset A}. (* Goal: @sig2 (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (maxgroup (@gval gT H) gP)) (fun H : @group_of gT (Phant (FinGroup.arg_sort (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 H))))) *) (* Goal: @sig2 (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (fun A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) => is_true (maxgroup A gP)) (fun A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (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)) A)))) *) by apply: maxset_exists; rewrite groupP genGidG. (* Goal: @sig2 (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (maxgroup (@gval gT H) gP)) (fun H : @group_of gT (Phant (FinGroup.arg_sort (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 H))))) *) by exists <<A>>%G; rewrite /= gen_set_id; case/andP: (maxsetp maxA). Qed. Lemma mingroup_exists : {H : {group gT} | mingroup H gP & H \subset G}. Proof. (* Goal: @sig2 (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (mingroup (@gval gT H) gP)) (fun H : @group_of gT (Phant (FinGroup.arg_sort (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 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))))) *) have [A maxA sGA]: {A | mingroup A gP & A \subset G}. (* Goal: @sig2 (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (mingroup (@gval gT H) gP)) (fun H : @group_of gT (Phant (FinGroup.arg_sort (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 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))))) *) (* Goal: @sig2 (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (fun A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) => is_true (mingroup A gP)) (fun A : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (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)) 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: minset_exists; rewrite groupP genGidG. (* Goal: @sig2 (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (mingroup (@gval gT H) gP)) (fun H : @group_of gT (Phant (FinGroup.arg_sort (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 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 exists <<A>>%G; rewrite /= gen_set_id; case/andP: (minsetp maxA). Qed. End MinMaxGroup. Arguments mingroup {gT} A%g gP. Arguments maxgroup {gT} A%g gP. Arguments mingroupP {gT gP G}. Arguments maxgroupP {gT gP G}. Notation "[ 'max' A 'of' G | gP ]" := (maxgroup A (fun G : {group _} => gP)) : group_scope. Notation "[ 'max' G | gP ]" := [max gval G of G | gP] : group_scope. Notation "[ 'max' A 'of' G | gP & gQ ]" := [max A of G | gP && gQ] : group_scope. Notation "[ 'max' G | gP & gQ ]" := [max G | gP && gQ] : group_scope. Notation "[ 'min' A 'of' G | gP ]" := (mingroup A (fun G : {group _} => gP)) : group_scope. Notation "[ 'min' G | gP ]" := [min gval G of G | gP] : group_scope. Notation "[ 'min' A 'of' G | gP & gQ ]" := [min A of G | gP && gQ] : group_scope. Notation "[ 'min' G | gP & gQ ]" := [min G | gP && gQ] : group_scope.
Require Import Coq.Arith.Peano_dec. Require Import Coq.Logic.Eqdep Coq.Logic.Eqdep_dec Coq.Program.Equality. Theorem eq_rect_nat_double : forall T (a b c : nat) x ab bc, eq_rect b T (eq_rect a T x b ab) c bc = eq_rect a T x c (eq_trans ab bc). Proof. (* Goal: forall (T : forall _ : nat, Type) (a b c : nat) (x : T a) (ab : @eq nat a b) (bc : @eq nat b c), @eq (T c) (@eq_rect nat b T (@eq_rect nat a T x b ab) c bc) (@eq_rect nat a T x c (@eq_trans nat a b c ab bc)) *) intros. (* Goal: @eq (T c) (@eq_rect nat b T (@eq_rect nat a T x b ab) c bc) (@eq_rect nat a T x c (@eq_trans nat a b c ab bc)) *) destruct ab. (* Goal: @eq (T c) (@eq_rect nat a T (@eq_rect nat a T x a (@eq_refl nat a)) c bc) (@eq_rect nat a T x c (@eq_trans nat a a c (@eq_refl nat a) bc)) *) destruct bc. (* Goal: @eq (T a) (@eq_rect nat a T (@eq_rect nat a T x a (@eq_refl nat a)) a (@eq_refl nat a)) (@eq_rect nat a T x a (@eq_trans nat a a a (@eq_refl nat a) (@eq_refl nat a))) *) rewrite (UIP_dec eq_nat_dec (eq_trans eq_refl eq_refl) eq_refl). (* Goal: @eq (T a) (@eq_rect nat a T (@eq_rect nat a T x a (@eq_refl nat a)) a (@eq_refl nat a)) (@eq_rect nat a T x a (@eq_refl nat a)) *) simpl. (* Goal: @eq (T a) x x *) auto. Qed. Hint Rewrite eq_rect_nat_double. Hint Rewrite <- (eq_rect_eq_dec eq_nat_dec). Ltac generalize_proof := match goal with | [ |- context[eq_rect _ _ _ _ ?H ] ] => generalize H end. Ltac eq_rect_simpl := unfold eq_rec_r, eq_rec; repeat rewrite eq_rect_nat_double; repeat rewrite <- (eq_rect_eq_dec eq_nat_dec). Ltac destruct_existT := repeat match goal with | [H: existT _ _ _ = existT _ _ _ |- _] => (apply Eqdep.EqdepTheory.inj_pair2 in H; subst) end. Lemma eq_rect_word_offset_helper : forall a b c, a = b -> c + a = c + b. Proof. (* Goal: forall (a b c : nat) (_ : @eq nat a b), @eq nat (Nat.add c a) (Nat.add c b) *) intros; congruence. Qed. Lemma eq_rect_word_mult_helper : forall a b c, a = b -> a * c = b * c. Proof. (* Goal: forall (a b c : nat) (_ : @eq nat a b), @eq nat (Nat.mul a c) (Nat.mul b c) *) intros; congruence. Qed. Lemma existT_eq_rect: forall (X: Type) (P: X -> Type) (x1 x2: X) (H1: P x1) (Hx: x1 = x2), existT P x2 (eq_rect x1 P H1 x2 Hx) = existT P x1 H1. Proof. (* Goal: forall (X : Type) (P : forall _ : X, Type) (x1 x2 : X) (H1 : P x1) (Hx : @eq X x1 x2), @eq (@sigT X P) (@existT X P x2 (@eq_rect X x1 P H1 x2 Hx)) (@existT X P x1 H1) *) intros; subst; reflexivity. Qed. Lemma existT_eq_rect_eq: forall (X: Type) (P: X -> Type) (x1 x2: X) (H1: P x1) (H2: P x2) (Hx: x1 = x2), H2 = eq_rect _ P H1 _ Hx -> existT P x1 H1 = existT P x2 H2. Proof. (* Goal: forall (X : Type) (P : forall _ : X, Type) (x1 x2 : X) (H1 : P x1) (H2 : P x2) (Hx : @eq X x1 x2) (_ : @eq (P x2) H2 (@eq_rect X x1 P H1 x2 Hx)), @eq (@sigT X P) (@existT X P x1 H1) (@existT X P x2 H2) *) intros; subst; reflexivity. Qed. Lemma eq_rect_existT_eq: forall (X: Type) (P: X -> Type) (x1 x2: X) (H1: P x1) (H2: P x2) (Hx: x1 = x2) (Hex: existT P x1 H1 = existT P x2 H2), H2 = eq_rect _ P H1 _ Hx. Proof. (* Goal: forall (X : Type) (P : forall _ : X, Type) (x1 x2 : X) (H1 : P x1) (H2 : P x2) (Hx : @eq X x1 x2) (_ : @eq (@sigT X P) (@existT X P x1 H1) (@existT X P x2 H2)), @eq (P x2) H2 (@eq_rect X x1 P H1 x2 Hx) *) intros; subst. (* Goal: @eq (P x2) H2 (@eq_rect X x2 P H1 x2 (@eq_refl X x2)) *) subst; destruct_existT. (* Goal: @eq (P x2) H2 (@eq_rect X x2 P H2 x2 (@eq_refl X x2)) *) reflexivity. Qed.
Require Export GeoCoq.Elements.OriginalProofs.lemma_rightangleNC. Require Export GeoCoq.Elements.OriginalProofs.lemma_ABCequalsCBA. Require Export GeoCoq.Elements.OriginalProofs.lemma_supplements. Require Export GeoCoq.Elements.OriginalProofs.lemma_equalanglestransitive. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_8_2 : forall A B C, Per A B C -> Per C B A. Proof. (* Goal: forall (A B C : @Point Ax0) (_ : @Per Ax0 A B C), @Per Ax0 C B A *) intros. (* Goal: @Per Ax0 C B A *) let Tf:=fresh in assert (Tf:exists D, (BetS A B D /\ Cong A B D B /\ Cong A C D C /\ neq B C)) by (conclude_def Per );destruct Tf as [D];spliter. (* Goal: @Per Ax0 C B A *) assert (neq C B) by (conclude lemma_inequalitysymmetric). (* Goal: @Per Ax0 C B A *) let Tf:=fresh in assert (Tf:exists E, (BetS C B E /\ Cong B E B C)) by (conclude lemma_extension);destruct Tf as [E];spliter. (* Goal: @Per Ax0 C B A *) assert (neq A B) by (forward_using lemma_betweennotequal). (* Goal: @Per Ax0 C B A *) assert (neq B A) by (conclude lemma_inequalitysymmetric). (* Goal: @Per Ax0 C B A *) assert (eq C C) by (conclude cn_equalityreflexive). (* Goal: @Per Ax0 C B A *) assert (eq A A) by (conclude cn_equalityreflexive). (* Goal: @Per Ax0 C B A *) assert (Out B C C) by (conclude lemma_ray4). (* Goal: @Per Ax0 C B A *) assert (nCol A B C) by (conclude lemma_rightangleNC). (* Goal: @Per Ax0 C B A *) assert (Supp A B C C D) by (conclude_def Supp ). (* Goal: @Per Ax0 C B A *) assert (Out B A A) by (conclude lemma_ray4). (* Goal: @Per Ax0 C B A *) assert (Supp C B A A E) by (conclude_def Supp ). (* Goal: @Per Ax0 C B A *) assert (CongA A B C C B A) by (conclude lemma_ABCequalsCBA). (* Goal: @Per Ax0 C B A *) assert (CongA C B D A B E) by (conclude lemma_supplements). (* Goal: @Per Ax0 C B A *) assert (Cong B C B E) by (conclude lemma_congruencesymmetric). (* Goal: @Per Ax0 C B A *) assert (Cong B D B A) by (forward_using lemma_doublereverse). (* Goal: @Per Ax0 C B A *) assert (~ Col E B A). (* Goal: @Per Ax0 C B A *) (* Goal: not (@Col Ax0 E B A) *) { (* Goal: not (@Col Ax0 E B A) *) intro. (* Goal: False *) assert (Col C B E) by (conclude_def Col ). (* Goal: False *) assert (Col E B C) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq B E) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (neq E 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: @Per Ax0 C B A *) } (* Goal: @Per Ax0 C B A *) assert (~ Col A B E). (* Goal: @Per Ax0 C B A *) (* Goal: not (@Col Ax0 A B E) *) { (* Goal: not (@Col Ax0 A B E) *) intro. (* Goal: False *) assert (Col E B A) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @Per Ax0 C B A *) } (* Goal: @Per Ax0 C B A *) assert (CongA A B E E B A) by (conclude lemma_ABCequalsCBA). (* Goal: @Per Ax0 C B A *) assert (CongA C B D E B A) by (conclude lemma_equalanglestransitive). (* Goal: @Per Ax0 C B A *) assert ((Cong C D E A /\ CongA B C D B E A /\ CongA B D C B A E)) by (conclude proposition_04). (* Goal: @Per Ax0 C B A *) assert (Cong A C C D) by (forward_using lemma_congruenceflip). (* Goal: @Per Ax0 C B A *) assert (Cong A C E A) by (conclude lemma_congruencetransitive). (* Goal: @Per Ax0 C B A *) assert (Cong C A E A) by (forward_using lemma_congruenceflip). (* Goal: @Per Ax0 C B A *) assert (Cong C B E B) by (forward_using lemma_congruenceflip). (* Goal: @Per Ax0 C B A *) assert (neq B A) by (conclude lemma_inequalitysymmetric). (* Goal: @Per Ax0 C B A *) assert (Per C B A) by (conclude_def Per ). (* Goal: @Per Ax0 C B A *) close. Qed. End Euclid.